From a27f4a9b86c06515f2436026b592c4885e7c9bb3 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Mon, 9 Mar 2009 18:34:33 +0000 Subject: [PATCH] - MGR: Restore state even if we are not going to display the window. Otherwise when restoring from the system tray we'll end up on the resources tab. - MGR: Save state before exit. clientgui/ BOINCBaseFrame.cpp BOINCGUIApp.cpp svn path=/trunk/boinc/; revision=17565 --- checkin_notes | 10 ++++++++++ clientgui/BOINCBaseFrame.cpp | 4 ++++ clientgui/BOINCGUIApp.cpp | 6 ++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/checkin_notes b/checkin_notes index 9bb5e7507c..cee8baf715 100644 --- a/checkin_notes +++ b/checkin_notes @@ -2935,3 +2935,13 @@ Rom 9 Mar 2009 ViewStatistics.cpp win_build/ boincmgr_curl.vcproj + +Rom 9 Mar 2009 + - MGR: Restore state even if we are not going to display the + window. Otherwise when restoring from the system tray + we'll end up on the resources tab. + - MGR: Save state before exit. + + clientgui/ + BOINCBaseFrame.cpp + BOINCGUIApp.cpp diff --git a/clientgui/BOINCBaseFrame.cpp b/clientgui/BOINCBaseFrame.cpp index 580357f9b3..2e11a59bca 100644 --- a/clientgui/BOINCBaseFrame.cpp +++ b/clientgui/BOINCBaseFrame.cpp @@ -340,6 +340,10 @@ void CBOINCBaseFrame::OnExit(wxCommandEvent& WXUNUSED(event)) { if (wxGetApp().ConfirmExit()) { + // Save state before exiting + CFrameEvent eventSaveState(wxEVT_FRAME_SAVESTATE, this); + ProcessEvent(eventSaveState); + #ifdef __WXMSW__ CMainDocument* pDoc = wxGetApp().GetDocument(); diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index 942432978f..4d71707947 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -879,9 +879,11 @@ bool CBOINCGUIApp::SetActiveGUI(int iGUISelection, bool bShowWindow) { } // Show the new frame if needed - if (pNewFrame && bShowWindow) { + if (pNewFrame) { pNewFrame->FireRestoreState(); - pNewFrame->Show(); + if (bShowWindow) { + pNewFrame->Show(); + } } // Delete the old one if it exists