diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-12-04 13:22:29 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-12-04 13:22:29 -0500 |
| commit | b209a8e47f866a129c53cef43539e96ab8722405 (patch) | |
| tree | 98f8eed294d4757ed5885ed20dc166421f3b3197 /src | |
| parent | 00adf2b551f9b4b19d588dbfa4c9223597f8b95b (diff) | |
| parent | dd6f0fed1085682f56d2815ff885a5ab58058a0b (diff) | |
Merge pull request #919 from isanae/explore-stylesheets
Explore stylesheets
Diffstat (limited to 'src')
| -rw-r--r-- | src/mainwindow.cpp | 17 | ||||
| -rw-r--r-- | src/mainwindow.h | 1 | ||||
| -rw-r--r-- | src/settingsdialog.ui | 31 | ||||
| -rw-r--r-- | src/settingsdialoggeneral.cpp | 42 | ||||
| -rw-r--r-- | src/settingsdialoggeneral.h | 7 |
5 files changed, 56 insertions, 42 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 3af0f30c..c365fb6b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -4302,6 +4302,11 @@ void MainWindow::openPluginsFolder() shell::Explore(pluginsPath); } +void MainWindow::openStylesheetsFolder() +{ + QString ssPath = QCoreApplication::applicationDirPath() + "/" + ToQString(AppConfig::stylesheetsPath()); + shell::Explore(ssPath); +} void MainWindow::openProfileFolder() { @@ -4519,33 +4524,25 @@ static void addMenuAsPushButton(QMenu *menu, QMenu *subMenu) QMenu *MainWindow::openFolderMenu() { - QMenu *FolderMenu = new QMenu(this); FolderMenu->addAction(tr("Open Game folder"), this, SLOT(openGameFolder())); - FolderMenu->addAction(tr("Open MyGames folder"), this, SLOT(openMyGamesFolder())); - FolderMenu->addAction(tr("Open INIs folder"), this, SLOT(openIniFolder())); FolderMenu->addSeparator(); FolderMenu->addAction(tr("Open Instance folder"), this, SLOT(openInstanceFolder())); - FolderMenu->addAction(tr("Open Mods folder"), this, SLOT(openModsFolder())); - FolderMenu->addAction(tr("Open Profile folder"), this, SLOT(openProfileFolder())); - FolderMenu->addAction(tr("Open Downloads folder"), this, SLOT(openDownloadsFolder())); + FolderMenu->addAction(tr("Open Logs folder"), this, SLOT(openLogsFolder())); FolderMenu->addSeparator(); FolderMenu->addAction(tr("Open MO2 Install folder"), this, SLOT(openInstallFolder())); - FolderMenu->addAction(tr("Open MO2 Plugins folder"), this, SLOT(openPluginsFolder())); - - FolderMenu->addAction(tr("Open MO2 Logs folder"), this, SLOT(openLogsFolder())); - + FolderMenu->addAction(tr("Open MO2 Stylesheets folder"), this, SLOT(openStylesheetsFolder())); return FolderMenu; } diff --git a/src/mainwindow.h b/src/mainwindow.h index 2894b2e7..f5bab586 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -545,6 +545,7 @@ private slots: void openLogsFolder(); void openInstallFolder(); void openPluginsFolder(); + void openStylesheetsFolder(); void openDownloadsFolder(); void openModsFolder(); void openProfileFolder(); diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index ad7e2ab3..bc59d635 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -45,7 +45,7 @@ <layout class="QVBoxLayout" name="verticalLayout_14"> <item> <widget class="QWidget" name="widget_6" native="true"> - <layout class="QFormLayout" name="formLayout_4"> + <layout class="QGridLayout" name="gridLayout_5" columnstretch="0,1,0"> <property name="leftMargin"> <number>0</number> </property> @@ -65,16 +65,6 @@ </property> </widget> </item> - <item row="0" column="1"> - <widget class="QComboBox" name="languageBox"> - <property name="toolTip"> - <string>The language of the user interface.</string> - </property> - <property name="whatsThis"> - <string>The language of the user interface.</string> - </property> - </widget> - </item> <item row="2" column="0"> <widget class="QLabel" name="label_10"> <property name="text"> @@ -92,7 +82,24 @@ </property> </widget> </item> - <item row="1" column="1"> + <item row="2" column="2"> + <widget class="QPushButton" name="exploreStyles"> + <property name="text"> + <string>Explore...</string> + </property> + </widget> + </item> + <item row="0" column="1" colspan="2"> + <widget class="QComboBox" name="languageBox"> + <property name="toolTip"> + <string>The language of the user interface.</string> + </property> + <property name="whatsThis"> + <string>The language of the user interface.</string> + </property> + </widget> + </item> + <item row="1" column="1" colspan="2"> <widget class="LinkLabel" name="label_33"> <property name="text"> <string><a href="https://www.transifex.com/tannin/mod-organizer/">Help translate Mod Organizer</a></string> diff --git a/src/settingsdialoggeneral.cpp b/src/settingsdialoggeneral.cpp index b0e64305..dca4410b 100644 --- a/src/settingsdialoggeneral.cpp +++ b/src/settingsdialoggeneral.cpp @@ -3,8 +3,11 @@ #include "appconfig.h" #include "categoriesdialog.h" #include "colortable.h" +#include <utility.h> #include <questionboxmemory.h> +using namespace MOBase; + GeneralSettingsTab::GeneralSettingsTab(Settings& s, SettingsDialog& d) : SettingsTab(s, d) { @@ -24,17 +27,16 @@ GeneralSettingsTab::GeneralSettingsTab(Settings& s, SettingsDialog& d) ui->usePrereleaseBox->setChecked(settings().usePrereleases()); ui->colorSeparatorsBox->setChecked(settings().colors().colorSeparatorScrollbar()); + QObject::connect(ui->exploreStyles, &QPushButton::clicked, [&]{ onExploreStyles(); }); + QObject::connect( - ui->categoriesBtn, &QPushButton::clicked, - [&]{ on_categoriesBtn_clicked(); }); + ui->categoriesBtn, &QPushButton::clicked, [&]{ onEditCategories(); }); QObject::connect( - ui->resetColorsBtn, &QPushButton::clicked, - [&]{ on_resetColorsBtn_clicked(); }); + ui->resetColorsBtn, &QPushButton::clicked, [&]{ onResetColors(); }); QObject::connect( - ui->resetDialogsButton, &QPushButton::clicked, - [&]{ on_resetDialogsButton_clicked(); }); + ui->resetDialogsButton, &QPushButton::clicked, [&]{ onResetDialogs(); }); } void GeneralSettingsTab::update() @@ -175,12 +177,27 @@ void GeneralSettingsTab::resetDialogs() settings().widgets().resetQuestionButtons(); } -void GeneralSettingsTab::on_resetColorsBtn_clicked() +void GeneralSettingsTab::onExploreStyles() +{ + QString ssPath = QCoreApplication::applicationDirPath() + "/" + ToQString(AppConfig::stylesheetsPath()); + shell::Explore(ssPath); +} + +void GeneralSettingsTab::onEditCategories() +{ + CategoriesDialog dialog(&dialog()); + + if (dialog.exec() == QDialog::Accepted) { + dialog.commitChanges(); + } +} + +void GeneralSettingsTab::onResetColors() { ui->colorTable->resetColors(); } -void GeneralSettingsTab::on_resetDialogsButton_clicked() +void GeneralSettingsTab::onResetDialogs() { const auto r = QMessageBox::question( parentWidget(), @@ -194,12 +211,3 @@ void GeneralSettingsTab::on_resetDialogsButton_clicked() resetDialogs(); } } - -void GeneralSettingsTab::on_categoriesBtn_clicked() -{ - CategoriesDialog dialog(&dialog()); - - if (dialog.exec() == QDialog::Accepted) { - dialog.commitChanges(); - } -} diff --git a/src/settingsdialoggeneral.h b/src/settingsdialoggeneral.h index 706ba9ef..455edcaf 100644 --- a/src/settingsdialoggeneral.h +++ b/src/settingsdialoggeneral.h @@ -20,9 +20,10 @@ private: void resetDialogs(); - void on_categoriesBtn_clicked(); - void on_resetColorsBtn_clicked(); - void on_resetDialogsButton_clicked(); + void onExploreStyles(); + void onEditCategories(); + void onResetColors(); + void onResetDialogs(); }; #endif // SETTINGSDIALOGGENERAL_H |
