Add support for disabling log from settings
This commit is contained in:
parent
ae311eb3ef
commit
371b61f3ea
|
@ -5,6 +5,7 @@
|
||||||
#include "common/common.h"
|
#include "common/common.h"
|
||||||
#include "common/log_manager.h"
|
#include "common/log_manager.h"
|
||||||
|
|
||||||
|
#include "core/settings.h"
|
||||||
#include "core/system.h"
|
#include "core/system.h"
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "core/loader/loader.h"
|
#include "core/loader/loader.h"
|
||||||
|
@ -23,6 +24,9 @@ int __cdecl main(int argc, char **argv) {
|
||||||
|
|
||||||
Config config;
|
Config config;
|
||||||
|
|
||||||
|
if (!Settings::values.enable_log)
|
||||||
|
LogManager::Shutdown();
|
||||||
|
|
||||||
std::string boot_filename = argv[1];
|
std::string boot_filename = argv[1];
|
||||||
EmuWindow_GLFW* emu_window = new EmuWindow_GLFW;
|
EmuWindow_GLFW* emu_window = new EmuWindow_GLFW;
|
||||||
|
|
||||||
|
|
|
@ -59,10 +59,15 @@ void Config::ReadData() {
|
||||||
Settings::values.use_virtual_sd = glfw_config->GetBoolean("Data Storage", "use_virtual_sd", true);
|
Settings::values.use_virtual_sd = glfw_config->GetBoolean("Data Storage", "use_virtual_sd", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Config::ReadMiscellaneous() {
|
||||||
|
Settings::values.enable_log = glfw_config->GetBoolean("Miscellaneous", "enable_log", true);
|
||||||
|
}
|
||||||
|
|
||||||
void Config::Reload() {
|
void Config::Reload() {
|
||||||
LoadINI(glfw_config, glfw_config_loc.c_str(), DefaultINI::glfw_config_file);
|
LoadINI(glfw_config, glfw_config_loc.c_str(), DefaultINI::glfw_config_file);
|
||||||
ReadControls();
|
ReadControls();
|
||||||
ReadData();
|
ReadData();
|
||||||
|
ReadMiscellaneous();
|
||||||
}
|
}
|
||||||
|
|
||||||
Config::~Config() {
|
Config::~Config() {
|
||||||
|
|
|
@ -17,6 +17,7 @@ class Config {
|
||||||
bool LoadINI(INIReader* config, const char* location, const std::string& default_contents="", bool retry=true);
|
bool LoadINI(INIReader* config, const char* location, const std::string& default_contents="", bool retry=true);
|
||||||
void ReadControls();
|
void ReadControls();
|
||||||
void ReadData();
|
void ReadData();
|
||||||
|
void ReadMiscellaneous();
|
||||||
public:
|
public:
|
||||||
Config();
|
Config();
|
||||||
~Config();
|
~Config();
|
||||||
|
|
|
@ -28,6 +28,9 @@ pad_sright =
|
||||||
|
|
||||||
[Data Storage]
|
[Data Storage]
|
||||||
use_virtual_sd =
|
use_virtual_sd =
|
||||||
|
|
||||||
|
[Miscellaneous]
|
||||||
|
enable_log =
|
||||||
)";
|
)";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,14 +76,28 @@ void Config::SaveData() {
|
||||||
qt_config->endGroup();
|
qt_config->endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Config::ReadMiscellaneous() {
|
||||||
|
qt_config->beginGroup("Miscellaneous");
|
||||||
|
Settings::values.enable_log = qt_config->value("enable_log", true).toBool();
|
||||||
|
qt_config->endGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Config::SaveMiscellaneous() {
|
||||||
|
qt_config->beginGroup("Miscellaneous");
|
||||||
|
qt_config->setValue("enable_log", Settings::values.enable_log);
|
||||||
|
qt_config->endGroup();
|
||||||
|
}
|
||||||
|
|
||||||
void Config::Reload() {
|
void Config::Reload() {
|
||||||
ReadControls();
|
ReadControls();
|
||||||
ReadData();
|
ReadData();
|
||||||
|
ReadMiscellaneous();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::Save() {
|
void Config::Save() {
|
||||||
SaveControls();
|
SaveControls();
|
||||||
SaveData();
|
SaveData();
|
||||||
|
SaveMiscellaneous();
|
||||||
}
|
}
|
||||||
|
|
||||||
Config::~Config() {
|
Config::~Config() {
|
||||||
|
|
|
@ -17,6 +17,9 @@ class Config {
|
||||||
|
|
||||||
void ReadData();
|
void ReadData();
|
||||||
void SaveData();
|
void SaveData();
|
||||||
|
|
||||||
|
void ReadMiscellaneous();
|
||||||
|
void SaveMiscellaneous();
|
||||||
public:
|
public:
|
||||||
Config();
|
Config();
|
||||||
~Config();
|
~Config();
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "debugger/graphics.hxx"
|
#include "debugger/graphics.hxx"
|
||||||
#include "debugger/graphics_cmdlists.hxx"
|
#include "debugger/graphics_cmdlists.hxx"
|
||||||
|
|
||||||
|
#include "core/settings.h"
|
||||||
#include "core/system.h"
|
#include "core/system.h"
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "core/loader/loader.h"
|
#include "core/loader/loader.h"
|
||||||
|
@ -34,8 +35,12 @@
|
||||||
GMainWindow::GMainWindow()
|
GMainWindow::GMainWindow()
|
||||||
{
|
{
|
||||||
LogManager::Init();
|
LogManager::Init();
|
||||||
|
|
||||||
Config config;
|
Config config;
|
||||||
|
|
||||||
|
if (!Settings::values.enable_log)
|
||||||
|
LogManager::Shutdown();
|
||||||
|
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
statusBar()->hide();
|
statusBar()->hide();
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,8 @@ struct Values {
|
||||||
int pad_sright_key;
|
int pad_sright_key;
|
||||||
|
|
||||||
bool use_virtual_sd;
|
bool use_virtual_sd;
|
||||||
|
|
||||||
|
bool enable_log;
|
||||||
} extern values;
|
} extern values;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue