Sync from quickmods
This commit is contained in:
@ -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"
|
||||
|
@ -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>
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
|
@ -16,6 +16,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#include "logic/BaseVersion.h"
|
||||
|
||||
namespace Ui
|
||||
|
@ -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))
|
||||
{
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user