summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-06-08 21:26:48 +0200
committerPetr Mrázek <peterix@gmail.com>2014-06-09 01:38:31 +0200
commitbe73eb3322b6bb5ab1144f9942ef9bd188c704a1 (patch)
tree8df6bfa84a62fc17d9842d30134c6a71fd4cb3f1 /gui
parentbf7b07050873770bd0b2ed5d73965b5a88d7a351 (diff)
downloadMultiMC-be73eb3322b6bb5ab1144f9942ef9bd188c704a1.tar
MultiMC-be73eb3322b6bb5ab1144f9942ef9bd188c704a1.tar.gz
MultiMC-be73eb3322b6bb5ab1144f9942ef9bd188c704a1.tar.lz
MultiMC-be73eb3322b6bb5ab1144f9942ef9bd188c704a1.tar.xz
MultiMC-be73eb3322b6bb5ab1144f9942ef9bd188c704a1.zip
Version revert logic improvements, colorful icons for mod lists and resource pack list.
Icons are from Oxygen.
Diffstat (limited to 'gui')
-rw-r--r--gui/pages/LegacyJarModPage.cpp2
-rw-r--r--gui/pages/LegacyUpgradePage.cpp2
-rw-r--r--gui/pages/ResourcePackPage.h23
-rw-r--r--gui/pages/TexturePackPage.h20
-rw-r--r--gui/pages/VersionPage.cpp28
5 files changed, 61 insertions, 14 deletions
diff --git a/gui/pages/LegacyJarModPage.cpp b/gui/pages/LegacyJarModPage.cpp
index 7ec53d80..f0f3d753 100644
--- a/gui/pages/LegacyJarModPage.cpp
+++ b/gui/pages/LegacyJarModPage.cpp
@@ -56,7 +56,7 @@ QString LegacyJarModPage::displayName()
QIcon LegacyJarModPage::icon()
{
- return QIcon::fromTheme("settings");
+ return QIcon::fromTheme("plugin-red");
}
QString LegacyJarModPage::id()
diff --git a/gui/pages/LegacyUpgradePage.cpp b/gui/pages/LegacyUpgradePage.cpp
index 9aa97543..02729c79 100644
--- a/gui/pages/LegacyUpgradePage.cpp
+++ b/gui/pages/LegacyUpgradePage.cpp
@@ -8,7 +8,7 @@ QString LegacyUpgradePage::displayName()
QIcon LegacyUpgradePage::icon()
{
- return QIcon::fromTheme("bug");
+ return QIcon::fromTheme("checkupdate");
}
QString LegacyUpgradePage::id()
diff --git a/gui/pages/ResourcePackPage.h b/gui/pages/ResourcePackPage.h
new file mode 100644
index 00000000..14321b9b
--- /dev/null
+++ b/gui/pages/ResourcePackPage.h
@@ -0,0 +1,23 @@
+#pragma once
+#include "ModFolderPage.h"
+
+class ResourcePackPage : public ModFolderPage
+{
+public:
+ explicit ResourcePackPage(BaseInstance *instance, QWidget *parent = 0)
+ : ModFolderPage(instance->texturePackList(), "resourcepacks", "resourcepacks",
+ tr("Resource packs"), parent)
+ {
+ m_inst = instance;
+ }
+
+ virtual ~ResourcePackPage() {};
+ virtual bool shouldDisplay() override
+ {
+ return !m_inst->traits().contains("no-texturepacks") &&
+ !m_inst->traits().contains("texturepacks");
+ }
+
+private:
+ BaseInstance *m_inst;
+};
diff --git a/gui/pages/TexturePackPage.h b/gui/pages/TexturePackPage.h
new file mode 100644
index 00000000..ddb1fa49
--- /dev/null
+++ b/gui/pages/TexturePackPage.h
@@ -0,0 +1,20 @@
+#pragma once
+#include "ModFolderPage.h"
+
+class TexturePackPage : public ModFolderPage
+{
+public:
+ explicit TexturePackPage(BaseInstance *instance, QWidget *parent = 0)
+ : ModFolderPage(instance->texturePackList(), "texturepacks", "resourcepacks",
+ tr("Texture packs"), parent)
+ {
+ m_inst = instance;
+ }
+ virtual ~TexturePackPage() {};
+ virtual bool shouldDisplay() override
+ {
+ return m_inst->traits().contains("texturepacks");
+ }
+private:
+ BaseInstance *m_inst;
+};
diff --git a/gui/pages/VersionPage.cpp b/gui/pages/VersionPage.cpp
index 74c3c2af..7cee0610 100644
--- a/gui/pages/VersionPage.cpp
+++ b/gui/pages/VersionPage.cpp
@@ -44,6 +44,7 @@
#include <QAbstractItemModel>
#include <logic/Mod.h>
+#include <logic/icons/IconList.h>
#include <QMessageBox>
#include <QListView>
@@ -57,7 +58,7 @@ QString VersionPage::displayName()
QIcon VersionPage::icon()
{
- return QIcon::fromTheme("settings");
+ return MMC->icons()->getIcon(m_inst->iconKey());
}
QString VersionPage::id()
@@ -157,7 +158,7 @@ void VersionPage::on_jarmodBtn_clicked()
auto f = [&](QStandardPaths::StandardLocation l)
{
QString location = QStandardPaths::writableLocation(l);
- if(!QFileInfo::exists(location))
+ if (!QFileInfo::exists(location))
return;
locations.insert(location);
};
@@ -166,7 +167,7 @@ void VersionPage::on_jarmodBtn_clicked()
f(QStandardPaths::DownloadLocation);
f(QStandardPaths::HomeLocation);
QList<QUrl> urls;
- for(auto location: locations)
+ for (auto location : locations)
{
urls.append(QUrl::fromLocalFile(location));
}
@@ -178,8 +179,9 @@ void VersionPage::on_jarmodBtn_clicked()
w.setDirectory(modsFolder);
w.setSidebarUrls(urls);
- if(w.exec());
- m_version->installJarMods(w.selectedFiles());
+ if (w.exec())
+ ;
+ m_version->installJarMods(w.selectedFiles());
}
void VersionPage::on_resetLibraryOrderBtn_clicked()
@@ -292,15 +294,16 @@ void VersionPage::on_forgeBtn_clicked()
m_version->removeFtbPack();
reloadInstanceVersion();
}
- if (m_version->usesLegacyCustomJson())
+ if (m_version->hasDeprecatedVersionFiles())
{
if (QMessageBox::question(this, tr("Revert?"),
- tr("This action will remove your custom.json. Continue?")) !=
+ tr("This action will remove deprecated version files "
+ "(custom.json and version.json). Continue?")) !=
QMessageBox::Yes)
{
return;
}
- m_version->revertToVanilla();
+ m_version->removeDeprecatedVersionFiles();
reloadInstanceVersion();
}
VersionSelectDialog vselect(MMC->forgelist().get(), tr("Select Forge version"), this);
@@ -329,15 +332,16 @@ void VersionPage::on_liteloaderBtn_clicked()
m_version->removeFtbPack();
reloadInstanceVersion();
}
- if (m_version->usesLegacyCustomJson())
+ if (m_version->hasDeprecatedVersionFiles())
{
if (QMessageBox::question(this, tr("Revert?"),
- tr("This action will remove your custom.json. Continue?")) !=
+ tr("This action will remove deprecated version files "
+ "(custom.json and version.json). Continue?")) !=
QMessageBox::Yes)
{
return;
}
- m_version->revertToVanilla();
+ m_version->removeDeprecatedVersionFiles();
reloadInstanceVersion();
}
VersionSelectDialog vselect(MMC->liteloaderlist().get(), tr("Select LiteLoader version"),
@@ -369,7 +373,7 @@ void VersionPage::versionCurrent(const QModelIndex &current, const QModelIndex &
ui->moveLibraryUpBtn->setEnabled(enabled);
}
QString selectedId = m_version->versionFileId(current.row());
- if(selectedId == "net.minecraft" || selectedId == "org.multimc.custom.json")
+ if (selectedId == "net.minecraft" || selectedId == "org.multimc.custom.json")
{
ui->changeMCVersionBtn->setEnabled(true);
}