diff --git a/CMakeLists.txt b/CMakeLists.txt index 85ba23f05..7cdf302c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,8 @@ set(MO2_CMAKE_DEPRECATED_UIBASE_INCLUDE ON) project(organizer) +find_package(mo2-cmake CONFIG REQUIRED) + # if MO2_INSTALL_IS_BIN is set, this means that we should install directly into the # installation prefix, without the bin/ subfolder, typically for a standalone build # to update an existing install diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 123e876b0..54d7af59f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,5 @@ cmake_minimum_required(VERSION 3.16) -find_package(mo2-cmake CONFIG REQUIRED) find_package(usvfs CONFIG REQUIRED) diff --git a/src/settings.cpp b/src/settings.cpp index ef1785b16..c22502031 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -2392,6 +2392,15 @@ void DiagnosticsSettings::setLootLogLevel(lootcli::LogLevels level) set(m_Settings, "Settings", "loot_log_level", level); } +bool DiagnosticsSettings::usvfsDebugMode() const +{ + return get(m_Settings, "Settings", "usvfs_debug_mode", false); +} +void DiagnosticsSettings::setUsvfsDebugMode(bool enabled) +{ + set(m_Settings, "Settings", "usvfs_debug_mode", enabled); +} + env::CoreDumpTypes DiagnosticsSettings::coreDumpType() const { return get(m_Settings, "Settings", "crash_dumps_type", diff --git a/src/settings.h b/src/settings.h index edc1d6445..ddca27eeb 100644 --- a/src/settings.h +++ b/src/settings.h @@ -713,6 +713,10 @@ class DiagnosticsSettings lootcli::LogLevels lootLogLevel() const; void setLootLogLevel(lootcli::LogLevels level); + // set USVFS debug mode + bool usvfsDebugMode() const; + void setUsvfsDebugMode(bool enabled); + // crash dump type for both MO and usvfs // env::CoreDumpTypes coreDumpType() const; diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index 6011b1588..91448cb30 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -7,7 +7,7 @@ 0 0 820 - 592 + 607 @@ -17,7 +17,7 @@ - 0 + 7 @@ -44,8 +44,8 @@ 0 0 - 761 - 550 + 766 + 611 @@ -1052,8 +1052,8 @@ If you disable this feature, MO will only display official DLCs this way. Please 0 0 - 761 - 515 + 766 + 548 @@ -1742,8 +1742,8 @@ If you disable this feature, MO will only display official DLCs this way. Please 0 0 - 778 - 475 + 780 + 489 @@ -2041,9 +2041,6 @@ p, li { white-space: pre-wrap; } - - Qt::Orientation::Horizontal - 40 @@ -2247,6 +2244,16 @@ programs you are intentionally running. + + + + For developer only. + + + USVFS Debug Mode + + + diff --git a/src/settingsdialogdiagnostics.cpp b/src/settingsdialogdiagnostics.cpp index d9db7de15..10d427c37 100644 --- a/src/settingsdialogdiagnostics.cpp +++ b/src/settingsdialogdiagnostics.cpp @@ -12,6 +12,7 @@ DiagnosticsSettingsTab::DiagnosticsSettingsTab(Settings& s, SettingsDialog& d) setLogLevel(); setLootLogLevel(); setCrashDumpTypesBox(); + ui->usvfsDebugModeBox->setChecked(settings().diagnostics().usvfsDebugMode()); ui->dumpsMaxEdit->setValue(settings().diagnostics().maxCoreDumps()); @@ -103,6 +104,8 @@ void DiagnosticsSettingsTab::update() settings().diagnostics().setLogLevel( static_cast(ui->logLevelBox->currentData().toInt())); + settings().diagnostics().setUsvfsDebugMode(ui->usvfsDebugModeBox->isChecked()); + settings().diagnostics().setCoreDumpType( static_cast(ui->dumpsTypeBox->currentData().toInt())); diff --git a/src/usvfsconnector.cpp b/src/usvfsconnector.cpp index 8d1d29601..6639f1624 100644 --- a/src/usvfsconnector.cpp +++ b/src/usvfsconnector.cpp @@ -130,13 +130,14 @@ UsvfsConnector::UsvfsConnector() const LogLevel logLevel = toUsvfsLogLevel(s.diagnostics().logLevel()); const auto dumpType = toUsvfsCrashDumpsType(s.diagnostics().coreDumpType()); const auto delay = duration_cast(s.diagnostics().spawnDelay()); + const auto debugMode = s.diagnostics().usvfsDebugMode(); std::string dumpPath = MOShared::ToString(OrganizerCore::getGlobalCoreDumpPath(), true); usvfsParameters* params = usvfsCreateParameters(); usvfsSetInstanceName(params, SHMID); - usvfsSetDebugMode(params, false); + usvfsSetDebugMode(params, debugMode); usvfsSetLogLevel(params, logLevel); usvfsSetCrashDumpType(params, dumpType); usvfsSetCrashDumpPath(params, dumpPath.c_str());