Basic version changing (OneSix only for now)

This commit is contained in:
Petr Mrázek 2013-10-07 23:09:50 +02:00
parent 346087efbb
commit a58912eaf7
6 changed files with 15 additions and 3 deletions

View File

@ -602,6 +602,7 @@ void MainWindow::on_actionChangeInstMCVersion_triggered()
VersionSelectDialog vselect(m_selectedInstance->versionList().get(), VersionSelectDialog vselect(m_selectedInstance->versionList().get(),
tr("Change Minecraft version"), this); tr("Change Minecraft version"), this);
vselect.setFilter(1, "OneSix");
if (vselect.exec() && vselect.selectedVersion()) if (vselect.exec() && vselect.selectedVersion())
{ {
m_selectedInstance->setIntendedVersionId(vselect.selectedVersion()->descriptor()); m_selectedInstance->setIntendedVersionId(vselect.selectedVersion()->descriptor());
@ -646,6 +647,8 @@ void MainWindow::instanceChanged(const QModelIndex &current, const QModelIndex &
m_selectedInstance->menuActionEnabled("actionChangeInstLWJGLVersion")); m_selectedInstance->menuActionEnabled("actionChangeInstLWJGLVersion"));
ui->actionEditInstMods->setEnabled( ui->actionEditInstMods->setEnabled(
m_selectedInstance->menuActionEnabled("actionEditInstMods")); m_selectedInstance->menuActionEnabled("actionEditInstMods"));
ui->actionChangeInstMCVersion->setEnabled(
m_selectedInstance->menuActionEnabled("actionChangeInstMCVersion"));
statusBar()->clearMessage(); statusBar()->clearMessage();
statusBar()->showMessage(m_selectedInstance->getStatusbarDescription()); statusBar()->showMessage(m_selectedInstance->getStatusbarDescription());
auto ico = MMC->icons()->getIcon(iconKey); auto ico = MMC->icons()->getIcon(iconKey);

View File

@ -107,6 +107,7 @@
<addaction name="actionChangeInstGroup"/> <addaction name="actionChangeInstGroup"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionInstanceSettings"/> <addaction name="actionInstanceSettings"/>
<addaction name="actionChangeInstMCVersion"/>
<addaction name="actionChangeInstLWJGLVersion"/> <addaction name="actionChangeInstLWJGLVersion"/>
<addaction name="actionEditInstMods"/> <addaction name="actionEditInstMods"/>
<addaction name="actionViewSelectedInstFolder"/> <addaction name="actionViewSelectedInstFolder"/>
@ -371,9 +372,6 @@
</property> </property>
</action> </action>
<action name="actionChangeInstMCVersion"> <action name="actionChangeInstMCVersion">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text"> <property name="text">
<string>Change Version</string> <string>Change Version</string>
</property> </property>

View File

@ -314,6 +314,8 @@ QString LegacyInstance::defaultCustomBaseJar() const
bool LegacyInstance::menuActionEnabled ( QString action_name ) const bool LegacyInstance::menuActionEnabled ( QString action_name ) const
{ {
if (action_name == "actionChangeInstMCVersion")
return false;
return true; return true;
} }

View File

@ -11,6 +11,10 @@ QString NostalgiaInstance::getStatusbarDescription()
return "Nostalgia : " + intendedVersionId(); return "Nostalgia : " + intendedVersionId();
} }
bool NostalgiaInstance::menuActionEnabled(QString action_name) const
{
return false;
}
/* /*
ADD MORE ADD MORE

View File

@ -8,5 +8,6 @@ class NostalgiaInstance : public OneSixInstance
public: public:
explicit NostalgiaInstance(const QString &rootDir, SettingsObject * settings, QObject *parent = 0); explicit NostalgiaInstance(const QString &rootDir, SettingsObject * settings, QObject *parent = 0);
virtual QString getStatusbarDescription(); virtual QString getStatusbarDescription();
virtual bool menuActionEnabled(QString action_name) const;
}; };

View File

@ -122,9 +122,13 @@ MCVListLoadTask::MCVListLoadTask(MinecraftVersionList *vlist)
legacyWhitelist.insert("1.4.6"); legacyWhitelist.insert("1.4.6");
legacyWhitelist.insert("1.4.5"); legacyWhitelist.insert("1.4.5");
legacyWhitelist.insert("1.4.4"); legacyWhitelist.insert("1.4.4");
legacyWhitelist.insert("1.4.3");
legacyWhitelist.insert("1.4.2"); legacyWhitelist.insert("1.4.2");
legacyWhitelist.insert("1.4.1");
legacyWhitelist.insert("1.4");
legacyWhitelist.insert("1.3.2"); legacyWhitelist.insert("1.3.2");
legacyWhitelist.insert("1.3.1"); legacyWhitelist.insert("1.3.1");
legacyWhitelist.insert("1.3");
legacyWhitelist.insert("1.2.5"); legacyWhitelist.insert("1.2.5");
legacyWhitelist.insert("1.2.4"); legacyWhitelist.insert("1.2.4");
legacyWhitelist.insert("1.2.3"); legacyWhitelist.insert("1.2.3");