From 04043586da2656c286a739501a2de1e399bc0c4a Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Tue, 25 May 2010 14:22:15 +0000 Subject: [PATCH] Console log defaults to open/on now in all build types (not just devel/debug). Better fix for the bios selector thingie. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3078 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/gui/AppConfig.cpp | 2 +- pcsx2/gui/ConsoleLogger.cpp | 21 +++++++++++---------- pcsx2/gui/ConsoleLogger.h | 2 -- pcsx2/gui/MainFrame.cpp | 2 -- pcsx2/gui/Panels/BiosSelectorPanel.cpp | 6 +++--- 5 files changed, 15 insertions(+), 18 deletions(-) diff --git a/pcsx2/gui/AppConfig.cpp b/pcsx2/gui/AppConfig.cpp index 5ed4b747ec..631416451c 100644 --- a/pcsx2/gui/AppConfig.cpp +++ b/pcsx2/gui/AppConfig.cpp @@ -487,7 +487,7 @@ AppConfig::ConsoleLogOptions::ConsoleLogOptions() : DisplayPosition( wxDefaultPosition ) , DisplaySize( wxSize( 680, 560 ) ) { - Visible = false; + Visible = true; AutoDock = true; FontSize = 8; } diff --git a/pcsx2/gui/ConsoleLogger.cpp b/pcsx2/gui/ConsoleLogger.cpp index 218559c27a..f1f84733f3 100644 --- a/pcsx2/gui/ConsoleLogger.cpp +++ b/pcsx2/gui/ConsoleLogger.cpp @@ -421,14 +421,6 @@ void ConsoleLogFrame::Newline() Write( Color_Current, L"\n" ); } -void ConsoleLogFrame::DoClose() -{ - // instead of closing just hide the window to be able to Show() it later - Show(false); - if( wxWindow* main = GetParent() ) - wxStaticCast( main, MainEmuFrame )->OnLogBoxHidden(); -} - void ConsoleLogFrame::DockedMove() { SetPosition( m_conf.DisplayPosition ); @@ -504,9 +496,18 @@ void ConsoleLogFrame::OnActivate( wxActivateEvent& evt ) void ConsoleLogFrame::OnCloseWindow(wxCloseEvent& event) { if( event.CanVeto() ) - DoClose(); + { + // instead of closing just hide the window to be able to Show() it later + Show( false ); + + // Can't do this via a Connect() on the MainFrame because Close events are not commands, + // and thus do not propagate up/down the event chain. + if( wxWindow* main = GetParent() ) + wxStaticCast( main, MainEmuFrame )->OnLogBoxHidden(); + } else { + // This is sent when the app is exiting typically, so do a full close. m_threadlogger = NULL; wxGetApp().OnProgramLogClosed( GetId() ); event.Skip(); @@ -520,7 +521,7 @@ void ConsoleLogFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) void ConsoleLogFrame::OnClose( wxCommandEvent& event ) { - DoClose(); + Close( false ); } void ConsoleLogFrame::OnSave(wxCommandEvent& WXUNUSED(event)) diff --git a/pcsx2/gui/ConsoleLogger.h b/pcsx2/gui/ConsoleLogger.h index 34574a55f9..f19077d230 100644 --- a/pcsx2/gui/ConsoleLogger.h +++ b/pcsx2/gui/ConsoleLogger.h @@ -256,8 +256,6 @@ protected: void OnFlushUnlockerTimer( wxTimerEvent& evt ); void OnFlushEvent( wxCommandEvent& event ); - // common part of OnClose() and OnCloseWindow() - virtual void DoClose(); void DoFlushQueue(); void DoFlushEvent( bool isPending ); diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index d3ed28f833..b10157f76c 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -469,9 +469,7 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title) ConnectMenus(); Connect( wxEVT_MOVE, wxMoveEventHandler (MainEmuFrame::OnMoveAround) ); Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler (MainEmuFrame::OnCloseWindow) ); - Connect( wxEVT_SET_FOCUS, wxFocusEventHandler (MainEmuFrame::OnFocus) ); - Connect( wxEVT_ACTIVATE, wxActivateEventHandler (MainEmuFrame::OnActivate) ); PushEventHandler( &wxGetApp().GetRecentIsoManager() ); diff --git a/pcsx2/gui/Panels/BiosSelectorPanel.cpp b/pcsx2/gui/Panels/BiosSelectorPanel.cpp index 49df0420ef..5497fce6ac 100644 --- a/pcsx2/gui/Panels/BiosSelectorPanel.cpp +++ b/pcsx2/gui/Panels/BiosSelectorPanel.cpp @@ -114,12 +114,12 @@ Panels::BiosSelectorPanel::~BiosSelectorPanel() throw () void Panels::BiosSelectorPanel::Apply() { + // User never visited this tab, so there's nothing to apply. + if( !m_BiosList ) return; + int sel = m_ComboBox->GetSelection(); if( sel == wxNOT_FOUND ) { - // If we already have a bios, lets not worry about it. - if (g_Conf->BaseFilenames.Bios.IsOk() && wxFileName::FileExists(g_Conf->BaseFilenames.Bios.GetFullPath()) && !g_Conf->BaseFilenames.Bios.IsDir()) return; - throw Exception::CannotApplySettings( this, // English Log L"User did not specify a valid BIOS selection.",