diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-04-28 00:04:37 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-04-28 00:04:37 +0200 |
commit | 4392abfb8d3b45fb6c5cabe9d5e30c9416a5ad90 (patch) | |
tree | f9e848e8e9b25f829e8607474980f0432387d9a4 | |
parent | 72c92893a5669a91e3d48b1341b6fde306db9a54 (diff) | |
download | MultiMC-4392abfb8d3b45fb6c5cabe9d5e30c9416a5ad90.tar MultiMC-4392abfb8d3b45fb6c5cabe9d5e30c9416a5ad90.tar.gz MultiMC-4392abfb8d3b45fb6c5cabe9d5e30c9416a5ad90.tar.lz MultiMC-4392abfb8d3b45fb6c5cabe9d5e30c9416a5ad90.tar.xz MultiMC-4392abfb8d3b45fb6c5cabe9d5e30c9416a5ad90.zip |
GH-1556 disable export for tracked FTB instances
-rw-r--r-- | application/MainWindow.cpp | 1 | ||||
-rw-r--r-- | logic/BaseInstance.h | 1 | ||||
-rw-r--r-- | logic/NullInstance.h | 4 | ||||
-rw-r--r-- | logic/minecraft/ftb/LegacyFTBInstance.h | 4 | ||||
-rw-r--r-- | logic/minecraft/ftb/OneSixFTBInstance.h | 5 | ||||
-rw-r--r-- | logic/minecraft/legacy/LegacyInstance.h | 5 | ||||
-rw-r--r-- | logic/minecraft/onesix/OneSixInstance.h | 5 |
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 ¤t, 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(); |