summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--application/MainWindow.cpp1
-rw-r--r--logic/BaseInstance.h1
-rw-r--r--logic/NullInstance.h4
-rw-r--r--logic/minecraft/ftb/LegacyFTBInstance.h4
-rw-r--r--logic/minecraft/ftb/OneSixFTBInstance.h5
-rw-r--r--logic/minecraft/legacy/LegacyInstance.h5
-rw-r--r--logic/minecraft/onesix/OneSixInstance.h5
7 files changed, 24 insertions, 1 deletions
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp
index da9ea779..e1d306b0 100644
--- a/application/MainWindow.cpp
+++ b/application/MainWindow.cpp
@@ -1630,6 +1630,7 @@ void MainWindow::instanceChanged(const QModelIndex &current, const QModelIndex &
ui->instanceToolBar->setEnabled(true);
ui->actionLaunchInstance->setEnabled(m_selectedInstance->canLaunch());
ui->actionLaunchInstanceOffline->setEnabled(m_selectedInstance->canLaunch());
+ ui->actionExportInstance->setEnabled(m_selectedInstance->canExport());
renameButton->setText(m_selectedInstance->name());
m_statusLeft->setText(m_selectedInstance->getStatusbarDescription());
updateInstanceToolIcon(m_selectedInstance->iconKey());
diff --git a/logic/BaseInstance.h b/logic/BaseInstance.h
index 392cb3d9..5e587c48 100644
--- a/logic/BaseInstance.h
+++ b/logic/BaseInstance.h
@@ -206,6 +206,7 @@ public:
void unsetFlag(const InstanceFlag flag);
bool canLaunch() const;
+ virtual bool canExport() const = 0;
virtual bool reload();
diff --git a/logic/NullInstance.h b/logic/NullInstance.h
index d46230f4..fbb2d985 100644
--- a/logic/NullInstance.h
+++ b/logic/NullInstance.h
@@ -83,4 +83,8 @@ public:
{
return "Null";
}
+ bool canExport() const override
+ {
+ return false;
+ }
};
diff --git a/logic/minecraft/ftb/LegacyFTBInstance.h b/logic/minecraft/ftb/LegacyFTBInstance.h
index 3f3f5edf..7178bca4 100644
--- a/logic/minecraft/ftb/LegacyFTBInstance.h
+++ b/logic/minecraft/ftb/LegacyFTBInstance.h
@@ -10,4 +10,8 @@ public:
virtual QString id() const;
virtual void copy(const QDir &newDir);
virtual QString typeName() const;
+ bool canExport() const override
+ {
+ return false;
+ }
};
diff --git a/logic/minecraft/ftb/OneSixFTBInstance.h b/logic/minecraft/ftb/OneSixFTBInstance.h
index 09a2dcb0..e7f8f485 100644
--- a/logic/minecraft/ftb/OneSixFTBInstance.h
+++ b/logic/minecraft/ftb/OneSixFTBInstance.h
@@ -21,7 +21,10 @@ public:
QDir versionsPath() const override;
bool providesVersionFile() const override;
virtual QString typeName() const override;
-
+ bool canExport() const override
+ {
+ return false;
+ }
private:
SettingsObjectPtr m_globalSettings;
};
diff --git a/logic/minecraft/legacy/LegacyInstance.h b/logic/minecraft/legacy/LegacyInstance.h
index d88e2a71..3bef240d 100644
--- a/logic/minecraft/legacy/LegacyInstance.h
+++ b/logic/minecraft/legacy/LegacyInstance.h
@@ -124,6 +124,11 @@ public:
virtual QString typeName() const override;
+ bool canExport() const override
+ {
+ return true;
+ }
+
protected:
mutable std::shared_ptr<ModList> jar_mod_list;
mutable std::shared_ptr<ModList> core_mod_list;
diff --git a/logic/minecraft/onesix/OneSixInstance.h b/logic/minecraft/onesix/OneSixInstance.h
index 0a92ab2f..2dfab48c 100644
--- a/logic/minecraft/onesix/OneSixInstance.h
+++ b/logic/minecraft/onesix/OneSixInstance.h
@@ -94,6 +94,11 @@ public:
virtual QString typeName() const override;
+ bool canExport() const override
+ {
+ return true;
+ }
+
signals:
void versionReloaded();