summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MultiMC.h9
-rw-r--r--gui/MainWindow.ui9
-rw-r--r--gui/dialogs/SettingsDialog.cpp9
-rw-r--r--logic/minecraft/MinecraftVersion.cpp16
-rw-r--r--logic/minecraft/MinecraftVersion.h3
-rw-r--r--logic/minecraft/MinecraftVersionList.cpp28
-rw-r--r--resources/versions/minecraft.json12
7 files changed, 64 insertions, 22 deletions
diff --git a/MultiMC.h b/MultiMC.h
index a80a54c6..ce3f9238 100644
--- a/MultiMC.h
+++ b/MultiMC.h
@@ -30,15 +30,6 @@ class URNResolver;
#endif
#define MMC (static_cast<MultiMC *>(QCoreApplication::instance()))
-// FIXME: possibly move elsewhere
-enum InstSortMode
-{
- // Sort alphabetically by name.
- Sort_Name,
- // Sort by which instance was launched most recently.
- Sort_LastLaunch
-};
-
enum UpdateFlag
{
None = 0x0,
diff --git a/gui/MainWindow.ui b/gui/MainWindow.ui
index 8ee196fd..188433e9 100644
--- a/gui/MainWindow.ui
+++ b/gui/MainWindow.ui
@@ -116,6 +116,7 @@
<addaction name="actionScreenshots"/>
<addaction name="separator"/>
<addaction name="actionEditInstance"/>
+ <addaction name="actionInstance_Settings"/>
<addaction name="actionViewSelectedInstFolder"/>
<addaction name="actionConfig_Folder"/>
<addaction name="separator"/>
@@ -488,6 +489,14 @@
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;View and upload screenshots for this instance&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</action>
+ <action name="actionInstance_Settings">
+ <property name="text">
+ <string>Instance Settings</string>
+ </property>
+ <property name="toolTip">
+ <string>Change the settings specific to the instance</string>
+ </property>
+ </action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>
diff --git a/gui/dialogs/SettingsDialog.cpp b/gui/dialogs/SettingsDialog.cpp
index 4c69c785..f7333055 100644
--- a/gui/dialogs/SettingsDialog.cpp
+++ b/gui/dialogs/SettingsDialog.cpp
@@ -38,6 +38,15 @@
#include <QMessageBox>
#include <QDir>
+// FIXME: possibly move elsewhere
+enum InstSortMode
+{
+ // Sort alphabetically by name.
+ Sort_Name,
+ // Sort by which instance was launched most recently.
+ Sort_LastLaunch
+};
+
SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::SettingsDialog)
{
MultiMCPlatform::fixWM_CLASS(this);
diff --git a/logic/minecraft/MinecraftVersion.cpp b/logic/minecraft/MinecraftVersion.cpp
index e0cbce8d..b66b9768 100644
--- a/logic/minecraft/MinecraftVersion.cpp
+++ b/logic/minecraft/MinecraftVersion.cpp
@@ -20,14 +20,26 @@ QString MinecraftVersion::name()
QString MinecraftVersion::typeString() const
{
- if (is_snapshot)
+ if(m_type == "snapshot")
{
return QObject::tr("Snapshot");
}
- else
+ else if (m_type == "release")
{
return QObject::tr("Regular release");
}
+ else if (m_type == "old_alpha")
+ {
+ return QObject::tr("Alpha");
+ }
+ else if (m_type == "old_beta")
+ {
+ return QObject::tr("Beta");
+ }
+ else
+ {
+ return QString();
+ }
}
bool MinecraftVersion::hasJarMods()
diff --git a/logic/minecraft/MinecraftVersion.h b/logic/minecraft/MinecraftVersion.h
index 02afd709..422b4cea 100644
--- a/logic/minecraft/MinecraftVersion.h
+++ b/logic/minecraft/MinecraftVersion.h
@@ -61,9 +61,6 @@ public: /* data */
/// The URL that this version will be downloaded from. maybe.
QString download_url;
- /// is this a snapshot?
- bool is_snapshot = false;
-
VersionSource m_versionSource = Builtin;
/// the human readable version name
diff --git a/logic/minecraft/MinecraftVersionList.cpp b/logic/minecraft/MinecraftVersionList.cpp
index 26a17c73..e012330e 100644
--- a/logic/minecraft/MinecraftVersionList.cpp
+++ b/logic/minecraft/MinecraftVersionList.cpp
@@ -154,6 +154,7 @@ void MinecraftVersionList::loadBuiltinList()
"http://" + URLConstants::AWS_DOWNLOAD_VERSIONS + versionID + "/";
mcVersion->m_versionSource = Builtin;
+ mcVersion->m_type = versionTypeStr;
mcVersion->m_appletClass = versionObj.value("appletClass").toString("");
mcVersion->m_mainClass = versionObj.value("mainClass").toString("");
mcVersion->m_processArguments = versionObj.value("processArguments").toString("legacy");
@@ -293,10 +294,13 @@ void MinecraftVersionList::loadMojangList(QByteArray data, VersionSource source)
continue;
}
mcVersion->m_type = versionTypeStr;
- mcVersion->is_snapshot = is_snapshot;
tempList.append(mcVersion);
}
updateListData(tempList);
+ if(source == Remote)
+ {
+ m_loaded = true;
+ }
}
void MinecraftVersionList::sort()
@@ -322,6 +326,7 @@ void MinecraftVersionList::updateListData(QList<BaseVersionPtr> versions)
if (!m_lookup.contains(descr))
{
+ m_lookup[version->descriptor()] = version;
m_vlist.append(version);
continue;
}
@@ -343,7 +348,6 @@ void MinecraftVersionList::updateListData(QList<BaseVersionPtr> versions)
// alright, it's an update. put it inside the original, for further processing.
orig->upstreamUpdate = added;
}
- m_loaded = true;
sortInternal();
endResetModel();
}
@@ -528,6 +532,26 @@ void MinecraftVersionList::saveCachedList()
entriesArr.append(entryObj);
}
toplevel.insert("versions", entriesArr);
+
+ {
+ bool someLatest = false;
+ QJsonObject latestObj;
+ if(!m_latestReleaseID.isNull())
+ {
+ latestObj.insert("release", m_latestReleaseID);
+ someLatest = true;
+ }
+ if(!m_latestSnapshotID.isNull())
+ {
+ latestObj.insert("snapshot", m_latestSnapshotID);
+ someLatest = true;
+ }
+ if(someLatest)
+ {
+ toplevel.insert("latest", latestObj);
+ }
+ }
+
QJsonDocument doc(toplevel);
QByteArray jsonData = doc.toJson();
qint64 result = tfile.write(jsonData);
diff --git a/resources/versions/minecraft.json b/resources/versions/minecraft.json
index d5739cb5..1c6928c6 100644
--- a/resources/versions/minecraft.json
+++ b/resources/versions/minecraft.json
@@ -37,42 +37,42 @@
},
{
"id": "1.4.5",
- "releaseTime": "2012-12-20T00:00:00+02:00",
+ "releaseTime": "2012-11-20T00:00:00+02:00",
"type": "release",
"processArguments": "legacy",
"+traits": ["legacyLaunch"]
},
{
"id": "1.4.4",
- "releaseTime": "2012-12-14T00:00:00+02:00",
+ "releaseTime": "2012-11-14T00:00:00+02:00",
"type": "release",
"processArguments": "legacy",
"+traits": ["legacyLaunch"]
},
{
"id": "1.4.3",
- "releaseTime": "2012-12-01T00:00:00+02:00",
+ "releaseTime": "2012-11-01T00:00:00+02:00",
"type": "snapshot",
"processArguments": "legacy",
"+traits": ["legacyLaunch"]
},
{
"id": "1.4.2",
- "releaseTime": "2012-11-25T00:00:00+02:00",
+ "releaseTime": "2012-10-25T00:00:00+02:00",
"type": "release",
"processArguments": "legacy",
"+traits": ["legacyLaunch"]
},
{
"id": "1.4.1",
- "releaseTime": "2012-11-23T00:00:00+02:00",
+ "releaseTime": "2012-10-23T00:00:00+02:00",
"type": "snapshot",
"processArguments": "legacy",
"+traits": ["legacyLaunch"]
},
{
"id": "1.4",
- "releaseTime": "2012-11-19T00:00:00+02:00",
+ "releaseTime": "2012-10-19T00:00:00+02:00",
"type": "snapshot",
"processArguments": "legacy",
"+traits": ["legacyLaunch"]