Make log options an AUI window instead of a dialog.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7217 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice 2011-02-21 15:01:00 +00:00
parent f9ccd6dfa1
commit 3b6f7644fd
15 changed files with 111 additions and 87 deletions

View File

@ -157,6 +157,7 @@ void SConfig::SaveSettings()
ini.Set("Interface", "ShowToolbar", m_InterfaceToolbar); ini.Set("Interface", "ShowToolbar", m_InterfaceToolbar);
ini.Set("Interface", "ShowStatusbar", m_InterfaceStatusbar); ini.Set("Interface", "ShowStatusbar", m_InterfaceStatusbar);
ini.Set("Interface", "ShowLogWindow", m_InterfaceLogWindow); ini.Set("Interface", "ShowLogWindow", m_InterfaceLogWindow);
ini.Set("Interface", "ShowLogConfigWindow", m_InterfaceLogConfigWindow);
ini.Set("Interface", "ShowConsole", m_InterfaceConsole); ini.Set("Interface", "ShowConsole", m_InterfaceConsole);
// Hotkeys // Hotkeys
@ -278,6 +279,7 @@ void SConfig::LoadSettings()
ini.Get("Interface", "ShowToolbar", &m_InterfaceToolbar, true); ini.Get("Interface", "ShowToolbar", &m_InterfaceToolbar, true);
ini.Get("Interface", "ShowStatusbar", &m_InterfaceStatusbar, true); ini.Get("Interface", "ShowStatusbar", &m_InterfaceStatusbar, true);
ini.Get("Interface", "ShowLogWindow", &m_InterfaceLogWindow, false); ini.Get("Interface", "ShowLogWindow", &m_InterfaceLogWindow, false);
ini.Get("Interface", "ShowLogConfigWindow", &m_InterfaceLogConfigWindow, false);
ini.Get("Interface", "ShowConsole", &m_InterfaceConsole, false); ini.Get("Interface", "ShowConsole", &m_InterfaceConsole, false);
// Hotkeys // Hotkeys

View File

@ -59,6 +59,7 @@ struct SConfig : NonCopyable
bool m_InterfaceToolbar; bool m_InterfaceToolbar;
bool m_InterfaceStatusbar; bool m_InterfaceStatusbar;
bool m_InterfaceLogWindow; bool m_InterfaceLogWindow;
bool m_InterfaceLogConfigWindow;
bool m_InterfaceConsole; bool m_InterfaceConsole;
bool m_ListDrives; bool m_ListDrives;

View File

@ -43,7 +43,7 @@ if(wxWidgets_FOUND)
Src/ISOProperties.cpp Src/ISOProperties.cpp
Src/InputConfigDiag.cpp Src/InputConfigDiag.cpp
Src/InputConfigDiagBitmaps.cpp Src/InputConfigDiagBitmaps.cpp
Src/LogConfigDiag.cpp Src/LogConfigWindow.cpp
Src/LogWindow.cpp Src/LogWindow.cpp
Src/Main.cpp Src/Main.cpp
Src/MemcardManager.cpp Src/MemcardManager.cpp

View File

@ -245,7 +245,7 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
<ClCompile Include="Src\ISOFile.cpp" /> <ClCompile Include="Src\ISOFile.cpp" />
<ClCompile Include="Src\ISOProperties.cpp" /> <ClCompile Include="Src\ISOProperties.cpp" />
<ClCompile Include="Src\Debugger\JitWindow.cpp" /> <ClCompile Include="Src\Debugger\JitWindow.cpp" />
<ClCompile Include="Src\LogConfigDiag.cpp" /> <ClCompile Include="Src\LogConfigWindow.cpp" />
<ClCompile Include="Src\LogWindow.cpp" /> <ClCompile Include="Src\LogWindow.cpp" />
<ClCompile Include="Src\Main.cpp" /> <ClCompile Include="Src\Main.cpp" />
<ClCompile Include="Src\MainNoGUI.cpp"> <ClCompile Include="Src\MainNoGUI.cpp">
@ -305,7 +305,7 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
<ClInclude Include="Src\ISOFile.h" /> <ClInclude Include="Src\ISOFile.h" />
<ClInclude Include="Src\ISOProperties.h" /> <ClInclude Include="Src\ISOProperties.h" />
<ClInclude Include="Src\Debugger\JitWindow.h" /> <ClInclude Include="Src\Debugger\JitWindow.h" />
<ClInclude Include="Src\LogConfigDiag.h" /> <ClInclude Include="Src\LogConfigWindow.h" />
<ClInclude Include="Src\LogWindow.h" /> <ClInclude Include="Src\LogWindow.h" />
<ClInclude Include="Src\Main.h" /> <ClInclude Include="Src\Main.h" />
<ClInclude Include="Src\MemcardManager.h" /> <ClInclude Include="Src\MemcardManager.h" />
@ -390,4 +390,4 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
</Project> </Project>

View File

