| 86 | } |
| 87 | |
| 88 | void LogConfigWindow::LoadSettings() |
| 89 | { |
| 90 | IniFile ini; |
| 91 | ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX)); |
| 92 | |
| 93 | IniFile::Section* options = ini.GetOrCreateSection("Options"); |
| 94 | |
| 95 | // Retrieve the verbosity value from the config ini file. |
| 96 | int verbosity; |
| 97 | options->Get("Verbosity", &verbosity, 0); |
| 98 | |
| 99 | // Ensure the verbosity level is valid. |
| 100 | if (verbosity < 1) |
| 101 | verbosity = 1; |
| 102 | if (verbosity > MAX_LOGLEVEL) |
| 103 | verbosity = MAX_LOGLEVEL; |
| 104 | |
| 105 | // Actually set the logging verbosity. |
| 106 | m_verbosity->SetSelection(verbosity - 1); |
| 107 | |
| 108 | // Get the logger output settings from the config ini file. |
| 109 | options->Get("WriteToFile", &m_writeFile, false); |
| 110 | m_writeFileCB->SetValue(m_writeFile); |
| 111 | options->Get("WriteToConsole", &m_writeConsole, true); |
| 112 | m_writeConsoleCB->SetValue(m_writeConsole); |
| 113 | options->Get("WriteToWindow", &m_writeWindow, true); |
| 114 | m_writeWindowCB->SetValue(m_writeWindow); |
| 115 | |
| 116 | // Run through all of the log types and check each checkbox for each logging type |
| 117 | // depending on its set value within the config ini. |
| 118 | for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i) |
| 119 | { |
| 120 | bool log_enabled; |
| 121 | ini.GetOrCreateSection("Logs")->Get(m_LogManager->GetShortName((LogTypes::LOG_TYPE)i), &log_enabled, false); |
| 122 | |
| 123 | if (log_enabled) |
| 124 | enableAll = false; |
| 125 | |
| 126 | m_checks->Check(i, log_enabled); |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | void LogConfigWindow::SaveSettings() |
| 131 | { |
nothing calls this directly
no test coverage detected