diff --git a/launcher/icons/mod-delete.png b/launcher/icons/mod-delete.png index fa0c04d95..8055222aa 100644 Binary files a/launcher/icons/mod-delete.png and b/launcher/icons/mod-delete.png differ diff --git a/launcher/icons/mod-disabled.png b/launcher/icons/mod-disabled.png index 14b11cdf4..c5a516a27 100644 Binary files a/launcher/icons/mod-disabled.png and b/launcher/icons/mod-disabled.png differ diff --git a/launcher/icons/mod-download.png b/launcher/icons/mod-download.png index 15644a404..c842898bd 100644 Binary files a/launcher/icons/mod-download.png and b/launcher/icons/mod-download.png differ diff --git a/launcher/icons/mod-enabled.png b/launcher/icons/mod-enabled.png index 40204a56f..0089197c2 100644 Binary files a/launcher/icons/mod-enabled.png and b/launcher/icons/mod-enabled.png differ diff --git a/launcher/icons/mod-update.png b/launcher/icons/mod-update.png index b8bdbc6a2..04e1b267e 100644 Binary files a/launcher/icons/mod-update.png and b/launcher/icons/mod-update.png differ diff --git a/launcher/modManager/cmodlistmodel_moc.cpp b/launcher/modManager/cmodlistmodel_moc.cpp index 7e9622f26..1c58dfef4 100644 --- a/launcher/modManager/cmodlistmodel_moc.cpp +++ b/launcher/modManager/cmodlistmodel_moc.cpp @@ -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) diff --git a/launcher/modManager/cmodlistmodel_moc.h b/launcher/modManager/cmodlistmodel_moc.h index 208efc625..5fe3c0f3b 100644 --- a/launcher/modManager/cmodlistmodel_moc.h +++ b/launcher/modManager/cmodlistmodel_moc.h @@ -23,8 +23,6 @@ enum EModFields STATUS_UPDATE, TYPE, VERSION, - SIZE, - AUTHOR, COUNT }; } diff --git a/launcher/modManager/cmodlistview_moc.cpp b/launcher/modManager/cmodlistview_moc.cpp index df1e17885..6ebfad9c8 100644 --- a/launcher/modManager/cmodlistview_moc.cpp +++ b/launcher/modManager/cmodlistview_moc.cpp @@ -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()) @@ -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); diff --git a/launcher/modManager/cmodlistview_moc.h b/launcher/modManager/cmodlistview_moc.h index 8aa98c499..db13c29eb 100644 --- a/launcher/modManager/cmodlistview_moc.h +++ b/launcher/modManager/cmodlistview_moc.h @@ -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; }; diff --git a/launcher/modManager/cmodlistview_moc.ui b/launcher/modManager/cmodlistview_moc.ui index 5e546e279..4b8060ed7 100644 --- a/launcher/modManager/cmodlistview_moc.ui +++ b/launcher/modManager/cmodlistview_moc.ui @@ -6,14 +6,17 @@ 0 0 - 680 - 342 + 639 + 351 - + + + 6 + 0 @@ -26,15 +29,9 @@ 0 - - 3 - - - - - 6 - - + + + @@ -62,7 +59,7 @@ - + @@ -111,7 +108,7 @@ - + @@ -124,7 +121,11 @@ - + + + + + QAbstractItemView::SingleSelection @@ -134,8 +135,8 @@ - 32 - 32 + 24 + 24 @@ -152,367 +153,127 @@ - - - - - - - 0 - 0 - - - - - 16 - 100 - - - - - - - true - - - Qt::RightArrow - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Qt::LeftToRight - - - false - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - - Description - - - - 4 - - - 4 - - - 4 - - - 4 - - - - - - 0 - 0 - - - - true - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + + 0 + + + + Description + + + + 4 + + + 4 + + + 4 + + + 4 + + + + + + 0 + 0 + + + + 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> - - - true - - - true - - - - - - - - Changelog - - - - 4 - - - 4 - - - 4 - - - 4 - - - - - - - - - Screenshots - - - - 4 - - - 4 - - - 4 - - - 4 - - - - - Qt::ScrollBarAlwaysOff - - - QAbstractItemView::NoSelection - - - QAbstractItemView::SelectRows - - - - 240 - 180 - - - - QListView::IconMode - - - true - - - - - + + + true + + + true + + + + + + + + Changelog + + + + 4 + + + 4 + + + 4 + + + 4 + + + + + + + + + Screenshots + + + + 4 + + + 4 + + + 4 + + + 4 + + + + + Qt::ScrollBarAlwaysOff + + + QAbstractItemView::NoSelection + + + QAbstractItemView::SelectRows + + + + 240 + 180 + + + + QListView::IconMode + + + true + + + + - - - - - - - - 6 - - - - - - 0 - 0 - - - - - 51 - 0 - - - - - 220 - 16777215 - - - - Show details - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 51 - 0 - - - - - 140 - 16777215 - - - - Uninstall - - - - - - - - 0 - 0 - - - - - 51 - 0 - - - - - 140 - 16777215 - - - - Enable - - - - - - - - 0 - 0 - - - - - 51 - 0 - - - - - 140 - 16777215 - - - - Disable - - - - - - - - 0 - 0 - - - - - 51 - 0 - - - - - 140 - 16777215 - - - - Update - - - - - - - - 0 - 0 - - - - - 51 - 0 - - - - - 100 - 16777215 - - - - Install - - + true @@ -531,13 +292,16 @@ p, li { white-space: pre-wrap; } - 9 + 0 - 6 + 0 + + + 0 - 6 + 0 @@ -580,14 +344,206 @@ p, li { white-space: pre-wrap; } + + + + 6 + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + 51 + 0 + + + + + 140 + 16777215 + + + + Uninstall + + + + icons:mod-delete.pngicons:mod-delete.png + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + + 51 + 0 + + + + + 140 + 16777215 + + + + Enable + + + + icons:mod-enabled.pngicons:mod-enabled.png + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + + 51 + 0 + + + + + 140 + 16777215 + + + + Disable + + + + icons:mod-disabled.pngicons:mod-disabled.png + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + + 51 + 0 + + + + + 140 + 16777215 + + + + Update + + + + icons:mod-update.pngicons:mod-update.png + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + + 51 + 0 + + + + + 100 + 16777215 + + + + Install + + + + icons:mod-download.pngicons:mod-download.png + + + + 20 + 20 + + + + + + - - lineEdit - comboBox - allModsView - hideModInfoButton - diff --git a/launcher/settingsView/csettingsview_moc.cpp b/launcher/settingsView/csettingsview_moc.cpp index 902992081..4e7b3098e 100644 --- a/launcher/settingsView/csettingsview_moc.cpp +++ b/launcher/settingsView/csettingsview_moc.cpp @@ -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 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); + +} diff --git a/launcher/settingsView/csettingsview_moc.h b/launcher/settingsView/csettingsview_moc.h index 987143924..84a044eb7 100644 --- a/launcher/settingsView/csettingsview_moc.h +++ b/launcher/settingsView/csettingsview_moc.h @@ -73,6 +73,8 @@ private slots: void on_comboBoxCursorType_currentIndexChanged(int index); + void on_listWidgetSettings_currentRowChanged(int currentRow); + private: Ui::CSettingsView * ui; diff --git a/launcher/settingsView/csettingsview_moc.ui b/launcher/settingsView/csettingsview_moc.ui index 73c7226f8..8182a6d22 100644 --- a/launcher/settingsView/csettingsview_moc.ui +++ b/launcher/settingsView/csettingsview_moc.ui @@ -6,14 +6,14 @@ 0 0 - 779 - 619 + 842 + 363 - + 0 @@ -26,642 +26,635 @@ 0 - - - - false + + + + + 1 + 0 + - 150 + 200 0 - - /home/user/.vcmi + + + 75 + true + - + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + false + + + QAbstractItemView::NoEditTriggers + + + QAbstractItemView::SelectRows + + + 4 + + + + General + + + + + Video + + + + + Artificial Intelligence + + + + + Data Directories + + + + + Mod Repositories + + + + + + + + + 100 + 0 + + + + Qt::ScrollBarAlwaysOn + + + Qt::ScrollBarAlwaysOff + + true - - - - - - - 75 - true - - - - Launcher Settings - - - - - - - - 150 - 0 - - - - /usr/share/vcmi - - - - - - - false - - - Change - - - - - - - 1 - - - - Off + + + + 0 + 0 + 620 + 762 + - - - - On - - - - - - - - Open - - - - - - - Heroes III character set - - - - - - - Fullscreen - - - - - - - 1 - - - - Off - - - - - On - - - - - - - - Log files directory - - - - - - - false - - - - 150 - 0 - - - - /home/user/.vcmi - - - true - - - - - - - Autosave - - - - - - - - 75 - true - - - - Repositories - - - - - - - Check for updates - - - - - - - - - - Check repositories on startup - - - - - - - Open - - - - - - - Player AI - - - - - - - Display index - - - - - - - - 75 - true - true - false - - - - AI in the battlefield - - - - - - - QPlainTextEdit::NoWrap - - - http://downloads.vcmi.eu/Mods/repository.json - - - - - - - - 75 - true - - - - General - - - - - - - Show intro - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 8 - - - - - - - - Build version - - - - - - - Extra data directory - - - - - - - Resolution - - - - - - - 0 - - - - Off - - - - - On - - - - - Real - - - - - - - - 1 - - - - Off - - - - - On - - - - - - - - - 75 - true - - - - AI on the map - - - - - - - VCAI - - - - VCAI - - - - - Nullkiller - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 8 - 20 - - - - - - - - - - - Open - - - - - - - - 75 - true - - - - Video - - - - - - - - 75 - true - - - - Data Directories - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 56 - 8 - - - - - - - - User data directory - - - - - - - Network port - - - - - - - 1024 - - - 65535 - - - 3030 - - - - - - - VCMI Language - - - - - - - - - - - - - - - Automatic detection - - - - - Central European (Windows 1250) - - - - - Cyrillic script (Windows 1251) - - - - - Western European (Windows 1252) - - - - - Simplified Chinese (GBK) - - - - - Simplified Chinese (GB2312) - - - - - Korean (Windows 949) - - - - - - - - - English - - - - - Deutsch (German) - - - - - Polska (Polish) - - - - - Русский (Russian) - - - - - Українська (Ukrainian) - - - - - - - - Neutral AI - - - - - - - BattleAI - - - - BattleAI - - - - - StupidAI - - - - - - - - - 0 - 22 - - - - Friendly AI - - - - - - - false - - - BattleAI - - - - BattleAI - - - - - StupidAI - - - - - - - - false - - - BattleAI - - - - BattleAI - - - - - StupidAI - - - - - - - - - 0 - 22 - - - - Enemy AI - - - - - - - Cursor - - - - - - - - Default - - - - - Hardware - - - - - Software - - + + + + + + 75 + true + + + + General + + + + + + + VCMI Language + + + + + + + Heroes III character set + + + + + + + + Automatic detection + + + + + Central European (Windows 1250) + + + + + Cyrillic script (Windows 1251) + + + + + Western European (Windows 1252) + + + + + Simplified Chinese (GBK) + + + + + Simplified Chinese (GB2312) + + + + + Korean (Windows 949) + + + + + + + + Network port + + + + + + + Autosave + + + + + + + Build version + + + + + + + + 75 + true + + + + Video + + + + + + + Resolution + + + + + + + Fullscreen + + + + + + + Show intro + + + + + + + Display index + + + + + + + Cursor + + + + + + + + 75 + true + + + + Artificial Intelligence + + + + + + + Adventure Map AI + + + + + + + Neutral AI + + + + + + + Friendly AI + + + + + + + Enemy AI + + + + + + + + 75 + true + + + + Data Directories + + + + + + + Extra data directory + + + + + + + /usr/share/vcmi + + + + + + + false + + + Change + + + + + + + Open + + + + + + + User data directory + + + + + + + Open + + + + + + + Log files directory + + + + + + + Open + + + + + + + + 75 + true + + + + Mod Repositories + + + + + + + Check on startup + + + + + + + 1 + + + + Off + + + + + On + + + + + + + + Update now + + + + + + + QPlainTextEdit::NoWrap + + + http://downloads.vcmi.eu/Mods/repository.json + + + + + + + + Default + + + + + Hardware + + + + + Software + + + + + + + + + English + + + + + Deutsch (German) + + + + + Polska (Polish) + + + + + Русский (Russian) + + + + + Українська (Ukrainian) + + + + + + + + 1024 + + + 65535 + + + 3030 + + + + + + + 1 + + + + Off + + + + + On + + + + + + + + + + + false + + + /home/user/.vcmi + + + true + + + + + + + false + + + /home/user/.vcmi + + + true + + + + + + + false + + + BattleAI + + + + BattleAI + + + + + StupidAI + + + + + + + + false + + + BattleAI + + + + BattleAI + + + + + StupidAI + + + + + + + + BattleAI + + + + BattleAI + + + + + StupidAI + + + + + + + + VCAI + + + + VCAI + + + + + Nullkiller + + + + + + + + + + + 1 + + + + Off + + + + + On + + + + + + + + 0 + + + + Off + + + + + On + + + + + Real + + + + + + + + + + + true + + + + +