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
2008-08-06 18:36:30 +00:00
// Copyright (C) 2008 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"
2006-06-15 11:11:41 +00:00
# if (defined(SANDBOX) && defined(_DEBUG))
# include "SetupSecurity.h"
# endif
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"
2007-01-09 19:03:20 +00:00
# include "common/wxFlatNotebook.h"
2010-06-28 18:05:31 +00:00
# include "BOINCInternetFSHandler.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
2008-10-30 01:55:11 +00:00
DEFINE_EVENT_TYPE ( wxEVT_RPC_FINISHED )
2004-04-10 09:11:03 +00:00
IMPLEMENT_APP ( CBOINCGUIApp )
IMPLEMENT_DYNAMIC_CLASS ( CBOINCGUIApp , wxApp )
2008-10-30 01:55:11 +00:00
BEGIN_EVENT_TABLE ( CBOINCGUIApp , wxApp )
EVT_RPC_FINISHED ( CBOINCGUIApp : : OnRPCFinished )
END_EVENT_TABLE ( )
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
# ifdef __WXMAC__
// Set s_bSkipExitConfirmation to true if cancelled because of logging out or shutting down
OSErr QuitAppleEventHandler ( const AppleEvent * appleEvt , AppleEvent * reply , UInt32 refcon ) {
DescType senderType ;
Size actualSize ;
2009-11-19 10:13:24 +00:00
ProcessSerialNumber SenderPSN ;
- 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
ProcessInfoRec pInfo ;
FSSpec fileSpec ;
OSStatus anErr ;
// Refuse to quit if a modal dialog is open.
// Unfortunately, I know of no way to disable the Quit item in our Dock menu
if ( wxGetApp ( ) . IsModalDialogDisplayed ( ) ) {
SysBeep ( 4 ) ;
return userCanceledErr ;
}
anErr = AEGetAttributePtr ( appleEvt , keyAddressAttr , typeProcessSerialNumber ,
& senderType , & SenderPSN , sizeof ( SenderPSN ) , & actualSize ) ;
if ( anErr = = noErr ) {
2009-11-19 10:13:24 +00:00
pInfo . processInfoLength = sizeof ( ProcessInfoRec ) ;
pInfo . processName = NULL ;
pInfo . processAppSpec = & fileSpec ;
- 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-11-19 10:13:24 +00:00
anErr = GetProcessInformation ( & SenderPSN , & pInfo ) ;
- 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-11-19 10:13:24 +00:00
// Consider a Quit command from our Dock menu as coming from this application
if ( ( pInfo . processSignature ! = ' dock ' ) & & ( pInfo . processSignature ! = ' BNC ! ' ) ) {
s_bSkipExitConfirmation = true ; // Not from our app, our dock icon or our taskbar icon
wxGetApp ( ) . ExitMainLoop ( ) ; // Prevents wxMac from issuing events to closed frames
- 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
}
}
return wxGetApp ( ) . MacHandleAEQuit ( ( AppleEvent * ) appleEvt , reply ) ;
}
# endif
2008-07-23 14:16:59 +00:00
2004-04-10 09:11:03 +00:00
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 ;
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
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 ;
2006-10-25 21:38:06 +00:00
# ifdef __WXMAC__
m_pMacSystemMenu = NULL ;
# 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 ;
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 ;
2006-10-20 15:00:14 +00:00
m_iGUISelected = BOINC_SIMPLEGUI ;
2008-08-20 16:07:06 +00:00
m_bSafeMessageBoxDisplayed = 0 ;
2006-10-20 15:00:14 +00:00
# ifdef __WXMSW__
m_hClientLibraryDll = NULL ;
2006-02-07 01:08:02 +00:00
# endif
2005-12-28 12:33:18 +00:00
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
// Initialize local variables
int iErrorCode = 0 ;
2008-11-04 08:08:16 +00:00
int iSelectedLanguage = 0 ;
2010-07-22 10:59:26 +00:00
bool bOpenEventLog = false ;
2008-11-04 08:08:16 +00:00
wxString strDesiredSkinName = 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
wxString strDialogMessage = wxEmptyString ;
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
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 ) ;
// Cache the current process serial number
GetCurrentProcess ( & m_psnCurrentProcess ) ;
- 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 ) ;
m_pConfig - > Read ( wxT ( " DisableAutoStart " ) , & m_iBOINCMGRDisableAutoStart , 0L ) ;
m_pConfig - > Read ( wxT ( " Language " ) , & iSelectedLanguage , 0L ) ;
m_pConfig - > Read ( wxT ( " GUISelection " ) , & m_iGUISelected , BOINC_SIMPLEGUI ) ;
2010-07-22 10:59:26 +00:00
m_pConfig - > Read ( wxT ( " EventLogOpen " ) , & bOpenEventLog ) ;
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 =
BOINC_DIAG_DUMPCALLSTACKENABLED |
BOINC_DIAG_HEAPCHECKENABLED |
BOINC_DIAG_MEMORYLEAKCHECKENABLED |
# if defined(__WXMSW__) || defined(__WXMAC__)
BOINC_DIAG_REDIRECTSTDERR |
BOINC_DIAG_REDIRECTSTDOUT |
# endif
BOINC_DIAG_TRACETOSTDOUT ;
diagnostics_init (
dwDiagnosticsFlags ,
" stdoutgui " ,
" stderrgui "
) ;
// 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 ) ;
// Look for the localization files by absolute and relative locations.
// preference given to the absolute location.
m_pLocale - > Init ( iSelectedLanguage ) ;
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 " ) ) ;
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 ( ) ) ;
2006-07-28 09:05:54 +00:00
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
- 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 ) {
2006-07-28 09:05:54 +00:00
# if (defined(__WXMAC__) && defined(_DEBUG)) // TODO: implement this for other platforms
// GDB can't attach to applications which are running as a different user
// or group, so fix up data with current user and group during debugging
2006-08-01 12:36:19 +00:00
if ( check_security ( g_use_sandbox , true ) ) {
2006-07-28 09:05:54 +00:00
CreateBOINCUsersAndGroups ( ) ;
SetBOINCDataOwnersGroupsAndPermissions ( ) ;
SetBOINCAppOwnersGroupsAndPermissions ( 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
# endif
iErrorCode = check_security ( g_use_sandbox , true ) ;
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 ) {
strDialogMessage =
2009-10-31 00:35:38 +00:00
_ ( " You currently are not authorized to manage the client. \n \n To run BOINC as this user, please: \n - reinstall BOINC answering \" Yes \" to the question about \n non-administrative users \n or \n - contact your administrator to add you to the 'boinc_master' \n user group. " ) ;
2009-09-02 02:11:03 +00:00
} else {
2006-06-21 12:41:06 +00:00
strDialogMessage . Printf (
2009-10-31 08:39:00 +00:00
_ ( " BOINC ownership or permissions are not set properly; please reinstall BOINC. \n (Error code %d) " ) ,
- 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
iErrorCode
2006-10-20 15:00:14 +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
2009-09-02 02: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
wxMessageDialog * pDlg = new wxMessageDialog ( NULL , strDialogMessage , wxT ( " BOINC Manager " ) , wxOK ) ;
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
2004-10-21 23:07:13 +00:00
// Enable known image types
2009-03-13 19:53:32 +00:00
wxInitAllImageHandlers ( ) ;
// Enable additional file system type handlers
2009-06-30 02:05:46 +00:00
wxFileSystem : : AddHandler ( new wxMemoryFSHandler ) ;
2010-06-28 18:05:31 +00:00
wxFileSystem : : AddHandler ( new CBOINCInternetFSHandler ) ;
- 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-10-20 15:00:14 +00:00
// Initialize the skin manager
2009-01-30 09:25:35 +00:00
m_pSkinManager = new CSkinManager ( m_bDebugSkins ) ;
2006-10-20 15:00:14 +00:00
wxASSERT ( m_pSkinManager ) ;
2008-11-04 08:08:16 +00:00
// Load desired manager skin
2008-11-04 09:33:03 +00:00
m_pConfig - > Read ( wxT ( " Skin " ) , & strDesiredSkinName , m_pSkinManager - > GetDefaultSkinName ( ) ) ;
2011-03-10 10:25:54 +00:00
m_pSkinManager - > ReloadSkin ( strDesiredSkinName ) ;
2004-05-21 06:27:15 +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-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
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.
if ( ! m_bMultipleInstancesOK ) {
if ( DetectDuplicateInstance ( ) ) {
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
2006-08-10 21:51:56 +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 ( )
2005-12-28 12:33:18 +00:00
) ;
2005-04-27 06:55:28 +00:00
wxASSERT ( m_pTaskBarIcon ) ;
2005-04-26 15:03:51 +00:00
# ifdef __WXMAC__
2006-07-18 11:21:13 +00:00
m_pMacSystemMenu = new CMacSystemMenu (
2006-10-20 15:00:14 +00:00
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationName ( ) ,
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationIcon ( ) ,
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationDisconnectedIcon ( ) ,
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationSnoozeIcon ( )
2006-07-18 11:21:13 +00:00
) ;
wxASSERT ( m_pMacSystemMenu ) ;
- 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 ( ) ;
# ifdef __WXMAC__
2008-10-30 01:55:11 +00:00
ProcessSerialNumber psn ;
2005-04-26 15:03:51 +00:00
ProcessInfoRec pInfo ;
OSStatus err ;
memset ( & pInfo , 0 , sizeof ( pInfo ) ) ;
pInfo . processInfoLength = sizeof ( ProcessInfoRec ) ;
2008-10-30 01:55:11 +00:00
err = GetProcessInformation ( & m_psnCurrentProcess , & pInfo ) ;
2005-04-26 15:03:51 +00:00
if ( ! err ) {
psn = pInfo . processLauncher ;
memset ( & pInfo , 0 , sizeof ( pInfo ) ) ;
pInfo . processInfoLength = sizeof ( ProcessInfoRec ) ;
err = GetProcessInformation ( & psn , & pInfo ) ;
}
// Don't open main window if we were started automatically at login
2005-04-27 12:59:53 +00:00
if ( pInfo . processSignature = = ' lgnw ' ) { // Login Window app
2006-06-28 02:43:01 +00:00
m_bGUIVisible = false ;
2005-04-27 12:59:53 +00:00
// If the system was just started, we usually get a "Connection
// failed" error if we try to connect too soon, so delay a bit.
sleep ( 10 ) ;
}
2005-04-26 15:03:51 +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
2004-11-17 09:27:06 +00:00
// Show the UI
2006-06-23 08:20:08 +00:00
SetActiveGUI ( m_iGUISelected , false ) ;
if ( m_bGUIVisible ) {
SetActiveGUI ( m_iGUISelected ) ;
2005-04-07 07:04:50 +00:00
} else {
- 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
}
2010-07-22 10:59:26 +00:00
if ( bOpenEventLog ) {
DisplayEventLog ( m_bGUIVisible ) ;
2010-07-24 00:54:10 +00:00
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 ;
}
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
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
2009-05-16 07:26:11 +00:00
m_pConfig - > SetPath ( wxT ( " / " ) ) ;
2006-10-20 15:00:14 +00:00
if ( m_pSkinManager ) {
2006-10-25 14:09:47 +00:00
m_pConfig - > Write ( wxT ( " Skin " ) , m_pSkinManager - > GetSelectedSkin ( ) ) ;
2006-10-20 15:00:14 +00:00
delete m_pSkinManager ;
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
}
2008-11-04 08:08:16 +00:00
// Save Application State
m_pConfig - > Write ( wxT ( " AutomaticallyShutdownClient " ) , m_iShutdownCoreClient ) ;
m_pConfig - > Write ( wxT ( " DisplayShutdownClientDialog " ) , m_iDisplayExitDialog ) ;
2008-11-04 09:33:03 +00:00
m_pConfig - > Write ( wxT ( " DisableAutoStart " ) , m_iBOINCMGRDisableAutoStart ) ;
2008-11-04 08:08:16 +00:00
2008-10-15 18:12:37 +00:00
diagnostics_finish ( ) ;
2004-11-23 07:45:11 +00:00
return wxApp : : OnExit ( ) ;
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 ) ;
2004-04-10 09:11:03 +00:00
static const wxCmdLineEntryDesc cmdLineDesc [ ] = {
2008-11-04 09:33:03 +00:00
{ wxCMD_LINE_SWITCH , wxT ( " a " ) , wxT ( " autostart " ) , _ ( " BOINC Manager was started by the operating system automatically " ) } ,
2009-02-25 20:51:56 +00:00
# if defined(__WXMSW__) || defined(__WXMAC__)
2004-11-19 08:11:49 +00:00
{ wxCMD_LINE_SWITCH , wxT ( " s " ) , wxT ( " systray " ) , _ ( " Startup BOINC so only the system tray icon is visible " ) } ,
2009-08-26 07:47:49 +00:00
# else
{ wxCMD_LINE_OPTION , wxT ( " e " ) , wxT ( " clientdir " ) , _ ( " Directory containing the BOINC Client executable " ) } ,
{ wxCMD_LINE_OPTION , wxT ( " d " ) , wxT ( " datadir " ) , _ ( " BOINC data directory " ) } ,
2009-02-25 20:51:56 +00:00
# endif
2010-08-07 06:48:25 +00:00
{ wxCMD_LINE_OPTION , wxT ( " n " ) , wxT ( " namehost " ) , _ ( " Host name or IP address " ) } ,
{ wxCMD_LINE_OPTION , wxT ( " g " ) , wxT ( " gui_rpc_port " ) , _ ( " GUI RPC port number " ) } ,
{ wxCMD_LINE_OPTION , wxT ( " p " ) , wxT ( " password " ) , _ ( " Password " ) } ,
2011-03-02 19:41:42 +00:00
{ wxCMD_LINE_OPTION , wxT ( " b " ) , wxT ( " boincargs " ) , _ ( " Startup BOINC with these optional arguments " ) } ,
2007-01-19 23:45:19 +00:00
{ wxCMD_LINE_SWITCH , wxT ( " i " ) , wxT ( " insecure " ) , _ ( " disable BOINC security users and permissions " ) } ,
2009-01-30 09:26:21 +00:00
{ wxCMD_LINE_SWITCH , wxT ( " c " ) , wxT ( " checkskins " ) , _ ( " set skin debugging mode to enable skin manager error messages " ) } ,
2010-10-06 11:13:07 +00:00
{ wxCMD_LINE_SWITCH , wxT ( " m " ) , wxT ( " multiple " ) , _ ( " multiple instances of BOINC Manager allowed " ) } ,
2011-11-10 22:53:12 +00:00
# ifdef __WXMAC__
{ wxCMD_LINE_OPTION , wxT ( " NSDocumentRevisionsDebugMode " ) , NULL , _ ( " Not used: workaround for bug in XCode 4.2 " ) } ,
# endif
2004-04-10 09:11:03 +00:00
{ wxCMD_LINE_NONE } //DON'T forget this line!!
} ;
parser . SetDesc ( cmdLineDesc ) ;
}
- 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 ;
}
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.
// Returns true if there is, otherwise false
///
bool CBOINCGUIApp : : DetectDuplicateInstance ( ) {
# ifdef __WXMSW__
2010-10-18 19:21:46 +00:00
if ( CTaskBarIcon : : FireAppRestore ( ) ) {
2010-10-14 18:16:24 +00:00
return true ;
}
2010-10-14 19:37:13 +00:00
# endif
# ifdef __WXMAC__
ProcessSerialNumber PSN ;
int iInstanceID = wxGetApp ( ) . IsAnotherInstanceRunning ( ) ;
if ( iInstanceID ) {
// Bring other instance to the front and exit this instance
OSStatus err = GetProcessForPID ( iInstanceID , & PSN ) ;
if ( ! err ) SetFrontProcess ( & PSN ) ;
return true ;
}
2010-10-14 18:16:24 +00:00
# endif
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 ;
# 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 ;
# endif
}
///
/// Determines where the BOINC data directory is.
///
void CBOINCGUIApp : : DetectDataDirectory ( ) {
# ifdef __WXMSW__
//
// Determine BOINCMgr Data Directory
//
LONG lReturnValue ;
HKEY hkSetupHive ;
LPTSTR lpszRegistryValue = NULL ;
DWORD dwSize = 0 ;
// 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 ,
NULL ,
NULL ,
& dwSize
) ;
if ( lReturnValue ! = ERROR_FILE_NOT_FOUND ) {
// Allocate the buffer space.
lpszRegistryValue = ( LPTSTR ) malloc ( dwSize ) ;
( * lpszRegistryValue ) = NULL ;
// Now get the data
lReturnValue = RegQueryValueEx (
hkSetupHive ,
_T ( " DATADIR " ) ,
NULL ,
NULL ,
( LPBYTE ) lpszRegistryValue ,
& dwSize
) ;
// Store the root directory for later use.
m_strBOINCMGRDataDirectory = lpszRegistryValue ;
}
}
// Cleanup
if ( hkSetupHive ) RegCloseKey ( hkSetupHive ) ;
if ( lpszRegistryValue ) free ( lpszRegistryValue ) ;
# 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 ;
}
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 ;
}
2009-12-22 20:15:55 +00:00
// Display the Event Log, it is a modeless dialog not owned by any
// other UI element.
2010-07-23 23:42:25 +00:00
void CBOINCGUIApp : : DisplayEventLog ( bool bShowWindow ) {
if ( m_pEventLog ) {
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 ) {
2010-07-23 23:42:25 +00:00
m_pEventLog - > Show ( bShowWindow ) ;
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 ) {
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 ;
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
// Reterieve the desired window state before creating the
// 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 ) ;
} else {
m_pConfig - > SetPath ( wxT ( " /Simple " ) ) ;
m_pConfig - > Read ( wxT ( " YPos " ) , & iTop , 30 ) ;
m_pConfig - > Read ( wxT ( " XPos " ) , & iLeft , 30 ) ;
# ifdef __WXMAC__
m_pConfig - > Read ( wxT ( " Width " ) , & iWidth , 409 ) ;
m_pConfig - > Read ( wxT ( " Height " ) , & iHeight , 561 ) ;
# else
m_pConfig - > Read ( wxT ( " Width " ) , & iWidth , 416 ) ;
m_pConfig - > Read ( wxT ( " Height " ) , & iHeight , 570 ) ;
# endif
}
// Make sure that the new window is going to be visible
// on a screen
# ifdef __WXMAC__
Rect titleRect = { iTop , iLeft , iTop + 22 , iLeft + iWidth } ;
InsetRect ( & titleRect , 5 , 5 ) ; // Make sure at least a 5X5 piece visible
RgnHandle displayRgn = NewRgn ( ) ;
CopyRgn ( GetGrayRgn ( ) , displayRgn ) ; // Region encompassing all displays
Rect menuRect = ( ( * * GetMainDevice ( ) ) ) . gdRect ;
menuRect . bottom = GetMBarHeight ( ) + menuRect . top ;
RgnHandle menuRgn = NewRgn ( ) ;
RectRgn ( menuRgn , & menuRect ) ; // Region hidden by menu bar
DiffRgn ( displayRgn , menuRgn , displayRgn ) ; // Subtract menu bar retion
if ( ! RectInRgn ( & titleRect , displayRgn ) )
iTop = iLeft = 30 ;
DisposeRgn ( menuRgn ) ;
DisposeRgn ( displayRgn ) ;
# 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 ( ) ,
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationIcon32 ( ) ,
wxPoint ( iLeft , iTop ) ,
wxSize ( iWidth , iHeight )
) ;
} else {
// Initialize the simple gui window
pNewFrame = new CSimpleFrame (
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationName ( ) ,
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationIcon ( ) ,
m_pSkinManager - > GetAdvanced ( ) - > GetApplicationIcon32 ( ) ,
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
2010-07-30 07:30:11 +00:00
// Note: this has the side effect of hiding the Event Log
2008-10-30 09:14:33 +00:00
if ( pOldFrame ) pOldFrame - > Destroy ( ) ;
2010-07-30 07:30:11 +00:00
// Show the new frame if needed (and show the Event Log if open)
if ( pNewFrame & & bShowWindow ) pNewFrame - > Show ( ) ;
2006-06-23 08:20:08 +00:00
}
}
// Show the new frame if needed
2009-03-09 18:02:37 +00:00
if ( m_pFrame & & ! m_pFrame - > IsShown ( ) & & bShowWindow ) {
m_pFrame - > Show ( ) ;
2010-07-23 23:42:25 +00:00
m_pFrame - > Raise ( ) ;
2010-10-18 19:21:46 +00:00
# ifdef __WXMSW__
: : SetForegroundWindow ( ( HWND ) m_pFrame - > GetHWND ( ) ) ;
# endif
2010-07-23 23:42:25 +00:00
}
// Raise the frame to the top of the Z order if needed
if ( m_pFrame & & m_pFrame - > IsShown ( ) & & bShowWindow ) {
m_pFrame - > Raise ( ) ;
2010-10-18 19:21:46 +00:00
# ifdef __WXMSW__
: : SetForegroundWindow ( ( HWND ) m_pFrame - > GetHWND ( ) ) ;
# endif
2009-03-09 18:02:37 +00:00
}
2006-06-23 08:20:08 +00:00
m_iGUISelected = iGUISelection ;
2009-03-09 18:02:37 +00:00
m_pConfig - > SetPath ( wxT ( " / " ) ) ;
2006-06-23 08:20:08 +00:00
m_pConfig - > Write ( wxT ( " GUISelection " ) , iGUISelection ) ;
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
///
/// Determines if another instance of BOINC Manager is running.
///
/// @return
/// true if another instance of BOINC Manager is running, otherwise false.
///
/// Note: will always return false on Win95, Win98, WinME
///
2010-10-06 11:13:07 +00:00
int CBOINCGUIApp : : IsAnotherInstanceRunning ( ) {
2011-09-02 17:45:29 +00:00
PROC_MAP pm ;
2010-08-11 12:18:07 +00:00
int retval ;
char myName [ 256 ] ;
2010-10-06 11:13:07 +00:00
int otherInstanceID = 0 ;
2010-08-11 12:18:07 +00:00
int myPid ;
// Look for BOINC Manager in list of all running processes
2011-09-02 17:45:29 +00:00
retval = procinfo_setup ( pm ) ;
2010-08-11 12:18:07 +00:00
if ( retval ) return false ; // Should never happen
# ifdef _WIN32
myPid = ( int ) GetCurrentProcessId ( ) ;
# else
myPid = getpid ( ) ;
# endif
// Get the name of this Application
myName [ 0 ] = 0 ;
2011-09-02 17:45:29 +00:00
PROC_MAP : : iterator i ;
for ( i = pm . begin ( ) ; i ! = pm . end ( ) ; i + + ) {
PROCINFO & pi = i - > second ;
if ( pi . id = = myPid ) {
strncpy ( myName , pi . command , sizeof ( myName ) ) ;
2010-08-11 12:18:07 +00:00
break ;
}
}
if ( myName [ 0 ] = = 0 ) {
return false ; // Should never happen
}
// Search process list for other applications with same name
2011-09-02 17:45:29 +00:00
for ( i = pm . begin ( ) ; i ! = pm . end ( ) ; i + + ) {
PROCINFO & pi = i - > second ;
if ( pi . id = = myPid ) continue ;
if ( ! strcmp ( pi . command , myName ) ) {
otherInstanceID = pi . id ;
2010-08-11 12:18:07 +00:00
break ;
}
}
2010-10-06 11:13:07 +00:00
return otherInstanceID ;
2010-08-11 12:18:07 +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
///
/// Determines if the current process is visible.
///
/// @return
/// true if the current process is visible, otherwise false.
///
bool CBOINCGUIApp : : IsApplicationVisible ( ) {
# ifdef __WXMAC__
if ( IsProcessVisible ( & m_psnCurrentProcess ) ) {
return true ;
}
# endif
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
# ifdef __WXMAC__
- 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
void CBOINCGUIApp : : ShowApplication ( bool bShow ) {
if ( bShow ) {
SetFrontProcess ( & m_psnCurrentProcess ) ;
} else {
ShowHideProcess ( & m_psnCurrentProcess , false ) ;
}
}
2008-10-30 09:14:33 +00:00
# else
void CBOINCGUIApp : : ShowApplication ( bool ) {
}
# endif
2008-08-20 16:07:06 +00:00
2009-12-18 22:44:10 +00:00
bool CBOINCGUIApp : : ShowInterface ( ) {
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-11-18 13:28:26 +00:00
void CBOINCGUIApp : : DeleteTaskBarIcon ( ) {
if ( m_pTaskBarIcon ) {
delete m_pTaskBarIcon ;
}
m_pTaskBarIcon = NULL ;
}
# ifdef __WXMAC__
void CBOINCGUIApp : : DeleteMacSystemMenu ( ) {
if ( m_pMacSystemMenu ) {
delete m_pMacSystemMenu ;
}
m_pMacSystemMenu = NULL ;
}
# endif
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
}