summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-09-06 18:16:56 +0200
committerPetr Mrázek <peterix@gmail.com>2014-09-06 19:03:05 +0200
commit20cb97a35af5097e9d3b2062c0dfcb5f2e5fff5c (patch)
tree56bf51e681f2e73590a549499bd83d7b505c39f8 /gui
parent36efcf8d3c0cbd7823fc65569cfc2b011435db2c (diff)
downloadMultiMC-20cb97a35af5097e9d3b2062c0dfcb5f2e5fff5c.tar
MultiMC-20cb97a35af5097e9d3b2062c0dfcb5f2e5fff5c.tar.gz
MultiMC-20cb97a35af5097e9d3b2062c0dfcb5f2e5fff5c.tar.lz
MultiMC-20cb97a35af5097e9d3b2062c0dfcb5f2e5fff5c.tar.xz
MultiMC-20cb97a35af5097e9d3b2062c0dfcb5f2e5fff5c.zip
Sync from quickmods
Diffstat (limited to 'gui')
-rw-r--r--gui/MainWindow.cpp7
-rw-r--r--gui/MainWindow.ui2
-rw-r--r--gui/dialogs/ModEditDialogCommon.cpp4
-rw-r--r--gui/dialogs/NewInstanceDialog.cpp9
-rw-r--r--gui/dialogs/NewInstanceDialog.h1
-rw-r--r--gui/groupview/InstanceDelegate.cpp16
-rw-r--r--gui/groupview/InstanceDelegate.h2
7 files changed, 14 insertions, 27 deletions
diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp
index d3dc8f6e..a5bffcc4 100644
--- a/gui/MainWindow.cpp
+++ b/gui/MainWindow.cpp
@@ -65,9 +65,9 @@
#include "gui/pages/global/MultiMCPage.h"
#include "gui/pages/global/ExternalToolsPage.h"
#include "gui/pages/global/AccountListPage.h"
-#include "pages/global/ProxyPage.h"
-#include "pages/global/JavaPage.h"
-#include "pages/global/MinecraftPage.h"
+#include "gui/pages/global/ProxyPage.h"
+#include "gui/pages/global/JavaPage.h"
+#include "gui/pages/global/MinecraftPage.h"
#include "gui/ConsoleWindow.h"
#include "pagedialog/PageDialog.h"
@@ -91,6 +91,7 @@
#include "logic/net/NetJob.h"
#include "logic/BaseInstance.h"
+#include "logic/OneSixInstance.h"
#include "logic/InstanceFactory.h"
#include "logic/MinecraftProcess.h"
#include "logic/OneSixUpdate.h"
diff --git a/gui/MainWindow.ui b/gui/MainWindow.ui
index 03a07ce5..a3edf6bd 100644
--- a/gui/MainWindow.ui
+++ b/gui/MainWindow.ui
@@ -387,7 +387,7 @@
</action>
<action name="actionEditInstance">
<property name="text">
- <string>Edit Mods</string>
+ <string>Edit Instance</string>
</property>
<property name="iconText">
<string>Edit Instance</string>
diff --git a/gui/dialogs/ModEditDialogCommon.cpp b/gui/dialogs/ModEditDialogCommon.cpp
index 35942374..4a2115d8 100644
--- a/gui/dialogs/ModEditDialogCommon.cpp
+++ b/gui/dialogs/ModEditDialogCommon.cpp
@@ -4,7 +4,7 @@
bool lastfirst(QModelIndexList &list, int &first, int &last)
{
- if (!list.size())
+ if (list.isEmpty())
return false;
first = last = list[0].row();
for (auto item : list)
@@ -37,4 +37,4 @@ void showWebsiteForMod(QWidget *parentDlg, Mod &m)
QObject::tr("The mod author didn't provide a website link for this mod."),
QMessageBox::Warning);
}
-} \ No newline at end of file
+}
diff --git a/gui/dialogs/NewInstanceDialog.cpp b/gui/dialogs/NewInstanceDialog.cpp
index 41ae329c..80cbbeb2 100644
--- a/gui/dialogs/NewInstanceDialog.cpp
+++ b/gui/dialogs/NewInstanceDialog.cpp
@@ -38,15 +38,6 @@ NewInstanceDialog::NewInstanceDialog(QWidget *parent)
ui->setupUi(this);
resize(minimumSizeHint());
layout()->setSizeConstraint(QLayout::SetFixedSize);
- /*
- if (!MinecraftVersionList::getMainList().isLoaded())
- {
- TaskDialog *taskDlg = new TaskDialog(this);
- Task *loadTask = MinecraftVersionList::getMainList().getLoadTask();
- loadTask->setParent(taskDlg);
- taskDlg->exec(loadTask);
- }
- */
setSelectedVersion(MMC->minecraftlist()->getLatestStable(), true);
InstIconKey = "infinity";
ui->iconButton->setIcon(MMC->icons()->getIcon(InstIconKey));
diff --git a/gui/dialogs/NewInstanceDialog.h b/gui/dialogs/NewInstanceDialog.h
index 17045ec0..fa9012ea 100644
--- a/gui/dialogs/NewInstanceDialog.h
+++ b/gui/dialogs/NewInstanceDialog.h
@@ -16,6 +16,7 @@
#pragma once
#include <QDialog>
+
#include "logic/BaseVersion.h"
namespace Ui
diff --git a/gui/groupview/InstanceDelegate.cpp b/gui/groupview/InstanceDelegate.cpp
index 3bd77747..e49e1552 100644
--- a/gui/groupview/InstanceDelegate.cpp
+++ b/gui/groupview/InstanceDelegate.cpp
@@ -113,16 +113,10 @@ void drawProgressOverlay(QPainter *painter, const QStyleOptionViewItemV4 &option
void drawBadges(QPainter *painter, const QStyleOptionViewItemV4 &option, BaseInstance *instance)
{
QList<QString> pixmaps;
- for (auto flag : instance->flags())
+ const BaseInstance::InstanceFlags flags = instance->flags();
+ if (flags & BaseInstance::VersionBrokenFlag)
{
- switch (flag)
- {
- case BaseInstance::VersionBrokenFlag:
- pixmaps.append("broken");
- break;
- default:
- break;
- }
+ pixmaps.append("broken");
}
// begin easter eggs
@@ -160,7 +154,7 @@ void drawBadges(QPainter *painter, const QStyleOptionViewItemV4 &option, BaseIns
{
return;
}
- const QPixmap pixmap = ListViewDelegate::requestPixmap(it.next()).scaled(
+ const QPixmap pixmap = ListViewDelegate::requestBadgePixmap(it.next()).scaled(
itemSide, itemSide, Qt::KeepAspectRatio, Qt::FastTransformation);
painter->drawPixmap(option.rect.width() - x * itemSide + qMax(x - 1, 0) * spacing - itemSide,
y * itemSide + qMax(y - 1, 0) * spacing, itemSide, itemSide,
@@ -354,7 +348,7 @@ QSize ListViewDelegate::sizeHint(const QStyleOptionViewItem &option,
return sz;
}
-QPixmap ListViewDelegate::requestPixmap(const QString &key)
+QPixmap ListViewDelegate::requestBadgePixmap(const QString &key)
{
if (!m_pixmapCache.contains(key))
{
diff --git a/gui/groupview/InstanceDelegate.h b/gui/groupview/InstanceDelegate.h
index 9ab44864..1520cbb8 100644
--- a/gui/groupview/InstanceDelegate.h
+++ b/gui/groupview/InstanceDelegate.h
@@ -23,7 +23,7 @@ class ListViewDelegate : public QStyledItemDelegate
public:
explicit ListViewDelegate(QObject *parent = 0);
- static QPixmap requestPixmap(const QString &key);
+ static QPixmap requestBadgePixmap(const QString &key);
protected:
void paint(QPainter *painter, const QStyleOptionViewItem &option,