@ -126,7 +126,7 @@
<ClCompile Include="Src\Debugger\BreakpointView.cpp"> <ClCompile Include="Src\Debugger\BreakpointView.cpp">
<Filter>GUI\Debugger</Filter> <Filter>GUI\Debugger</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="Src\LogConfigDiag.cpp"> <ClCompile Include="Src\LogConfigWindow.cpp">
<Filter>GUI</Filter> <Filter>GUI</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
@ -249,7 +249,7 @@
<ClInclude Include="Src\Debugger\BreakpointView.h"> <ClInclude Include="Src\Debugger\BreakpointView.h">
<Filter>GUI\Debugger</Filter> <Filter>GUI\Debugger</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Src\LogConfigDiag.h"> <ClInclude Include="Src\LogConfigWindow.h">
<Filter>GUI</Filter> <Filter>GUI</Filter>
</ClInclude> </ClInclude>
</ItemGroup> </ItemGroup>
@ -291,4 +291,4 @@
<Filter>Resources</Filter> <Filter>Resources</Filter>
</ResourceCompile> </ResourceCompile>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -90,6 +90,7 @@ void CCodeWindow::Load()
const char* SettingName[] = { const char* SettingName[] = {
"Log", "Log",
"LogConfig",
"Console", "Console",
"Registers", "Registers",
"Breakpoints", "Breakpoints",
@ -131,6 +132,7 @@ void CCodeWindow::Save()
const char* SettingName[] = { const char* SettingName[] = {
"Log", "Log",
"LogConfig",
"Console", "Console",
"Registers", "Registers",
"Breakpoints", "Breakpoints",
@ -415,6 +417,8 @@ void CCodeWindow::OpenPages()
ToggleCodeWindow(true); ToggleCodeWindow(true);
if (bShowOnStart[0]) if (bShowOnStart[0])
Parent->ToggleLogWindow(true); Parent->ToggleLogWindow(true);
if (bShowOnStart[IDM_LOGCONFIGWINDOW - IDM_LOGWINDOW])
Parent->ToggleLogConfigWindow(true);
if (bShowOnStart[IDM_CONSOLEWINDOW - IDM_LOGWINDOW]) if (bShowOnStart[IDM_CONSOLEWINDOW - IDM_LOGWINDOW])
Parent->ToggleConsole(true); Parent->ToggleConsole(true);
if (bShowOnStart[IDM_REGISTERWINDOW - IDM_LOGWINDOW]) if (bShowOnStart[IDM_REGISTERWINDOW - IDM_LOGWINDOW])

View File

@ -263,7 +263,6 @@ EVT_MENU(IDM_CONFIG_DSP_EMULATOR, CFrame::OnConfigDSP)
EVT_MENU(IDM_CONFIG_PAD_PLUGIN, CFrame::OnConfigPAD) EVT_MENU(IDM_CONFIG_PAD_PLUGIN, CFrame::OnConfigPAD)
EVT_MENU(IDM_CONFIG_WIIMOTE_PLUGIN, CFrame::OnConfigWiimote) EVT_MENU(IDM_CONFIG_WIIMOTE_PLUGIN, CFrame::OnConfigWiimote)
EVT_MENU(IDM_CONFIG_HOTKEYS, CFrame::OnConfigHotkey) EVT_MENU(IDM_CONFIG_HOTKEYS, CFrame::OnConfigHotkey)
EVT_MENU(IDM_CONFIG_LOGGER, CFrame::OnConfigLogger)
EVT_MENU(IDM_SAVE_PERSPECTIVE, CFrame::OnToolBar) EVT_MENU(IDM_SAVE_PERSPECTIVE, CFrame::OnToolBar)
EVT_AUITOOLBAR_TOOL_DROPDOWN(IDM_SAVE_PERSPECTIVE, CFrame::OnDropDownToolbarItem) EVT_AUITOOLBAR_TOOL_DROPDOWN(IDM_SAVE_PERSPECTIVE, CFrame::OnDropDownToolbarItem)
@ -347,7 +346,7 @@ CFrame::CFrame(wxFrame* parent,
, m_ToolBar(NULL), m_ToolBarDebug(NULL), m_ToolBarAui(NULL) , m_ToolBar(NULL), m_ToolBarDebug(NULL), m_ToolBarAui(NULL)
, m_GameListCtrl(NULL), m_Panel(NULL) , m_GameListCtrl(NULL), m_Panel(NULL)
, m_RenderFrame(NULL), m_RenderParent(NULL) , m_RenderFrame(NULL), m_RenderParent(NULL)
, m_LogWindow(NULL), UseDebugger(_UseDebugger) , m_LogWindow(NULL), m_LogConfigWindow(NULL), UseDebugger(_UseDebugger)
, m_bBatchMode(_BatchMode), m_bEdit(false), m_bTabSplit(false), m_bNoDocking(false) , m_bBatchMode(_BatchMode), m_bEdit(false), m_bTabSplit(false), m_bNoDocking(false)
, m_bGameLoading(false) , m_bGameLoading(false)
{ {
@ -442,6 +441,8 @@ CFrame::CFrame(wxFrame* parent,
{ {
if (SConfig::GetInstance().m_InterfaceLogWindow) if (SConfig::GetInstance().m_InterfaceLogWindow)
ToggleLogWindow(true); ToggleLogWindow(true);
if (SConfig::GetInstance().m_InterfaceLogConfigWindow)
ToggleLogConfigWindow(true);
if (SConfig::GetInstance().m_InterfaceConsole) if (SConfig::GetInstance().m_InterfaceConsole)
ToggleConsole(true); ToggleConsole(true);
} }
@ -710,7 +711,8 @@ void CFrame::OnRenderWindowSizeRequest(int width, int height)
m_RenderFrame->GetClientSize(&old_width, &old_height); m_RenderFrame->GetClientSize(&old_width, &old_height);
// Add space for the log/console/debugger window // Add space for the log/console/debugger window
if ((SConfig::GetInstance().m_InterfaceLogWindow || SConfig::GetInstance().m_InterfaceConsole) && if ((SConfig::GetInstance().m_InterfaceLogWindow || SConfig::GetInstance().m_InterfaceConsole ||
SConfig::GetInstance().m_InterfaceLogConfigWindow) &&
!m_Mgr->GetPane(wxT("Pane 1")).IsFloating()) !m_Mgr->GetPane(wxT("Pane 1")).IsFloating())
{ {
switch (m_Mgr->GetPane(wxT("Pane 1")).dock_direction) switch (m_Mgr->GetPane(wxT("Pane 1")).dock_direction)

View File

@ -31,6 +31,7 @@
#include "CDUtils.h" #include "CDUtils.h"
#include "Debugger/CodeWindow.h" #include "Debugger/CodeWindow.h"
#include "LogWindow.h" #include "LogWindow.h"
#include "LogConfigWindow.h"
#if defined(HAVE_X11) && HAVE_X11 #if defined(HAVE_X11) && HAVE_X11
#include "X11Utils.h" #include "X11Utils.h"
#endif #endif
@ -120,6 +121,7 @@ class CFrame : public CRenderFrame
void UpdateGUI(); void UpdateGUI();
void UpdateGameList(); void UpdateGameList();
void ToggleLogWindow(bool bShow); void ToggleLogWindow(bool bShow);
void ToggleLogConfigWindow(bool bShow);
void ToggleConsole(bool bShow); void ToggleConsole(bool bShow);
void PostEvent(wxCommandEvent& event); void PostEvent(wxCommandEvent& event);
void StatusBarMessage(const char * Text, ...); void StatusBarMessage(const char * Text, ...);
@ -170,6 +172,7 @@ class CFrame : public CRenderFrame
CRenderFrame* m_RenderFrame; CRenderFrame* m_RenderFrame;
wxPanel* m_RenderParent; wxPanel* m_RenderParent;
CLogWindow* m_LogWindow; CLogWindow* m_LogWindow;
LogConfigWindow* m_LogConfigWindow;
bool UseDebugger; bool UseDebugger;
bool m_bBatchMode; bool m_bBatchMode;
bool m_bEdit; bool m_bEdit;
@ -304,7 +307,6 @@ class CFrame : public CRenderFrame
void OnConfigPAD(wxCommandEvent& event); void OnConfigPAD(wxCommandEvent& event);
void OnConfigWiimote(wxCommandEvent& event); void OnConfigWiimote(wxCommandEvent& event);
void OnConfigHotkey(wxCommandEvent& event); void OnConfigHotkey(wxCommandEvent& event);
void OnConfigLogger(wxCommandEvent& event);
void OnToggleFullscreen(wxCommandEvent& event); void OnToggleFullscreen(wxCommandEvent& event);
void OnToggleDualCore(wxCommandEvent& event); void OnToggleDualCore(wxCommandEvent& event);

View File

@ -42,14 +42,17 @@ void CFrame::OnPaneClose(wxAuiManagerEvent& event)
if (!g_pCodeWindow) if (!g_pCodeWindow)
{ {
if ((nb->GetPage(0)->GetId() == IDM_LOGWINDOW || if (nb->GetPage(0)->GetId() == IDM_LOGWINDOW ||
nb->GetPage(0)->GetId() == IDM_CONSOLEWINDOW)) nb->GetPage(0)->GetId() == IDM_LOGCONFIGWINDOW ||
nb->GetPage(0)->GetId() == IDM_CONSOLEWINDOW)
{ {
// Closing a pane containing the logwindow or a console closes both // Closing a pane containing the logwindow or a console closes both
SConfig::GetInstance().m_InterfaceConsole = false; SConfig::GetInstance().m_InterfaceConsole = false;
SConfig::GetInstance().m_InterfaceLogWindow = false; SConfig::GetInstance().m_InterfaceLogWindow = false;
SConfig::GetInstance().m_InterfaceLogConfigWindow = false;
ToggleConsole(false); ToggleConsole(false);
ToggleLogWindow(false); ToggleLogWindow(false);
ToggleLogConfigWindow(false);
} }
} }
else else
@ -94,6 +97,29 @@ void CFrame::ToggleLogWindow(bool bShow)
TogglePane(); TogglePane();
} }
void CFrame::ToggleLogConfigWindow(bool bShow)
{
GetMenuBar()->FindItem(IDM_LOGCONFIGWINDOW)->Check(bShow);
if (bShow)
{
if (!m_LogConfigWindow)
m_LogConfigWindow = new LogConfigWindow(this, m_LogWindow, IDM_LOGCONFIGWINDOW);
DoAddPage(m_LogConfigWindow,
g_pCodeWindow ? g_pCodeWindow->iNbAffiliation[1] : 0,
g_pCodeWindow ? bFloatWindow[1] : false);
}
else
{
DoRemovePage(m_LogConfigWindow, false);
m_LogConfigWindow = NULL;
}
// Hide or Show the pane
if (!g_pCodeWindow)
TogglePane();
}
void CFrame::ToggleConsole(bool bShow) void CFrame::ToggleConsole(bool bShow)
{ {
#ifdef _WIN32 #ifdef _WIN32
@ -155,6 +181,11 @@ void CFrame::OnToggleWindow(wxCommandEvent& event)
SConfig::GetInstance().m_InterfaceLogWindow = bShow; SConfig::GetInstance().m_InterfaceLogWindow = bShow;
ToggleLogWindow(bShow); ToggleLogWindow(bShow);
break; break;
case IDM_LOGCONFIGWINDOW:
if (!g_pCodeWindow)
SConfig::GetInstance().m_InterfaceLogConfigWindow = bShow;
ToggleLogConfigWindow(bShow);
break;
case IDM_CONSOLEWINDOW: case IDM_CONSOLEWINDOW:
if (!g_pCodeWindow) if (!g_pCodeWindow)
SConfig::GetInstance().m_InterfaceConsole = bShow; SConfig::GetInstance().m_InterfaceConsole = bShow;
@ -186,6 +217,7 @@ void CFrame::OnToggleWindow(wxCommandEvent& event)
void CFrame::ClosePages() void CFrame::ClosePages()
{ {
ToggleLogWindow(false); ToggleLogWindow(false);
ToggleLogConfigWindow(false);
ToggleConsole(false); ToggleConsole(false);
if (g_pCodeWindow) if (g_pCodeWindow)
{ {
@ -224,6 +256,8 @@ void CFrame::OnNotebookPageClose(wxAuiNotebookEvent& event)
if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_LOGWINDOW) if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_LOGWINDOW)
ToggleLogWindow(false); ToggleLogWindow(false);
if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_LOGCONFIGWINDOW)
ToggleLogConfigWindow(false);
if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_CONSOLEWINDOW) if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_CONSOLEWINDOW)
ToggleConsole(false); ToggleConsole(false);
if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_REGISTERWINDOW) if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_REGISTERWINDOW)

View File

@ -50,7 +50,7 @@ Core::GetWindowHandle().
#include "GameListCtrl.h" #include "GameListCtrl.h"
#include "BootManager.h" #include "BootManager.h"
#include "LogWindow.h" #include "LogWindow.h"
#include "LogConfigDiag.h" #include "LogConfigWindow.h"
#include "WxUtils.h" #include "WxUtils.h"
#include "ConfigManager.h" // Core #include "ConfigManager.h" // Core
@ -192,7 +192,6 @@ void CFrame::CreateMenu()
pOptionsMenu->Append(IDM_CONFIG_PAD_PLUGIN, _("Gamecube &Pad Settings")); pOptionsMenu->Append(IDM_CONFIG_PAD_PLUGIN, _("Gamecube &Pad Settings"));
pOptionsMenu->Append(IDM_CONFIG_WIIMOTE_PLUGIN, _("&Wiimote Settings")); pOptionsMenu->Append(IDM_CONFIG_WIIMOTE_PLUGIN, _("&Wiimote Settings"));
pOptionsMenu->Append(IDM_CONFIG_HOTKEYS, _("&Hotkey Settings")); pOptionsMenu->Append(IDM_CONFIG_HOTKEYS, _("&Hotkey Settings"));
pOptionsMenu->Append(IDM_CONFIG_LOGGER, _("&Logger Settings"));
if (g_pCodeWindow) if (g_pCodeWindow)
{ {
pOptionsMenu->AppendSeparator(); pOptionsMenu->AppendSeparator();
@ -234,6 +233,7 @@ void CFrame::CreateMenu()
viewMenu->Check(IDM_TOGGLE_STATUSBAR, SConfig::GetInstance().m_InterfaceStatusbar); viewMenu->Check(IDM_TOGGLE_STATUSBAR, SConfig::GetInstance().m_InterfaceStatusbar);
viewMenu->AppendSeparator(); viewMenu->AppendSeparator();
viewMenu->AppendCheckItem(IDM_LOGWINDOW, _("Show &Log")); viewMenu->AppendCheckItem(IDM_LOGWINDOW, _("Show &Log"));
viewMenu->AppendCheckItem(IDM_LOGCONFIGWINDOW, _("Show Log &Configuration"));
viewMenu->AppendCheckItem(IDM_CONSOLEWINDOW, _("Show &Console")); viewMenu->AppendCheckItem(IDM_CONSOLEWINDOW, _("Show &Console"));
viewMenu->AppendSeparator(); viewMenu->AppendSeparator();
@ -266,6 +266,7 @@ void CFrame::CreateMenu()
else else
{ {
viewMenu->Check(IDM_LOGWINDOW, SConfig::GetInstance().m_InterfaceLogWindow); viewMenu->Check(IDM_LOGWINDOW, SConfig::GetInstance().m_InterfaceLogWindow);
viewMenu->Check(IDM_LOGCONFIGWINDOW, SConfig::GetInstance().m_InterfaceLogConfigWindow);
viewMenu->Check(IDM_CONSOLEWINDOW, SConfig::GetInstance().m_InterfaceConsole); viewMenu->Check(IDM_CONSOLEWINDOW, SConfig::GetInstance().m_InterfaceConsole);
} }
@ -1229,12 +1230,6 @@ void CFrame::OnConfigHotkey(wxCommandEvent& WXUNUSED (event))
UpdateGUI(); UpdateGUI();
} }
void CFrame::OnConfigLogger(wxCommandEvent& WXUNUSED (event))
{
LogConfigDiag *m_LogConfigDiag = new LogConfigDiag(this, m_LogWindow);
m_LogConfigDiag->Show();
}
void CFrame::OnHelp(wxCommandEvent& event) void CFrame::OnHelp(wxCommandEvent& event)
{ {
switch (event.GetId()) switch (event.GetId())

View File

@ -545,16 +545,16 @@ void CGameListCtrl::ScanForISOs()
for (u32 i = 0; i < Directories.size(); i++) for (u32 i = 0; i < Directories.size(); i++)
{ {
File::FSTEntry FST_Temp; File::FSTEntry FST_Temp;
File::ScanDirectoryTree(Directories.at(i).c_str(), FST_Temp); File::ScanDirectoryTree(Directories[i].c_str(), FST_Temp);
for (u32 j = 0; j < FST_Temp.children.size(); j++) for (u32 j = 0; j < FST_Temp.children.size(); j++)
{ {
if (FST_Temp.children.at(j).isDirectory) if (FST_Temp.children[j].isDirectory)
{ {
bool duplicate = false; bool duplicate = false;
for (u32 k = 0; k < Directories.size(); k++) for (u32 k = 0; k < Directories.size(); k++)
{ {
if (strcmp(Directories.at(k).c_str(), if (strcmp(Directories[k].c_str(),
FST_Temp.children.at(j).physicalName.c_str()) == 0) FST_Temp.children[j].physicalName.c_str()) == 0)
{ {
duplicate = true; duplicate = true;
break; break;
@ -562,7 +562,7 @@ void CGameListCtrl::ScanForISOs()
} }
if (!duplicate) if (!duplicate)
Directories.push_back( Directories.push_back(
FST_Temp.children.at(j).physicalName.c_str()); FST_Temp.children[j].physicalName.c_str());
} }
} }
} }
@ -841,7 +841,11 @@ void CGameListCtrl::OnKeyPress(wxListEvent& event)
wxString text = bleh.GetText(); wxString text = bleh.GetText();
if (text.MakeUpper().at(0) == event.GetKeyCode()) #ifdef __WXGTK__
if (text.MakeLower()[0] == event.GetKeyCode())
#else
if (text.MakeUpper()[0] == event.GetKeyCode())
#endif
{ {
if (lastKey == event.GetKeyCode() && Loop < sLoop) if (lastKey == event.GetKeyCode() && Loop < sLoop)
{ {
@ -889,7 +893,7 @@ void CGameListCtrl::OnMouseMotion(wxMouseEvent& event)
// The subitem parameter of HitTest is only implemented for wxMSW. On // The subitem parameter of HitTest is only implemented for wxMSW. On
// all other platforms it will always be -1. Check the x position // all other platforms it will always be -1. Check the x position
// instead. // instead.
GetItemRect(item, Rect); GetItemRect(item, Rect);
if (Rect.GetX() + Rect.GetWidth() - GetColumnWidth(COLUMN_EMULATION_STATE) < event.GetX()) if (Rect.GetX() + Rect.GetWidth() - GetColumnWidth(COLUMN_EMULATION_STATE) < event.GetX())
#endif #endif
{ {

View File

@ -125,6 +125,7 @@ enum
// Views // Views
IDM_LOGWINDOW, IDM_LOGWINDOW,
IDM_LOGCONFIGWINDOW,
IDM_CONSOLEWINDOW, IDM_CONSOLEWINDOW,
IDM_REGISTERWINDOW, IDM_REGISTERWINDOW,
IDM_BREAKPOINTWINDOW, IDM_BREAKPOINTWINDOW,
@ -136,6 +137,7 @@ enum
// Float Window IDs // Float Window IDs
IDM_LOGWINDOW_PARENT, IDM_LOGWINDOW_PARENT,
IDM_LOGCONFIGWINDOW_PARENT,
IDM_CONSOLEWINDOW_PARENT, IDM_CONSOLEWINDOW_PARENT,
IDM_REGISTERWINDOW_PARENT, IDM_REGISTERWINDOW_PARENT,
IDM_BREAKPOINTWINDOW_PARENT, IDM_BREAKPOINTWINDOW_PARENT,
@ -147,6 +149,7 @@ enum
// Float popup menu IDs // Float popup menu IDs
IDM_FLOAT_LOGWINDOW, IDM_FLOAT_LOGWINDOW,
IDM_FLOAT_LOGCONFIGWINDOW,
IDM_FLOAT_CONSOLEWINDOW, IDM_FLOAT_CONSOLEWINDOW,
IDM_FLOAT_REGISTERWINDOW, IDM_FLOAT_REGISTERWINDOW,
IDM_FLOAT_BREAKPOINTWINDOW, IDM_FLOAT_BREAKPOINTWINDOW,

View File

@ -15,7 +15,7 @@
// Official SVN repository and contact information can be found at // Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/ // http://code.google.com/p/dolphin-emu/
#include "LogConfigDiag.h" #include "LogConfigWindow.h"
#include "LogManager.h" #include "LogManager.h"
#include "ConsoleListener.h" #include "ConsoleListener.h"
#include "LogWindow.h" #include "LogWindow.h"
@ -24,17 +24,21 @@
#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) LogConfigWindow::LogConfigWindow(wxWindow* parent, CLogWindow *log_window, wxWindowID id)
: wxDialog(parent, wxID_ANY, _("Logger Configuration"), wxDefaultPosition, wxDefaultSize) : wxPanel(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _("Log Configuration"))
, m_LogWindow(log_window), enableAll(true) , m_LogWindow(log_window), enableAll(true)
{ {
Connect(wxID_ANY, wxEVT_CLOSE_WINDOW, wxCloseEventHandler(LogConfigDiag::OnClose), (wxObject*)0, this);
m_LogManager = LogManager::GetInstance(); m_LogManager = LogManager::GetInstance();
CreateGUIControls(); CreateGUIControls();
LoadSettings(); LoadSettings();
} }
void LogConfigDiag::CreateGUIControls() LogConfigWindow::~LogConfigWindow()
{
SaveSettings();
}
void LogConfigWindow::CreateGUIControls()
{ {
// Verbosity // Verbosity
wxArrayString wxLevels, wxLevelsUse; wxArrayString wxLevels, wxLevelsUse;
@ -48,59 +52,44 @@ void LogConfigDiag::CreateGUIControls()
m_verbosity = new wxRadioBox(this, wxID_ANY, _("Verbosity"), m_verbosity = new wxRadioBox(this, wxID_ANY, _("Verbosity"),
wxDefaultPosition, wxDefaultSize, wxLevelsUse, 0, wxDefaultPosition, wxDefaultSize, wxLevelsUse, 0,
wxRA_SPECIFY_ROWS, wxDefaultValidator); wxRA_SPECIFY_ROWS, wxDefaultValidator);
_connect_macro_(m_verbosity, LogConfigDiag::OnVerbosityChange, wxEVT_COMMAND_RADIOBOX_SELECTED, this); _connect_macro_(m_verbosity, LogConfigWindow::OnVerbosityChange, wxEVT_COMMAND_RADIOBOX_SELECTED, this);
// Options // Options
m_writeFileCB = new wxCheckBox(this, wxID_ANY, _("Write to File")); m_writeFileCB = new wxCheckBox(this, wxID_ANY, _("Write to File"));
_connect_macro_(m_writeFileCB, LogConfigDiag::OnWriteFileChecked, wxEVT_COMMAND_CHECKBOX_CLICKED, this); _connect_macro_(m_writeFileCB, LogConfigWindow::OnWriteFileChecked, wxEVT_COMMAND_CHECKBOX_CLICKED, this);
m_writeConsoleCB = new wxCheckBox(this, wxID_ANY, _("Write to Console")); m_writeConsoleCB = new wxCheckBox(this, wxID_ANY, _("Write to Console"));
_connect_macro_(m_writeConsoleCB, LogConfigDiag::OnWriteConsoleChecked, wxEVT_COMMAND_CHECKBOX_CLICKED, this); _connect_macro_(m_writeConsoleCB, LogConfigWindow::OnWriteConsoleChecked, wxEVT_COMMAND_CHECKBOX_CLICKED, this);
m_writeWindowCB = new wxCheckBox(this, wxID_ANY, _("Write to Window")); m_writeWindowCB = new wxCheckBox(this, wxID_ANY, _("Write to Window"));
_connect_macro_(m_writeWindowCB, LogConfigDiag::OnWriteWindowChecked, wxEVT_COMMAND_CHECKBOX_CLICKED, this); _connect_macro_(m_writeWindowCB, LogConfigWindow::OnWriteWindowChecked, wxEVT_COMMAND_CHECKBOX_CLICKED, this);
wxButton *btn_toggle_all = new wxButton(this, wxID_ANY, _("Toggle All Log Types"), wxButton *btn_toggle_all = new wxButton(this, wxID_ANY, _("Toggle All Log Types"),
wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
_connect_macro_(btn_toggle_all, LogConfigDiag::OnToggleAll, wxEVT_COMMAND_BUTTON_CLICKED, this); _connect_macro_(btn_toggle_all, LogConfigWindow::OnToggleAll, wxEVT_COMMAND_BUTTON_CLICKED, this);
m_checks = new wxCheckListBox(this, wxID_ANY); m_checks = new wxCheckListBox(this, wxID_ANY);
_connect_macro_(m_checks, LogConfigDiag::OnLogCheck, wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, this); _connect_macro_(m_checks, LogConfigWindow::OnLogCheck, wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, this);
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++) for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++)
m_checks->Append(wxString::FromAscii(m_LogManager->getFullName((LogTypes::LOG_TYPE)i))); m_checks->Append(wxString::FromAscii(m_LogManager->getFullName((LogTypes::LOG_TYPE)i)));
// Sizers // Sizers
wxStaticBoxSizer* sbOptions = new wxStaticBoxSizer(wxVERTICAL, this, _("Logger Outputs")); wxStaticBoxSizer* sbOutputs = new wxStaticBoxSizer(wxVERTICAL, this, _("Logger Outputs"));
sbOptions->Add(m_writeFileCB, 0, wxDOWN, 1); sbOutputs->Add(m_writeFileCB, 0, wxDOWN, 1);
sbOptions->Add(m_writeConsoleCB, 0, wxDOWN, 1); sbOutputs->Add(m_writeConsoleCB, 0, wxDOWN, 1);
sbOptions->Add(m_writeWindowCB, 0); sbOutputs->Add(m_writeWindowCB, 0);
wxStaticBoxSizer* sbLogTypes = new wxStaticBoxSizer(wxVERTICAL, this, _("Log Types")); wxStaticBoxSizer* sbLogTypes = new wxStaticBoxSizer(wxVERTICAL, this, _("Log Types"));
sbLogTypes->Add(m_checks, 1, wxEXPAND); sbLogTypes->Add(m_checks, 1, wxEXPAND);
wxBoxSizer* sButtons = new wxBoxSizer(wxHORIZONTAL);
sButtons->AddStretchSpacer();
wxButton *btn_close = new wxButton(this, wxID_CLOSE);
_connect_macro_(btn_close, LogConfigDiag::OnClickClose, wxEVT_COMMAND_BUTTON_CLICKED, this);
sButtons->Add(btn_close, 0, wxALL, 5);
wxBoxSizer *sLeft = new wxBoxSizer(wxVERTICAL);
sLeft->Add(m_verbosity, 0, wxEXPAND | wxLEFT | wxRIGHT, 5);
sLeft->Add(sbOptions, 0, wxEXPAND | wxLEFT | wxRIGHT, 5);
sLeft->AddStretchSpacer();
sLeft->Add(btn_toggle_all, 0, wxEXPAND | wxLEFT | wxRIGHT, 5);
wxBoxSizer *sTop = new wxBoxSizer(wxHORIZONTAL);
sTop->Add(sLeft, 0, wxEXPAND);
sTop->Add(sbLogTypes, 0, wxEXPAND | wxRIGHT, 5);
wxBoxSizer *sMain = new wxBoxSizer(wxVERTICAL); wxBoxSizer *sMain = new wxBoxSizer(wxVERTICAL);
sMain->Add(sTop, 0, wxEXPAND); sMain->Add(m_verbosity, 0, wxEXPAND | wxLEFT | wxRIGHT, 5);
sMain->Add(sButtons, 0, wxEXPAND); sMain->Add(sbOutputs, 0, wxEXPAND | wxLEFT | wxRIGHT, 5);
sMain->Add(btn_toggle_all, 0, wxEXPAND | wxLEFT | wxRIGHT, 5);
sMain->Add(sbLogTypes, 1, wxEXPAND | wxLEFT | wxRIGHT, 5);
SetSizer(sMain); SetSizer(sMain);
Layout(); Layout();
Fit();
} }
void LogConfigDiag::LoadSettings() void LogConfigWindow::LoadSettings()
{ {
IniFile ini; IniFile ini;
ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX)); ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));
@ -126,7 +115,7 @@ void LogConfigDiag::LoadSettings()
} }
} }
void LogConfigDiag::SaveSettings() void LogConfigWindow::SaveSettings()
{ {
IniFile ini; IniFile ini;
ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX)); ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));
@ -140,7 +129,7 @@ void LogConfigDiag::SaveSettings()
ini.Save(File::GetUserPath(F_LOGGERCONFIG_IDX)); ini.Save(File::GetUserPath(F_LOGGERCONFIG_IDX));
} }
void LogConfigDiag::OnVerbosityChange(wxCommandEvent& event) void LogConfigWindow::OnVerbosityChange(wxCommandEvent& event)
{ {
int v = m_verbosity->GetSelection() + 1; int v = m_verbosity->GetSelection() + 1;
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++) for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++)
@ -148,7 +137,7 @@ void LogConfigDiag::OnVerbosityChange(wxCommandEvent& event)
event.Skip(); event.Skip();
} }
void LogConfigDiag::OnWriteFileChecked(wxCommandEvent& event) void LogConfigWindow::OnWriteFileChecked(wxCommandEvent& event)
{ {
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i) for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
{ {
@ -163,7 +152,7 @@ void LogConfigDiag::OnWriteFileChecked(wxCommandEvent& event)
} }
} }
void LogConfigDiag::OnWriteConsoleChecked(wxCommandEvent& event) void LogConfigWindow::OnWriteConsoleChecked(wxCommandEvent& event)
{ {
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i) for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
{ {
@ -178,7 +167,7 @@ void LogConfigDiag::OnWriteConsoleChecked(wxCommandEvent& event)
} }
} }
void LogConfigDiag::OnWriteWindowChecked(wxCommandEvent& event) void LogConfigWindow::OnWriteWindowChecked(wxCommandEvent& event)
{ {
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i) for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
{ {
@ -193,7 +182,7 @@ void LogConfigDiag::OnWriteWindowChecked(wxCommandEvent& event)
} }
} }
void LogConfigDiag::OnToggleAll(wxCommandEvent& WXUNUSED(event)) void LogConfigWindow::OnToggleAll(wxCommandEvent& WXUNUSED(event))
{ {
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);
@ -201,7 +190,7 @@ void LogConfigDiag::OnToggleAll(wxCommandEvent& WXUNUSED(event))
enableAll = !enableAll; enableAll = !enableAll;
} }
void LogConfigDiag::ToggleLog(int _logType, bool enable) void LogConfigWindow::ToggleLog(int _logType, bool enable)
{ {
LogTypes::LOG_TYPE logType = (LogTypes::LOG_TYPE)_logType; LogTypes::LOG_TYPE logType = (LogTypes::LOG_TYPE)_logType;
@ -226,19 +215,8 @@ void LogConfigDiag::ToggleLog(int _logType, bool enable)
} }
} }
void LogConfigDiag::OnLogCheck(wxCommandEvent& event) void LogConfigWindow::OnLogCheck(wxCommandEvent& event)
{ {
int i = event.GetInt(); int i = event.GetInt();
ToggleLog(i, m_checks->IsChecked(i)); ToggleLog(i, m_checks->IsChecked(i));
} }
void LogConfigDiag::OnClickClose(wxCommandEvent& WXUNUSED(event))
{
Close();
}
void LogConfigDiag::OnClose(wxCloseEvent& event)
{
SaveSettings();
event.Skip();
}

