Make the log config dialog modeless. Eventually I will make this a dockable window.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7193 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice 2011-02-18 20:03:01 +00:00
parent a51b99795e
commit 83dc3bf210
5 changed files with 12 additions and 22 deletions

View File

@ -197,6 +197,10 @@ CRenderFrame::CRenderFrame(wxFrame* parent, wxWindowID id, const wxString& title
const wxPoint& pos, const wxSize& size, long style) const wxPoint& pos, const wxSize& size, long style)
: wxFrame(parent, id, title, pos, size, style) : wxFrame(parent, id, title, pos, size, style)
{ {
// Give it an icon
wxIcon IconTemp;
IconTemp.CopyFromBitmap(wxGetBitmapFromMemory(dolphin_ico32x32));
SetIcon(IconTemp);
} }
#ifdef _WIN32 #ifdef _WIN32
@ -375,11 +379,6 @@ CFrame::CFrame(wxFrame* parent,
// Create toolbar bitmaps // Create toolbar bitmaps
InitBitmaps(); InitBitmaps();
// Give it an icon
wxIcon IconTemp;
IconTemp.CopyFromBitmap(wxGetBitmapFromMemory(dolphin_ico32x32));
SetIcon(IconTemp);
// Give it a status bar // Give it a status bar
SetStatusBar(CreateStatusBar(2, wxST_SIZEGRIP, ID_STATUSBAR)); SetStatusBar(CreateStatusBar(2, wxST_SIZEGRIP, ID_STATUSBAR));
if (!SConfig::GetInstance().m_InterfaceStatusbar) if (!SConfig::GetInstance().m_InterfaceStatusbar)

View File

@ -1231,9 +1231,8 @@ void CFrame::OnConfigHotkey(wxCommandEvent& WXUNUSED (event))
void CFrame::OnConfigLogger(wxCommandEvent& WXUNUSED (event)) void CFrame::OnConfigLogger(wxCommandEvent& WXUNUSED (event))
{ {
LogConfigDiag m_LogConfigDiag(this, m_LogWindow); LogConfigDiag *m_LogConfigDiag = new LogConfigDiag(this, m_LogWindow);
m_LogConfigDiag.ShowModal(); m_LogConfigDiag->Show();
m_LogConfigDiag.Destroy();
} }
void CFrame::OnHelp(wxCommandEvent& event) void CFrame::OnHelp(wxCommandEvent& event)

View File

@ -22,11 +22,11 @@
#include "FileUtil.h" #include "FileUtil.h"
#define _connect_macro_(b, f, c, s) \ #define _connect_macro_(b, f, c, s) \
(b)->Connect(wxID_ANY, (c), wxCommandEventHandler( f ), (wxObject*)0, (wxEvtHandler*)s) (b)->Connect(wxID_ANY, (c), wxCommandEventHandler(f), (wxObject*)0, (wxEvtHandler*)s)
LogConfigDiag::LogConfigDiag(wxWindow* parent, CLogWindow *log_window) LogConfigDiag::LogConfigDiag(wxWindow* parent, CLogWindow *log_window)
: wxDialog(parent, wxID_ANY, _("Logger Configuration"), wxDefaultPosition, wxDefaultSize) : wxDialog(parent, wxID_ANY, _("Logger Configuration"), wxDefaultPosition, wxDefaultSize)
, m_LogWindow(log_window) , m_LogWindow(log_window), enableAll(true)
{ {
Connect(wxID_ANY, wxEVT_CLOSE_WINDOW, wxCloseEventHandler(LogConfigDiag::OnClose), (wxObject*)0, this); Connect(wxID_ANY, wxEVT_CLOSE_WINDOW, wxCloseEventHandler(LogConfigDiag::OnClose), (wxObject*)0, this);
m_LogManager = LogManager::GetInstance(); m_LogManager = LogManager::GetInstance();
@ -121,6 +121,7 @@ void LogConfigDiag::LoadSettings()
{ {
bool log_enabled; bool log_enabled;
ini.Get("Logs", m_LogManager->getShortName((LogTypes::LOG_TYPE)i), &log_enabled, true); ini.Get("Logs", m_LogManager->getShortName((LogTypes::LOG_TYPE)i), &log_enabled, true);
if (log_enabled) enableAll=false;
m_checks->Check(i, log_enabled); m_checks->Check(i, log_enabled);
} }
} }
@ -194,11 +195,9 @@ void LogConfigDiag::OnWriteWindowChecked(wxCommandEvent& event)
void LogConfigDiag::OnToggleAll(wxCommandEvent& WXUNUSED(event)) void LogConfigDiag::OnToggleAll(wxCommandEvent& WXUNUSED(event))
{ {
static bool enableAll = false;
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i) for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
ToggleLog(i, enableAll); ToggleLog(i, enableAll);
SaveSettings();
enableAll = !enableAll; enableAll = !enableAll;
} }
@ -231,8 +230,6 @@ void LogConfigDiag::OnLogCheck(wxCommandEvent& event)
{ {
int i = event.GetInt(); int i = event.GetInt();
ToggleLog(i, m_checks->IsChecked(i)); ToggleLog(i, m_checks->IsChecked(i));
SaveSettings();
} }
void LogConfigDiag::OnClickClose(wxCommandEvent& WXUNUSED(event)) void LogConfigDiag::OnClickClose(wxCommandEvent& WXUNUSED(event))
@ -240,8 +237,8 @@ void LogConfigDiag::OnClickClose(wxCommandEvent& WXUNUSED(event))
Close(); Close();
} }
void LogConfigDiag::OnClose(wxCloseEvent& WXUNUSED(event)) void LogConfigDiag::OnClose(wxCloseEvent& event)
{ {
SaveSettings(); SaveSettings();
EndModal(wxID_CLOSE); event.Skip();
} }

View File

@ -37,6 +37,7 @@ private:
LogManager *m_LogManager; LogManager *m_LogManager;
CLogWindow *m_LogWindow; CLogWindow *m_LogWindow;
bool m_writeFile, m_writeConsole, m_writeWindow; bool m_writeFile, m_writeConsole, m_writeWindow;
bool enableAll;
// Controls // Controls
wxCheckBox *m_writeFileCB, *m_writeConsoleCB, *m_writeWindowCB; wxCheckBox *m_writeFileCB, *m_writeConsoleCB, *m_writeWindowCB;

View File

@ -27,15 +27,9 @@ enum
{ {
IDM_LOG, IDM_LOG,
IDM_CLEARLOG, IDM_CLEARLOG,
IDM_LOGCHECKS,
IDM_OPTIONS,
IDM_TOGGLEALL, IDM_TOGGLEALL,
IDM_WRAPLINE, IDM_WRAPLINE,
IDM_WRITEFILE,
IDM_WRITECONSOLE,
IDM_WRITEWINDOW,
IDTM_UPDATELOG, IDTM_UPDATELOG,
IDM_VERBOSITY,
IDM_FONT, IDM_FONT,
IDM_SUBMITCMD IDM_SUBMITCMD
}; };