diff options
| author | 2014-10-27 17:18:28 -0400 | |
|---|---|---|
| committer | 2014-11-03 17:00:32 -0500 | |
| commit | 371b61f3eaf6ad8bc35311d906c8d780d1531f8b (patch) | |
| tree | 9eb38c4d0033ba414b749f7905ff91ec0e7a93bc | |
| parent | Merge pull request #154 from lioncash/dyncom (diff) | |
| download | yuzu-371b61f3eaf6ad8bc35311d906c8d780d1531f8b.tar.gz yuzu-371b61f3eaf6ad8bc35311d906c8d780d1531f8b.tar.xz yuzu-371b61f3eaf6ad8bc35311d906c8d780d1531f8b.zip | |
Add support for disabling log from settings
Diffstat (limited to '')
| -rw-r--r-- | src/citra/citra.cpp | 4 | ||||
| -rw-r--r-- | src/citra/config.cpp | 5 | ||||
| -rw-r--r-- | src/citra/config.h | 1 | ||||
| -rw-r--r-- | src/citra/default_ini.h | 3 | ||||
| -rw-r--r-- | src/citra_qt/config.cpp | 14 | ||||
| -rw-r--r-- | src/citra_qt/config.h | 3 | ||||
| -rw-r--r-- | src/citra_qt/main.cpp | 5 | ||||
| -rw-r--r-- | src/core/settings.h | 2 |
8 files changed, 37 insertions, 0 deletions
diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index 6ac5c5dc5..41b62ac16 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include "common/common.h" | 5 | #include "common/common.h" |
| 6 | #include "common/log_manager.h" | 6 | #include "common/log_manager.h" |
| 7 | 7 | ||
| 8 | #include "core/settings.h" | ||
| 8 | #include "core/system.h" | 9 | #include "core/system.h" |
| 9 | #include "core/core.h" | 10 | #include "core/core.h" |
| 10 | #include "core/loader/loader.h" | 11 | #include "core/loader/loader.h" |
| @@ -22,6 +23,9 @@ int __cdecl main(int argc, char **argv) { | |||
| 22 | } | 23 | } |
| 23 | 24 | ||
| 24 | Config config; | 25 | Config config; |
| 26 | |||
| 27 | if (!Settings::values.enable_log) | ||
| 28 | LogManager::Shutdown(); | ||
| 25 | 29 | ||
| 26 | std::string boot_filename = argv[1]; | 30 | std::string boot_filename = argv[1]; |
| 27 | EmuWindow_GLFW* emu_window = new EmuWindow_GLFW; | 31 | EmuWindow_GLFW* emu_window = new EmuWindow_GLFW; |
diff --git a/src/citra/config.cpp b/src/citra/config.cpp index 03a0ce606..65edcfc9f 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp | |||
| @@ -59,10 +59,15 @@ void Config::ReadData() { | |||
| 59 | Settings::values.use_virtual_sd = glfw_config->GetBoolean("Data Storage", "use_virtual_sd", true); | 59 | Settings::values.use_virtual_sd = glfw_config->GetBoolean("Data Storage", "use_virtual_sd", true); |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | void Config::ReadMiscellaneous() { | ||
| 63 | Settings::values.enable_log = glfw_config->GetBoolean("Miscellaneous", "enable_log", true); | ||
| 64 | } | ||
| 65 | |||
| 62 | void Config::Reload() { | 66 | void Config::Reload() { |
| 63 | LoadINI(glfw_config, glfw_config_loc.c_str(), DefaultINI::glfw_config_file); | 67 | LoadINI(glfw_config, glfw_config_loc.c_str(), DefaultINI::glfw_config_file); |
| 64 | ReadControls(); | 68 | ReadControls(); |
| 65 | ReadData(); | 69 | ReadData(); |
| 70 | ReadMiscellaneous(); | ||
| 66 | } | 71 | } |
| 67 | 72 | ||
| 68 | Config::~Config() { | 73 | Config::~Config() { |
diff --git a/src/citra/config.h b/src/citra/config.h index c4fac2459..63b5978e2 100644 --- a/src/citra/config.h +++ b/src/citra/config.h | |||
| @@ -17,6 +17,7 @@ class Config { | |||
| 17 | bool LoadINI(INIReader* config, const char* location, const std::string& default_contents="", bool retry=true); | 17 | bool LoadINI(INIReader* config, const char* location, const std::string& default_contents="", bool retry=true); |
| 18 | void ReadControls(); | 18 | void ReadControls(); |
| 19 | void ReadData(); | 19 | void ReadData(); |
| 20 | void ReadMiscellaneous(); | ||
| 20 | public: | 21 | public: |
| 21 | Config(); | 22 | Config(); |
| 22 | ~Config(); | 23 | ~Config(); |
diff --git a/src/citra/default_ini.h b/src/citra/default_ini.h index e7e45f4a9..1f0b6cad4 100644 --- a/src/citra/default_ini.h +++ b/src/citra/default_ini.h | |||
| @@ -28,6 +28,9 @@ pad_sright = | |||
| 28 | 28 | ||
| 29 | [Data Storage] | 29 | [Data Storage] |
| 30 | use_virtual_sd = | 30 | use_virtual_sd = |
| 31 | |||
| 32 | [Miscellaneous] | ||
| 33 | enable_log = | ||
| 31 | )"; | 34 | )"; |
| 32 | 35 | ||
| 33 | } | 36 | } |
diff --git a/src/citra_qt/config.cpp b/src/citra_qt/config.cpp index 0c4f75a96..0ebc15f13 100644 --- a/src/citra_qt/config.cpp +++ b/src/citra_qt/config.cpp | |||
| @@ -76,14 +76,28 @@ void Config::SaveData() { | |||
| 76 | qt_config->endGroup(); | 76 | qt_config->endGroup(); |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | void Config::ReadMiscellaneous() { | ||
| 80 | qt_config->beginGroup("Miscellaneous"); | ||
| 81 | Settings::values.enable_log = qt_config->value("enable_log", true).toBool(); | ||
| 82 | qt_config->endGroup(); | ||
| 83 | } | ||
| 84 | |||
| 85 | void Config::SaveMiscellaneous() { | ||
| 86 | qt_config->beginGroup("Miscellaneous"); | ||
| 87 | qt_config->setValue("enable_log", Settings::values.enable_log); | ||
| 88 | qt_config->endGroup(); | ||
| 89 | } | ||
| 90 | |||
| 79 | void Config::Reload() { | 91 | void Config::Reload() { |
| 80 | ReadControls(); | 92 | ReadControls(); |
| 81 | ReadData(); | 93 | ReadData(); |
| 94 | ReadMiscellaneous(); | ||
| 82 | } | 95 | } |
| 83 | 96 | ||
| 84 | void Config::Save() { | 97 | void Config::Save() { |
| 85 | SaveControls(); | 98 | SaveControls(); |
| 86 | SaveData(); | 99 | SaveData(); |
| 100 | SaveMiscellaneous(); | ||
| 87 | } | 101 | } |
| 88 | 102 | ||
| 89 | Config::~Config() { | 103 | Config::~Config() { |
diff --git a/src/citra_qt/config.h b/src/citra_qt/config.h index 74c9ff11d..979902467 100644 --- a/src/citra_qt/config.h +++ b/src/citra_qt/config.h | |||
| @@ -17,6 +17,9 @@ class Config { | |||
| 17 | 17 | ||
| 18 | void ReadData(); | 18 | void ReadData(); |
| 19 | void SaveData(); | 19 | void SaveData(); |
| 20 | |||
| 21 | void ReadMiscellaneous(); | ||
| 22 | void SaveMiscellaneous(); | ||
| 20 | public: | 23 | public: |
| 21 | Config(); | 24 | Config(); |
| 22 | ~Config(); | 25 | ~Config(); |
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index bac6a6bb8..c99f92835 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include "debugger/graphics.hxx" | 22 | #include "debugger/graphics.hxx" |
| 23 | #include "debugger/graphics_cmdlists.hxx" | 23 | #include "debugger/graphics_cmdlists.hxx" |
| 24 | 24 | ||
| 25 | #include "core/settings.h" | ||
| 25 | #include "core/system.h" | 26 | #include "core/system.h" |
| 26 | #include "core/core.h" | 27 | #include "core/core.h" |
| 27 | #include "core/loader/loader.h" | 28 | #include "core/loader/loader.h" |
| @@ -34,8 +35,12 @@ | |||
| 34 | GMainWindow::GMainWindow() | 35 | GMainWindow::GMainWindow() |
| 35 | { | 36 | { |
| 36 | LogManager::Init(); | 37 | LogManager::Init(); |
| 38 | |||
| 37 | Config config; | 39 | Config config; |
| 38 | 40 | ||
| 41 | if (!Settings::values.enable_log) | ||
| 42 | LogManager::Shutdown(); | ||
| 43 | |||
| 39 | ui.setupUi(this); | 44 | ui.setupUi(this); |
| 40 | statusBar()->hide(); | 45 | statusBar()->hide(); |
| 41 | 46 | ||
diff --git a/src/core/settings.h b/src/core/settings.h index d586e2ef4..77b2f02fc 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -26,6 +26,8 @@ struct Values { | |||
| 26 | int pad_sright_key; | 26 | int pad_sright_key; |
| 27 | 27 | ||
| 28 | bool use_virtual_sd; | 28 | bool use_virtual_sd; |
| 29 | |||
| 30 | bool enable_log; | ||
| 29 | } extern values; | 31 | } extern values; |
| 30 | 32 | ||
| 31 | } | 33 | } |