mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 16:49:58 -06:00
Remove all tab/space mismatches from the DolphinWX project (at least 99%. I promise!)
Also fix up the dangling else's. Shit just looks incredibly ugly in terms of actual structure in the code. I took the liberty of adding comments in FifoPlayerDlg.cpp, LogConfigWindow.cpp, LogWindow.cpp, and FrameAui.cpp to better explain some things. If any comments are wrong, don't hesitate to complain.
This commit is contained in:
@ -111,12 +111,20 @@ void LogConfigWindow::LoadSettings()
|
||||
IniFile ini;
|
||||
ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));
|
||||
|
||||
// Retrieve the verbosity value from the config ini file.
|
||||
int verbosity;
|
||||
ini.Get("Options", "Verbosity", &verbosity, 0);
|
||||
if (verbosity < 1) verbosity = 1;
|
||||
if (verbosity > MAX_LOGLEVEL) verbosity = MAX_LOGLEVEL;
|
||||
|
||||
// Ensure the verbosity level is valid.
|
||||
if (verbosity < 1)
|
||||
verbosity = 1;
|
||||
if (verbosity > MAX_LOGLEVEL)
|
||||
verbosity = MAX_LOGLEVEL;
|
||||
|
||||
// Actually set the logging verbosity.
|
||||
m_verbosity->SetSelection(verbosity - 1);
|
||||
|
||||
// Get the logger output settings from the config ini file.
|
||||
ini.Get("Options", "WriteToFile", &m_writeFile, false);
|
||||
m_writeFileCB->SetValue(m_writeFile);
|
||||
ini.Get("Options", "WriteToConsole", &m_writeConsole, true);
|
||||
@ -134,11 +142,17 @@ void LogConfigWindow::LoadSettings()
|
||||
{
|
||||
m_writeDebugger = false;
|
||||
}
|
||||
|
||||
// Run through all of the log types and check each checkbox for each logging type
|
||||
// depending on its set value within the config ini.
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
|
||||
{
|
||||
bool log_enabled;
|
||||
ini.Get("Logs", m_LogManager->GetShortName((LogTypes::LOG_TYPE)i), &log_enabled, true);
|
||||
if (log_enabled) enableAll = false;
|
||||
|
||||
if (log_enabled)
|
||||
enableAll = false;
|
||||
|
||||
m_checks->Check(i, log_enabled);
|
||||
}
|
||||
}
|
||||
@ -148,7 +162,10 @@ void LogConfigWindow::SaveSettings()
|
||||
IniFile ini;
|
||||
ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));
|
||||
|
||||
// Save the verbosity level.
|
||||
ini.Set("Options", "Verbosity", m_verbosity->GetSelection() + 1);
|
||||
|
||||
// Save the enabled/disabled states of the logger outputs to the config ini.
|
||||
ini.Set("Options", "WriteToFile", m_writeFile);
|
||||
ini.Set("Options", "WriteToConsole", m_writeConsole);
|
||||
ini.Set("Options", "WriteToWindow", m_writeWindow);
|
||||
@ -156,16 +173,28 @@ void LogConfigWindow::SaveSettings()
|
||||
if (IsDebuggerPresent())
|
||||
ini.Set("Options", "WriteToDebugger", m_writeDebugger);
|
||||
#endif
|
||||
|
||||
// Save all enabled/disabled states of the log types to the config ini.
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
|
||||
{
|
||||
ini.Set("Logs", m_LogManager->GetShortName((LogTypes::LOG_TYPE)i), m_checks->IsChecked(i));
|
||||
}
|
||||
|
||||
ini.Save(File::GetUserPath(F_LOGGERCONFIG_IDX));
|
||||
}
|
||||
|
||||
// If the verbosity changes while logging
|
||||
void LogConfigWindow::OnVerbosityChange(wxCommandEvent& event)
|
||||
{
|
||||
// Get the new verbosity
|
||||
int v = m_verbosity->GetSelection() + 1;
|
||||
|
||||
// Set all log types to that verbosity level
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++)
|
||||
{
|
||||
m_LogManager->SetLogLevel((LogTypes::LOG_TYPE)i, (LogTypes::LOG_LEVELS)v);
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user