From a58912eaf7e98c1bc9e960fbf77b6293e57c28a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 7 Oct 2013 23:09:50 +0200 Subject: Basic version changing (OneSix only for now) --- gui/mainwindow.cpp | 3 +++ gui/mainwindow.ui | 4 +--- logic/LegacyInstance.cpp | 2 ++ logic/NostalgiaInstance.cpp | 4 ++++ logic/NostalgiaInstance.h | 1 + logic/lists/MinecraftVersionList.cpp | 4 ++++ 6 files changed, 15 insertions(+), 3 deletions(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 080ce4b2..70d26e02 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -602,6 +602,7 @@ void MainWindow::on_actionChangeInstMCVersion_triggered() VersionSelectDialog vselect(m_selectedInstance->versionList().get(), tr("Change Minecraft version"), this); + vselect.setFilter(1, "OneSix"); if (vselect.exec() && vselect.selectedVersion()) { m_selectedInstance->setIntendedVersionId(vselect.selectedVersion()->descriptor()); @@ -646,6 +647,8 @@ void MainWindow::instanceChanged(const QModelIndex ¤t, const QModelIndex & m_selectedInstance->menuActionEnabled("actionChangeInstLWJGLVersion")); ui->actionEditInstMods->setEnabled( m_selectedInstance->menuActionEnabled("actionEditInstMods")); + ui->actionChangeInstMCVersion->setEnabled( + m_selectedInstance->menuActionEnabled("actionChangeInstMCVersion")); statusBar()->clearMessage(); statusBar()->showMessage(m_selectedInstance->getStatusbarDescription()); auto ico = MMC->icons()->getIcon(iconKey); diff --git a/gui/mainwindow.ui b/gui/mainwindow.ui index 1cda7a34..4c288d5f 100644 --- a/gui/mainwindow.ui +++ b/gui/mainwindow.ui @@ -107,6 +107,7 @@ + @@ -371,9 +372,6 @@ - - false - Change Version diff --git a/logic/LegacyInstance.cpp b/logic/LegacyInstance.cpp index 2ffcb075..205f6873 100644 --- a/logic/LegacyInstance.cpp +++ b/logic/LegacyInstance.cpp @@ -314,6 +314,8 @@ QString LegacyInstance::defaultCustomBaseJar() const bool LegacyInstance::menuActionEnabled ( QString action_name ) const { + if (action_name == "actionChangeInstMCVersion") + return false; return true; } diff --git a/logic/NostalgiaInstance.cpp b/logic/NostalgiaInstance.cpp index 039cd9ce..efd8f46b 100644 --- a/logic/NostalgiaInstance.cpp +++ b/logic/NostalgiaInstance.cpp @@ -11,6 +11,10 @@ QString NostalgiaInstance::getStatusbarDescription() return "Nostalgia : " + intendedVersionId(); } +bool NostalgiaInstance::menuActionEnabled(QString action_name) const +{ + return false; +} /* ADD MORE diff --git a/logic/NostalgiaInstance.h b/logic/NostalgiaInstance.h index 1436e48d..64eb7a81 100644 --- a/logic/NostalgiaInstance.h +++ b/logic/NostalgiaInstance.h @@ -8,5 +8,6 @@ class NostalgiaInstance : public OneSixInstance public: explicit NostalgiaInstance(const QString &rootDir, SettingsObject * settings, QObject *parent = 0); virtual QString getStatusbarDescription(); + virtual bool menuActionEnabled(QString action_name) const; }; diff --git a/logic/lists/MinecraftVersionList.cpp b/logic/lists/MinecraftVersionList.cpp index 36611165..fbf609b5 100644 --- a/logic/lists/MinecraftVersionList.cpp +++ b/logic/lists/MinecraftVersionList.cpp @@ -122,9 +122,13 @@ MCVListLoadTask::MCVListLoadTask(MinecraftVersionList *vlist) legacyWhitelist.insert("1.4.6"); legacyWhitelist.insert("1.4.5"); legacyWhitelist.insert("1.4.4"); + legacyWhitelist.insert("1.4.3"); legacyWhitelist.insert("1.4.2"); + legacyWhitelist.insert("1.4.1"); + legacyWhitelist.insert("1.4"); legacyWhitelist.insert("1.3.2"); legacyWhitelist.insert("1.3.1"); + legacyWhitelist.insert("1.3"); legacyWhitelist.insert("1.2.5"); legacyWhitelist.insert("1.2.4"); legacyWhitelist.insert("1.2.3"); -- cgit v1.2.3