Merge pull request #1509 from IvanSavenko/launcher_settings_refresh
Launcher layout changes
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 895 B After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 6.9 KiB |
@ -21,8 +21,6 @@ static const QString names[ModFields::COUNT] =
|
||||
"",
|
||||
"modType",
|
||||
"version",
|
||||
"size",
|
||||
"author"
|
||||
};
|
||||
|
||||
}
|
||||
@ -72,8 +70,6 @@ QVariant CModListModel::getText(const CModEntry & mod, int field) const
|
||||
case ModFields::STATUS_ENABLED:
|
||||
case ModFields::STATUS_UPDATE:
|
||||
return "";
|
||||
case ModFields::SIZE:
|
||||
return CModEntry::sizeToString(getValue(mod, field).toDouble());
|
||||
default:
|
||||
return getValue(mod, field);
|
||||
}
|
||||
@ -96,10 +92,6 @@ QVariant CModListModel::getIcon(const CModEntry & mod, int field) const
|
||||
|
||||
QVariant CModListModel::getTextAlign(int field) const
|
||||
{
|
||||
if(field == ModFields::SIZE)
|
||||
return QVariant(Qt::AlignRight | Qt::AlignVCenter);
|
||||
//if (field == ModFields::NAME)
|
||||
// return QVariant(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
return QVariant(Qt::AlignLeft | Qt::AlignVCenter);
|
||||
}
|
||||
|
||||
@ -152,8 +144,6 @@ QVariant CModListModel::headerData(int section, Qt::Orientation orientation, int
|
||||
QT_TR_NOOP(""), // status icon
|
||||
QT_TR_NOOP("Type"),
|
||||
QT_TR_NOOP("Version"),
|
||||
QT_TR_NOOP("Size"),
|
||||
QT_TR_NOOP("Author")
|
||||
};
|
||||
|
||||
if(role == Qt::DisplayRole && orientation == Qt::Horizontal)
|
||||
|
@ -23,8 +23,6 @@ enum EModFields
|
||||
STATUS_UPDATE,
|
||||
TYPE,
|
||||
VERSION,
|
||||
SIZE,
|
||||
AUTHOR,
|
||||
COUNT
|
||||
};
|
||||
}
|
||||
|
@ -71,12 +71,11 @@ void CModListView::setupModsView()
|
||||
else //default //TODO: default high-DPI scaling
|
||||
{
|
||||
ui->allModsView->setColumnWidth(ModFields::NAME, 185);
|
||||
ui->allModsView->setColumnWidth(ModFields::STATUS_ENABLED, 30);
|
||||
ui->allModsView->setColumnWidth(ModFields::STATUS_UPDATE, 30);
|
||||
ui->allModsView->setColumnWidth(ModFields::TYPE, 75);
|
||||
ui->allModsView->setColumnWidth(ModFields::SIZE, 80);
|
||||
ui->allModsView->setColumnWidth(ModFields::VERSION, 60);
|
||||
}
|
||||
ui->allModsView->setColumnWidth(ModFields::STATUS_ENABLED, 24);
|
||||
ui->allModsView->setColumnWidth(ModFields::STATUS_UPDATE, 24);
|
||||
|
||||
ui->allModsView->setUniformRowHeights(true);
|
||||
|
||||
@ -161,23 +160,6 @@ void CModListView::showEvent(QShowEvent * event)
|
||||
}
|
||||
}
|
||||
|
||||
void CModListView::showModInfo()
|
||||
{
|
||||
enableModInfo();
|
||||
ui->modInfoWidget->show();
|
||||
ui->hideModInfoButton->setArrowType(Qt::RightArrow);
|
||||
ui->showInfoButton->setVisible(false);
|
||||
loadScreenshots();
|
||||
}
|
||||
|
||||
void CModListView::hideModInfo()
|
||||
{
|
||||
ui->modInfoWidget->hide();
|
||||
ui->hideModInfoButton->setArrowType(Qt::LeftArrow);
|
||||
ui->hideModInfoButton->setEnabled(true);
|
||||
ui->showInfoButton->setVisible(true);
|
||||
}
|
||||
|
||||
static QString replaceIfNotEmpty(QVariant value, QString pattern)
|
||||
{
|
||||
if(value.canConvert<QStringList>())
|
||||
@ -255,7 +237,7 @@ QString CModListView::genModInfoText(CModEntry & mod)
|
||||
result += urlTemplate.arg(tr("License")).arg(mod.getValue("licenseURL").toString()).arg(mod.getValue("licenseName").toString());
|
||||
|
||||
if(mod.getValue("contact").isValid())
|
||||
result += urlTemplate.arg(tr("Home")).arg(mod.getValue("contact").toString()).arg(mod.getValue("contact").toString());
|
||||
result += urlTemplate.arg(tr("Contact")).arg(mod.getValue("contact").toString()).arg(mod.getValue("contact").toString());
|
||||
|
||||
//compatibility info
|
||||
if(mod.isCompatible())
|
||||
@ -313,18 +295,8 @@ QString CModListView::genModInfoText(CModEntry & mod)
|
||||
return result;
|
||||
}
|
||||
|
||||
void CModListView::enableModInfo()
|
||||
{
|
||||
ui->hideModInfoButton->setEnabled(true);
|
||||
ui->showInfoButton->setVisible(true);
|
||||
}
|
||||
|
||||
void CModListView::disableModInfo()
|
||||
{
|
||||
hideModInfo();
|
||||
ui->hideModInfoButton->setEnabled(false);
|
||||
ui->showInfoButton->setVisible(false);
|
||||
|
||||
ui->disableButton->setVisible(false);
|
||||
ui->enableButton->setVisible(false);
|
||||
ui->installButton->setVisible(false);
|
||||
@ -354,8 +326,6 @@ void CModListView::selectMod(const QModelIndex & index)
|
||||
bool hasBlockingMods = !findBlockingMods(index.data(ModRoles::ModNameRole).toString()).empty();
|
||||
bool hasDependentMods = !findDependentMods(index.data(ModRoles::ModNameRole).toString(), true).empty();
|
||||
|
||||
ui->hideModInfoButton->setEnabled(true);
|
||||
ui->showInfoButton->setVisible(!ui->modInfoWidget->isVisible());
|
||||
ui->disableButton->setVisible(mod.isEnabled());
|
||||
ui->enableButton->setVisible(mod.isDisabled());
|
||||
ui->installButton->setVisible(mod.isAvailable() && !mod.getName().contains('.'));
|
||||
@ -380,35 +350,15 @@ bool CModListView::isExtraResolutionsModEnabled() const
|
||||
return manager->isExtraResolutionsModEnabled();
|
||||
}
|
||||
|
||||
void CModListView::keyPressEvent(QKeyEvent * event)
|
||||
{
|
||||
if(event->key() == Qt::Key_Escape && ui->modInfoWidget->isVisible())
|
||||
{
|
||||
hideModInfo();
|
||||
}
|
||||
else
|
||||
{
|
||||
return QWidget::keyPressEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
void CModListView::modSelected(const QModelIndex & current, const QModelIndex &)
|
||||
{
|
||||
selectMod(current);
|
||||
}
|
||||
|
||||
void CModListView::on_hideModInfoButton_clicked()
|
||||
{
|
||||
if(ui->modInfoWidget->isVisible())
|
||||
hideModInfo();
|
||||
else
|
||||
showModInfo();
|
||||
}
|
||||
|
||||
void CModListView::on_allModsView_activated(const QModelIndex & index)
|
||||
{
|
||||
showModInfo();
|
||||
selectMod(index);
|
||||
loadScreenshots();
|
||||
}
|
||||
|
||||
void CModListView::on_lineEdit_textChanged(const QString & arg1)
|
||||
@ -798,8 +748,7 @@ void CModListView::on_pushButton_clicked()
|
||||
|
||||
void CModListView::modelReset()
|
||||
{
|
||||
if(ui->modInfoWidget->isVisible())
|
||||
selectMod(filterModel->rowCount() > 0 ? filterModel->index(0, 0) : QModelIndex());
|
||||
selectMod(filterModel->rowCount() > 0 ? filterModel->index(0, 0) : QModelIndex());
|
||||
}
|
||||
|
||||
void CModListView::checkManagerErrors()
|
||||
@ -820,7 +769,7 @@ void CModListView::on_tabWidget_currentChanged(int index)
|
||||
|
||||
void CModListView::loadScreenshots()
|
||||
{
|
||||
if(ui->tabWidget->currentIndex() == 2 && ui->modInfoWidget->isVisible())
|
||||
if(ui->tabWidget->currentIndex() == 2)
|
||||
{
|
||||
ui->screenshotsList->clear();
|
||||
QString modName = ui->allModsView->currentIndex().data(ModRoles::ModNameRole).toString();
|
||||
@ -860,11 +809,6 @@ void CModListView::on_screenshotsList_clicked(const QModelIndex & index)
|
||||
}
|
||||
}
|
||||
|
||||
void CModListView::on_showInfoButton_clicked()
|
||||
{
|
||||
showModInfo();
|
||||
}
|
||||
|
||||
const CModList & CModListView::getModList() const
|
||||
{
|
||||
assert(modModel);
|
||||
|
@ -40,8 +40,6 @@ class CModListView : public QWidget
|
||||
|
||||
void showEvent(QShowEvent * event) override;
|
||||
|
||||
void keyPressEvent(QKeyEvent * event) override;
|
||||
|
||||
void setupModModel();
|
||||
void setupFilterModel();
|
||||
void setupModsView();
|
||||
@ -74,8 +72,6 @@ public:
|
||||
explicit CModListView(QWidget * parent = 0);
|
||||
~CModListView();
|
||||
|
||||
void showModInfo();
|
||||
void hideModInfo();
|
||||
void loadScreenshots();
|
||||
|
||||
void enableModInfo();
|
||||
@ -98,8 +94,6 @@ private slots:
|
||||
void modelReset();
|
||||
void hideProgressBar();
|
||||
|
||||
void on_hideModInfoButton_clicked();
|
||||
|
||||
void on_lineEdit_textChanged(const QString & arg1);
|
||||
|
||||
void on_comboBox_currentIndexChanged(int index);
|
||||
@ -124,8 +118,6 @@ private slots:
|
||||
|
||||
void on_screenshotsList_clicked(const QModelIndex & index);
|
||||
|
||||
void on_showInfoButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::CModListView * ui;
|
||||
};
|
||||
|
@ -6,14 +6,17 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>680</width>
|
||||
<height>342</height>
|
||||
<width>639</width>
|
||||
<height>351</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@ -26,15 +29,9 @@
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
@ -62,7 +59,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
@ -111,7 +108,7 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<item>
|
||||
<widget class="QPushButton" name="refreshButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
@ -124,7 +121,11 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="3">
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QTreeView" name="allModsView">
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
@ -134,8 +135,8 @@
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="verticalScrollMode">
|
||||
@ -152,367 +153,127 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QToolButton" name="hideModInfoButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="arrowType">
|
||||
<enum>Qt::RightArrow</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QWidget" name="modInfoWidget" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0" colspan="6">
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tabInfo">
|
||||
<attribute name="title">
|
||||
<string>Description</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QTextBrowser" name="modInfoBrowser">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tabInfo">
|
||||
<attribute name="title">
|
||||
<string>Description</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QTextBrowser" name="modInfoBrowser">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt;"><br /></p></body></html></string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="openLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabChangelog">
|
||||
<attribute name="title">
|
||||
<string>Changelog</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QTextBrowser" name="changelogBrowser"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabScreenshots">
|
||||
<attribute name="title">
|
||||
<string>Screenshots</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QListWidget" name="screenshotsList">
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::NoSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>240</width>
|
||||
<height>180</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="viewMode">
|
||||
<enum>QListView::IconMode</enum>
|
||||
</property>
|
||||
<property name="uniformItemSizes">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="openLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabChangelog">
|
||||
<attribute name="title">
|
||||
<string>Changelog</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QTextBrowser" name="changelogBrowser"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabScreenshots">
|
||||
<attribute name="title">
|
||||
<string>Screenshots</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QListWidget" name="screenshotsList">
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::NoSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>240</width>
|
||||
<height>180</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="viewMode">
|
||||
<enum>QListView::IconMode</enum>
|
||||
</property>
|
||||
<property name="uniformItemSizes">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="3">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="showInfoButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>51</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>220</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show details</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="modButtonSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="uninstallButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>51</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>140</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Uninstall</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="enableButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>51</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>140</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="disableButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>51</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>140</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Disable</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="updateButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>51</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>140</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Update</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="installButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>51</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Install</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="3">
|
||||
<item>
|
||||
<widget class="QWidget" name="progressWidget" native="true">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@ -531,13 +292,16 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>9</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
@ -580,14 +344,206 @@ p, li { white-space: pre-wrap; }
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="modButtonSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="uninstallButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>51</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>140</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Uninstall</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>icons:mod-delete.png</normaloff>icons:mod-delete.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="enableButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>51</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>140</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>icons:mod-enabled.png</normaloff>icons:mod-enabled.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="disableButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>51</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>140</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Disable</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>icons:mod-disabled.png</normaloff>icons:mod-disabled.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="updateButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>51</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>140</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Update</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>icons:mod-update.png</normaloff>icons:mod-update.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="installButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>51</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Install</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>icons:mod-download.png</normaloff>icons:mod-download.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>lineEdit</tabstop>
|
||||
<tabstop>comboBox</tabstop>
|
||||
<tabstop>allModsView</tabstop>
|
||||
<tabstop>hideModInfoButton</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@ -202,7 +202,7 @@ CSettingsView::CSettingsView(QWidget * parent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->labelBuildVersion->setText(QString::fromStdString(GameConstants::VCMI_VERSION));
|
||||
ui->lineEditBuildVersion->setText(QString::fromStdString(GameConstants::VCMI_VERSION));
|
||||
loadSettings();
|
||||
}
|
||||
|
||||
@ -359,3 +359,24 @@ void CSettingsView::on_comboBoxCursorType_currentIndexChanged(int index)
|
||||
node->String() = cursorTypesList[index];
|
||||
}
|
||||
|
||||
|
||||
void CSettingsView::on_listWidgetSettings_currentRowChanged(int currentRow)
|
||||
{
|
||||
QVector<QWidget*> targetWidgets = {
|
||||
ui->labelGeneral,
|
||||
ui->labelVideo,
|
||||
ui->labelArtificialIntelligence,
|
||||
ui->labelDataDirs,
|
||||
ui->labelRepositories
|
||||
};
|
||||
|
||||
QWidget * currentTarget = targetWidgets[currentRow];
|
||||
|
||||
// We want to scroll in a way that will put target widget in topmost visible position
|
||||
// To show not just header, but all settings in this group as well
|
||||
// In order to do that, let's scroll to the very bottom and the scroll back up until target widget is visible
|
||||
int maxPosition = ui->settingsScrollArea->verticalScrollBar()->maximum();
|
||||
ui->settingsScrollArea->verticalScrollBar()->setValue(maxPosition);
|
||||
ui->settingsScrollArea->ensureWidgetVisible(currentTarget, 5, 5);
|
||||
|
||||
}
|
||||
|
@ -73,6 +73,8 @@ private slots:
|
||||
|
||||
void on_comboBoxCursorType_currentIndexChanged(int index);
|
||||
|
||||
void on_listWidgetSettings_currentRowChanged(int currentRow);
|
||||
|
||||
private:
|
||||
Ui::CSettingsView * ui;
|
||||
|
||||
|