View File

@ -25,10 +25,11 @@ class CFrame;
class LogManager; class LogManager;
class CLogWindow; class CLogWindow;
class LogConfigDiag : public wxDialog class LogConfigWindow : public wxPanel
{ {
public: public:
LogConfigDiag(wxWindow* parent, CLogWindow *log_window); LogConfigWindow(wxWindow* parent, CLogWindow *log_window, wxWindowID id = wxID_ANY);
~LogConfigWindow();
void SaveSettings(); void SaveSettings();
void LoadSettings(); void LoadSettings();
@ -52,8 +53,6 @@ private:
void OnToggleAll(wxCommandEvent& event); void OnToggleAll(wxCommandEvent& event);
void ToggleLog(int _logType, bool enable); void ToggleLog(int _logType, bool enable);
void OnLogCheck(wxCommandEvent& event); void OnLogCheck(wxCommandEvent& event);
void OnClickClose(wxCommandEvent& WXUNUSED(event));
void OnClose(wxCloseEvent& event);
}; };
#endif // _LOG_CONFIG_DIAG_H_ #endif // _LOG_CONFIG_DIAG_H_

View File

@ -20,7 +20,7 @@ else:
'FrameAui.cpp', 'FrameAui.cpp',
'FrameTools.cpp', 'FrameTools.cpp',
'LogWindow.cpp', 'LogWindow.cpp',
'LogConfigDiag.cpp', 'LogConfigWindow.cpp',
'GameListCtrl.cpp', 'GameListCtrl.cpp',
'HotkeyDlg.cpp', 'HotkeyDlg.cpp',
'InputConfigDiag.cpp', 'InputConfigDiag.cpp',