From 73842ee245a09fe4ead0e1a2a5f778d89f0a8039 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Thu, 1 Nov 2018 16:20:53 +0100 Subject: Added ability to change color of conflict and plugin highlighting from the settings. --- src/settingsdialog.cpp | 104 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) (limited to 'src/settingsdialog.cpp') diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index 058d082a..7f484830 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -33,6 +33,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #define WIN32_LEAN_AND_MEAN #include @@ -177,6 +178,109 @@ void SettingsDialog::on_browseOverwriteDirBtn_clicked() } } +void SettingsDialog::on_containsBtn_clicked() +{ + QColor result = QColorDialog::getColor(m_ContainsColor, this); + if (result.isValid()) { + m_ContainsColor = result; + + QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); + ui->containsBtn->setStyleSheet(COLOR_STYLE.arg( + result.name()).arg(Settings::getIdealTextColor( + result).name())); + + /*ui->containsBtn->setAutoFillBackground(true); + ui->containsBtn->setPalette(QPalette(result)); + QPalette palette = ui->containsBtn->palette(); + palette.setColor(QPalette::Background, result); + ui->containsBtn->setPalette(palette);*/ + } +} + +void SettingsDialog::on_containedBtn_clicked() +{ + QColor result = QColorDialog::getColor(m_ContainedColor, this); + if (result.isValid()) { + m_ContainedColor = result; + + QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); + ui->containedBtn->setStyleSheet(COLOR_STYLE.arg( + result.name()).arg(Settings::getIdealTextColor( + result).name())); + + /*ui->containedBtn->setAutoFillBackground(true); + ui->containedBtn->setPalette(QPalette(result)); + QPalette palette = ui->containedBtn->palette(); + palette.setColor(QPalette::Background, result); + ui->containedBtn->setPalette(palette);*/ + } +} + +void SettingsDialog::on_overwrittenBtn_clicked() +{ + QColor result = QColorDialog::getColor(m_OverwrittenColor, this); + if (result.isValid()) { + m_OverwrittenColor = result; + + QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); + ui->overwrittenBtn->setStyleSheet(COLOR_STYLE.arg( + result.name()).arg(Settings::getIdealTextColor( + result).name())); + + /*ui->overwrittenBtn->setAutoFillBackground(true); + ui->overwrittenBtn->setPalette(QPalette(result)); + QPalette palette = ui->overwrittenBtn->palette(); + palette.setColor(QPalette::Background, result); + ui->overwrittenBtn->setPalette(palette);*/ + } +} + +void SettingsDialog::on_overwritingBtn_clicked() +{ + QColor result = QColorDialog::getColor(m_OverwritingColor, this); + if (result.isValid()) { + m_OverwritingColor = result; + + QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); + ui->overwritingBtn->setStyleSheet(COLOR_STYLE.arg( + result.name()).arg(Settings::getIdealTextColor( + result).name())); + + /*ui->overwritingBtn->setAutoFillBackground(true); + ui->overwritingBtn->setPalette(QPalette(result)); + QPalette palette = ui->overwritingBtn->palette(); + palette.setColor(QPalette::Background, result); + ui->overwritingBtn->setPalette(palette);*/ + } +} + +void SettingsDialog::on_resetColorsBtn_clicked() +{ + m_OverwritingColor = QColor(255, 0, 0, 64); + m_OverwrittenColor = QColor(0, 255, 0, 64); + m_ContainsColor = QColor(0, 0, 255, 64); + m_ContainedColor = QColor(0, 0, 255, 64); + + QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); + + ui->overwritingBtn->setStyleSheet(COLOR_STYLE.arg( + QColor(255, 0, 0, 64).name()).arg(Settings::getIdealTextColor( + QColor(255, 0, 0, 64)).name())); + + ui->overwrittenBtn->setStyleSheet(COLOR_STYLE.arg( + QColor(0, 255, 0, 64).name()).arg(Settings::getIdealTextColor( + QColor(0, 255, 0, 64)).name())); + + ui->containsBtn->setStyleSheet(COLOR_STYLE.arg( + QColor(0, 0, 255, 64).name()).arg(Settings::getIdealTextColor( + QColor(0, 0, 255, 64)).name())); + + ui->containedBtn->setStyleSheet(COLOR_STYLE.arg( + QColor(0, 0, 255, 64).name()).arg(Settings::getIdealTextColor( + QColor(0, 0, 255, 64)).name())); + +} + void SettingsDialog::on_resetDialogsButton_clicked() { if (QMessageBox::question(this, tr("Confirm?"), -- cgit v1.3.1 From 545b7b4eb7f629ccbbe03d7c20c305f1225b5416 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Fri, 9 Nov 2018 17:42:15 -0600 Subject: Fix button colors in the settings dialog with the default theme --- src/settings.cpp | 15 ++++++--------- src/settingsdialog.cpp | 32 ++++++++++++++++++-------------- src/settingsdialog.h | 6 ++++++ 3 files changed, 30 insertions(+), 23 deletions(-) (limited to 'src/settingsdialog.cpp') diff --git a/src/settings.cpp b/src/settings.cpp index 7d9fb7c0..0f8eaa2a 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -741,24 +741,21 @@ Settings::GeneralTab::GeneralTab(Settings *m_parent, SettingsDialog &m_dialog) m_containsBtn->setPalette(palette3); m_containedBtn->setPalette(palette4); */ - - //version with stylesheet - QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); - - m_overwritingBtn->setStyleSheet(COLOR_STYLE.arg( + //version with stylesheet + m_overwritingBtn->setStyleSheet(m_dialog.getColoredButtonStyleSheet().arg( m_parent->modlistOverwritingLooseColor().name()).arg(getIdealTextColor( m_parent->modlistOverwritingLooseColor()).name())); - m_overwrittenBtn->setStyleSheet(COLOR_STYLE.arg( + m_overwrittenBtn->setStyleSheet(m_dialog.getColoredButtonStyleSheet().arg( m_parent->modlistOverwrittenLooseColor().name()).arg(getIdealTextColor( m_parent->modlistOverwrittenLooseColor()).name())); - m_containsBtn->setStyleSheet(COLOR_STYLE.arg( + m_containsBtn->setStyleSheet(m_dialog.getColoredButtonStyleSheet().arg( m_parent->modlistContainsPluginColor().name()).arg(getIdealTextColor( m_parent->modlistContainsPluginColor()).name())); - m_containedBtn->setStyleSheet(COLOR_STYLE.arg( + m_containedBtn->setStyleSheet(m_dialog.getColoredButtonStyleSheet().arg( m_parent->pluginListContainedColor().name()).arg(getIdealTextColor( m_parent->pluginListContainedColor()).name())); - + m_dialog.setOverwritingColor(m_parent->modlistOverwritingLooseColor()); m_dialog.setOverwrittenColor(m_parent->modlistOverwrittenLooseColor()); m_dialog.setContainsColor(m_parent->modlistContainsPluginColor()); diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index 7f484830..8a983896 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -59,6 +59,16 @@ SettingsDialog::~SettingsDialog() delete ui; } +QString SettingsDialog::getColoredButtonStyleSheet() const +{ + return QString("QPushButton {" + "background-color: %1;" + "color: %2;" + "border: 1px solid;" + "padding: 3px;" + "}"); +} + void SettingsDialog::accept() { QString newModPath = ui->modDirEdit->text(); @@ -184,8 +194,7 @@ void SettingsDialog::on_containsBtn_clicked() if (result.isValid()) { m_ContainsColor = result; - QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); - ui->containsBtn->setStyleSheet(COLOR_STYLE.arg( + ui->containsBtn->setStyleSheet(getColoredButtonStyleSheet().arg( result.name()).arg(Settings::getIdealTextColor( result).name())); @@ -203,8 +212,7 @@ void SettingsDialog::on_containedBtn_clicked() if (result.isValid()) { m_ContainedColor = result; - QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); - ui->containedBtn->setStyleSheet(COLOR_STYLE.arg( + ui->containedBtn->setStyleSheet(getColoredButtonStyleSheet().arg( result.name()).arg(Settings::getIdealTextColor( result).name())); @@ -222,8 +230,7 @@ void SettingsDialog::on_overwrittenBtn_clicked() if (result.isValid()) { m_OverwrittenColor = result; - QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); - ui->overwrittenBtn->setStyleSheet(COLOR_STYLE.arg( + ui->overwrittenBtn->setStyleSheet(getColoredButtonStyleSheet().arg( result.name()).arg(Settings::getIdealTextColor( result).name())); @@ -241,8 +248,7 @@ void SettingsDialog::on_overwritingBtn_clicked() if (result.isValid()) { m_OverwritingColor = result; - QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); - ui->overwritingBtn->setStyleSheet(COLOR_STYLE.arg( + ui->overwritingBtn->setStyleSheet(getColoredButtonStyleSheet().arg( result.name()).arg(Settings::getIdealTextColor( result).name())); @@ -261,21 +267,19 @@ void SettingsDialog::on_resetColorsBtn_clicked() m_ContainsColor = QColor(0, 0, 255, 64); m_ContainedColor = QColor(0, 0, 255, 64); - QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); - - ui->overwritingBtn->setStyleSheet(COLOR_STYLE.arg( + ui->overwritingBtn->setStyleSheet(getColoredButtonStyleSheet().arg( QColor(255, 0, 0, 64).name()).arg(Settings::getIdealTextColor( QColor(255, 0, 0, 64)).name())); - ui->overwrittenBtn->setStyleSheet(COLOR_STYLE.arg( + ui->overwrittenBtn->setStyleSheet(getColoredButtonStyleSheet().arg( QColor(0, 255, 0, 64).name()).arg(Settings::getIdealTextColor( QColor(0, 255, 0, 64)).name())); - ui->containsBtn->setStyleSheet(COLOR_STYLE.arg( + ui->containsBtn->setStyleSheet(getColoredButtonStyleSheet().arg( QColor(0, 0, 255, 64).name()).arg(Settings::getIdealTextColor( QColor(0, 0, 255, 64)).name())); - ui->containedBtn->setStyleSheet(COLOR_STYLE.arg( + ui->containedBtn->setStyleSheet(getColoredButtonStyleSheet().arg( QColor(0, 0, 255, 64).name()).arg(Settings::getIdealTextColor( QColor(0, 0, 255, 64)).name())); diff --git a/src/settingsdialog.h b/src/settingsdialog.h index c678ec78..7df52ccd 100644 --- a/src/settingsdialog.h +++ b/src/settingsdialog.h @@ -44,6 +44,12 @@ public: explicit SettingsDialog(PluginContainer *pluginContainer, QWidget *parent = 0); ~SettingsDialog(); + /** + * @brief get stylesheet of settings buttons with colored background + * @return string of stylesheet + */ + QString getColoredButtonStyleSheet() const; + public slots: virtual void accept(); -- cgit v1.3.1 From aaa1523db9c7e93ca9b258a74f36c17e29e5fc5a Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Sat, 10 Nov 2018 16:24:45 -0600 Subject: Normalize path settings to prevent extra characters --- src/settingsdialog.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ src/settingsdialog.h | 11 +++++++++++ 2 files changed, 52 insertions(+) (limited to 'src/settingsdialog.cpp') diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index 8a983896..91ce0e25 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -358,3 +358,44 @@ void SettingsDialog::on_clearCacheButton_clicked() NexusInterface::instance(m_PluginContainer)->clearCache(); } +void SettingsDialog::normalizePath(QLineEdit *lineEdit) +{ + QString text = lineEdit->text(); + QString new_text = text; + if (text.contains("%BASE_DIR%")) { + QString baseDir = ui->baseDirEdit->text(); + new_text = new_text.replace("%BASE_DIR%", baseDir); + new_text = QDir(new_text).absolutePath(); + new_text = new_text.replace(baseDir, "%BASE_DIR%"); + } else { + new_text = QDir(new_text).absolutePath(); + } + if (new_text.compare(text, Qt::CaseInsensitive)) { + lineEdit->setText(new_text); + } +} + +void SettingsDialog::on_downloadDirEdit_editingFinished() +{ + normalizePath(ui->downloadDirEdit); +} + +void SettingsDialog::on_modDirEdit_editingFinished() +{ + normalizePath(ui->modDirEdit); +} + +void SettingsDialog::on_cacheDirEdit_editingFinished() +{ + normalizePath(ui->cacheDirEdit); +} + +void SettingsDialog::on_profilesDirEdit_editingFinished() +{ + normalizePath(ui->profilesDirEdit); +} + +void SettingsDialog::on_overwriteDirEdit_editingFinished() +{ + normalizePath(ui->overwriteDirEdit); +} diff --git a/src/settingsdialog.h b/src/settingsdialog.h index 7df52ccd..3609c940 100644 --- a/src/settingsdialog.h +++ b/src/settingsdialog.h @@ -61,6 +61,7 @@ signals: private: void storeSettings(QListWidgetItem *pluginItem); + void normalizePath(QLineEdit *lineEdit); public: @@ -113,6 +114,16 @@ private slots: void on_resetColorsBtn_clicked(); + void on_downloadDirEdit_editingFinished(); + + void on_modDirEdit_editingFinished(); + + void on_cacheDirEdit_editingFinished(); + + void on_profilesDirEdit_editingFinished(); + + void on_overwriteDirEdit_editingFinished(); + private: Ui::SettingsDialog *ui; PluginContainer *m_PluginContainer; -- cgit v1.3.1 From ad01e1d6085a97681537fe3328955dd1660dae36 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Sat, 10 Nov 2018 22:04:12 -0600 Subject: Less strict implementation of path normalization --- src/settingsdialog.cpp | 19 ++++++++----------- src/settingsdialog.h | 2 ++ 2 files changed, 10 insertions(+), 11 deletions(-) (limited to 'src/settingsdialog.cpp') diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index 91ce0e25..31c1d0fe 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -361,18 +361,15 @@ void SettingsDialog::on_clearCacheButton_clicked() void SettingsDialog::normalizePath(QLineEdit *lineEdit) { QString text = lineEdit->text(); - QString new_text = text; - if (text.contains("%BASE_DIR%")) { - QString baseDir = ui->baseDirEdit->text(); - new_text = new_text.replace("%BASE_DIR%", baseDir); - new_text = QDir(new_text).absolutePath(); - new_text = new_text.replace(baseDir, "%BASE_DIR%"); - } else { - new_text = QDir(new_text).absolutePath(); - } - if (new_text.compare(text, Qt::CaseInsensitive)) { - lineEdit->setText(new_text); + while (text.endsWith('/') || text.endsWith('\\')) { + text.chop(1); } + lineEdit->setText(text); +} + +void SettingsDialog::on_baseDirEdit_editingFinished() +{ + normalizePath(ui->baseDirEdit); } void SettingsDialog::on_downloadDirEdit_editingFinished() diff --git a/src/settingsdialog.h b/src/settingsdialog.h index 3609c940..386cd24e 100644 --- a/src/settingsdialog.h +++ b/src/settingsdialog.h @@ -114,6 +114,8 @@ private slots: void on_resetColorsBtn_clicked(); + void on_baseDirEdit_editingFinished(); + void on_downloadDirEdit_editingFinished(); void on_modDirEdit_editingFinished(); -- cgit v1.3.1 From 4eaa0d16bb02bb08d0bde75a3b767e8f10b4559c Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Mon, 26 Nov 2018 06:44:09 -0600 Subject: Resize plugin settings to make keys visible --- src/settingsdialog.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/settingsdialog.cpp') diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index 31c1d0fe..de18a850 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -48,6 +48,7 @@ SettingsDialog::SettingsDialog(PluginContainer *pluginContainer, QWidget *parent , m_PluginContainer(pluginContainer) { ui->setupUi(this); + ui->pluginSettingsList->setStyleSheet("QTreeWidget::item {padding-right: 10px;}"); QShortcut *delShortcut = new QShortcut(QKeySequence(Qt::Key_Delete), ui->pluginBlacklist); @@ -340,6 +341,9 @@ void SettingsDialog::on_pluginsList_currentItemChanged(QListWidgetItem *current, newItem->setFlags(newItem->flags() | Qt::ItemIsEditable); ui->pluginSettingsList->addTopLevelItem(newItem); } + + ui->pluginSettingsList->resizeColumnToContents(0); + ui->pluginSettingsList->resizeColumnToContents(1); } void SettingsDialog::deleteBlacklistItem() -- cgit v1.3.1 From 2212ad6f1c0bbaff7025cdb7227023661e399596 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Thu, 29 Nov 2018 08:17:28 -0600 Subject: Add executable blacklisting --- src/mainwindow.cpp | 14 +-- src/organizer_en.ts | 263 +++++++++++++++++++++++++++++-------------------- src/organizercore.cpp | 20 +++- src/organizercore.h | 2 +- src/settings.cpp | 18 ++++ src/settings.h | 7 +- src/settingsdialog.cpp | 27 +++++ src/settingsdialog.h | 13 ++- src/settingsdialog.ui | 22 ++++- src/usvfsconnector.cpp | 13 ++- src/usvfsconnector.h | 2 +- 11 files changed, 272 insertions(+), 129 deletions(-) (limited to 'src/settingsdialog.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d0591d6e..9a0e02aa 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2877,7 +2877,7 @@ void MainWindow::createSeparator_clicked() } int newPriority = -1; - if (m_ContextRow >= 0 && m_ModListSortProxy->sortColumn() == ModList::COL_PRIORITY) + if (m_ContextRow >= 0 && m_ModListSortProxy->sortColumn() == ModList::COL_PRIORITY) { newPriority = m_OrganizerCore.currentProfile()->getModPriority(m_ContextRow); } @@ -2885,7 +2885,7 @@ void MainWindow::createSeparator_clicked() if (m_OrganizerCore.createMod(name) == nullptr) { return; } m_OrganizerCore.refreshModList(); - if (newPriority >= 0) + if (newPriority >= 0) { m_OrganizerCore.modList()->changeModPriority(ModInfo::getIndex(name), newPriority); } @@ -4129,7 +4129,7 @@ void MainWindow::on_actionSettings_triggered() updateDownloadListDelegate(); - m_OrganizerCore.updateVFSParams(settings.logLevel(), settings.crashDumpsType()); + m_OrganizerCore.updateVFSParams(settings.logLevel(), settings.crashDumpsType(), settings.executablesBlacklist()); m_OrganizerCore.cycleDiagnostics(); } @@ -4405,8 +4405,8 @@ void MainWindow::sendSelectedPluginsToBottom_clicked() void MainWindow::sendSelectedPluginsToPriority_clicked() { bool ok; - int newPriority = QInputDialog::getInt(this, - tr("Set Priority"), tr("Set the priority of the selected plugins"), + int newPriority = QInputDialog::getInt(this, + tr("Set Priority"), tr("Set the priority of the selected plugins"), 0, 0, INT_MAX, 1, &ok); if (!ok) return; @@ -5678,8 +5678,8 @@ void MainWindow::sendSelectedModsToBottom_clicked() void MainWindow::sendSelectedModsToPriority_clicked() { bool ok; - int newPriority = QInputDialog::getInt(this, - tr("Set Priority"), tr("Set the priority of the selected mods"), + int newPriority = QInputDialog::getInt(this, + tr("Set Priority"), tr("Set the priority of the selected mods"), 0, 0, INT_MAX, 1, &ok); if (!ok) return; diff --git a/src/organizer_en.ts b/src/organizer_en.ts index 9b1294ac..518e49bc 100644 --- a/src/organizer_en.ts +++ b/src/organizer_en.ts @@ -4041,113 +4041,113 @@ p, li { white-space: pre-wrap; } - + drag&drop failed: %1 - + Confirm - + Are you sure you want to remove "%1"? - + Flags - + Content - + Mod Name - + Version - + Priority - + Category - + Source Game - + Nexus ID - + Installation - - + + unknown - + Name of your mods - + Version of the mod (if available) - + Installation priority of your mod. The higher, the more "important" it is and thus overwrites files from mods with lower priority. - + Category of the mod. - + The source game which was the origin of this mod. - + Id of the mod as used on Nexus. - + Emblemes to highlight things that might require attention. - + Depicts the content of the mod:<br><table cellspacing=7><tr><td><img src=":/MO/gui/content/plugin" width=32/></td><td>Game plugins (esp/esm/esl)</td></tr><tr><td><img src=":/MO/gui/content/interface" width=32/></td><td>Interface</td></tr><tr><td><img src=":/MO/gui/content/mesh" width=32/></td><td>Meshes</td></tr><tr><td><img src=":/MO/gui/content/bsa" width=32/></td><td>BSA</td></tr><tr><td><img src=":/MO/gui/content/texture" width=32/></td><td>Textures</td></tr><tr><td><img src=":/MO/gui/content/sound" width=32/></td><td>Sounds</td></tr><tr><td><img src=":/MO/gui/content/music" width=32/></td><td>Music</td></tr><tr><td><img src=":/MO/gui/content/string" width=32/></td><td>Strings</td></tr><tr><td><img src=":/MO/gui/content/script" width=32/></td><td>Scripts (Papyrus)</td></tr><tr><td><img src=":/MO/gui/content/skse" width=32/></td><td>Script Extender plugins</td></tr><tr><td><img src=":/MO/gui/content/skyproc" width=32/></td><td>SkyProc Patcher</td></tr><tr><td><img src=":/MO/gui/content/menu" width=32/></td><td>Mod Configuration Menu</td></tr><tr><td><img src=":/MO/gui/content/inifile" width=32/></td><td>INI files</td></tr><tr><td><img src=":/MO/gui/content/modgroup" width=32/></td><td>ModGroup files</td></tr></table> - + Time this mod was installed @@ -4353,91 +4353,103 @@ Continue launching %1? - + + Blacklisted Executable + + + + + The executable you are attempted to launch is blacklisted in the virtual file system. This will likely prevent the executable, and any executables that are launched by this one, from seeing any mods. This could extend to INI files, save games and any other virtualized files. + +Continue launching %1? + + + + No profile set - + Failed to refresh list of esps: %1 - + Multiple esps/esls activated, please check that they don't conflict. - + Download? - + A download has been started but no installed page plugin recognizes it. If you download anyway no information (i.e. version) will be associated with the download. Continue? - + failed to update mod list: %1 - - + + login successful - + Login failed - + Login failed, try again? - + login failed: %1. Download will not be associated with an account - + login failed: %1 - + login failed: %1. You need to log-in with Nexus to update MO. - + MO1 "Script Extender" load mechanism has left hook.dll in your game folder - - + + Description missing - + <a href="%1">hook.dll</a> has been found in your game folder (right click to copy the full path). This is most likely a leftover of setting the ModOrganizer 1 load mechanism to "Script Extender", in which case you must remove this file either by changing the load mechanism in ModOrganizer 1 or manually removing the file, otherwise the game is likely to crash and burn. - + failed to save load order: %1 - + The designated write target "%1" is not enabled. @@ -5398,7 +5410,7 @@ If the folder was still in use, restart MO and try again. - + Mod Organizer @@ -5475,12 +5487,12 @@ If the folder was still in use, restart MO and try again. - + Script Extender - + Proxy DLL @@ -5694,18 +5706,18 @@ Select Show Details option to see the full change-log. - - + + attempt to store setting for unknown plugin "%1" - + Error - + Failed to create "%1", you may not have the necessary permission. path remains unchanged. @@ -6042,52 +6054,52 @@ p, li { white-space: pre-wrap; } - + Author: - + Version: - + Description: - + Key - + Value - + Blacklisted Plugins (use <del> to remove): - + Workarounds - + Steam App ID - + The Steam AppID for your game - + <!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; } @@ -6103,17 +6115,17 @@ p, li { white-space: pre-wrap; } - + Load Mechanism - + Select loading mechanism. See help for details. - + Mod Organizer needs a dll to be injected into the game so all mods are visible to it. There are several means to do this: *Mod Organizer* (default) In this mode the Mod Organizer itself injects the dll. The disadvantage is that you always have to start the game through MO or a link created by it. @@ -6124,17 +6136,17 @@ If you use the Steam version of Oblivion the default will NOT work. In this case - + NMM Version - + The Version of Nexus Mod Manager to impersonate. - + Mod Organizer uses an API provided by the Nexus to provide features like checking for updates and downloading files. Unfortunately this API has not been made available officially to third party tools like MO so we have to impersonate the Nexus Mod Manager to be allowed in. On top of this Nexus has used the client identification to lock out outdated versions of NMM to force users to update. This means that MO also needs to impersonate the new version of NMM even if MO doesn't need an update. Therefore you can configure the version to identify as here. Please note that MO does identify itself as MO to the webserver, it's not lying about what it is. It is merely adding a "compatible" NMM version to the user agent. @@ -6143,44 +6155,44 @@ tl;dr-version: If Nexus-features don't work, insert the current version num - + Enforces that inactive ESPs and ESMs are never loaded. - + It seems that the Games occasionally load ESP or ESM files even if they haven't been activated as plugins. I don't yet know what the circumstances are, but user reports imply it is in some cases unwanted. If this is checked, ESPs and ESMs not checked in the List are invisible to the game and can not be loaded. - + Hide inactive ESPs/ESMs - + If checked, files (i.e. esps, esms and bsas) belonging to the core game can not be disabled in the UI. (default: on) - + If checked, files (i.e. esps, esms and bsas) belonging to the core game can not be disabled in the UI. (default: on) Uncheck this if you want to use Mod Organizer with total conversions (like Nehrim) but be aware that the game will crash if required files are not enabled. - + Force-enable game files - + Disable this to no longer display mods installed outside MO in the mod list (left pane). Assets from those mods will then be treated as having lowest mod priority together with the original game content. - + By default Mod Organizer will display esp+bsa bundles installed with foreign tools as mods (left pane). This allows you to control their priority in relation to other mods. This is particularly useful if you also use Steam Workshop to install mods. However, if you installed loose file mods outside MO which conflict with BSAs also installed outside MO those conflicts can't be resolved correctly. @@ -6188,44 +6200,63 @@ If you disable this feature, MO will only display official DLCs this way. Please - + Display mods installed outside MO - - + + For Skyrim, this can be used instead of Archive Invalidation. It should make AI redundant for all Profiles. For the other games this is not a sufficient replacement for AI! - + Back-date BSAs + + + Add executables to the blacklist to prevent them from +accessing the virtual file system. This is useful to prevent +unintended programs from being hooked. Hooking unintended +programs may affect the execution of these programs or the +programs you are intentionally running. + + + + + Add executables to the blacklist to prevent them from accessing the virtual file system. This is useful to prevent unintended programs from being hooked. Hooking unintended programs may affect the execution of these programs or the programs you are intentionally running. + + + Configure Executables Blacklist + + + + These are workarounds for problems with Mod Organizer. Please make sure you read the help text before changing anything here. - + Diagnostics - + Log Level - + Decides the amount of data printed to "ModOrganizer.log" - + Decides the amount of data printed to "ModOrganizer.log". "Debug" produces very useful information for finding problems. There is usually no noteworthy performance impact but the file may become rather large. If this is a problem you may prefer the "Info" level for regluar use. On the "Error" level the log file usually remains empty. @@ -6233,37 +6264,37 @@ For the other games this is not a sufficient replacement for AI! - + Debug - + Info (recommended) - + Warning - + Error - + Crash Dumps - + Decides which type of crash dumps are collected when injected processes crash. - + Decides which type of crash dumps are collected when injected processes crash. "None" Disables the generation of crash dumps by MO. @@ -6274,37 +6305,37 @@ For the other games this is not a sufficient replacement for AI! - + None - + Mini (recommended) - + Data - + Full - + Max Dumps To Keep - + Maximum number of crash dumps to keep on disk. Use 0 for unlimited. - + Maximum number of crash dumps to keep on disk. Use 0 for unlimited. Set "Crash Dumps" above to None to disable crash dump collection. @@ -6312,12 +6343,12 @@ For the other games this is not a sufficient replacement for AI! - + Hint: right click link and copy link location - + Logs and crash dumps are stored under your current instance in the <a href="LOGS_FULL_PATH">LOGS_DIR</a> and <a href="DUMPS_FULL_PATH">DUMPS_DIR</a> folders. @@ -6327,52 +6358,68 @@ For the other games this is not a sufficient replacement for AI! - + Confirm - + Changing the mod directory affects all your profiles! Mods not present (or named differently) in the new location will be disabled in all profiles. There is no way to undo this unless you backed up your profiles manually. Proceed? - + + Executables Blacklist + + + + + Enter one executable per line to be blacklisted from the virtual file system. +Mods and other virtualized files will not be visible to these executables and +any executables launched by them. + +Example: + Chrome.exe + Firefox.exe + + + + Select base directory - + Select download directory - + Select mod directory - + Select cache directory - + Select profiles directory - + Select overwrite directory - + Confirm? - + This will make all dialogs show up again where you checked the "Remember selection"-box. Continue? @@ -6576,7 +6623,7 @@ On Windows XP: UsvfsConnector - + Preparing vfs diff --git a/src/organizercore.cpp b/src/organizercore.cpp index b66895db..9ac3cb63 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -762,9 +762,9 @@ void OrganizerCore::prepareVFS() m_USVFS.updateMapping(fileMapping(m_CurrentProfile->name(), QString())); } -void OrganizerCore::updateVFSParams(int logLevel, int crashDumpsType) { +void OrganizerCore::updateVFSParams(int logLevel, int crashDumpsType, QString executableBlacklist) { setGlobalCrashDumpsType(crashDumpsType); - m_USVFS.updateParams(logLevel, crashDumpsType); + m_USVFS.updateParams(logLevel, crashDumpsType, executableBlacklist); } bool OrganizerCore::cycleDiagnostics() { @@ -1339,10 +1339,24 @@ HANDLE OrganizerCore::spawnBinaryProcess(const QFileInfo &binary, } } + for (auto exec : settings().executablesBlacklist().split(";")) { + if (exec.compare(binary.fileName(), Qt::CaseInsensitive)) { + if (QuestionBoxMemory::query(window, QString("blacklistedExecutable"), binary.fileName(), + tr("Blacklisted Executable"), + tr("The executable you are attempted to launch is blacklisted in the virtual file" + " system. This will likely prevent the executable, and any executables that are" + " launched by this one, from seeing any mods. This could extend to INI files, save" + " games and any other virtualized files.\n\nContinue launching %1?").arg(binary.fileName()), + QDialogButtonBox::Yes | QDialogButtonBox::No) == QDialogButtonBox::No) { + return INVALID_HANDLE_VALUE; + } + } + } + QString modsPath = settings().getModDirectory(); // Check if this a request with either an executable or a working directory under our mods folder - // then will start the processs in a virtualized "environment" with the appropriate paths fixed: + // then will start the process in a virtualized "environment" with the appropriate paths fixed: // (i.e. mods\FNIS\path\exe => game\data\path\exe) QString cwdPath = currentDirectory.absolutePath(); bool virtualizedCwd = cwdPath.startsWith(modsPath, Qt::CaseInsensitive); diff --git a/src/organizercore.h b/src/organizercore.h index 28ecef48..086fa11d 100644 --- a/src/organizercore.h +++ b/src/organizercore.h @@ -167,7 +167,7 @@ public: void prepareVFS(); - void updateVFSParams(int logLevel, int crashDumpsType); + void updateVFSParams(int logLevel, int crashDumpsType, QString executableBlacklist); bool cycleDiagnostics(); diff --git a/src/settings.cpp b/src/settings.cpp index ce3a68ff..c311ef29 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -386,6 +386,20 @@ QColor Settings::pluginListContainedColor() const return m_Settings.value("Settings/containedColor", QColor(0, 0, 255, 64)).value(); } +QString Settings::executablesBlacklist() const +{ + return m_Settings.value("Settings/executable_blacklist", ( + QStringList() + << "Chrome.exe" + << "Firefox.exe" + << "TSVNCache.exe" + << "TGitCache.exe" + << "Steam.exe" + << "GameOverlayUI.exe" + ).join(";") + ).toString(); +} + void Settings::setNexusLogin(QString username, QString password) { m_Settings.setValue("Settings/nexus_login", true); @@ -1080,6 +1094,8 @@ Settings::WorkaroundsTab::WorkaroundsTab(Settings *m_parent, m_forceEnableBox->setChecked(m_parent->forceEnableCoreFiles()); m_displayForeignBox->setChecked(m_parent->displayForeign()); + m_dialog.setExecutableBlacklist(m_parent->executablesBlacklist()); + } void Settings::WorkaroundsTab::update() @@ -1094,4 +1110,6 @@ void Settings::WorkaroundsTab::update() m_Settings.setValue("Settings/hide_unchecked_plugins", m_hideUncheckedBox->isChecked()); m_Settings.setValue("Settings/force_enable_core_files", m_forceEnableBox->isChecked()); m_Settings.setValue("Settings/display_foreign", m_displayForeignBox->isChecked()); + + m_Settings.setValue("Settings/executable_blacklist", m_dialog.getExecutableBlacklist()); } diff --git a/src/settings.h b/src/settings.h index 8fe053e8..667b1b4c 100644 --- a/src/settings.h +++ b/src/settings.h @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with Mod Organizer. If not, see . */ -#ifndef WORKAROUNDS_H -#define WORKAROUNDS_H +#ifndef SETTINGS_H +#define SETTINGS_H #include "loadmechanism.h" @@ -227,6 +227,7 @@ public: QColor pluginListContainedColor() const; + QString executablesBlacklist() const; /** * @brief set the nexus login information @@ -525,4 +526,4 @@ private: }; -#endif // WORKAROUNDS_H +#endif // SETTINGS_H diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index de18a850..e1c4b10d 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -34,6 +34,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #define WIN32_LEAN_AND_MEAN #include @@ -115,6 +116,32 @@ void SettingsDialog::on_categoriesBtn_clicked() } } +void SettingsDialog::on_execBlacklistBtn_clicked() +{ + bool ok = false; + QString result = QInputDialog::getMultiLineText( + this, + tr("Executables Blacklist"), + tr("Enter one executable per line to be blacklisted from the virtual file system.\n" + "Mods and other virtualized files will not be visible to these executables and\n" + "any executables launched by them.\n\n" + "Example:\n" + " Chrome.exe\n" + " Firefox.exe"), + m_ExecutableBlacklist.split(";").join("\n"), + &ok + ); + if (ok) { + QStringList blacklist; + for (auto exec : result.split("\n")) { + if (exec.trimmed().endsWith(".exe", Qt::CaseInsensitive)) { + blacklist << exec.trimmed(); + } + } + m_ExecutableBlacklist = blacklist.join(";"); + } +} + void SettingsDialog::on_bsaDateBtn_clicked() { IPluginGame const *game diff --git a/src/settingsdialog.h b/src/settingsdialog.h index 386cd24e..911f910d 100644 --- a/src/settingsdialog.h +++ b/src/settingsdialog.h @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with Mod Organizer. If not, see . */ -#ifndef WORKAROUNDDIALOG_H -#define WORKAROUNDDIALOG_H +#ifndef SETTINGSDIALOG_H +#define SETTINGSDIALOG_H #include "tutorabledialog.h" #include @@ -69,17 +69,22 @@ public: QColor getOverwrittenColor() { return m_OverwrittenColor; } QColor getContainsColor() { return m_ContainsColor; } QColor getContainedColor() { return m_ContainedColor; } + QString getExecutableBlacklist() { return m_ExecutableBlacklist; } void setOverwritingColor(QColor col) { m_OverwritingColor = col; } void setOverwrittenColor(QColor col) { m_OverwrittenColor = col; } void setContainsColor(QColor col) { m_ContainsColor = col; } void setContainedColor(QColor col) { m_ContainedColor = col; } + void setExecutableBlacklist(QString blacklist) { m_ExecutableBlacklist = blacklist; } + private slots: void on_loginCheckBox_toggled(bool checked); void on_categoriesBtn_clicked(); + void on_execBlacklistBtn_clicked(); + void on_bsaDateBtn_clicked(); void on_browseDownloadDirBtn_clicked(); @@ -134,8 +139,10 @@ private: QColor m_OverwrittenColor; QColor m_ContainsColor; QColor m_ContainedColor; + + QString m_ExecutableBlacklist; }; -#endif // WORKAROUNDDIALOG_H +#endif // SETTINGSDIALOG_H diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index 555180b5..ae13b9f2 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -17,7 +17,7 @@ - 4 + 5 @@ -1037,6 +1037,26 @@ For the other games this is not a sufficient replacement for AI! + + + + Add executables to the blacklist to prevent them from +accessing the virtual file system. This is useful to prevent +unintended programs from being hooked. Hooking unintended +programs may affect the execution of these programs or the +programs you are intentionally running. + + + Add executables to the blacklist to prevent them from accessing the virtual file system. This is useful to prevent unintended programs from being hooked. Hooking unintended programs may affect the execution of these programs or the programs you are intentionally running. + + + Configure Executables Blacklist + + + false + + + diff --git a/src/usvfsconnector.cpp b/src/usvfsconnector.cpp index 4ffc81c0..9c81d0d9 100644 --- a/src/usvfsconnector.cpp +++ b/src/usvfsconnector.cpp @@ -132,7 +132,11 @@ UsvfsConnector::UsvfsConnector() CreateVFS(¶ms); - BlacklistExecutable(L"TSVNCache.exe"); + ClearExecutableBlacklist(); + for (auto exec : Settings::instance().executablesBlacklist().split(";")) { + std::wstring buf = exec.toStdWString(); + BlacklistExecutable(buf.data()); + } m_LogWorker.moveToThread(&m_WorkerThread); @@ -199,6 +203,11 @@ void UsvfsConnector::updateMapping(const MappingType &mapping) */ } -void UsvfsConnector::updateParams(int logLevel, int crashDumpsType) { +void UsvfsConnector::updateParams(int logLevel, int crashDumpsType, QString executableBlacklist) { USVFSUpdateParams(::logLevel(logLevel), ::crashDumpsType(crashDumpsType)); + ClearExecutableBlacklist(); + for (auto exec : executableBlacklist.split(";")) { + std::wstring buf = exec.toStdWString(); + BlacklistExecutable(buf.data()); + } } diff --git a/src/usvfsconnector.h b/src/usvfsconnector.h index 40f8857b..3aefb703 100644 --- a/src/usvfsconnector.h +++ b/src/usvfsconnector.h @@ -82,7 +82,7 @@ public: ~UsvfsConnector(); void updateMapping(const MappingType &mapping); - void updateParams(int logLevel, int crashDumpsType); + void updateParams(int logLevel, int crashDumpsType, QString executableBlacklist); private: -- cgit v1.3.1 From 4914fd172deffe15631ab37264a1ffda33637e99 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Sat, 8 Dec 2018 01:19:37 -0600 Subject: Add workarounds button to reset window geometries --- src/mainwindow.cpp | 34 ++-- src/organizer_en.ts | 527 +++++++++++++++++++++++++------------------------ src/settings.cpp | 11 ++ src/settingsdialog.cpp | 4 + src/settingsdialog.h | 1 + src/settingsdialog.ui | 16 ++ 6 files changed, 323 insertions(+), 270 deletions(-) (limited to 'src/settingsdialog.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index de015c54..84b77945 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1738,21 +1738,31 @@ void MainWindow::processUpdates() { void MainWindow::storeSettings(QSettings &settings) { settings.setValue("group_state", ui->groupCombo->currentIndex()); - - settings.setValue("window_geometry", saveGeometry()); - settings.setValue("window_split", ui->splitter->saveState()); - settings.setValue("log_split", ui->topLevelSplitter->saveState()); - - settings.setValue("browser_geometry", m_IntegratedBrowser.saveGeometry()); - - settings.setValue("filters_visible", ui->displayCategoriesBtn->isChecked()); - settings.setValue("selected_executable", ui->executablesListBox->currentIndex()); - for (const std::pair kv : m_PersistedGeometry) { - QString key = QString("geometry/") + kv.first; - settings.setValue(key, kv.second->saveState()); + if (settings.value("reset_geometry", false).toBool()) { + settings.remove("window_geometry"); + settings.remove("window_split"); + settings.remove("log_split"); + settings.remove("filters_visible"); + settings.remove("browser_geometry"); + settings.beginGroup("geometry"); + for (auto key : settings.childKeys()) { + settings.remove(key); + } + settings.endGroup(); + settings.remove("reset_geometry"); + } else { + settings.setValue("window_geometry", saveGeometry()); + settings.setValue("window_split", ui->splitter->saveState()); + settings.setValue("log_split", ui->topLevelSplitter->saveState()); + settings.setValue("browser_geometry", m_IntegratedBrowser.saveGeometry()); + settings.setValue("filters_visible", ui->displayCategoriesBtn->isChecked()); + for (const std::pair kv : m_PersistedGeometry) { + QString key = QString("geometry/") + kv.first; + settings.setValue(key, kv.second->saveState()); + } } } diff --git a/src/organizer_en.ts b/src/organizer_en.ts index 2ea1c09a..1b752ae5 100644 --- a/src/organizer_en.ts +++ b/src/organizer_en.ts @@ -1620,7 +1620,7 @@ p, li { white-space: pre-wrap; } - + Create Backup @@ -1784,8 +1784,8 @@ p, li { white-space: pre-wrap; } - - + + Refresh @@ -1969,7 +1969,7 @@ p, li { white-space: pre-wrap; } - + Update @@ -2010,7 +2010,7 @@ Right now this has very limited functionality - + Endorse Mod Organizer @@ -2145,678 +2145,678 @@ Right now this has very limited functionality - + Also in: <br> - + No conflict - + <Edit...> - + This bsa is enabled in the ini file so it may be required! - + Activating Network Proxy - + Notice: Your current MO version (%1) is lower than the previous version (%2).<br>The GUI may not downgrade gracefully, so you may experience oddities.<br>However, there should be no serious issues. - + Choose Mod - + Mod Archive - + Start Tutorial? - + You're about to start a tutorial. For technical reasons it's not possible to end the tutorial early. Continue? - + failed to spawn notepad.exe: %1 - + failed to change origin name: %1 - + failed to move "%1" from mod "%2" to "%3": %4 - + <Contains %1> - + <Checked> - + <Unchecked> - + <Update> - + <Mod Backup> - + <Managed by MO> - + <Managed outside MO> - + <No category> - + <Conflicted> - + <Not Endorsed> - + failed to rename mod: %1 - + Overwrite? - + This will replace the existing mod "%1". Continue? - + failed to remove mod "%1" - - - + + + failed to rename "%1" to "%2" - - - - + + + + Confirm - + Remove the following mods?<br><ul>%1</ul> - + failed to remove mod: %1 - - - + + + Failed - + Installation file no longer exists - + Mods installed with old versions of MO can't be reinstalled in this way. - + Failed to create backup. - + You need to be logged in with Nexus to resume a download - - + + You need to be logged in with Nexus to endorse - + Failed to display overwrite dialog: %1 - + Nexus ID for this Mod is unknown - + Web page for this mod is unknown - - - + + + Create Mod... - + This will create an empty mod. Please enter a name: - - + + A mod with this name already exists - + Create Separator... - + This will create a new separator. Please enter a name: - + A separator with this name already exists - + This will move all files from overwrite into a new, regular mod. Please enter a name: - - + + Are you sure? - + About to recursively delete: - + Not logged in, endorsement information will be wrong - + Continue? - + The versioning scheme decides which version is considered newer than another. This function will guess the versioning scheme under the assumption that the installed version is outdated. - - + + Sorry - + I don't know a versioning scheme where %1 is newer than %2. - + Really enable all visible mods? - + Really disable all visible mods? - + Export to csv - + CSV (Comma Separated Values) is a format that can be imported in programs like Excel to create a spreadsheet. You can also use online editors and converters instead. - + Select what mods you want export: - + All installed mods - + Only active (checked) mods from your current profile - + All currently visible mods in the mod list - + Choose what Columns to export: - + Mod_Priority - + Mod_Name - + Mod_Status - + Primary_Category - + Nexus_ID - + Mod_Nexus_URL - + Mod_Version - + Install_Date - + Download_File_Name - + export failed: %1 - + Open Game folder - + Open MyGames folder - + Open Instance folder - + Open Mods folder - + Open Profile folder - + Open Downloads folder - + Open MO2 Install folder - + Open MO2 Plugins folder - + Open MO2 Logs folder - + Install Mod... - + Create empty mod - + Create Separator - + Enable all visible - + Disable all visible - + Check all for update - + Export to csv... - - + + Send to - - + + Top - - + + Bottom - - + + Priority... - + Separator... - + All Mods - + Sync to Mods... - + Clear Overwrite... - - + + Open in Explorer - + Restore Backup - + Remove Backup... - - + + Change Categories - - + + Primary Category - + Rename Separator... - + Remove Separator... - + Select Color... - + Reset Color - + Change versioning scheme - + Un-ignore update - + Ignore update - - + + Enable selected - - + + Disable selected - + Rename Mod... - + Reinstall Mod - + Remove Mod... - + Un-Endorse - - + + Endorse - + Won't endorse - + Endorsement state unknown - + Ignore missing data - + Mark as converted/working - + Visit on Nexus - + Visit web page - + Information... - - + + Exception: - - + + Unknown exception - + <All> - + <Multiple> - + %1 more - + Are you sure you want to remove the following %n save(s)?<br><ul>%1</ul><br>Removed saves will be sent to the Recycle Bin. @@ -2824,12 +2824,12 @@ You can also use online editors and converters instead. - + Enable Mods... - + Delete %n save(s) @@ -2837,335 +2837,335 @@ You can also use online editors and converters instead. - + failed to remove %1 - + failed to create %1 - + Can't change download directory while downloads are in progress! - + failed to write to file %1 - + %1 written - + Select binary - + Binary - + Enter Name - + Please enter a name for the executable - + Not an executable - + This is not a recognized executable. - - + + Replace file? - + There already is a hidden version of this file. Replace it? - - + + File operation failed - - + + Failed to remove "%1". Maybe you lack the required file permissions? - + There already is a visible version of this file. Replace it? - - + + Set Priority - + Set the priority of the selected plugins - + file not found: %1 - + failed to generate preview for %1 - + Sorry, can't preview anything. This function currently does not support extracting from bsas. - + Update available - + Open/Execute - + Add as Executable - + Preview - + Un-Hide - + Hide - + Write To File... - + Do you want to endorse Mod Organizer on %1 now? - + Thank you! - + Thank you for your endorsement! - + Request to Nexus failed: %1 - - + + failed to read %1: %2 - - + + Error - + failed to extract %1 (errorcode %2) - + Extract BSA - + This archive contains invalid hashes. Some files may be broken. - + Extract... - + This will restart MO, continue? - + Edit Categories... - + Deselect filter - + Remove - + Enable all - + Disable all - + Unlock load order - + Lock load order - + depends on missing "%1" - + incompatible with "%1" - + Please wait while LOOT is running - + loot failed. Exit code was: %1 - + failed to start loot - + failed to run loot: %1 - + Errors occured - + Backup of load order created - + Choose backup to restore - + No Backups - + There are no backups to restore - - + + Restore failed - - + + Failed to restore the backup. Errorcode: %1 - + Backup of modlist created - + A file with the same name has already been downloaded. What would you like to do? - + Overwrite - + Rename new file - + Ignore file - + Set the priority of the selected mods @@ -5462,13 +5462,13 @@ If the folder was still in use, restart MO and try again. - - + + <Manage...> - + failed to parse profile %1: %2 @@ -6268,27 +6268,38 @@ programs you are intentionally running. - + + + Resets the window geometries for all windows. This can be useful if a window becomes too small or too large, if a column becomes too thin or too wide, and in similar situations. + + + + + Reset Window Geometries + + + + These are workarounds for problems with Mod Organizer. Please make sure you read the help text before changing anything here. - + Diagnostics - + Log Level - + Decides the amount of data printed to "ModOrganizer.log" - + Decides the amount of data printed to "ModOrganizer.log". "Debug" produces very useful information for finding problems. There is usually no noteworthy performance impact but the file may become rather large. If this is a problem you may prefer the "Info" level for regluar use. On the "Error" level the log file usually remains empty. @@ -6296,37 +6307,37 @@ programs you are intentionally running. - + Debug - + Info (recommended) - + Warning - + Error - + Crash Dumps - + Decides which type of crash dumps are collected when injected processes crash. - + Decides which type of crash dumps are collected when injected processes crash. "None" Disables the generation of crash dumps by MO. @@ -6337,37 +6348,37 @@ programs you are intentionally running. - + None - + Mini (recommended) - + Data - + Full - + Max Dumps To Keep - + Maximum number of crash dumps to keep on disk. Use 0 for unlimited. - + Maximum number of crash dumps to keep on disk. Use 0 for unlimited. Set "Crash Dumps" above to None to disable crash dump collection. @@ -6375,12 +6386,12 @@ programs you are intentionally running. - + Hint: right click link and copy link location - + Logs and crash dumps are stored under your current instance in the <a href="LOGS_FULL_PATH">LOGS_DIR</a> and <a href="DUMPS_FULL_PATH">DUMPS_DIR</a> folders. diff --git a/src/settings.cpp b/src/settings.cpp index c311ef29..3abb0988 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1112,4 +1112,15 @@ void Settings::WorkaroundsTab::update() m_Settings.setValue("Settings/display_foreign", m_displayForeignBox->isChecked()); m_Settings.setValue("Settings/executable_blacklist", m_dialog.getExecutableBlacklist()); + + if (m_dialog.getResetGeometries()) { + m_Settings.setValue("reset_geometry", true); + if (QMessageBox::question(nullptr, + tr("Restart Mod Organizer?"), + tr("In order to reset the window geometries, MO must be restarted.\n" + "Restart it now?"), + QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { + qApp->exit(INT_MAX); + } + } } diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index e1c4b10d..dec2532c 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -94,6 +94,10 @@ void SettingsDialog::accept() TutorableDialog::accept(); } +bool SettingsDialog::getResetGeometries() +{ + return ui->resetGeometryBtn->isChecked(); +} void SettingsDialog::on_loginCheckBox_toggled(bool checked) { diff --git a/src/settingsdialog.h b/src/settingsdialog.h index 911f910d..95ed288f 100644 --- a/src/settingsdialog.h +++ b/src/settingsdialog.h @@ -70,6 +70,7 @@ public: QColor getContainsColor() { return m_ContainsColor; } QColor getContainedColor() { return m_ContainedColor; } QString getExecutableBlacklist() { return m_ExecutableBlacklist; } + bool getResetGeometries(); void setOverwritingColor(QColor col) { m_OverwritingColor = col; } void setOverwrittenColor(QColor col) { m_OverwrittenColor = col; } diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index a6c6a03b..91bfca4e 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -1057,6 +1057,22 @@ programs you are intentionally running. + + + + Resets the window geometries for all windows. This can be useful if a window becomes too small or too large, if a column becomes too thin or too wide, and in similar situations. + + + Resets the window geometries for all windows. This can be useful if a window becomes too small or too large, if a column becomes too thin or too wide, and in similar situations. + + + Reset Window Geometries + + + true + + + -- cgit v1.3.1 From 1266e13921812ac647e1b788fab5eb04e8267ec9 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Tue, 11 Dec 2018 01:52:53 -0600 Subject: Add the ability to change the managed game directory --- src/mainwindow.cpp | 13 +++++++++++-- src/settings.cpp | 11 +++++++++++ src/settings.h | 5 +++++ src/settingsdialog.cpp | 10 ++++++++++ src/settingsdialog.h | 2 ++ src/settingsdialog.ui | 7 +++++++ 6 files changed, 46 insertions(+), 2 deletions(-) (limited to 'src/settingsdialog.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2551aa2a..834a1fce 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -4178,11 +4178,22 @@ void MainWindow::on_actionSettings_triggered() QString oldModDirectory(settings.getModDirectory()); QString oldCacheDirectory(settings.getCacheDirectory()); QString oldProfilesDirectory(settings.getProfileDirectory()); + QString oldManagedGameDirectory(settings.getManagedGameDirectory()); bool oldDisplayForeign(settings.displayForeign()); bool proxy = settings.useProxy(); + DownloadManager *dlManager = m_OrganizerCore.downloadManager(); settings.query(&m_PluginContainer, this); + if (oldManagedGameDirectory != settings.getManagedGameDirectory()) { + QMessageBox::about(this, tr("Restarting MO"), + tr("Changing the managed game directory requires restarting MO.\n" + "Any pending downloads will be paused.\n\n" + "Click OK to restart MO now.")); + dlManager->pauseAll(); + qApp->exit(INT_MAX); + } + InstallationManager *instManager = m_OrganizerCore.installationManager(); instManager->setModsDirectory(settings.getModDirectory()); instManager->setDownloadDirectory(settings.getDownloadDirectory()); @@ -4194,8 +4205,6 @@ void MainWindow::on_actionSettings_triggered() refreshProfiles(); } - DownloadManager *dlManager = m_OrganizerCore.downloadManager(); - if (dlManager->getOutputDirectory() != settings.getDownloadDirectory()) { if (dlManager->downloadsInProgress()) { MessageDialog::showMessage(tr("Can't change download directory while " diff --git a/src/settings.cpp b/src/settings.cpp index b067106f..5db656d8 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -298,6 +298,11 @@ QString Settings::getModDirectory(bool resolve) const return getConfigurablePath("mod_directory", ToQString(AppConfig::modsPath()), resolve); } +QString Settings::getManagedGameDirectory() const +{ + return m_Settings.value("gamePath", "").toString(); +} + QString Settings::getProfileDirectory(bool resolve) const { return getConfigurablePath("profiles_directory", ToQString(AppConfig::profilesPath()), resolve); @@ -882,6 +887,12 @@ void Settings::PathsTab::update() } else { m_Settings.remove("Settings/base_directory"); } + + QFileInfo oldGameExe(m_parent->m_GamePlugin->gameDirectory().absoluteFilePath(m_parent->m_GamePlugin->binaryName())); + QFileInfo newGameExe(m_managedGameDirEdit->text()); + if (oldGameExe != newGameExe) { + m_Settings.setValue("gamePath", newGameExe.absolutePath()); + } } Settings::DiagnosticsTab::DiagnosticsTab(Settings *m_parent, SettingsDialog &m_dialog) diff --git a/src/settings.h b/src/settings.h index 2b8186f3..4009d4a3 100644 --- a/src/settings.h +++ b/src/settings.h @@ -160,6 +160,11 @@ public: **/ QString getCacheDirectory(bool resolve = true) const; + /** + * retrieve the directory where the managed game is stored (with native separators) + **/ + QString getManagedGameDirectory() const; + /** * retrieve the directory where profiles stored (with native separators) **/ diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index dec2532c..0d96e63a 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -220,6 +220,16 @@ void SettingsDialog::on_browseOverwriteDirBtn_clicked() } } +void SettingsDialog::on_browseGameDirBtn_clicked() +{ + QFileInfo oldGameExe(ui->managedGameDirEdit->text()); + + QString temp = QFileDialog::getOpenFileName(this, tr("Select game executable"), oldGameExe.absolutePath(), oldGameExe.fileName()); + if (!temp.isEmpty()) { + ui->managedGameDirEdit->setText(temp); + } +} + void SettingsDialog::on_containsBtn_clicked() { QColor result = QColorDialog::getColor(m_ContainsColor, this); diff --git a/src/settingsdialog.h b/src/settingsdialog.h index 95ed288f..f0567d87 100644 --- a/src/settingsdialog.h +++ b/src/settingsdialog.h @@ -110,6 +110,8 @@ private slots: void on_browseProfilesDirBtn_clicked(); + void on_browseGameDirBtn_clicked(); + void on_overwritingBtn_clicked(); void on_overwrittenBtn_clicked(); diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index 203078a6..80a6a0e7 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -386,6 +386,13 @@ If you use pre-releases, never contact me directly by e-mail or via private mess + + + + ... + + + -- cgit v1.3.1