From 93763a93640754f468d4a5d1aeaf5ad4effa6d56 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Sat, 8 Dec 2018 11:15:16 -0600 Subject: Add workaround setting to prevent the GUI from locking when running an executable --- src/organizercore.cpp | 5 ++- src/settings.cpp | 8 ++++ src/settings.h | 6 +++ src/settingsdialog.ui | 117 +++++++++++++++++++++++++++++--------------------- 4 files changed, 85 insertions(+), 51 deletions(-) (limited to 'src') diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 4dbe7c86..1a5a9484 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -1223,7 +1223,7 @@ HANDLE OrganizerCore::spawnBinaryDirect(const QFileInfo &binary, LPDWORD exitCode) { HANDLE processHandle = spawnBinaryProcess(binary, arguments, profileName, currentDirectory, steamAppID, customOverwrite); - if (processHandle != INVALID_HANDLE_VALUE) { + if (Settings::instance().lockGUI() && processHandle != INVALID_HANDLE_VALUE) { std::unique_ptr dlg; ILockedWaitingForProcess* uilock = nullptr; @@ -1485,6 +1485,9 @@ HANDLE OrganizerCore::startApplication(const QString &executable, bool OrganizerCore::waitForApplication(HANDLE handle, LPDWORD exitCode) { + if (!Settings::instance().lockGUI()) + return true; + ILockedWaitingForProcess* uilock = nullptr; if (m_UserInterface != nullptr) { uilock = m_UserInterface->lock(); diff --git a/src/settings.cpp b/src/settings.cpp index 3abb0988..b067106f 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -210,6 +210,11 @@ bool Settings::forceEnableCoreFiles() const return m_Settings.value("Settings/force_enable_core_files", true).toBool(); } +bool Settings::lockGUI() const +{ + return m_Settings.value("Settings/lock_gui", true).toBool(); +} + bool Settings::automaticLoginEnabled() const { return m_Settings.value("Settings/nexus_login", false).toBool(); @@ -1060,6 +1065,7 @@ Settings::WorkaroundsTab::WorkaroundsTab(Settings *m_parent, , m_hideUncheckedBox(m_dialog.findChild("hideUncheckedBox")) , m_forceEnableBox(m_dialog.findChild("forceEnableBox")) , m_displayForeignBox(m_dialog.findChild("displayForeignBox")) + , m_lockGUIBox(m_dialog.findChild("lockGUIBox")) { m_appIDEdit->setText(m_parent->getSteamAppID()); @@ -1093,6 +1099,7 @@ Settings::WorkaroundsTab::WorkaroundsTab(Settings *m_parent, m_hideUncheckedBox->setChecked(m_parent->hideUncheckedPlugins()); m_forceEnableBox->setChecked(m_parent->forceEnableCoreFiles()); m_displayForeignBox->setChecked(m_parent->displayForeign()); + m_lockGUIBox->setChecked(m_parent->lockGUI()); m_dialog.setExecutableBlacklist(m_parent->executablesBlacklist()); @@ -1110,6 +1117,7 @@ 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/lock_gui", m_lockGUIBox->isChecked()); m_Settings.setValue("Settings/executable_blacklist", m_dialog.getExecutableBlacklist()); diff --git a/src/settings.h b/src/settings.h index 667b1b4c..2b8186f3 100644 --- a/src/settings.h +++ b/src/settings.h @@ -109,6 +109,11 @@ public: */ bool forceEnableCoreFiles() const; + /** + * @return true if the GUI should be locked when running executables + */ + bool lockGUI() const; + /** * @brief register download speed * @param url complete download url @@ -496,6 +501,7 @@ private: QCheckBox *m_hideUncheckedBox; QCheckBox *m_forceEnableBox; QCheckBox *m_displayForeignBox; + QCheckBox *m_lockGUIBox; }; private slots: diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index 91bfca4e..203078a6 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -966,57 +966,77 @@ tl;dr-version: If Nexus-features don't work, insert the current version number o - - - false - - - 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) + + + + + 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 - - - true - - - - - - - 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. + + + Force-enable game files + + + true + + + + + + + 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. If you disable this feature, MO will only display official DLCs this way. Please note that plugins (esps, esms, and esls) displayed in the right pane are completely unaffected by this feature. - - - Display mods installed outside MO - - - true - - + + + Display mods installed outside MO + + + true + + + + + + + false + + + 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 + + + + + + + Disable this to prevent the GUI from being locked when running an executable. This may result in abnormal behavior. + + + Disable this to prevent the GUI from being locked when running an executable. This may result in abnormal behavior. + + + Lock GUI when running executable + + + true + + + + @@ -1330,9 +1350,6 @@ programs you are intentionally running. appIDEdit mechanismBox nmmVersionEdit - hideUncheckedBox - forceEnableBox - displayForeignBox bsaDateBtn tabWidget -- cgit v1.3.1