Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
cmake_minimum_required(VERSION 3.16)

find_package(mo2-cmake CONFIG REQUIRED)

find_package(usvfs CONFIG REQUIRED)

Expand Down
9 changes: 9 additions & 0 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2392,6 +2392,15 @@ void DiagnosticsSettings::setLootLogLevel(lootcli::LogLevels level)
set(m_Settings, "Settings", "loot_log_level", level);
}

bool DiagnosticsSettings::usvfsDebugMode() const
{
return get<bool>(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<env::CoreDumpTypes>(m_Settings, "Settings", "crash_dumps_type",
Expand Down
4 changes: 4 additions & 0 deletions src/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
29 changes: 18 additions & 11 deletions src/settingsdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>820</width>
<height>592</height>
<height>607</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -17,7 +17,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>7</number>
</property>
<widget class="QWidget" name="generalTab">
<attribute name="title">
Expand All @@ -44,8 +44,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>761</width>
<height>550</height>
<width>766</width>
<height>611</height>
</rect>
</property>
<property name="autoFillBackground">
Expand Down Expand Up @@ -1052,8 +1052,8 @@ If you disable this feature, MO will only display official DLCs this way. Please
<rect>
<x>0</x>
<y>0</y>
<width>761</width>
<height>515</height>
<width>766</width>
<height>548</height>
</rect>
</property>
<property name="autoFillBackground">
Expand Down Expand Up @@ -1742,8 +1742,8 @@ If you disable this feature, MO will only display official DLCs this way. Please
<rect>
<x>0</x>
<y>0</y>
<width>778</width>
<height>475</height>
<width>780</width>
<height>489</height>
</rect>
</property>
<property name="autoFillBackground">
Expand Down Expand Up @@ -2041,9 +2041,6 @@ p, li { white-space: pre-wrap; }
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
Expand Down Expand Up @@ -2247,6 +2244,16 @@ programs you are intentionally running.</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="usvfsDebugModeBox">
<property name="toolTip">
<string>For developer only.</string>
</property>
<property name="text">
<string>USVFS Debug Mode</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down
3 changes: 3 additions & 0 deletions src/settingsdialogdiagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down Expand Up @@ -103,6 +104,8 @@ void DiagnosticsSettingsTab::update()
settings().diagnostics().setLogLevel(
static_cast<log::Levels>(ui->logLevelBox->currentData().toInt()));

settings().diagnostics().setUsvfsDebugMode(ui->usvfsDebugModeBox->isChecked());

settings().diagnostics().setCoreDumpType(
static_cast<env::CoreDumpTypes>(ui->dumpsTypeBox->currentData().toInt()));

Expand Down
3 changes: 2 additions & 1 deletion src/usvfsconnector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<milliseconds>(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());
Expand Down