From c71f76834ed7dfa22478b2f90ddcd752ac856ac2 Mon Sep 17 00:00:00 2001 From: "sl1nk3.s" Date: Tue, 15 Sep 2009 21:35:32 +0000 Subject: [PATCH] GUI : Added possibility to move the logwindow around in non-debugger mode, fix toolbar size issue, fix changing themes (again...) and added abort button to extract all as well as misc changes. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4281 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Core/DebuggerWX/Src/BreakpointWindow.cpp | 19 ------ Source/Core/DebuggerWX/Src/BreakpointWindow.h | 6 -- Source/Core/DebuggerWX/Src/CodeWindow.cpp | 3 - .../DebuggerWX/Src/CodeWindowFunctions.cpp | 37 ++++------- Source/Core/DebuggerWX/Src/JitWindow.cpp | 19 ------ Source/Core/DebuggerWX/Src/JitWindow.h | 3 - Source/Core/DebuggerWX/Src/RegisterWindow.cpp | 17 ----- Source/Core/DebuggerWX/Src/RegisterWindow.h | 3 - Source/Core/DolphinWX/Src/Frame.cpp | 25 ++++---- Source/Core/DolphinWX/Src/FrameAui.cpp | 53 ++++++---------- Source/Core/DolphinWX/Src/FrameTools.cpp | 63 +++++++++++-------- Source/Core/DolphinWX/Src/ISOProperties.cpp | 9 ++- Source/Core/DolphinWX/Src/LogWindow.cpp | 14 ++--- Source/Core/DolphinWX/Src/Main.cpp | 25 +++++--- 14 files changed, 106 insertions(+), 190 deletions(-) diff --git a/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp b/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp index dee778c789..228bc60568 100644 --- a/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp +++ b/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp @@ -56,25 +56,6 @@ CBreakPointWindow::CBreakPointWindow(CCodeWindow* _pCodeWindow, wxWindow* parent // Create the toolbar RecreateToolbar(); } -CBreakPointWindow::~CBreakPointWindow() -{} - -void CBreakPointWindow::Save(IniFile& _IniFile) const -{ - _IniFile.Set("BreakPoint", "x", GetPosition().x); - _IniFile.Set("BreakPoint", "y", GetPosition().y); - _IniFile.Set("BreakPoint", "w", GetSize().GetWidth()); - _IniFile.Set("BreakPoint", "h", GetSize().GetHeight()); -} -void CBreakPointWindow::Load(IniFile& _IniFile) -{ - int x,y,w,h; - _IniFile.Get("BreakPoint", "x", &x, GetPosition().x); - _IniFile.Get("BreakPoint", "y", &y, GetPosition().y); - _IniFile.Get("BreakPoint", "w", &w, GetSize().GetWidth()); - _IniFile.Get("BreakPoint", "h", &h, GetSize().GetHeight()); - SetSize(x, y, w, h); -} void CBreakPointWindow::CreateGUIControls() { diff --git a/Source/Core/DebuggerWX/Src/BreakpointWindow.h b/Source/Core/DebuggerWX/Src/BreakpointWindow.h index bb2909aa1c..1c8c444d2e 100644 --- a/Source/Core/DebuggerWX/Src/BreakpointWindow.h +++ b/Source/Core/DebuggerWX/Src/BreakpointWindow.h @@ -36,13 +36,7 @@ class CBreakPointWindow const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(400, 250), long style = wxNO_BORDER); - virtual ~CBreakPointWindow(); - void NotifyUpdate(); - - void Save(IniFile& _IniFile) const; - void Load(IniFile& _IniFile); - private: diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.cpp b/Source/Core/DebuggerWX/Src/CodeWindow.cpp index 98e9d0b2f1..3edba8bf75 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindow.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindow.cpp @@ -489,9 +489,6 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam jitsroff = pCoreMenu->Append(IDM_JITSROFF, _T("&JIT SystemRegisters off"), wxEmptyString, wxITEM_CHECK); #endif -// wxMenuItem* dualcore = pDebugMenu->Append(IDM_DUALCORE, _T("&DualCore"), wxEmptyString, wxITEM_CHECK); -// dualcore->Check(_LocalCoreStartupParameter.bUseDualCore); - pMenuBar->Append(pCoreMenu, _T("&JIT")); CreateMenuSymbols(); diff --git a/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp b/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp index b119c001fd..e601cc9675 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp @@ -162,32 +162,21 @@ void CCodeWindow::Save() ini.Set(_Section.c_str(), "Sound", iSoundWindow); ini.Set(_Section.c_str(), "Video", iVideoWindow); // Save floating setting - ini.Set("Float", "Log", (bool)FindWindowById(IDM_LOGWINDOW_PARENT)); - ini.Set("Float", "Console", (bool)FindWindowById(IDM_CONSOLEWINDOW_PARENT)); - ini.Set("Float", "Code", (bool)FindWindowById(IDM_CODEWINDOW_PARENT)); - ini.Set("Float", "Registers", (bool)FindWindowById(IDM_REGISTERWINDOW_PARENT)); - ini.Set("Float", "Breakpoints", (bool)FindWindowById(IDM_BREAKPOINTWINDOW_PARENT)); - ini.Set("Float", "Memory", (bool)FindWindowById(IDM_MEMORYWINDOW_PARENT)); - ini.Set("Float", "JIT", (bool)FindWindowById(IDM_JITWINDOW_PARENT)); - ini.Set("Float", "Sound", (bool)FindWindowById(IDM_SOUNDWINDOW_PARENT)); - ini.Set("Float", "Video", (bool)FindWindowById(IDM_VIDEOWINDOW_PARENT)); + ini.Set("Float", "Log", !!FindWindowById(IDM_LOGWINDOW_PARENT)); + ini.Set("Float", "Console", !!FindWindowById(IDM_CONSOLEWINDOW_PARENT)); + ini.Set("Float", "Code", !!FindWindowById(IDM_CODEWINDOW_PARENT)); + ini.Set("Float", "Registers", !!FindWindowById(IDM_REGISTERWINDOW_PARENT)); + ini.Set("Float", "Breakpoints", !!FindWindowById(IDM_BREAKPOINTWINDOW_PARENT)); + ini.Set("Float", "Memory", !!FindWindowById(IDM_MEMORYWINDOW_PARENT)); + ini.Set("Float", "JIT", !!FindWindowById(IDM_JITWINDOW_PARENT)); + ini.Set("Float", "Sound", !!FindWindowById(IDM_SOUNDWINDOW_PARENT)); + ini.Set("Float", "Video", !!FindWindowById(IDM_VIDEOWINDOW_PARENT)); // Save window settings - /* - ini.Set("CodeWindow", "x", GetPosition().x); - ini.Set("CodeWindow", "y", GetPosition().y); - ini.Set("CodeWindow", "w", GetSize().GetWidth()); - ini.Set("CodeWindow", "h", GetSize().GetHeight()); - ini.Set("MainWindow", "x", GetParent()->GetPosition().x); - ini.Set("MainWindow", "y", GetParent()->GetPosition().y); - ini.Set("MainWindow", "w", GetParent()->GetSize().GetWidth()); - ini.Set("MainWindow", "h", GetParent()->GetSize().GetHeight()); - - if (m_BreakpointWindow) m_BreakpointWindow->Save(file); - if (m_RegisterWindow) m_RegisterWindow->Save(file); - if (m_MemoryWindow) m_MemoryWindow->Save(file); - if (m_JitWindow) m_JitWindow->Save(file); - */ + ini.Set("MainWindow", "x", Parent->GetPosition().x); + ini.Set("MainWindow", "y", Parent->GetPosition().y); + ini.Set("MainWindow", "w", Parent->GetSize().GetWidth()); + ini.Set("MainWindow", "h", Parent->GetSize().GetHeight()); ini.Save(DEBUGGER_CONFIG_FILE); } diff --git a/Source/Core/DebuggerWX/Src/JitWindow.cpp b/Source/Core/DebuggerWX/Src/JitWindow.cpp index a0b489b7fd..c3543140e4 100644 --- a/Source/Core/DebuggerWX/Src/JitWindow.cpp +++ b/Source/Core/DebuggerWX/Src/JitWindow.cpp @@ -104,25 +104,6 @@ CJitWindow::~CJitWindow() } -void CJitWindow::Save(IniFile& _IniFile) const -{ - _IniFile.Set("JitWindow", "x", GetPosition().x); - _IniFile.Set("JitWindow", "y", GetPosition().y); - _IniFile.Set("JitWindow", "w", GetSize().GetWidth()); - _IniFile.Set("JitWindow", "h", GetSize().GetHeight()); -} - - -void CJitWindow::Load(IniFile& _IniFile) -{ - int x,y,w,h; - _IniFile.Get("JitWindow", "x", &x, GetPosition().x); - _IniFile.Get("JitWindow", "y", &y, GetPosition().y); - _IniFile.Get("JitWindow", "w", &w, GetSize().GetWidth()); - _IniFile.Get("JitWindow", "h", &h, GetSize().GetHeight()); - SetSize(x, y, w, h); -} - void CJitWindow::OnRefresh(wxCommandEvent& /*event*/) { block_list->Update(); } diff --git a/Source/Core/DebuggerWX/Src/JitWindow.h b/Source/Core/DebuggerWX/Src/JitWindow.h index 6f898ae480..8320f800e4 100644 --- a/Source/Core/DebuggerWX/Src/JitWindow.h +++ b/Source/Core/DebuggerWX/Src/JitWindow.h @@ -52,9 +52,6 @@ public: long style = wxNO_BORDER); ~CJitWindow(); - void Save(IniFile& _IniFile) const; - void Load(IniFile& _IniFile); - static void ViewAddr(u32 em_address); void Update(); diff --git a/Source/Core/DebuggerWX/Src/RegisterWindow.cpp b/Source/Core/DebuggerWX/Src/RegisterWindow.cpp index fdebddf8a1..0771929f26 100644 --- a/Source/Core/DebuggerWX/Src/RegisterWindow.cpp +++ b/Source/Core/DebuggerWX/Src/RegisterWindow.cpp @@ -38,23 +38,6 @@ CRegisterWindow::~CRegisterWindow() { } -void CRegisterWindow::Save(IniFile& _IniFile) const -{ - _IniFile.Set("RegisterWindow", "x", GetPosition().x); - _IniFile.Set("RegisterWindow", "y", GetPosition().y); - _IniFile.Set("RegisterWindow", "w", GetSize().GetWidth()); - _IniFile.Set("RegisterWindow", "h", GetSize().GetHeight()); -} - -void CRegisterWindow::Load(IniFile& _IniFile) -{ - int x,y,w,h; - _IniFile.Get("RegisterWindow", "x", &x, GetPosition().x); - _IniFile.Get("RegisterWindow", "y", &y, GetPosition().y); - _IniFile.Get("RegisterWindow", "w", &w, GetSize().GetWidth()); - _IniFile.Get("RegisterWindow", "h", &h, GetSize().GetHeight()); - SetSize(x, y, w, h); -} void CRegisterWindow::CreateGUIControls() { diff --git a/Source/Core/DebuggerWX/Src/RegisterWindow.h b/Source/Core/DebuggerWX/Src/RegisterWindow.h index 3006a276dd..f1e6c6a8c3 100644 --- a/Source/Core/DebuggerWX/Src/RegisterWindow.h +++ b/Source/Core/DebuggerWX/Src/RegisterWindow.h @@ -35,9 +35,6 @@ public: virtual ~CRegisterWindow(); - void Save(IniFile& _IniFile) const; - void Load(IniFile& _IniFile); - void NotifyUpdate(); diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index e4a9a338f9..31e08368a3 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -411,7 +411,7 @@ CFrame::CFrame(wxFrame* parent, else { m_Mgr->AddPane(m_Panel, wxAuiPaneInfo().Name(wxT("Pane 0")).Caption(wxT("Pane 0")).Hide()); - m_Mgr->AddPane(CreateEmptyNotebook(), wxAuiPaneInfo().Name(wxT("Pane 1")).Caption(wxT("Pane 1")).Hide()); + m_Mgr->AddPane(CreateEmptyNotebook(), wxAuiPaneInfo().Name(wxT("Pane 1")).Caption(wxT("Logging")).Hide()); } // Setup perspectives @@ -423,7 +423,13 @@ CFrame::CFrame(wxFrame* parent, } else { + IniFile ini; int pos; + ini.Load(LOGGER_CONFIG_FILE); + ini.Get("LogWindow", "pos", &pos, 2); + m_Mgr->GetPane(wxT("Pane 0")).Show().PaneBorder(false).CaptionVisible(false).Layer(0).Center(); + m_Mgr->GetPane(wxT("Pane 1")).Hide().PaneBorder(false).CaptionVisible(true).Layer(0) + .FloatingSize(wxSize(600, 350)).CloseButton(false).Direction(pos); AuiFullscreen = m_Mgr->SavePerspective(); } @@ -442,21 +448,14 @@ CFrame::CFrame(wxFrame* parent, DoLoadPerspective(); } else - { - m_Mgr->GetPane(wxT("Pane 1")).Hide().PaneBorder(false).CaptionVisible(false).Layer(0).Right(); - } - - // Show window - Show(); - - if (!g_pCodeWindow) { SetSimplePaneSize(); if (SConfig::GetInstance().m_InterfaceLogWindow) DoToggleWindow(IDM_LOGWINDOW, true); if (SConfig::GetInstance().m_InterfaceConsole) DoToggleWindow(IDM_CONSOLEWINDOW, true); } - //sizerPanel->SetSizeHints(m_Panel); + // Show window + Show(); // Commit m_Mgr->Update(); @@ -829,11 +828,9 @@ void CFrame::Update() double TmpSeconds = Common::Timer::GetDoubleTime(); // Get timestamp double CompareTime = TmpSeconds - HideDelay; // Compare it - if(m_iLastMotionTime < CompareTime) // Update cursor #ifdef _WIN32 - MSWSetCursor(false); - #else - {} + if(m_iLastMotionTime < CompareTime) // Update cursor + MSWSetCursor(false); #endif } } diff --git a/Source/Core/DolphinWX/Src/FrameAui.cpp b/Source/Core/DolphinWX/Src/FrameAui.cpp index a2ba9af60a..7cdaf35ef2 100644 --- a/Source/Core/DolphinWX/Src/FrameAui.cpp +++ b/Source/Core/DolphinWX/Src/FrameAui.cpp @@ -92,13 +92,13 @@ void CFrame::OnPaneClose(wxAuiManagerEvent& event) m_Mgr->Update(); } - // Enable and disable the log window void CFrame::OnToggleLogWindow(wxCommandEvent& event) { SConfig::GetInstance().m_InterfaceLogWindow = event.IsChecked(); DoToggleWindow(event.GetId(), event.IsChecked()); } + void CFrame::ToggleLogWindow(bool bShow, int i) { if (bShow) @@ -113,16 +113,15 @@ void CFrame::ToggleLogWindow(bool bShow, int i) // Hide pane if (!g_pCodeWindow) HidePane(); - - // Make sure the check is updated (if wxw isn't calling this func) - //GetMenuBar()->FindItem(IDM_LOGWINDOW)->Check(Show); } + // Enable and disable the console void CFrame::OnToggleConsole(wxCommandEvent& event) { SConfig::GetInstance().m_InterfaceConsole = event.IsChecked(); DoToggleWindow(event.GetId(), event.IsChecked()); } + void CFrame::ToggleConsole(bool bShow, int i) { #ifdef _WIN32 @@ -167,13 +166,8 @@ void CFrame::ToggleConsole(bool bShow, int i) // Hide pane if (!g_pCodeWindow) HidePane(); - - // Make sure the check is updated (if wxw isn't calling this func) - //GetMenuBar()->FindItem(IDM_CONSOLEWINDOW)->Check(Show); #endif } -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Notebooks @@ -332,10 +326,6 @@ void CFrame::OnAllowNotebookDnD(wxAuiNotebookEvent& event) event.Skip(); event.Allow(); ResizeConsole(); - - // wxAuiNotebook* Ctrl = (wxAuiNotebook*)event.GetEventObject(); - // If we drag away the last one the tab bar goes away and we can't add any panes to it - //if (Ctrl->GetPageCount() == 1) Ctrl->AddPage(CreateEmptyPanel(), wxT("<>"), true); } void CFrame::HidePane() { @@ -353,6 +343,7 @@ void CFrame::HidePane() m_Mgr->GetPane(wxT("Pane 1")).Show(); m_Mgr->Update(); } + SetSimplePaneSize(); } @@ -795,27 +786,24 @@ void CFrame::ResizeConsole() void CFrame::SetSimplePaneSize() { - wxArrayInt Pane, Size; - Pane.Add(0); Size.Add(50); - Pane.Add(1); Size.Add(50); + int x = 0, y = 0; - int iClientSize = this->GetSize().GetX(); - // Fix the pane sizes - for (u32 i = 0; i < Pane.size(); i++) - { - // Check limits - Size[i] = Limit(Size[i], 5, 95); - // Produce pixel width from percentage width - Size[i] = PercentageToPixels(Size[i], iClientSize); - // Update size - m_Mgr->GetPane(wxString::Format(wxT("Pane %i"), Pane[i])).BestSize(Size[i], -1).MinSize(Size[i], -1).MaxSize(Size[i], -1); - } + // Produce pixel width from percentage width + int Size = PercentageToPixels(50, this->GetSize().GetX()); + + IniFile ini; + ini.Load(LOGGER_CONFIG_FILE); + ini.Get("LogWindow", "x", &x, Size); + ini.Get("LogWindow", "y", &y, Size); + + // Update size + m_Mgr->GetPane(wxT("Pane 0")).BestSize(x, y).MinSize(x, y).MaxSize(x, y); + m_Mgr->GetPane(wxT("Pane 1")).BestSize(x, y).MinSize(x, y).MaxSize(x, y); m_Mgr->Update(); - for (u32 i = 0; i < Pane.size(); i++) - { - // Remove the size limits - m_Mgr->GetPane(wxString::Format(wxT("Pane %i"), Pane[i])).MinSize(-1, -1).MaxSize(-1, -1); - } + + // Set the position of the Pane + m_Mgr->GetPane(wxT("Pane 1")).MinSize(-1, -1).MaxSize(-1, -1); + m_Mgr->GetPane(wxT("Pane 0")).MinSize(-1, -1).MaxSize(-1, -1); } void CFrame::SetPaneSize() @@ -942,7 +930,6 @@ void CFrame::SaveLocal() ini.Get("Perspectives", "Active", &ActivePerspective, 5); SplitString(_Perspectives, ",", VPerspectives); - // for (u32 i = 0; i < VPerspectives.size(); i++) { SPerspectives Tmp; diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 51cd40b58d..15a066d345 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -118,9 +118,8 @@ void CFrame::CreateMenu() fileMenu->Append(wxID_REFRESH, _T("&Refresh List")); fileMenu->AppendSeparator(); fileMenu->Append(IDM_BROWSE, _T("&Browse for ISOs...")); - // fileMenu->AppendSeparator(); - // fileMenu->Append(IDM_RESTART, g_pCodeWindow ? _T("Restart in regular mode") : _T("Restart in debugging mode")); fileMenu->AppendSeparator(); + // fileMenu->Append(IDM_RESTART, g_pCodeWindow ? _T("Restart in regular &mode") : _T("&Restart in debugging &mode")); fileMenu->Append(wxID_EXIT, _T("E&xit\tAlt+F4")); m_MenuBar->Append(fileMenu, _T("&File")); @@ -216,18 +215,24 @@ void CFrame::CreateMenu() viewMenu->AppendSeparator(); } - viewMenu->AppendCheckItem(IDM_LISTWII, _T("Show Wii")); - viewMenu->Check(IDM_LISTWII, SConfig::GetInstance().m_ListWii); - viewMenu->AppendCheckItem(IDM_LISTGC, _T("Show GameCube")); - viewMenu->Check(IDM_LISTGC, SConfig::GetInstance().m_ListGC); - viewMenu->AppendCheckItem(IDM_LISTWAD, _T("Show Wad")); - viewMenu->Check(IDM_LISTWAD, SConfig::GetInstance().m_ListWad); - viewMenu->AppendCheckItem(IDM_LISTJAP, _T("Show JAP")); - viewMenu->Check(IDM_LISTJAP, SConfig::GetInstance().m_ListJap); - viewMenu->AppendCheckItem(IDM_LISTPAL, _T("Show PAL")); - viewMenu->Check(IDM_LISTPAL, SConfig::GetInstance().m_ListPal); - viewMenu->AppendCheckItem(IDM_LISTUSA, _T("Show USA")); - viewMenu->Check(IDM_LISTUSA, SConfig::GetInstance().m_ListUsa); + wxMenu *platformMenu = new wxMenu; + viewMenu->AppendSubMenu(platformMenu, _T("Show Platforms")); + platformMenu->AppendCheckItem(IDM_LISTWII, _T("Show Wii")); + platformMenu->Check(IDM_LISTWII, SConfig::GetInstance().m_ListWii); + platformMenu->AppendCheckItem(IDM_LISTGC, _T("Show GameCube")); + platformMenu->Check(IDM_LISTGC, SConfig::GetInstance().m_ListGC); + platformMenu->AppendCheckItem(IDM_LISTWAD, _T("Show Wad")); + platformMenu->Check(IDM_LISTWAD, SConfig::GetInstance().m_ListWad); + + wxMenu *regionMenu = new wxMenu; + viewMenu->AppendSubMenu(regionMenu, _T("Show Regions")); + regionMenu->AppendCheckItem(IDM_LISTJAP, _T("Show JAP")); + regionMenu->Check(IDM_LISTJAP, SConfig::GetInstance().m_ListJap); + regionMenu->AppendCheckItem(IDM_LISTPAL, _T("Show PAL")); + regionMenu->Check(IDM_LISTPAL, SConfig::GetInstance().m_ListPal); + regionMenu->AppendCheckItem(IDM_LISTUSA, _T("Show USA")); + regionMenu->Check(IDM_LISTUSA, SConfig::GetInstance().m_ListUsa); + viewMenu->AppendCheckItem(IDM_LISTDRIVES, _T("Show Drives")); viewMenu->Check(IDM_LISTDRIVES, SConfig::GetInstance().m_ListDrives); viewMenu->AppendSeparator(); @@ -276,8 +281,7 @@ void CFrame::PopulateToolbar(wxAuiToolBar* ToolBar) ToolBar->AddTool(IDM_CONFIG_DSP_PLUGIN, _T("DSP"), m_Bitmaps[Toolbar_PluginDSP], _T("DSP settings")); ToolBar->AddTool(IDM_CONFIG_PAD_PLUGIN, _T("Pad"), m_Bitmaps[Toolbar_PluginPAD], _T("Pad settings")); ToolBar->AddTool(IDM_CONFIG_WIIMOTE_PLUGIN, _T("Wiimote"), m_Bitmaps[Toolbar_Wiimote], _T("Wiimote settings")); - // FIXME: UGLY HACK!!! why doesn't get the right size without this line?!?!? - ToolBar->AddTool(IDM_CONFIG_WIIMOTE_PLUGIN, _T("Wiimote"), m_Bitmaps[Toolbar_Wiimote], _T("Wiimote settings")); + // after adding the buttons to the toolbar, must call Realize() to reflect // the changes ToolBar->Realize(); @@ -301,6 +305,12 @@ void CFrame::PopulateToolbarAui(wxAuiToolBar* ToolBar) // Delete and recreate the toolbar void CFrame::RecreateToolbar() { + if (m_ToolBar) + { + m_Mgr->DetachPane(m_ToolBar); + m_ToolBar->Destroy(); + } + m_ToolBar = new wxAuiToolBar(this, ID_TOOLBAR, wxDefaultPosition, wxDefaultSize, TOOLBAR_STYLE); PopulateToolbar(m_ToolBar); @@ -309,7 +319,7 @@ void CFrame::RecreateToolbar() ToolbarPane().Top(). LeftDockable(false).RightDockable(false).Floatable(false)); - if (g_pCodeWindow) + if (g_pCodeWindow && !m_ToolBarDebug) { m_ToolBarDebug = new wxAuiToolBar(this, ID_TOOLBAR_DEBUG, wxDefaultPosition, wxDefaultSize, TOOLBAR_STYLE); g_pCodeWindow->PopulateToolbar(m_ToolBarDebug); @@ -326,6 +336,8 @@ void CFrame::RecreateToolbar() ToolbarPane().Top(). LeftDockable(false).RightDockable(false).Floatable(false)); } + + UpdateGUI(); } void CFrame::InitBitmaps() @@ -425,7 +437,7 @@ void CFrame::InitBitmaps() } // Update in case the bitmap has been updated - //if (GetToolBar() != NULL) RecreateToolbar(); + if (m_ToolBar != NULL) RecreateToolbar(); aNormalFile = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16)); } @@ -865,10 +877,9 @@ void CFrame::UpdateGUI() bool Paused = Core::GetState() == Core::CORE_PAUSE; // Make sure that we have a toolbar - if (m_ToolBar != NULL) + if (m_ToolBar) { // Enable/disable the Config and Stop buttons - //GetToolBar()->EnableTool(IDM_CONFIG_MAIN, !initialized); m_ToolBar->EnableTool(wxID_OPEN, !Initialized); m_ToolBar->EnableTool(wxID_REFRESH, !Initialized); // Don't allow refresh when we don't show the list m_ToolBar->EnableTool(IDM_STOP, Running || Paused); @@ -890,9 +901,6 @@ void CFrame::UpdateGUI() m_pSubMenuLoad->Enable(Initialized); m_pSubMenuSave->Enable(Initialized); - // Let's enable it by default. - //m_pSubMenuFrameSkipping->Enable(initialized); - // Misc GetMenuBar()->FindItem(IDM_CHANGEDISC)->Enable(Initialized); if (DiscIO::CNANDContentManager::Access().GetNANDLoader(FULL_WII_MENU_DIR).IsValid()) @@ -900,7 +908,7 @@ void CFrame::UpdateGUI() if (Running) { - if (m_ToolBar != NULL) + if (m_ToolBar) { m_ToolBar->SetToolBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Pause]); m_ToolBar->SetToolShortHelp(IDM_PLAY, _("Pause")); @@ -910,7 +918,7 @@ void CFrame::UpdateGUI() } else { - if (m_ToolBar != NULL) + if (m_ToolBar) { m_ToolBar->SetToolBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Play]); m_ToolBar->SetToolShortHelp(IDM_PLAY, _("Play")); @@ -945,10 +953,11 @@ void CFrame::UpdateGUI() } } - // Commit changes to toolbar - if (m_ToolBar != NULL) m_ToolBar->Realize(); if (g_pCodeWindow) g_pCodeWindow->Update(); + // Commit changes to manager + if (m_ToolBar) + m_ToolBar->Refresh(); m_Mgr->Update(); } diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp index c38cfeb77a..83fc1405dd 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.cpp +++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp @@ -657,12 +657,13 @@ void CISOProperties::ExportDir(const char* _rFullPath, const char* _rExportFolde DEBUG_LOG(DISCIO,"Dir found from %u to %u\nextracting to:\n%s",index[0],index[1],_rExportFolder); } - wxProgressDialog dialog(index[0] ? _T("Extracting Directory") : _T("Extracting All Files"), + wxString dialogTitle = index[0] ? _T("Extracting Directory") : _T("Extracting All Files"); + wxProgressDialog dialog(dialogTitle, _T("Extracting..."), index[1], // range this, // parent - wxPD_APP_MODAL | wxPD_AUTO_HIDE | wxPD_ELAPSED_TIME | - wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME | + wxPD_APP_MODAL | wxPD_AUTO_HIDE | wxPD_CAN_ABORT | + wxPD_ELAPSED_TIME | wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME | wxPD_SMOOTH // - makes indeterminate mode bar on WinXP very small ); dialog.CenterOnParent(); @@ -670,6 +671,8 @@ void CISOProperties::ExportDir(const char* _rFullPath, const char* _rExportFolde // Extraction for (u32 i = index[0]; i < index[1]; i++) { + dialog.SetTitle(wxString::Format(_T("%s : %d%%"), dialogTitle, + (u32)(((float)(i - index[0]) / (float)(index[1] - index[0])) * 100))); if (!dialog.Update(i, wxString::Format(_T("Extracting %s"), wxString::FromAscii(fst[i]->m_FullPath)))) break; diff --git a/Source/Core/DolphinWX/Src/LogWindow.cpp b/Source/Core/DolphinWX/Src/LogWindow.cpp index 042abcb116..ee611567ba 100644 --- a/Source/Core/DolphinWX/Src/LogWindow.cpp +++ b/Source/Core/DolphinWX/Src/LogWindow.cpp @@ -161,10 +161,9 @@ void CLogWindow::OnClose(wxCloseEvent& event) void CLogWindow::SaveSettings() { IniFile ini; - ini.Set("LogWindow", "x", GetPosition().x); - ini.Set("LogWindow", "y", GetPosition().y); - ini.Set("LogWindow", "w", GetSize().GetWidth()); - ini.Set("LogWindow", "h", GetSize().GetHeight()); + ini.Set("LogWindow", "x", Parent->m_Mgr->GetPane(wxT("Pane 1")).rect.GetWidth()); + ini.Set("LogWindow", "y", Parent->m_Mgr->GetPane(wxT("Pane 1")).rect.GetHeight()); + ini.Set("LogWindow", "pos", Parent->m_Mgr->GetPane(wxT("Pane 1")).dock_direction); ini.Set("Options", "Verbosity", m_verbosity->GetSelection() + 1); ini.Set("Options", "Font", m_FontChoice->GetSelection()); ini.Set("Options", "WriteToFile", m_writeFile); @@ -179,12 +178,7 @@ void CLogWindow::LoadSettings() { IniFile ini; ini.Load(LOGGER_CONFIG_FILE); - int x,y,w,h,verbosity,font; - ini.Get("LogWindow", "x", &x, GetPosition().x); - ini.Get("LogWindow", "y", &y, GetPosition().y); - ini.Get("LogWindow", "w", &w, GetSize().GetWidth()); - ini.Get("LogWindow", "h", &h, GetSize().GetHeight()); - SetSize(x, y, w, h); + int verbosity,font; ini.Get("Options", "Verbosity", &verbosity, 0); if (verbosity < 1) verbosity = 1; if (verbosity > MAX_LOGLEVEL) verbosity = MAX_LOGLEVEL; diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index 8b44d65b51..6baec96c73 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -338,20 +338,27 @@ bool DolphinApp::OnInit() #ifdef _DEBUG const char *title = "Dolphin Debug SVN R " SVN_REV_STR; #else - const char *title = "Dolphin SVN R " SVN_REV_STR; + #ifdef DEBUGFAST + const char *title = "Dolphin Debugfast SVN R " SVN_REV_STR; + #else + const char *title = "Dolphin SVN R " SVN_REV_STR; + #endif #endif - // If we are debugging let use save the main window position and size - IniFile ini; - ini.Load(DEBUGGER_CONFIG_FILE); - int x, y, w, h; - ini.Get("MainWindow", "x", &x, 100); - ini.Get("MainWindow", "y", &y, 100); - ini.Get("MainWindow", "w", &w, 800); - ini.Get("MainWindow", "h", &h, 600); + if (UseDebugger) { + // If we are debugging let user save the main window position and size + IniFile ini; + ini.Load(DEBUGGER_CONFIG_FILE); + int x, y, w, h; + + ini.Get("MainWindow", "x", &x, 100); + ini.Get("MainWindow", "y", &y, 100); + ini.Get("MainWindow", "w", &w, 800); + ini.Get("MainWindow", "h", &h, 600); + main_frame = new CFrame((wxFrame*)NULL, wxID_ANY, wxString::FromAscii(title), wxPoint(x, y), wxSize(w, h), true, UseLogger); }