2008-08-06 18:36:30 +00:00
// This file is part of BOINC.
2005-01-20 23:22:22 +00:00
// http://boinc.berkeley.edu
2017-01-06 09:53:47 +00:00
// Copyright (C) 2017 University of California
2004-05-17 22:15:10 +00:00
//
2008-08-06 18:36:30 +00:00
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
2004-04-10 09:11:03 +00:00
//
2008-08-06 18:36:30 +00:00
// BOINC is distributed in the hope that it will be useful,
2005-01-20 23:22:22 +00:00
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
2004-05-17 22:15:10 +00:00
//
2008-08-06 18:36:30 +00:00
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
2004-04-10 09:11:03 +00:00
2004-04-11 04:37:10 +00:00
# if defined(__GNUG__) && !defined(__APPLE__)
# pragma implementation "BOINCGUIApp.h"
# endif
2004-04-10 09:11:03 +00:00
2005-07-05 00:06:47 +00:00
# ifdef __WXMAC__
# include <Carbon/Carbon.h>
2006-06-13 09:08:00 +00:00
# include "filesys.h"
# include "util.h"
2016-12-02 12:08:43 +00:00
# include "mac_util.h"
2007-10-09 00:34:38 +00:00
# include "sandbox.h"
2005-07-05 00:06:47 +00:00
# endif
2004-04-11 04:37:10 +00:00
# include "stdwx.h"
2005-02-01 00:54:06 +00:00
# include "diagnostics.h"
2006-01-23 08:47:05 +00:00
# include "network.h"
2006-10-20 15:00:14 +00:00
# include "util.h"
# include "mfile.h"
# include "miofile.h"
# include "parse.h"
2009-11-13 21:23:15 +00:00
# include "idlemon.h"
2006-01-19 12:22:22 +00:00
# include "Events.h"
2006-10-20 15:00:14 +00:00
# include "LogBOINC.h"
2006-06-23 08:20:08 +00:00
# include "BOINCGUIApp.h"
2006-10-20 15:00:14 +00:00
# include "SkinManager.h"
# include "MainDocument.h"
2008-01-30 06:09:34 +00:00
# include "BOINCClientManager.h"
2006-10-20 15:00:14 +00:00
# include "BOINCTaskBar.h"
# include "BOINCBaseFrame.h"
2006-06-24 05:00:57 +00:00
# include "AdvancedFrame.h"
2008-11-04 08:08:16 +00:00
# include "DlgExitMessage.h"
2009-12-22 20:15:55 +00:00
# include "DlgEventLog.h"
2010-08-11 12:18:07 +00:00
# include "procinfo.h"
2011-01-27 14:36:49 +00:00
# include "sg_BoincSimpleFrame.h"
2008-11-04 08:08:16 +00:00
2004-04-10 09:11:03 +00:00
2009-09-11 20:38:05 +00:00
bool s_bSkipExitConfirmation = false ;
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
2014-06-24 17:45:53 +00:00
2014-03-05 22:23:40 +00:00
DEFINE_EVENT_TYPE ( wxEVT_RPC_FINISHED )
IMPLEMENT_APP ( CBOINCGUIApp )
IMPLEMENT_DYNAMIC_CLASS ( CBOINCGUIApp , wxApp )
BEGIN_EVENT_TABLE ( CBOINCGUIApp , wxApp )
EVT_ACTIVATE_APP ( CBOINCGUIApp : : OnActivateApp )
EVT_RPC_FINISHED ( CBOINCGUIApp : : OnRPCFinished )
2014-03-06 12:53:19 +00:00
# ifndef __WXMAC__
2014-03-05 22:23:40 +00:00
EVT_END_SESSION ( CBOINCGUIApp : : OnEndSession )
2014-03-06 12:53:19 +00:00
# endif
2014-03-05 22:23:40 +00:00
END_EVENT_TABLE ( )
2006-10-20 15:00:14 +00:00
bool CBOINCGUIApp : : OnInit ( ) {
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
// Initialize globals
# ifdef SANDBOX
g_use_sandbox = true ;
# else
g_use_sandbox = false ;
# endif
s_bSkipExitConfirmation = false ;
2011-11-03 02:35:04 +00:00
m_bFilterEvents = false ;
2013-08-28 05:38:00 +00:00
m_bAboutDialogIsOpen = false ;
2005-12-28 12:33:18 +00:00
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
// Initialize class variables
2014-03-06 19:47:00 +00:00
m_pInstanceChecker = NULL ;
2006-10-25 21:38:06 +00:00
m_pLocale = NULL ;
m_pSkinManager = NULL ;
2006-10-20 15:00:14 +00:00
m_pFrame = NULL ;
2006-10-25 21:38:06 +00:00
m_pDocument = NULL ;
m_pTaskBarIcon = NULL ;
2009-12-22 20:15:55 +00:00
m_pEventLog = NULL ;
2015-01-16 11:22:10 +00:00
m_bEventLogWasActive = false ;
m_bProcessingActivateAppEvent = false ;
2006-10-25 21:38:06 +00:00
# ifdef __WXMAC__
2013-08-23 12:02:06 +00:00
m_pMacDockIcon = NULL ;
2006-10-25 21:38:06 +00:00
# endif
2010-10-13 21:02:42 +00:00
m_strBOINCMGRExecutableName = wxEmptyString ;
2009-07-25 05:35:27 +00:00
m_strBOINCMGRRootDirectory = wxEmptyString ;
m_strBOINCMGRDataDirectory = wxEmptyString ;
2010-08-07 06:48:25 +00:00
m_strHostNameArg = wxEmptyString ;
m_strPasswordArg = wxEmptyString ;
m_iRPCPortArg = GUI_RPC_PORT ;
2009-07-25 05:35:27 +00:00
m_strBOINCArguments = wxEmptyString ;
2014-02-18 05:36:03 +00:00
m_strISOLanguageCode = wxEmptyString ;
2006-10-20 15:00:14 +00:00
m_bGUIVisible = true ;
2009-01-30 09:25:35 +00:00
m_bDebugSkins = false ;
2010-10-06 11:13:07 +00:00
m_bMultipleInstancesOK = false ;
2008-11-04 09:33:03 +00:00
m_bBOINCMGRAutoStarted = false ;
m_iBOINCMGRDisableAutoStart = 0 ;
2008-11-04 08:08:16 +00:00
m_iShutdownCoreClient = 0 ;
m_iDisplayExitDialog = 1 ;
2017-04-15 21:30:47 +00:00
m_iDisplayShutdownConnectedClientDialog = 1 ;
2006-10-20 15:00:14 +00:00
m_iGUISelected = BOINC_SIMPLEGUI ;
2008-08-20 16:07:06 +00:00
m_bSafeMessageBoxDisplayed = 0 ;
2015-07-27 11:44:56 +00:00
m_bRunDaemon = true ;
m_bNeedRunDaemon = true ;
2005-12-28 12:33:18 +00:00
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
// Initialize local variables
int iErrorCode = 0 ;
2014-06-24 17:45:53 +00:00
int iDesiredLanguageCode = 0 ;
2010-07-22 10:59:26 +00:00
bool bOpenEventLog = false ;
2008-11-04 08:08:16 +00:00
wxString strDesiredSkinName = wxEmptyString ;
2017-04-30 05:45:44 +00:00
# ifdef SANDBOX
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
wxString strDialogMessage = wxEmptyString ;
2017-04-30 05:45:44 +00:00
# endif
2008-11-04 08:08:16 +00:00
bool success = false ;
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
2014-03-05 18:57:44 +00:00
2009-07-25 05:35:27 +00:00
// Configure wxWidgets platform specific code
# ifdef __WXMSW__
wxSystemOptions : : SetOption ( wxT ( " msw.staticbox.optimized-paint " ) , 0 ) ;
# endif
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
# ifdef __WXMAC__
// In wxMac-2.8.7, default wxListCtrl::RefreshItem() does not work
// so use traditional generic implementation.
// This has been fixed in wxMac-2.8.8, but the Mac native implementation:
// - takes 3 times the CPU time as the Mac generic version.
// - seems to always redraw entire control even if asked to refresh only one row.
// - causes major flicker of progress bars, (probably due to full redraws.)
wxSystemOptions : : SetOption ( wxT ( " mac.listctrl.always_use_generic " ) , 1 ) ;
2009-12-18 22:44:10 +00:00
AEInstallEventHandler ( kCoreEventClass , kAEQuitApplication , NewAEEventHandlerUPP ( ( AEEventHandlerProcPtr ) QuitAppleEventHandler ) , 0 , false ) ;
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
# endif
2006-06-10 00:17:52 +00:00
2009-07-25 05:35:27 +00:00
// Commandline parsing is done in wxApp::OnInit()
if ( ! wxApp : : OnInit ( ) ) {
return false ;
}
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
if ( g_use_sandbox ) {
wxCHANGE_UMASK ( 2 ) ; // Set file creation mask to be writable by both user and group
// Our umask will be inherited by all our child processes
}
2006-01-23 13:31:57 +00:00
// Setup application and company information
SetAppName ( wxT ( " BOINC Manager " ) ) ;
SetVendorName ( wxT ( " Space Sciences Laboratory, U.C. Berkeley " ) ) ;
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
2006-01-23 13:31:57 +00:00
// Initialize the configuration storage module
m_pConfig = new wxConfig ( GetAppName ( ) ) ;
wxConfigBase : : Set ( m_pConfig ) ;
wxASSERT ( m_pConfig ) ;
2005-02-02 22:20:25 +00:00
2008-11-04 09:33:03 +00:00
// Restore Application State
2009-03-09 18:02:37 +00:00
m_pConfig - > SetPath ( wxT ( " / " ) ) ;
2008-11-05 19:53:32 +00:00
m_pConfig - > Read ( wxT ( " AutomaticallyShutdownClient " ) , & m_iShutdownCoreClient , 0L ) ;
2008-11-04 09:33:03 +00:00
m_pConfig - > Read ( wxT ( " DisplayShutdownClientDialog " ) , & m_iDisplayExitDialog , 1L ) ;
2017-04-15 21:30:47 +00:00
m_pConfig - > Read ( wxT ( " DisplayShutdownConnectedClientDialog " ) , & m_iDisplayShutdownConnectedClientDialog , 1L ) ;
2008-11-04 09:33:03 +00:00
m_pConfig - > Read ( wxT ( " DisableAutoStart " ) , & m_iBOINCMGRDisableAutoStart , 0L ) ;
2014-06-18 15:14:29 +00:00
m_pConfig - > Read ( wxT ( " LanguageISO " ) , & m_strISOLanguageCode , wxT ( " " ) ) ;
2008-11-04 09:33:03 +00:00
m_pConfig - > Read ( wxT ( " GUISelection " ) , & m_iGUISelected , BOINC_SIMPLEGUI ) ;
2010-07-22 10:59:26 +00:00
m_pConfig - > Read ( wxT ( " EventLogOpen " ) , & bOpenEventLog ) ;
2015-07-27 11:44:56 +00:00
m_pConfig - > Read ( wxT ( " RunDaemon " ) , & m_bRunDaemon , 1L ) ;
2008-11-04 09:33:03 +00:00
2015-07-27 11:44:56 +00:00
// Detect if the daemon should be launched
m_bNeedRunDaemon = m_bNeedRunDaemon & & m_bRunDaemon ;
2008-11-04 09:33:03 +00:00
// Should we abort the BOINC Manager startup process?
if ( m_bBOINCMGRAutoStarted & & m_iBOINCMGRDisableAutoStart ) {
return false ;
}
2010-10-13 21:02:42 +00:00
// Detect where BOINC Manager executable name.
DetectExecutableName ( ) ;
2009-07-25 05:35:27 +00:00
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
// Detect where BOINC Manager was installed too.
DetectRootDirectory ( ) ;
2007-11-30 16:40:02 +00:00
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
// Detect where the BOINC Data files are.
DetectDataDirectory ( ) ;
2006-01-23 13:16:28 +00:00
2005-03-25 12:23:30 +00:00
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
// Switch the current directory to the BOINC Data directory
if ( ! GetDataDirectory ( ) . IsEmpty ( ) ) {
2008-10-30 01:55:11 +00:00
success = wxSetWorkingDirectory ( GetDataDirectory ( ) ) ;
if ( ! success ) {
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
if ( ! g_use_sandbox ) {
if ( ! wxDirExists ( GetDataDirectory ( ) ) ) {
2008-10-30 01:55:11 +00:00
success = wxMkdir ( GetDataDirectory ( ) , 0777 ) ; // Does nothing if dir exists
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
}
}
2006-08-01 12:36:19 +00:00
}
2005-03-25 12:23:30 +00:00
}
2008-10-30 01:55:11 +00:00
if ( ! success ) iErrorCode = - 1016 ;
2009-06-12 11:12:47 +00:00
// Initialize the BOINC Diagnostics Framework
int dwDiagnosticsFlags =
2014-03-07 04:02:04 +00:00
# ifdef _DEBUG
2009-06-12 11:12:47 +00:00
BOINC_DIAG_HEAPCHECKENABLED |
BOINC_DIAG_MEMORYLEAKCHECKENABLED |
2014-03-07 04:02:04 +00:00
# endif
BOINC_DIAG_DUMPCALLSTACKENABLED |
BOINC_DIAG_PERUSERLOGFILES |
2009-06-12 11:12:47 +00:00
BOINC_DIAG_REDIRECTSTDERR |
BOINC_DIAG_REDIRECTSTDOUT |
BOINC_DIAG_TRACETOSTDOUT ;
2014-03-07 04:02:04 +00:00
diagnostics_init ( dwDiagnosticsFlags , " stdoutgui " , " stderrgui " ) ;
2009-06-12 11:12:47 +00:00
// Enable Logging and Trace Masks
m_pLog = new wxLogBOINC ( ) ;
wxLog : : SetActiveTarget ( m_pLog ) ;
m_pLog - > AddTraceMask ( wxT ( " Function Start/End " ) ) ;
m_pLog - > AddTraceMask ( wxT ( " Function Status " ) ) ;
2009-10-31 07:45:44 +00:00
// Initialize the internationalization module
# ifdef __WXMSW__
// On Windows, set all locales for this thread on a per-thread basis
_configthreadlocale ( _ENABLE_PER_THREAD_LOCALE ) ;
# endif
m_pLocale = new wxLocale ( ) ;
wxASSERT ( m_pLocale ) ;
2014-06-18 15:14:29 +00:00
//
if ( m_strISOLanguageCode . IsEmpty ( ) ) {
2014-06-24 17:45:53 +00:00
iDesiredLanguageCode = wxLANGUAGE_DEFAULT ;
m_pLocale - > Init ( iDesiredLanguageCode ) ;
2014-06-18 15:14:29 +00:00
m_strISOLanguageCode = m_pLocale - > GetCanonicalName ( ) ;
} else {
m_pLocale - > Init ( wxLocale : : FindLanguageInfo ( m_strISOLanguageCode ) - > Language ) ;
}
2009-10-31 07:45:44 +00:00
// Look for the localization files by absolute and relative locations.
// preference given to the absolute location.
if ( ! m_strBOINCMGRRootDirectory . IsEmpty ( ) ) {
m_pLocale - > AddCatalogLookupPathPrefix (
wxString ( m_strBOINCMGRRootDirectory + wxT ( " locale " ) )
) ;
}
m_pLocale - > AddCatalogLookupPathPrefix ( wxT ( " locale " ) ) ;
m_pLocale - > AddCatalog ( wxT ( " BOINC-Manager " ) ) ;
2010-07-13 16:02:23 +00:00
m_pLocale - > AddCatalog ( wxT ( " BOINC-Client " ) ) ;
2011-12-16 10:27:30 +00:00
m_pLocale - > AddCatalog ( wxT ( " BOINC-Web " ) ) ;
2009-10-31 07:45:44 +00:00
InitSupportedLanguages ( ) ;
// Note: JAWS for Windows will only speak the context-sensitive
// help if you use this help provider:
wxHelpProvider : : Set ( new wxHelpControllerHelpProvider ( ) ) ;
2012-01-17 09:38:32 +00:00
// Enable known image types
wxInitAllImageHandlers ( ) ;
// Initialize the skin manager
m_pSkinManager = new CSkinManager ( m_bDebugSkins ) ;
wxASSERT ( m_pSkinManager ) ;
// Load desired manager skin
m_pConfig - > Read ( wxT ( " Skin " ) , & strDesiredSkinName , m_pSkinManager - > GetDefaultSkinName ( ) ) ;
m_pSkinManager - > ReloadSkin ( strDesiredSkinName ) ;
2006-06-14 10:45:42 +00:00
# ifdef SANDBOX
2006-08-01 12:36:19 +00:00
// Make sure owners, groups and permissions are correct for the current setting of g_use_sandbox
2017-01-06 09:53:47 +00:00
//
// NOTE: GDB and LLDB can't attach to applications which are running as
// a different user or group.
// Normally, the Mac Development (Debug) builds do not define SANDBOX, so
// check_security() is never called. However, it is possible to use GDB
// or LLDB on sandbox-specific code, as long as the code is run as the
// current user (i.e., not as boinc_master or boinc_project), and the
// current user is a member of both groups boinc_master and boinc_project.
// However, this has not been thoroughly tested. Please see the comments
// in SetupSecurity.cpp and check_security.cpp for more details.
//
2012-01-17 09:38:32 +00:00
char path_to_error [ MAXPATHLEN ] ;
path_to_error [ 0 ] = ' \0 ' ;
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
if ( ! iErrorCode ) {
2013-06-04 03:24:48 +00:00
iErrorCode = check_security (
g_use_sandbox , true , path_to_error , sizeof ( path_to_error )
) ;
2006-07-28 09:05:54 +00:00
}
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
if ( iErrorCode ) {
ShowApplication ( true ) ;
2009-09-02 02:11:03 +00:00
if ( iErrorCode = = - 1099 ) {
2017-01-06 09:53:47 +00:00
# if (defined(__WXMAC__) && defined (_DEBUG))
strDialogMessage . Printf (
" To debug with sandbox security enabled, the current user \n "
" must be a member of both groups boinc_master and boinc_project. "
) ;
# else // ! (defined(__WXMAC__) && defined (_DEBUG))
2012-01-17 09:38:32 +00:00
strDialogMessage . Printf (
2017-07-17 03:57:15 +00:00
_ ( " You currently are not authorized to manage %s. \n \n To run %s as this user, please: \n - reinstall %s answering \" Yes \" to the question about non-administrative users \n or \n - contact your administrator to add you to the 'boinc_master' user group. " ) ,
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationShortName ( ) . c_str ( ) ,
2012-01-17 09:38:32 +00:00
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationShortName ( ) . c_str ( ) ,
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationShortName ( ) . c_str ( )
) ;
2017-01-06 09:53:47 +00:00
# endif // ! (defined(__WXMAC__) && defined (_DEBUG))
2009-09-02 02:11:03 +00:00
} else {
2012-01-17 09:38:32 +00:00
strDialogMessage . Printf (
2012-01-17 10:37:38 +00:00
_ ( " %s ownership or permissions are not set properly; please reinstall %s. \n (Error code %d " ) ,
2012-01-17 09:38:32 +00:00
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationShortName ( ) . c_str ( ) ,
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationShortName ( ) . c_str ( ) ,
2012-01-17 10:37:38 +00:00
iErrorCode
2012-01-17 09:38:32 +00:00
) ;
2012-01-17 10:37:38 +00:00
if ( path_to_error [ 0 ] ) {
strDialogMessage + = _ ( " at " ) ;
strDialogMessage + = wxString : : FromUTF8 ( path_to_error ) ;
}
strDialogMessage + = _ ( " ) " ) ;
2013-10-22 10:56:48 +00:00
fprintf ( stderr , " %s \n " , ( const char * ) strDialogMessage . utf8_str ( ) ) ;
2009-09-02 02:11:03 +00:00
}
2012-10-16 19:56:34 +00:00
2012-01-17 09:38:32 +00:00
wxMessageDialog * pDlg = new wxMessageDialog (
NULL ,
strDialogMessage ,
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationName ( ) ,
wxOK
) ;
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
2006-06-14 10:45:42 +00:00
pDlg - > ShowModal ( ) ;
if ( pDlg )
pDlg - > Destroy ( ) ;
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
2006-06-14 10:45:42 +00:00
return false ;
}
2008-10-30 01:55:11 +00:00
# endif // SANDBOX
2006-01-23 08:47:05 +00:00
2009-10-31 07:45:44 +00:00
2008-07-17 10:00:43 +00:00
# ifdef __WXMSW__
2008-07-16 16:55:46 +00:00
// Perform any last minute checks that should keep the manager
// from starting up.
wxString strRebootPendingFile =
GetRootDirectory ( ) + wxFileName : : GetPathSeparator ( ) + wxT ( " RebootPending.txt " ) ;
2010-09-28 19:23:57 +00:00
if ( wxFile : : Exists ( strRebootPendingFile ) ) {
2008-07-16 16:55:46 +00:00
wxMessageDialog dialog (
NULL ,
_ ( " A reboot is required in order for BOINC to run properly. \n Please reboot your computer and try again. " ) ,
_ ( " BOINC Manager " ) ,
wxOK | wxICON_ERROR
) ;
dialog . ShowModal ( ) ;
return false ;
}
2008-07-17 10:00:43 +00:00
# endif
2008-07-16 16:55:46 +00:00
2014-09-08 10:59:35 +00:00
# ifdef __WXMAC__
2016-12-02 12:08:43 +00:00
// Prevent a situation where wxSingleInstanceChecker lock file
// from last login auto start (with same pid) was not deleted.
// This path must match that in DetectDuplicateInstance()
wxString lockFilePath = wxString ( wxFileName : : GetHomeDir ( ) +
" /Library/Application Support/BOINC/ " +
wxTheApp - > GetAppName ( ) +
' - ' + wxGetUserId ( )
2014-09-08 10:59:35 +00:00
) ;
2016-12-02 12:08:43 +00:00
if ( WasFileModifiedBeforeSystemBoot ( ( char * ) ( const char * ) lockFilePath . utf8_str ( ) ) ) {
2014-09-08 10:59:35 +00:00
boinc_delete_file ( lockFilePath . utf8_str ( ) ) ;
}
# endif
2010-10-14 18:16:24 +00:00
// Detect if BOINC Manager is already running, if so, bring it into the
// foreground and then exit.
2014-03-07 08:30:48 +00:00
if ( DetectDuplicateInstance ( ) ) {
2010-10-14 18:16:24 +00:00
return false ;
}
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
2004-04-10 09:11:03 +00:00
// Initialize the main document
m_pDocument = new CMainDocument ( ) ;
2005-04-27 06:55:28 +00:00
wxASSERT ( m_pDocument ) ;
2004-04-10 09:11:03 +00:00
2004-10-23 23:40:11 +00:00
m_pDocument - > OnInit ( ) ;
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
2007-06-12 18:28:53 +00:00
// Is there a condition in which the Simple GUI should not be used?
if ( BOINC_SIMPLEGUI = = m_iGUISelected ) {
2007-08-18 00:22:21 +00:00
// Screen too small?
if ( wxGetDisplaySize ( ) . GetHeight ( ) < 600 ) {
2007-06-12 18:28:53 +00:00
m_iGUISelected = BOINC_ADVANCEDGUI ;
}
}
2008-01-30 12:30:20 +00:00
2004-10-23 07:13:18 +00:00
// Initialize the task bar icon
2012-03-31 12:34:43 +00:00
m_pTaskBarIcon = new CTaskBarIcon (
2006-10-20 15:00:14 +00:00
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationName ( ) ,
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationIcon ( ) ,
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationDisconnectedIcon ( ) ,
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationSnoozeIcon ( )
2013-08-23 12:02:06 +00:00
# ifdef __WXMAC__
, wxTBI_CUSTOM_STATUSITEM
# endif
2005-12-28 12:33:18 +00:00
) ;
2014-02-14 21:05:42 +00:00
wxASSERT ( m_pTaskBarIcon ) ;
2012-03-31 12:34:43 +00:00
# ifdef __WXMAC__
2013-08-23 12:02:06 +00:00
m_pMacDockIcon = new CTaskBarIcon (
2006-10-20 15:00:14 +00:00
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationName ( ) ,
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationIcon ( ) ,
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationDisconnectedIcon ( ) ,
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationSnoozeIcon ( )
2013-08-23 12:02:06 +00:00
, wxTBI_DOCK
2006-07-18 11:21:13 +00:00
) ;
2013-08-23 12:02:06 +00:00
wxASSERT ( m_pMacDockIcon ) ;
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
# endif
2006-07-18 11:21:13 +00:00
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
// Startup the System Idle Detection code
IdleTrackerAttach ( ) ;
2013-08-27 11:42:38 +00:00
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
# ifdef __WXMAC__
2016-12-02 12:08:43 +00:00
// Don't open main window if we were started automatically at login
// We are launched hidden if started from our login item (except if
// we had windows open at logout, the system "restores" them.)
m_bGUIVisible = IsApplicationVisible ( ) ;
2005-04-27 12:59:53 +00:00
2016-12-02 12:08:43 +00:00
if ( getTimeSinceBoot ( ) < 30. ) {
2014-03-11 13:54:28 +00:00
// If the system was just started, we usually get a "Connection
2005-04-27 12:59:53 +00:00
// failed" error if we try to connect too soon, so delay a bit.
sleep ( 10 ) ;
}
2005-04-26 15:03:51 +00:00
# endif
2004-11-17 09:27:06 +00:00
// Show the UI
2013-08-27 11:42:38 +00:00
SetActiveGUI ( m_iGUISelected , m_bGUIVisible ) ;
if ( ! m_bGUIVisible ) {
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
ShowApplication ( false ) ;
2005-02-11 00:08:01 +00:00
}
2013-08-27 11:42:38 +00:00
if ( bOpenEventLog ) {
2010-07-22 10:59:26 +00:00
DisplayEventLog ( m_bGUIVisible ) ;
2013-08-27 11:42:38 +00:00
if ( m_bGUIVisible & & m_pFrame ) {
m_pFrame - > Raise ( ) ;
}
2010-07-22 10:59:26 +00:00
}
2010-07-24 00:54:10 +00:00
2004-04-10 09:11:03 +00:00
return true ;
}
2014-03-13 13:39:00 +00:00
# ifdef __WXMAC__
// We can "show" (unhide) the main window when the
// application is hidden and it won't be visible.
// If we don't do this under wxCocoa 3.0, the Dock
// icon will bounce (as in notification) when we
// click on our menu bar icon.
// But wxFrame::Show(true) makes the application
// visible again, so we instead call
// m_pFrame->wxWindow::Show() here.
//
// We need to call HideThisApp() after the event
// loop is running, so this is called from
// CBOINCBaseFrame::OnPeriodicRPC() at the first
// firing of ID_PERIODICRPCTIMER.
//
void CBOINCGUIApp : : OnFinishInit ( ) {
if ( ! m_bGUIVisible ) {
HideThisApp ( ) ;
2014-03-14 10:48:25 +00:00
m_pFrame - > wxWindow : : Show ( ) ;
if ( m_pEventLog ) {
m_pEventLog - > wxWindow : : Show ( ) ;
}
2014-03-13 13:39:00 +00:00
}
}
# endif
2004-04-10 09:11:03 +00:00
2005-04-07 07:04:50 +00:00
int CBOINCGUIApp : : OnExit ( ) {
2004-12-14 02:50:16 +00:00
// Shutdown the System Idle Detection code
2008-08-07 16:59:52 +00:00
IdleTrackerDetach ( ) ;
2004-12-14 02:50:16 +00:00
2014-03-01 15:13:00 +00:00
// Under wxWidgets 2.8.0, the task bar icons
// must be deleted for app to exit its main loop
# ifdef __WXMAC__
if ( m_pMacDockIcon ) {
delete m_pMacDockIcon ;
}
m_pMacDockIcon = NULL ;
# endif
if ( m_pTaskBarIcon ) {
delete m_pTaskBarIcon ;
}
m_pTaskBarIcon = NULL ;
2005-04-07 07:04:50 +00:00
if ( m_pDocument ) {
2004-10-23 23:40:11 +00:00
m_pDocument - > OnExit ( ) ;
2004-04-10 09:11:03 +00:00
delete m_pDocument ;
2008-10-15 06:30:22 +00:00
m_pDocument = NULL ;
2004-10-23 23:40:11 +00:00
}
2004-04-10 09:11:03 +00:00
2013-04-30 12:44:55 +00:00
// Save Application State
SaveState ( ) ;
2006-10-20 15:00:14 +00:00
if ( m_pSkinManager ) {
delete m_pSkinManager ;
2013-04-30 12:55:14 +00:00
m_pSkinManager = NULL ;
2006-01-06 10:50:59 +00:00
}
2005-04-08 16:58:55 +00:00
if ( m_pLocale ) {
2004-04-10 09:11:03 +00:00
delete m_pLocale ;
2009-12-23 05:23:48 +00:00
m_pLocale = NULL ;
2005-04-08 16:58:55 +00:00
}
2004-04-10 09:11:03 +00:00
2009-12-22 20:15:55 +00:00
if ( m_pEventLog ) {
m_pEventLog - > Destroy ( ) ;
2009-12-23 05:23:48 +00:00
m_pEventLog = NULL ;
2009-12-22 20:15:55 +00:00
}
2014-03-06 19:47:00 +00:00
if ( m_pInstanceChecker ) {
delete m_pInstanceChecker ;
m_pInstanceChecker = NULL ;
}
2008-10-15 18:12:37 +00:00
diagnostics_finish ( ) ;
2009-12-22 20:15:55 +00:00
2004-11-23 07:45:11 +00:00
return wxApp : : OnExit ( ) ;
2004-04-10 09:11:03 +00:00
}
2014-03-06 12:53:19 +00:00
# ifndef __WXMAC__
// Ensure we shut down gracefully on Windows logout or shutdown
2014-03-05 22:23:40 +00:00
void CBOINCGUIApp : : OnEndSession ( wxCloseEvent & ) {
s_bSkipExitConfirmation = true ;
2014-08-18 17:17:15 +00:00
// On Windows Vista with UAC turned on, we have to spawn a new process to change the
// state of a service. When Windows is shutting down it'll prevent new processes from
// being created. Sometimes it'll present a crash dialog for the newly spawned application.
//
// So, we will just let the OS shutdown the service via the service control manager.
//
if ( m_iShutdownCoreClient & & m_pDocument - > m_pClientManager - > IsBOINCConfiguredAsDaemon ( ) ) {
m_iShutdownCoreClient = false ;
}
2014-03-05 22:23:40 +00:00
CBOINCBaseFrame * pFrame = wxGetApp ( ) . GetFrame ( ) ;
wxCommandEvent evt ( wxEVT_COMMAND_MENU_SELECTED , wxID_EXIT ) ;
// The event loop has already been stopped,
// so we must call OnExit directly
pFrame - > OnExit ( evt ) ;
OnExit ( ) ;
}
2014-03-06 12:53:19 +00:00
# endif
2014-03-05 18:57:44 +00:00
2013-04-30 12:18:19 +00:00
void CBOINCGUIApp : : SaveState ( ) {
2008-11-04 08:08:16 +00:00
// Save Application State
2013-04-30 12:44:55 +00:00
m_pConfig - > SetPath ( wxT ( " / " ) ) ;
if ( m_pSkinManager ) {
m_pConfig - > Write ( wxT ( " Skin " ) , m_pSkinManager - > GetSelectedSkin ( ) ) ;
}
2014-06-18 15:14:29 +00:00
m_pConfig - > Write ( wxT ( " LanguageISO " ) , m_strISOLanguageCode ) ;
2008-11-04 08:08:16 +00:00
m_pConfig - > Write ( wxT ( " AutomaticallyShutdownClient " ) , m_iShutdownCoreClient ) ;
m_pConfig - > Write ( wxT ( " DisplayShutdownClientDialog " ) , m_iDisplayExitDialog ) ;
2017-04-15 21:30:47 +00:00
m_pConfig - > Write ( wxT ( " DisplayShutdownConnectedClientDialog " ) , m_iDisplayShutdownConnectedClientDialog ) ;
2008-11-04 09:33:03 +00:00
m_pConfig - > Write ( wxT ( " DisableAutoStart " ) , m_iBOINCMGRDisableAutoStart ) ;
2015-07-27 11:44:56 +00:00
m_pConfig - > Write ( wxT ( " RunDaemon " ) , m_bRunDaemon ) ;
2004-04-10 09:11:03 +00:00
}
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
///
/// Pass the command line parameters and discriptions to wxWidgets for displaying.
///
2005-04-07 07:04:50 +00:00
void CBOINCGUIApp : : OnInitCmdLine ( wxCmdLineParser & parser ) {
2004-11-23 07:45:11 +00:00
wxApp : : OnInitCmdLine ( parser ) ;
2016-04-12 21:07:29 +00:00
parser . AddSwitch ( " a " , " autostart " , _ ( " BOINC Manager was started by the operating system automatically " ) ) ;
2009-02-25 20:51:56 +00:00
# if defined(__WXMSW__) || defined(__WXMAC__)
2016-04-12 21:07:29 +00:00
parser . AddSwitch ( " s " , " systray " , _ ( " Startup BOINC so only the system tray icon is visible " ) ) ;
2009-08-26 07:47:49 +00:00
# else
2016-04-13 22:27:18 +00:00
parser . AddOption ( " e " , " clientdir " , _ ( " Directory containing the BOINC Client executable " ) ) ;
parser . AddOption ( " d " , " datadir " , _ ( " BOINC data directory " ) ) ;
2009-02-25 20:51:56 +00:00
# endif
2016-04-13 22:27:18 +00:00
parser . AddOption ( " n " , " namehost " , _ ( " Host name or IP address " ) ) ;
parser . AddOption ( " g " , " gui_rpc_port " , _ ( " GUI RPC port number " ) ) ;
parser . AddOption ( " p " , " password " , _ ( " Password " ) ) ;
parser . AddOption ( " b " , " boincargs " , _ ( " Startup BOINC with these optional arguments " ) ) ;
2016-04-12 21:07:29 +00:00
parser . AddSwitch ( " i " , " insecure " , _ ( " disable BOINC security users and permissions " ) ) ;
parser . AddSwitch ( " c " , " checkskins " , _ ( " set skin debugging mode to enable skin manager error messages " ) ) ;
parser . AddSwitch ( " m " , " multiple " , _ ( " multiple instances of BOINC Manager allowed " ) ) ;
2011-11-15 02:06:18 +00:00
# if (defined(__WXMAC__) && defined(_DEBUG))
2016-04-13 22:27:18 +00:00
parser . AddLongOption ( " NSDocumentRevisionsDebugMode " , _ ( " Not used: workaround for bug in XCode 4.2 " ) ) ;
2011-11-10 22:53:12 +00:00
# endif
2016-04-12 21:07:29 +00:00
parser . AddSwitch ( " nd " , " no-daemon " , _ ( " Not run the daemon " ) ) ;
2004-04-10 09:11:03 +00:00
}
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
///
/// Parse command line parameters.
///
2005-04-07 07:04:50 +00:00
bool CBOINCGUIApp : : OnCmdLineParsed ( wxCmdLineParser & parser ) {
2004-04-10 09:11:03 +00:00
// Give default processing (-?, --help and --verbose) the chance to do something.
2004-11-23 07:45:11 +00:00
wxApp : : OnCmdLineParsed ( parser ) ;
2010-08-07 06:48:25 +00:00
wxString portNum = wxEmptyString ;
2010-10-13 21:02:42 +00:00
long longPort ;
2010-10-15 02:07:39 +00:00
bool hostNameSpecified = false ;
bool passwordSpecified = false ;
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
2007-01-19 23:45:19 +00:00
parser . Found ( wxT ( " boincargs " ) , & m_strBOINCArguments ) ;
2008-11-04 09:33:03 +00:00
if ( parser . Found ( wxT ( " autostart " ) ) ) {
m_bBOINCMGRAutoStarted = true ;
}
2009-08-26 11:53:51 +00:00
# if defined(__WXMSW__) || defined(__WXMAC__)
2005-04-07 07:04:50 +00:00
if ( parser . Found ( wxT ( " systray " ) ) ) {
2006-06-23 08:20:08 +00:00
m_bGUIVisible = false ;
2004-04-10 09:11:03 +00:00
}
2009-08-26 11:53:51 +00:00
# endif
2006-08-01 12:36:19 +00:00
if ( parser . Found ( wxT ( " insecure " ) ) ) {
g_use_sandbox = false ;
}
2009-01-30 09:39:47 +00:00
if ( parser . Found ( wxT ( " checkskins " ) ) ) {
2009-01-30 09:25:35 +00:00
m_bDebugSkins = true ;
}
2010-10-06 11:13:07 +00:00
if ( parser . Found ( wxT ( " multiple " ) ) ) {
m_bMultipleInstancesOK = true ;
}
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
2009-08-26 11:53:51 +00:00
# if !(defined(__WXMSW__) || defined(__WXMAC__))
if ( ! parser . Found ( wxT ( " clientdir " ) , & m_strBOINCMGRRootDirectory ) ) {
m_strBOINCMGRRootDirectory = : : wxGetCwd ( ) ;
}
if ( m_strBOINCMGRRootDirectory . Last ( ) ! = ' / ' ) {
m_strBOINCMGRRootDirectory . Append ( ' / ' ) ;
}
if ( ! parser . Found ( wxT ( " datadir " ) , & m_strBOINCMGRDataDirectory ) ) {
m_strBOINCMGRDataDirectory = m_strBOINCMGRRootDirectory ;
}
if ( m_strBOINCMGRDataDirectory . Last ( ) ! = ' / ' ) {
m_strBOINCMGRDataDirectory . Append ( ' / ' ) ;
}
# endif
2010-10-15 02:07:39 +00:00
if ( parser . Found ( wxT ( " namehost " ) , & m_strHostNameArg ) ) {
hostNameSpecified = true ;
} else {
2010-08-07 06:48:25 +00:00
m_strHostNameArg = wxT ( " localhost " ) ;
}
if ( parser . Found ( wxT ( " gui_rpc_port " ) , & portNum ) ) {
if ( portNum . ToLong ( & longPort ) ) {
m_iRPCPortArg = longPort ;
} else {
m_iRPCPortArg = GUI_RPC_PORT ; // conversion failed
}
} else {
m_iRPCPortArg = GUI_RPC_PORT ;
}
2010-10-15 02:07:39 +00:00
if ( parser . Found ( wxT ( " password " ) , & m_strPasswordArg ) ) {
passwordSpecified = true ;
} else {
2010-08-07 06:48:25 +00:00
m_strPasswordArg = wxEmptyString ;
}
2010-10-15 02:07:39 +00:00
if ( hostNameSpecified & & passwordSpecified ) {
m_bMultipleInstancesOK = true ;
}
2015-07-27 11:44:56 +00:00
if ( parser . Found ( wxT ( " no-daemon " ) ) ) {
m_bNeedRunDaemon = false ;
}
2004-04-10 09:11:03 +00:00
return true ;
}
2004-11-17 09:27:06 +00:00
2010-10-14 18:16:24 +00:00
///
/// Detect if another instance of this application is running.
2014-03-07 08:30:48 +00:00
// Returns true if there is and it is forbidden, otherwise false
//
// We must initialize m_pInstanceChecker even if m_bMultipleInstancesOK
// is true so CMainDocument::OnPoll() can call IsMgrMultipleInstance().
2010-10-14 18:16:24 +00:00
///
bool CBOINCGUIApp : : DetectDuplicateInstance ( ) {
2014-03-07 08:30:48 +00:00
# ifdef __WXMAC__
m_pInstanceChecker = new wxSingleInstanceChecker (
wxTheApp - > GetAppName ( ) + ' - ' + wxGetUserId ( ) ,
wxFileName : : GetHomeDir ( ) + " /Library/Application Support/BOINC "
) ;
# else
2014-03-06 19:47:00 +00:00
m_pInstanceChecker = new wxSingleInstanceChecker ( ) ;
2014-03-07 08:30:48 +00:00
# endif
2014-03-06 19:47:00 +00:00
if ( m_pInstanceChecker - > IsAnotherRunning ( ) ) {
2014-03-07 08:30:48 +00:00
if ( m_bMultipleInstancesOK ) return false ;
2010-10-14 18:16:24 +00:00
# ifdef __WXMSW__
2014-03-06 19:47:00 +00:00
CTaskBarIcon : : FireAppRestore ( ) ;
2010-10-14 19:37:13 +00:00
# endif
return true ;
}
2010-10-14 18:16:24 +00:00
return false ;
}
2010-10-13 21:02:42 +00:00
///
/// Determines what name BOINC Manager is called.
///
void CBOINCGUIApp : : DetectExecutableName ( ) {
# ifdef __WXMSW__
TCHAR szPath [ MAX_PATH - 1 ] ;
// change the current directory to the boinc install directory
GetModuleFileName ( NULL , szPath , ( sizeof ( szPath ) / sizeof ( TCHAR ) ) ) ;
TCHAR * pszProg = _tcsrchr ( szPath , ' \\ ' ) ;
if ( pszProg ) {
pszProg + + ;
}
// Store the root directory for later use.
m_strBOINCMGRExecutableName = pszProg ;
2017-03-16 17:28:08 +00:00
# elif defined(__WXGTK__)
char path [ PATH_MAX ] ;
if ( ! get_real_executable_path ( path , PATH_MAX ) ) {
// find filename component
char * name = strrchr ( path , ' / ' ) ;
if ( name ) {
name + + ;
m_strBOINCMGRExecutableName = name ;
}
}
2010-10-13 21:02:42 +00:00
# endif
}
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
///
/// Determines where the BOINC Manager is executing from.
///
void CBOINCGUIApp : : DetectRootDirectory ( ) {
# ifdef __WXMSW__
TCHAR szPath [ MAX_PATH - 1 ] ;
// change the current directory to the boinc install directory
GetModuleFileName ( NULL , szPath , ( sizeof ( szPath ) / sizeof ( TCHAR ) ) ) ;
2009-04-22 21:09:17 +00:00
TCHAR * pszProg = _tcsrchr ( szPath , ' \\ ' ) ;
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
if ( pszProg ) {
szPath [ pszProg - szPath + 1 ] = 0 ;
}
// Store the root directory for later use.
m_strBOINCMGRRootDirectory = szPath ;
2017-03-16 17:28:08 +00:00
# elif defined(__WXGTK__)
char path [ PATH_MAX ] ;
if ( ! get_real_executable_path ( path , PATH_MAX ) ) {
// find path component
char * name = strrchr ( path , ' / ' ) ;
if ( name ) {
name + + ;
* name = ' \0 ' ;
m_strBOINCMGRRootDirectory = path ;
}
}
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
# endif
}
///
/// Determines where the BOINC data directory is.
///
void CBOINCGUIApp : : DetectDataDirectory ( ) {
# ifdef __WXMSW__
//
// Determine BOINCMgr Data Directory
//
LONG lReturnValue ;
HKEY hkSetupHive ;
2014-01-29 02:54:43 +00:00
TCHAR szPath [ MAX_PATH ] ;
2014-05-06 15:28:47 +00:00
LPTSTR lpszValue = NULL ;
LPTSTR lpszExpandedValue = NULL ;
DWORD dwValueType = REG_EXPAND_SZ ;
DWORD dwSize = 0 ;
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
// change the current directory to the boinc data directory if it exists
lReturnValue = RegOpenKeyEx (
HKEY_LOCAL_MACHINE ,
_T ( " SOFTWARE \\ Space Sciences Laboratory, U.C. Berkeley \\ BOINC Setup " ) ,
0 ,
KEY_READ ,
& hkSetupHive
) ;
if ( lReturnValue = = ERROR_SUCCESS ) {
// How large does our buffer need to be?
lReturnValue = RegQueryValueEx (
hkSetupHive ,
_T ( " DATADIR " ) ,
NULL ,
2014-05-06 15:28:47 +00:00
& dwValueType ,
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
NULL ,
& dwSize
) ;
if ( lReturnValue ! = ERROR_FILE_NOT_FOUND ) {
// Allocate the buffer space.
2014-05-06 15:28:47 +00:00
lpszValue = ( LPTSTR ) malloc ( dwSize ) ;
( * lpszValue ) = NULL ;
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
// Now get the data
lReturnValue = RegQueryValueEx (
hkSetupHive ,
_T ( " DATADIR " ) ,
NULL ,
2014-05-06 15:28:47 +00:00
& dwValueType ,
( LPBYTE ) lpszValue ,
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
& dwSize
) ;
2014-05-06 15:28:47 +00:00
// Expand the Strings
// We need to get the size of the buffer needed
dwSize = 0 ;
lReturnValue = ExpandEnvironmentStrings ( lpszValue , NULL , dwSize ) ;
if ( lReturnValue ) {
// Make the buffer big enough for the expanded string
lpszExpandedValue = ( LPTSTR ) malloc ( lReturnValue * sizeof ( TCHAR ) ) ;
( * lpszExpandedValue ) = NULL ;
dwSize = lReturnValue ;
ExpandEnvironmentStrings ( lpszValue , lpszExpandedValue , dwSize ) ;
// Store the root directory for later use.
m_strBOINCMGRDataDirectory = lpszExpandedValue ;
}
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
}
2014-01-29 02:54:43 +00:00
} else {
if ( SUCCEEDED ( SHGetFolderPath ( NULL , CSIDL_COMMON_APPDATA | CSIDL_FLAG_CREATE , NULL , SHGFP_TYPE_CURRENT , szPath ) ) ) {
_tcsncat ( szPath , _T ( " \\ boinc " ) , ( ( sizeof ( szPath ) / sizeof ( TCHAR ) ) - _tcslen ( szPath ) ) ) ;
2014-01-29 03:06:04 +00:00
if ( wxDir : : Exists ( szPath ) ) {
2014-01-29 02:54:43 +00:00
// Store the root directory for later use.
m_strBOINCMGRDataDirectory = szPath ;
}
}
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
}
// Cleanup
if ( hkSetupHive ) RegCloseKey ( hkSetupHive ) ;
2014-05-06 15:28:47 +00:00
if ( lpszValue ) free ( lpszValue ) ;
if ( lpszExpandedValue ) free ( lpszExpandedValue ) ;
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
# endif
# ifdef __WXMAC__
m_strBOINCMGRDataDirectory = wxT ( " /Library/Application Support/BOINC Data " ) ;
# endif
}
2005-04-07 07:04:50 +00:00
void CBOINCGUIApp : : InitSupportedLanguages ( ) {
2005-02-07 04:47:18 +00:00
wxInt32 iIndex = 0 ;
const wxLanguageInfo * liLanguage = NULL ;
2005-06-28 15:55:59 +00:00
// Prepare the array
m_astrLanguages . Insert ( wxEmptyString , 0 , wxLANGUAGE_USER_DEFINED + 1 ) ;
2005-02-07 04:47:18 +00:00
// These are just special tags so deal with them in a special way
2005-06-28 15:55:59 +00:00
m_astrLanguages [ wxLANGUAGE_DEFAULT ] = _ ( " (Automatic Detection) " ) ;
m_astrLanguages [ wxLANGUAGE_UNKNOWN ] = _ ( " (Unknown) " ) ;
m_astrLanguages [ wxLANGUAGE_USER_DEFINED ] = _ ( " (User Defined) " ) ;
2005-02-07 04:47:18 +00:00
2005-04-07 07:04:50 +00:00
for ( iIndex = 0 ; iIndex < = wxLANGUAGE_USER_DEFINED ; iIndex + + ) {
liLanguage = wxLocale : : GetLanguageInfo ( iIndex ) ;
2005-04-27 06:55:28 +00:00
if ( liLanguage ) {
2005-06-28 15:55:59 +00:00
m_astrLanguages [ iIndex ] = liLanguage - > Description ;
2005-02-07 04:47:18 +00:00
}
}
}
2008-08-07 16:59:52 +00:00
int CBOINCGUIApp : : IdleTrackerAttach ( ) {
# ifdef __WXMSW__
2009-11-13 21:23:15 +00:00
: : attach_idle_monitor ( ) ;
2008-08-07 16:59:52 +00:00
# endif
return 0 ;
}
int CBOINCGUIApp : : IdleTrackerDetach ( ) {
# ifdef __WXMSW__
2009-11-13 21:23:15 +00:00
: : detach_idle_monitor ( ) ;
2005-01-07 07:32:23 +00:00
# endif
return 0 ;
}
2012-01-23 19:30:51 +00:00
void CBOINCGUIApp : : OnActivateApp ( wxActivateEvent & event ) {
2015-01-16 11:22:10 +00:00
m_bProcessingActivateAppEvent = true ;
2012-02-17 13:59:57 +00:00
2012-01-23 19:30:51 +00:00
if ( event . GetActive ( ) ) {
2015-01-16 11:22:10 +00:00
# ifdef __WXMAC__
ShowInterface ( ) ;
# else
2015-01-21 15:41:02 +00:00
# ifdef __WXGTK__
// Linux allows the Event Log to be brought forward and made active
// even if we have a modal dialog displayed (associated with our
// main frame.) This test is needed to allow bringing the modal
// dialog forward again by clicking on its title bar.
if ( ! IsModalDialogDisplayed ( ) )
# endif
{
bool keepEventLogInFront = m_bEventLogWasActive ;
if ( m_pEventLog & & ! m_pEventLog - > IsIconized ( ) & & ! keepEventLogInFront ) {
m_pEventLog - > Raise ( ) ;
}
if ( m_pFrame ) {
m_pFrame - > Raise ( ) ;
}
if ( m_pEventLog & & ! m_pEventLog - > IsIconized ( ) & & keepEventLogInFront ) {
m_pEventLog - > Raise ( ) ;
}
2015-01-16 11:22:10 +00:00
}
2013-08-23 12:02:06 +00:00
# endif
2012-01-23 19:30:51 +00:00
}
2015-01-21 15:41:02 +00:00
2012-01-23 19:30:51 +00:00
event . Skip ( ) ;
2015-01-16 11:22:10 +00:00
m_bProcessingActivateAppEvent = false ;
2012-01-23 19:30:51 +00:00
}
2008-10-30 01:55:11 +00:00
void CBOINCGUIApp : : OnRPCFinished ( CRPCFinishedEvent & event ) {
CMainDocument * pDoc = wxGetApp ( ) . GetDocument ( ) ;
wxASSERT ( pDoc ) ;
wxASSERT ( wxDynamicCast ( pDoc , CMainDocument ) ) ;
pDoc - > OnRPCComplete ( event ) ;
}
2006-01-23 08:47:05 +00:00
int CBOINCGUIApp : : UpdateSystemIdleDetection ( ) {
2005-01-07 07:32:23 +00:00
# ifdef __WXMSW__
2009-11-13 21:23:15 +00:00
return get_idle_tick_count ( ) ;
2006-07-21 08:23:26 +00:00
# else
return TRUE ;
2004-12-14 02:50:16 +00:00
# endif
}
2006-05-02 09:31:04 +00:00
int CBOINCGUIApp : : StartBOINCScreensaverTest ( ) {
# ifdef __WXMSW__
wxString strExecute = wxEmptyString ;
wxChar szExecutableDirectory [ 4096 ] ;
memset ( szExecutableDirectory , 0 , sizeof ( szExecutableDirectory ) ) ;
// On Windows the screensaver is located in the Windows directory.
GetWindowsDirectory (
szExecutableDirectory ,
( sizeof ( szExecutableDirectory ) / sizeof ( wxChar ) )
) ;
2006-05-02 19:41:12 +00:00
// Append boinc.scr to the end of the strExecute string and get ready to rock
strExecute = wxT ( " \" " ) + wxString ( szExecutableDirectory ) + wxT ( " \\ boinc.scr \" /t " ) ;
: : wxExecute ( strExecute ) ;
2006-05-02 09:31:04 +00:00
# endif
return 0 ;
}
2009-07-25 05:35:27 +00:00
int CBOINCGUIApp : : StartBOINCDefaultScreensaverTest ( ) {
# ifdef __WXMSW__
wxString strExecute = wxEmptyString ;
strExecute = wxT ( " \" " ) + m_strBOINCMGRRootDirectory + wxT ( " \\ boincscr.exe \" --test " ) ;
: : wxExecute ( strExecute ) ;
# endif
return 0 ;
}
2015-01-16 11:22:10 +00:00
// Display the Event Log, it is a modeless dialog not owned by
// any other UI element.
// To work around a Linux bug in wxWidgets 3.0 which prevents
// bringing the main frame forward on top of a modeless dialog,
// the Event Log is now a wxFrame on Linux only.
2010-07-23 23:42:25 +00:00
void CBOINCGUIApp : : DisplayEventLog ( bool bShowWindow ) {
2012-01-23 19:30:51 +00:00
if ( m_pEventLog ) {
2010-07-23 23:42:25 +00:00
if ( bShowWindow ) {
2011-06-09 09:25:04 +00:00
if ( m_pEventLog - > IsIconized ( ) ) {
m_pEventLog - > Iconize ( false ) ;
}
2010-07-23 23:42:25 +00:00
m_pEventLog - > Raise ( ) ;
}
2010-03-18 09:34:33 +00:00
} else {
m_pEventLog = new CDlgEventLog ( ) ;
2010-03-18 10:41:25 +00:00
if ( m_pEventLog ) {
2014-03-11 13:54:28 +00:00
m_pEventLog - > Show ( bShowWindow ) ;
2010-07-23 23:42:25 +00:00
if ( bShowWindow ) {
m_pEventLog - > Raise ( ) ;
}
2010-03-18 10:41:25 +00:00
if ( m_pFrame ) {
m_pFrame - > UpdateRefreshTimerInterval ( ) ;
}
2009-12-23 05:23:48 +00:00
}
2009-12-22 20:15:55 +00:00
}
}
2009-12-23 01:09:56 +00:00
void CBOINCGUIApp : : OnEventLogClose ( ) {
2009-12-22 20:15:55 +00:00
m_pEventLog = NULL ;
2010-07-23 23:42:25 +00:00
if ( m_pFrame ) {
m_pFrame - > UpdateRefreshTimerInterval ( ) ;
}
2009-12-22 20:15:55 +00:00
}
2006-10-30 03:41:32 +00:00
// The skin has changed and all UI elements need to reload their bitmaps.
//
void CBOINCGUIApp : : FireReloadSkin ( ) {
if ( m_pFrame ) {
m_pFrame - > FireReloadSkin ( ) ;
}
if ( m_pTaskBarIcon ) {
m_pTaskBarIcon - > FireReloadSkin ( ) ;
}
}
2006-06-23 08:20:08 +00:00
bool CBOINCGUIApp : : SetActiveGUI ( int iGUISelection , bool bShowWindow ) {
2012-04-20 21:08:21 +00:00
wxLogTrace ( wxT ( " Function Start/End " ) , wxT ( " CBOINCGUIApp::SetActiveGUI - Function Begin " ) ) ;
wxLogTrace ( wxT ( " Function Start/End " ) , wxT ( " CBOINCGUIApp::SetActiveGUI - GUI Selection: '%d', Show: %d' " ) , iGUISelection , ( int ) bShowWindow ) ;
2006-06-23 08:20:08 +00:00
CBOINCBaseFrame * pNewFrame = NULL ;
2008-10-30 09:14:33 +00:00
CBOINCBaseFrame * pOldFrame = m_pFrame ;
2009-03-09 18:02:37 +00:00
wxInt32 iTop = 0 ;
wxInt32 iLeft = 0 ;
wxInt32 iHeight = 0 ;
wxInt32 iWidth = 0 ;
2016-11-07 02:25:07 +00:00
bool bWindowMaximized = false ;
2009-03-09 18:02:37 +00:00
2006-06-23 08:20:08 +00:00
// Create the new window
2006-06-28 21:32:28 +00:00
if ( ( iGUISelection ! = m_iGUISelected ) | | ! m_pFrame ) {
2009-03-09 18:02:37 +00:00
2013-08-27 01:28:04 +00:00
// Retrieve the desired window state before creating the
2009-03-09 18:02:37 +00:00
// desired frames
if ( BOINC_ADVANCEDGUI = = iGUISelection ) {
m_pConfig - > SetPath ( wxT ( " / " ) ) ;
m_pConfig - > Read ( wxT ( " YPos " ) , & iTop , 30 ) ;
m_pConfig - > Read ( wxT ( " XPos " ) , & iLeft , 30 ) ;
m_pConfig - > Read ( wxT ( " Width " ) , & iWidth , 800 ) ;
m_pConfig - > Read ( wxT ( " Height " ) , & iHeight , 600 ) ;
2016-11-07 02:25:07 +00:00
m_pConfig - > Read ( wxT ( " WindowMaximized " ) , & bWindowMaximized , false ) ;
2013-12-10 10:48:49 +00:00
// Guard against a rare situation where registry values are zero
if ( iWidth < 50 ) iWidth = 800 ;
if ( iHeight < 50 ) iHeight = 600 ;
2009-03-09 18:02:37 +00:00
} else {
m_pConfig - > SetPath ( wxT ( " /Simple " ) ) ;
m_pConfig - > Read ( wxT ( " YPos " ) , & iTop , 30 ) ;
m_pConfig - > Read ( wxT ( " XPos " ) , & iLeft , 30 ) ;
2012-10-15 19:17:13 +00:00
// We don't save Simple View's width & height since it's
// window is not resizable, so don't try to read them
2009-03-09 18:02:37 +00:00
# ifdef __WXMAC__
2012-10-15 19:17:13 +00:00
// m_pConfig->Read(wxT("Width"), &iWidth, 409);
// m_pConfig->Read(wxT("Height"), &iHeight, 561);
iWidth = 409 ;
iHeight = 561 ;
2009-03-09 18:02:37 +00:00
# else
2012-10-15 19:17:13 +00:00
// m_pConfig->Read(wxT("Width"), &iWidth, 416);
// m_pConfig->Read(wxT("Height"), &iHeight, 570);
iWidth = 416 ;
iHeight = 570 ;
2009-03-09 18:02:37 +00:00
# endif
}
// Make sure that the new window is going to be visible
// on a screen
# ifdef __WXMAC__
2012-05-10 08:56:58 +00:00
if ( ! IsWindowOnScreen ( iLeft , iTop , iWidth , iHeight ) ) {
iTop = iLeft = 30 ;
}
2009-03-09 18:02:37 +00:00
# else
// If either co-ordinate is less then 0 then set it equal to 0 to ensure
// it displays on the screen.
if ( iLeft < 0 ) iLeft = 30 ;
if ( iTop < 0 ) iTop = 30 ;
// Read the size of the screen
wxInt32 iMaxWidth = wxSystemSettings : : GetMetric ( wxSYS_SCREEN_X ) ;
wxInt32 iMaxHeight = wxSystemSettings : : GetMetric ( wxSYS_SCREEN_Y ) ;
// Max sure that it doesn't go off to the right or bottom
if ( iLeft + iWidth > iMaxWidth ) iLeft = iMaxWidth - iWidth ;
if ( iTop + iHeight > iMaxHeight ) iTop = iMaxHeight - iHeight ;
# endif
// Create the main window
//
if ( BOINC_ADVANCEDGUI = = iGUISelection ) {
// Initialize the advanced gui window
pNewFrame = new CAdvancedFrame (
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationName ( ) ,
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationIcon ( ) ,
wxPoint ( iLeft , iTop ) ,
wxSize ( iWidth , iHeight )
) ;
} else {
// Initialize the simple gui window
pNewFrame = new CSimpleFrame (
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationName ( ) ,
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationIcon ( ) ,
wxPoint ( iLeft , iTop ) ,
wxSize ( iWidth , iHeight )
) ;
2006-06-23 08:20:08 +00:00
}
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
2006-06-28 01:02:39 +00:00
wxASSERT ( pNewFrame ) ;
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
2006-06-23 08:20:08 +00:00
if ( pNewFrame ) {
SetTopWindow ( pNewFrame ) ;
2008-10-30 09:14:33 +00:00
// Store the new frame for future use
m_pFrame = pNewFrame ;
2008-10-30 09:33:48 +00:00
// Hide the old one if it exists. We must do this
// after updating m_pFrame to prevent Mac OSX from
// hiding the application
2009-03-12 08:02:33 +00:00
if ( pOldFrame ) pOldFrame - > Hide ( ) ;
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
2006-06-23 08:20:08 +00:00
// Delete the old one if it exists
2008-10-30 09:14:33 +00:00
if ( pOldFrame ) pOldFrame - > Destroy ( ) ;
2013-04-30 11:35:45 +00:00
if ( iGUISelection ! = m_iGUISelected ) {
m_iGUISelected = iGUISelection ;
m_pConfig - > SetPath ( wxT ( " / " ) ) ;
m_pConfig - > Write ( wxT ( " GUISelection " ) , iGUISelection ) ;
m_pConfig - > Flush ( ) ;
}
2006-06-23 08:20:08 +00:00
}
}
// Show the new frame if needed
2015-01-16 11:22:10 +00:00
if ( ! m_bProcessingActivateAppEvent ) {
if ( m_pFrame & & bShowWindow ) {
if ( m_pEventLog & & ! m_pEventLog - > IsIconized ( ) ) {
m_pEventLog - > Show ( ) ;
m_pEventLog - > Raise ( ) ;
# ifdef __WXMSW__
: : SetForegroundWindow ( ( HWND ) m_pEventLog - > GetHWND ( ) ) ;
# endif
}
2010-07-23 23:42:25 +00:00
2015-01-16 11:22:10 +00:00
if ( ! m_pFrame - > IsShown ( ) ) {
m_pFrame - > Show ( ) ;
}
if ( m_pFrame - > IsIconized ( ) ) {
m_pFrame - > Maximize ( false ) ;
}
2016-11-08 10:28:22 +00:00
else if ( BOINC_ADVANCEDGUI = = iGUISelection & & bWindowMaximized ) {
2016-11-07 02:25:07 +00:00
m_pFrame - > Maximize ( ) ;
}
2015-01-16 11:22:10 +00:00
m_pFrame - > Raise ( ) ;
2012-01-23 19:30:51 +00:00
2010-10-18 19:21:46 +00:00
# ifdef __WXMSW__
2015-01-16 11:22:10 +00:00
: : SetForegroundWindow ( ( HWND ) m_pFrame - > GetHWND ( ) ) ;
2010-10-18 19:21:46 +00:00
# endif
2015-01-16 11:22:10 +00:00
}
2009-03-09 18:02:37 +00:00
}
2006-06-23 08:20:08 +00:00
2012-04-20 21:08:21 +00:00
wxLogTrace ( wxT ( " Function Start/End " ) , wxT ( " CBOINCGUIApp::SetActiveGUI - Function End " ) ) ;
2006-06-23 08:20:08 +00:00
return true ;
}
2006-11-03 15:18:19 +00:00
int CBOINCGUIApp : : ConfirmExit ( ) {
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
CSkinAdvanced * pSkinAdvanced = wxGetApp ( ) . GetSkinManager ( ) - > GetAdvanced ( ) ;
CMainDocument * pDoc = wxGetApp ( ) . GetDocument ( ) ;
2008-11-04 21:42:58 +00:00
wxString strConnectedCompter = wxEmptyString ;
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
bool bWasVisible ;
2008-11-04 08:08:16 +00:00
int retval = 0 ;
2008-01-30 06:09:34 +00:00
wxASSERT ( pDoc ) ;
2006-11-22 09:51:59 +00:00
wxASSERT ( pSkinAdvanced ) ;
2008-01-30 06:09:34 +00:00
wxASSERT ( wxDynamicCast ( pDoc , CMainDocument ) ) ;
2006-11-22 09:51:59 +00:00
wxASSERT ( wxDynamicCast ( pSkinAdvanced , CSkinAdvanced ) ) ;
2010-08-24 01:45:12 +00:00
pDoc - > GetConnectedComputerName ( strConnectedCompter ) ;
if ( ! pDoc - > IsComputerNameLocal ( strConnectedCompter ) ) {
// Don't shut down remote clients on Manager exit
return 1 ;
2008-11-04 21:42:58 +00:00
}
2009-09-11 20:38:05 +00:00
// Don't run confirmation dialog if logging out or shutting down Mac,
// or if emergency exit from AsyncRPCDlg
2011-06-08 10:09:36 +00:00
if ( s_bSkipExitConfirmation ) return 1 ;
// Don't run confirmation dialog if second instance of Manager
if ( IsMgrMultipleInstance ( ) ) return 1 ;
2008-11-05 12:14:53 +00:00
if ( ! m_iDisplayExitDialog ) {
2011-02-04 00:13:48 +00:00
// Mac: User doesn't want to display the dialog and just wants to use their previous value.
// Win & Linux: User doesn't want to display the dialog and wants to shutdown the client.
return 1 ;
2008-11-05 12:14:53 +00:00
}
2006-11-03 15:18:19 +00:00
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
bWasVisible = IsApplicationVisible ( ) ;
ShowApplication ( true ) ;
2006-11-03 15:18:19 +00:00
2008-11-04 08:08:16 +00:00
CDlgExitMessage dlg ( NULL ) ;
2006-11-03 22:29:19 +00:00
2008-11-04 08:08:16 +00:00
if ( ! pSkinAdvanced - > GetExitMessage ( ) . IsEmpty ( ) ) {
dlg . m_DialogExitMessage - > SetLabel ( pSkinAdvanced - > GetExitMessage ( ) ) ;
}
2006-11-03 15:18:19 +00:00
2008-11-27 15:50:15 +00:00
# ifdef __WXMSW__
2008-11-04 16:51:31 +00:00
if ( m_iShutdownCoreClient ) {
dlg . m_DialogShutdownCoreClient - > SetValue ( TRUE ) ;
}
2008-11-05 12:14:53 +00:00
# endif
2008-11-04 16:51:31 +00:00
if ( m_iDisplayExitDialog ) {
dlg . m_DialogDisplay - > SetValue ( FALSE ) ;
}
2006-11-22 09:51:59 +00:00
dlg . Fit ( ) ;
dlg . Centre ( ) ;
2006-11-03 22:29:19 +00:00
2006-11-22 09:51:59 +00:00
if ( wxID_OK = = dlg . ShowModal ( ) ) {
2011-05-25 11:15:39 +00:00
# ifdef __WXMAC__
2008-11-05 12:14:53 +00:00
s_bSkipExitConfirmation = true ; // Don't ask twice (only affects Mac)
# else
2008-11-04 08:08:16 +00:00
m_iShutdownCoreClient = dlg . m_DialogShutdownCoreClient - > GetValue ( ) ;
2008-11-05 12:14:53 +00:00
# endif
2008-11-04 22:16:16 +00:00
m_iDisplayExitDialog = ! dlg . m_DialogDisplay - > GetValue ( ) ;
2008-11-04 16:51:31 +00:00
retval = true ;
2008-11-04 08:08:16 +00:00
2006-11-03 15:18:19 +00:00
}
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
if ( ! bWasVisible ) {
ShowApplication ( false ) ;
2007-06-24 10:56:11 +00:00
}
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
2008-11-04 08:08:16 +00:00
return retval ; // User cancelled exit
2006-11-03 15:18:19 +00:00
}
2008-08-20 16:07:06 +00:00
// Use this instead of wxMessageBox from all tab Views to suppress
// Periodic RPCs. See comment in CMainDocument::RunPeriodicRPCs()
// for a fuller explanation.
int CBOINCGUIApp : : SafeMessageBox ( const wxString & message , const wxString & caption , long style ,
wxWindow * parent , int x , int y )
{
int retval ;
m_bSafeMessageBoxDisplayed + + ;
retval = wxMessageBox ( message , caption , style , parent , x , y ) ;
m_bSafeMessageBoxDisplayed - - ;
return retval ;
}
2010-08-11 12:18:07 +00:00
2014-03-15 11:56:14 +00:00
# ifndef __WXMAC__
// See clientgui/mac/BOINCGUIApp.mm for the Mac versions.
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
///
/// Determines if the current process is visible.
///
/// @return
/// true if the current process is visible, otherwise false.
///
bool CBOINCGUIApp : : IsApplicationVisible ( ) {
return false ;
}
///
/// Shows or hides the current process.
///
/// @param bShow
/// true will show the process, false will hide the process.
///
2008-10-30 09:14:33 +00:00
void CBOINCGUIApp : : ShowApplication ( bool ) {
}
# endif
2008-08-20 16:07:06 +00:00
2009-12-18 22:44:10 +00:00
bool CBOINCGUIApp : : ShowInterface ( ) {
2013-08-27 01:28:04 +00:00
ShowApplication ( true ) ;
2009-12-18 22:44:10 +00:00
return SetActiveGUI ( m_iGUISelected , true ) ;
}
bool CBOINCGUIApp : : ShowNotifications ( ) {
bool retval = false ;
retval = SetActiveGUI ( m_iGUISelected , true ) ;
if ( retval ) {
GetFrame ( ) - > FireNotification ( ) ;
2010-07-23 15:25:39 +00:00
GetDocument ( ) - > UpdateUnreadNoticeState ( ) ;
2009-12-18 22:44:10 +00:00
}
return retval ;
}
2008-08-20 16:07:06 +00:00
bool CBOINCGUIApp : : IsModalDialogDisplayed ( ) {
if ( m_bSafeMessageBoxDisplayed ) return true ;
// Search for the dialog by ID since all of BOINC Manager's
// dialog IDs are 10000.
if ( wxDynamicCast ( wxWindow : : FindWindowById ( ID_ANYDIALOG ) , wxDialog ) ) {
return true ;
}
2008-10-14 03:28:34 +00:00
if ( m_pDocument ) {
if ( m_pDocument - > WaitingForRPC ( ) ) {
return true ;
}
}
2008-08-20 16:07:06 +00:00
return false ;
}
2008-10-14 03:28:34 +00:00
// Prevent recursive entry of CMainDocument::RequestRPC()
int CBOINCGUIApp : : FilterEvent ( wxEvent & event ) {
2011-11-03 02:35:04 +00:00
int theEventType ;
wxDialog * theRPCWaitDialog ;
wxObject * theObject ;
2008-10-14 03:28:34 +00:00
if ( ! m_pDocument ) return - 1 ;
2011-11-07 10:57:06 +00:00
theEventType = event . GetEventType ( ) ;
2011-11-03 02:35:04 +00:00
if ( m_pDocument - > WaitingForRPC ( ) ) {
// If in RPC Please Wait dialog, reject all command
// and timer events except:
// - RPC Finished
// - those for that dialog or its children
// - Open Manager menu item from system tray icon
2008-10-14 12:35:48 +00:00
2011-11-03 02:35:04 +00:00
if ( ( theEventType = = wxEVT_COMMAND_MENU_SELECTED ) & & ( event . GetId ( ) = = wxID_OPEN ) ) {
return - 1 ;
}
2008-10-14 03:28:34 +00:00
2011-11-03 02:35:04 +00:00
theRPCWaitDialog = m_pDocument - > GetRPCWaitDialog ( ) ;
theObject = event . GetEventObject ( ) ;
while ( theObject ) {
if ( ! theObject - > IsKindOf ( CLASSINFO ( wxWindow ) ) ) break ;
if ( theObject = = theRPCWaitDialog ) return - 1 ;
theObject = ( ( wxWindow * ) theObject ) - > GetParent ( ) ;
}
// Continue with rest of filtering below
} else {
// Do limited filtering if shutting down to allow RPC
// completion events but not events which start new RPCs
if ( ! m_bFilterEvents ) return - 1 ;
2008-10-14 03:28:34 +00:00
}
2011-11-03 02:35:04 +00:00
2008-10-14 12:49:07 +00:00
// Allow all except Command, Timer and Mouse Moved events
2008-10-14 12:35:48 +00:00
if ( event . IsCommandEvent ( ) ) {
return false ;
}
if ( theEventType = = wxEVT_TIMER ) {
return false ;
}
2008-10-14 12:49:07 +00:00
2008-11-06 03:15:12 +00:00
# ifdef __WXMSW__
2008-10-14 12:49:07 +00:00
if ( theEventType = = wxEVT_TASKBAR_MOVE ) {
return false ;
}
2008-11-06 03:15:12 +00:00
# endif
2008-10-14 12:35:48 +00:00
return - 1 ;
2008-10-14 03:28:34 +00:00
}