From 1194ec9a8e78df9e8e19d54d63a2379408dc7a66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Fri, 20 Jun 2014 01:24:32 +0200 Subject: [PATCH] No more disabling of actions in the instance toolbar. It makes no sense. --- gui/MainWindow.cpp | 2 -- logic/BaseInstance.h | 3 --- logic/LegacyFTBInstance.cpp | 5 ----- logic/LegacyFTBInstance.h | 1 - logic/LegacyInstance.cpp | 13 ------------- logic/LegacyInstance.h | 1 - logic/OneSixFTBInstance.cpp | 4 ---- logic/OneSixFTBInstance.h | 1 - logic/OneSixInstance.cpp | 13 ------------- logic/OneSixInstance.h | 1 - 10 files changed, 44 deletions(-) diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp index 35ac541dd..b8f42dc4e 100644 --- a/gui/MainWindow.cpp +++ b/gui/MainWindow.cpp @@ -1369,8 +1369,6 @@ void MainWindow::instanceChanged(const QModelIndex ¤t, const QModelIndex & { ui->instanceToolBar->setEnabled(m_selectedInstance->canLaunch()); renameButton->setText(m_selectedInstance->name()); - ui->actionEditInstance->setEnabled( - m_selectedInstance->menuActionEnabled("actionEditInstance")); m_statusLeft->setText(m_selectedInstance->getStatusbarDescription()); updateInstanceToolIcon(m_selectedInstance->iconKey()); diff --git a/logic/BaseInstance.h b/logic/BaseInstance.h index 2eba1fffb..9598549ba 100644 --- a/logic/BaseInstance.h +++ b/logic/BaseInstance.h @@ -183,9 +183,6 @@ public: /// 'prepareForLaunch' virtual void cleanupAfterRun() = 0; - /// is a particular action enabled with this instance selected? - virtual bool menuActionEnabled(QString action_name) const = 0; - virtual QString getStatusbarDescription() = 0; /// FIXME: this really should be elsewhere... diff --git a/logic/LegacyFTBInstance.cpp b/logic/LegacyFTBInstance.cpp index 3c3356c98..73a1f73d4 100644 --- a/logic/LegacyFTBInstance.cpp +++ b/logic/LegacyFTBInstance.cpp @@ -14,11 +14,6 @@ QString LegacyFTBInstance::getStatusbarDescription() return "Legacy FTB: " + intendedVersionId(); } -bool LegacyFTBInstance::menuActionEnabled(QString action_name) const -{ - return false; -} - QString LegacyFTBInstance::id() const { return "FTB/" + BaseInstance::id(); diff --git a/logic/LegacyFTBInstance.h b/logic/LegacyFTBInstance.h index 70f60535d..a2fe1ead5 100644 --- a/logic/LegacyFTBInstance.h +++ b/logic/LegacyFTBInstance.h @@ -9,6 +9,5 @@ public: explicit LegacyFTBInstance(const QString &rootDir, SettingsObject *settings, QObject *parent = 0); virtual QString getStatusbarDescription(); - virtual bool menuActionEnabled(QString action_name) const; virtual QString id() const; }; diff --git a/logic/LegacyInstance.cpp b/logic/LegacyInstance.cpp index b646bd7b6..4b856b0da 100644 --- a/logic/LegacyInstance.cpp +++ b/logic/LegacyInstance.cpp @@ -282,19 +282,6 @@ QString LegacyInstance::defaultCustomBaseJar() const return PathCombine(binDir(), "mcbackup.jar"); } -bool LegacyInstance::menuActionEnabled(QString action_name) const -{ - if (flags().contains(VersionBrokenFlag)) - { - return false; - } - if (action_name == "actionChangeInstMCVersion") - { - return false; - } - return true; -} - QString LegacyInstance::getStatusbarDescription() { if (flags().contains(VersionBrokenFlag)) diff --git a/logic/LegacyInstance.h b/logic/LegacyInstance.h index d367b9906..76a8c24de 100644 --- a/logic/LegacyInstance.h +++ b/logic/LegacyInstance.h @@ -95,7 +95,6 @@ public: virtual QString defaultBaseJar() const override; virtual QString defaultCustomBaseJar() const override; - bool menuActionEnabled(QString action_name) const; virtual QString getStatusbarDescription() override; protected diff --git a/logic/OneSixFTBInstance.cpp b/logic/OneSixFTBInstance.cpp index 059182314..ef9519875 100644 --- a/logic/OneSixFTBInstance.cpp +++ b/logic/OneSixFTBInstance.cpp @@ -125,10 +125,6 @@ QString OneSixFTBInstance::getStatusbarDescription() } return "OneSix FTB: " + intendedVersionId(); } -bool OneSixFTBInstance::menuActionEnabled(QString action_name) const -{ - return false; -} std::shared_ptr OneSixFTBInstance::doUpdate() { diff --git a/logic/OneSixFTBInstance.h b/logic/OneSixFTBInstance.h index 440dc9f11..ecfa2231e 100644 --- a/logic/OneSixFTBInstance.h +++ b/logic/OneSixFTBInstance.h @@ -16,7 +16,6 @@ public: void copy(const QDir &newDir) override; virtual QString getStatusbarDescription(); - virtual bool menuActionEnabled(QString action_name) const; virtual std::shared_ptr doUpdate() override; diff --git a/logic/OneSixInstance.cpp b/logic/OneSixInstance.cpp index 30e62d730..982448314 100644 --- a/logic/OneSixInstance.cpp +++ b/logic/OneSixInstance.cpp @@ -453,19 +453,6 @@ QString OneSixInstance::defaultCustomBaseJar() const return PathCombine(instanceRoot(), "custom.jar"); } -bool OneSixInstance::menuActionEnabled(QString action_name) const -{ - if (flags().contains(VersionBrokenFlag)) - { - return false; - } - if (action_name == "actionChangeInstLWJGLVersion") - { - return false; - } - return true; -} - QString OneSixInstance::getStatusbarDescription() { QStringList traits; diff --git a/logic/OneSixInstance.h b/logic/OneSixInstance.h index 405cfe97a..75caef1f7 100644 --- a/logic/OneSixInstance.h +++ b/logic/OneSixInstance.h @@ -87,7 +87,6 @@ public: virtual QString defaultBaseJar() const override; virtual QString defaultCustomBaseJar() const override; - virtual bool menuActionEnabled(QString action_name) const override; virtual QString getStatusbarDescription() override; virtual QDir jarmodsPath() const;