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"
|
2006-01-19 12:22:22 +00:00
|
|
|
#include "Events.h"
|
2007-01-09 19:03:20 +00:00
|
|
|
#include "common/wxFlatNotebook.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"
|
2006-06-23 08:20:08 +00:00
|
|
|
#include "sg_ImageLoader.h"
|
|
|
|
#include "sg_StatImageLoader.h"
|
|
|
|
#include "sg_BoincSimpleGUI.h"
|
2008-11-04 08:08:16 +00:00
|
|
|
#include "DlgExitMessage.h"
|
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-12-14 20:15:06 +00:00
|
|
|
#ifdef __WXMSW__
|
2006-03-02 19:30:39 +00:00
|
|
|
EXTERN_C BOOL ClientLibraryStartup();
|
2008-08-07 16:59:52 +00:00
|
|
|
EXTERN_C BOOL IdleTrackerAttach();
|
|
|
|
EXTERN_C void IdleTrackerDetach();
|
2006-03-02 19:30:39 +00:00
|
|
|
EXTERN_C void ClientLibraryShutdown();
|
|
|
|
EXTERN_C DWORD BOINCGetIdleTickCount();
|
2004-12-14 20:15:06 +00:00
|
|
|
#endif
|
2004-12-14 02:50:16 +00:00
|
|
|
|
2008-01-30 06:09:34 +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 ()
|
|
|
|
|
|
|
|
|
- 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
|
|
|
static bool s_bSkipExitConfirmation = false;
|
|
|
|
|
|
|
|
#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;
|
|
|
|
ProcessSerialNumber SenderPSN, ourPSN;
|
|
|
|
Boolean isSame;
|
|
|
|
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) {
|
|
|
|
|
|
|
|
GetCurrentProcess(&ourPSN);
|
|
|
|
|
|
|
|
anErr = SameProcess(&SenderPSN, &ourPSN, &isSame);
|
|
|
|
|
|
|
|
if (anErr == noErr) {
|
|
|
|
if (!isSame) {
|
|
|
|
|
|
|
|
pInfo.processInfoLength = sizeof( ProcessInfoRec );
|
|
|
|
pInfo.processName = NULL;
|
|
|
|
pInfo.processAppSpec = &fileSpec;
|
|
|
|
|
|
|
|
anErr = GetProcessInformation(&SenderPSN, &pInfo);
|
|
|
|
|
|
|
|
// Consider a Quit command from our Dock menu as coming from this application
|
|
|
|
if (pInfo.processSignature != 'dock') {
|
|
|
|
s_bSkipExitConfirmation = true; // Not from our app, our dock icon or our taskbar icon
|
|
|
|
wxGetApp().ExitMainLoop(); // Prevents wxMac from issuing events to closed frames
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
// Initialize statics
|
|
|
|
s_bSkipExitConfirmation = 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
|
2007-01-19 23:45:19 +00:00
|
|
|
m_strBOINCArguments = wxEmptyString;
|
2007-05-07 20:50:08 +00:00
|
|
|
m_strBOINCMGRRootDirectory = wxEmptyString;
|
2008-07-16 16:55:46 +00:00
|
|
|
m_strBOINCMGRDataDirectory = wxEmptyString;
|
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;
|
|
|
|
#ifdef __WXMAC__
|
|
|
|
m_pMacSystemMenu = NULL;
|
|
|
|
#endif
|
2006-10-20 15:00:14 +00:00
|
|
|
m_bGUIVisible = true;
|
2006-10-25 21:51:37 +00:00
|
|
|
m_strDefaultWindowStation = wxEmptyString;
|
|
|
|
m_strDefaultDesktop = wxEmptyString;
|
|
|
|
m_strDefaultDisplay = wxEmptyString;
|
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
|
|
|
|
- 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;
|
|
|
|
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
|
|
|
|
|
|
|
|
2006-08-01 12:36:19 +00:00
|
|
|
// Commandline parsing is done in wxApp::OnInit()
|
2006-10-20 15:00:14 +00:00
|
|
|
if (!wxApp::OnInit()) {
|
2006-08-01 12:36:19 +00:00
|
|
|
return false;
|
|
|
|
}
|
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
|
|
|
|
|
|
|
#ifdef __WXMAC__
|
|
|
|
AEInstallEventHandler( kCoreEventClass, kAEQuitApplication, NewAEEventHandlerUPP((AEEventHandlerProcPtr)QuitAppleEventHandler), 0, false );
|
|
|
|
|
|
|
|
// Cache the current process serial number
|
|
|
|
GetCurrentProcess(&m_psnCurrentProcess);
|
|
|
|
|
|
|
|
#if wxCHECK_VERSION(2,8,0)
|
|
|
|
// 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);
|
|
|
|
#endif
|
2006-08-01 12:36:19 +00:00
|
|
|
#endif
|
2006-06-10 00:17:52 +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 (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);
|
|
|
|
|
|
|
|
m_pConfig->SetPath(wxT("/"));
|
|
|
|
|
2005-02-02 22:20:25 +00:00
|
|
|
|
2008-11-04 09:33:03 +00:00
|
|
|
// Restore Application State
|
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);
|
|
|
|
|
|
|
|
|
|
|
|
// Should we abort the BOINC Manager startup process?
|
|
|
|
if (m_bBOINCMGRAutoStarted && m_iBOINCMGRDisableAutoStart) {
|
|
|
|
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
|
|
|
// Detect where BOINC Manager was installed too.
|
|
|
|
DetectRootDirectory();
|
2007-11-30 16:40:02 +00:00
|
|
|
|
2007-11-30 18:52:41 +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;
|
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);
|
|
|
|
|
2006-06-21 12:41:06 +00:00
|
|
|
strDialogMessage.Printf(
|
- 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
|
|
|
wxT("BOINC ownership or permissions are not set properly; please reinstall BOINC.\n(Error code %d)\n"),
|
|
|
|
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
|
|
|
|
|
|
|
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
|
|
|
|
2005-02-01 00:54:06 +00:00
|
|
|
// Initialize the BOINC Diagnostics Framework
|
|
|
|
int dwDiagnosticsFlags =
|
|
|
|
BOINC_DIAG_DUMPCALLSTACKENABLED |
|
|
|
|
BOINC_DIAG_HEAPCHECKENABLED |
|
|
|
|
BOINC_DIAG_MEMORYLEAKCHECKENABLED |
|
2005-05-25 19:48:01 +00:00
|
|
|
#if defined(__WXMSW__) || defined(__WXMAC__)
|
2005-02-01 00:54:06 +00:00
|
|
|
BOINC_DIAG_REDIRECTSTDERR |
|
|
|
|
BOINC_DIAG_REDIRECTSTDOUT |
|
2005-05-05 18:59:55 +00:00
|
|
|
#endif
|
2005-02-01 00:54:06 +00:00
|
|
|
BOINC_DIAG_TRACETOSTDOUT;
|
|
|
|
|
|
|
|
diagnostics_init(
|
|
|
|
dwDiagnosticsFlags,
|
|
|
|
"stdoutgui",
|
|
|
|
"stderrgui"
|
2005-04-08 16:58:55 +00:00
|
|
|
);
|
2004-12-04 05:42:22 +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
|
|
|
|
2005-02-01 00:54:06 +00:00
|
|
|
// Enable Logging and Trace Masks
|
|
|
|
m_pLog = new wxLogBOINC();
|
|
|
|
wxLog::SetActiveTarget(m_pLog);
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
m_pLog->AddTraceMask(wxT("Function Start/End"));
|
|
|
|
m_pLog->AddTraceMask(wxT("Function Status"));
|
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
|
|
|
|
2004-10-21 23:07:13 +00:00
|
|
|
// Enable known image types
|
|
|
|
wxImage::AddHandler(new wxXPMHandler);
|
2006-06-23 08:20:08 +00:00
|
|
|
wxImage::AddHandler(new wxPNGHandler);
|
2006-09-28 01:34:59 +00:00
|
|
|
wxImage::AddHandler(new wxGIFHandler);
|
|
|
|
wxImage::AddHandler(new wxICOHandler);
|
2004-10-21 23:07: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
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
// Initialize the internationalization module
|
|
|
|
m_pLocale = new wxLocale();
|
2005-04-27 06:55:28 +00:00
|
|
|
wxASSERT(m_pLocale);
|
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
|
|
|
|
2007-05-07 20:50:08 +00:00
|
|
|
// Look for the localization files by absolute and relative locations.
|
|
|
|
// preference given to the absolute location.
|
2005-02-07 04:47:18 +00:00
|
|
|
m_pLocale->Init(iSelectedLanguage);
|
2007-05-07 20:50:08 +00:00
|
|
|
if (!m_strBOINCMGRRootDirectory.IsEmpty()) {
|
|
|
|
m_pLocale->AddCatalogLookupPathPrefix(
|
2007-05-07 22:18:49 +00:00
|
|
|
wxString(m_strBOINCMGRRootDirectory + wxT("locale"))
|
2007-05-07 20:50:08 +00:00
|
|
|
);
|
|
|
|
}
|
2004-10-31 23:16:09 +00:00
|
|
|
m_pLocale->AddCatalogLookupPathPrefix(wxT("locale"));
|
2008-05-28 00:58:53 +00:00
|
|
|
m_pLocale->AddCatalog(wxT("BOINC-Manager"));
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2005-02-07 04:47:18 +00:00
|
|
|
InitSupportedLanguages();
|
|
|
|
|
- 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
|
|
|
|
2005-07-21 09:43:40 +00:00
|
|
|
// Note: JAWS for Windows will only speak the context-sensitive
|
|
|
|
// help if you use this help provider:
|
|
|
|
wxHelpProvider::Set(new wxHelpControllerHelpProvider());
|
|
|
|
|
- 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
|
|
|
|
m_pSkinManager = new CSkinManager();
|
|
|
|
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());
|
2006-10-25 14:09:47 +00:00
|
|
|
m_pSkinManager->ReloadSkin(
|
|
|
|
m_pLocale,
|
2008-11-04 08:08:16 +00:00
|
|
|
strDesiredSkinName
|
2006-10-25 14:09:47 +00:00
|
|
|
);
|
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");
|
|
|
|
|
|
|
|
wxFileInputStream fisRebootPending(strRebootPendingFile);
|
|
|
|
if (fisRebootPending.IsOk()) {
|
|
|
|
|
|
|
|
wxMessageDialog dialog(
|
|
|
|
NULL,
|
|
|
|
_("A reboot is required in order for BOINC to run properly.\nPlease 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
|
|
|
|
- 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;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Screen reader in use?
|
|
|
|
#ifdef __WXMSW__
|
|
|
|
BOOL bScreenReaderEnabled = false;
|
|
|
|
SystemParametersInfo(SPI_GETSCREENREADER, NULL, &bScreenReaderEnabled, NULL);
|
|
|
|
if (bScreenReaderEnabled) {
|
|
|
|
m_iGUISelected = BOINC_ADVANCEDGUI;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2008-10-30 01:55:11 +00:00
|
|
|
#ifdef __WXMAC__
|
|
|
|
#if 0 // We may still need this code; don't remove it yet -- CAF 1/30/08
|
|
|
|
// When running BOINC Client as a daemon / service, the menubar icon is sometimes
|
|
|
|
// unresponsive to mouse clicks if we create it before connecting to the Client.
|
|
|
|
CBOINCClientManager* pcm = m_pDocument->m_pClientManager;
|
|
|
|
if (pcm->IsSystemBooting() && pcm->IsBOINCConfiguredAsDaemon()) {
|
|
|
|
pcm->StartupBOINCCore();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
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
|
|
|
#if defined(__WXMSW__) || defined(__WXMAC__)
|
|
|
|
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);
|
2006-08-10 21:51:56 +00:00
|
|
|
#endif
|
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
|
|
|
// Detect the display info and store for later use.
|
|
|
|
DetectDisplayInfo();
|
|
|
|
|
|
|
|
|
|
|
|
// Startup the System Idle Detection code
|
|
|
|
ClientLibraryStartup();
|
|
|
|
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
|
|
|
}
|
|
|
|
|
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();
|
2006-01-23 08:47:05 +00:00
|
|
|
ClientLibraryShutdown();
|
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
|
|
|
|
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;
|
2005-04-08 16:58:55 +00:00
|
|
|
}
|
2004-04-10 09:11:03 +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")},
|
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")},
|
2007-01-19 23:45:19 +00:00
|
|
|
{ wxCMD_LINE_SWITCH, wxT("b"), wxT("boincargs"), _("Startup BOINC with these optional arguments")},
|
|
|
|
{ wxCMD_LINE_SWITCH, wxT("i"), wxT("insecure"), _("disable BOINC security users and permissions")},
|
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);
|
- 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;
|
|
|
|
}
|
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
|
|
|
}
|
2006-08-01 12:36:19 +00:00
|
|
|
if (parser.Found(wxT("insecure"))) {
|
|
|
|
g_use_sandbox = 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
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2004-11-17 09:27:06 +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 the desktop that BOINC Manager is running in.
|
|
|
|
///
|
2005-02-15 06:32:43 +00:00
|
|
|
void CBOINCGUIApp::DetectDisplayInfo() {
|
|
|
|
#ifdef __WXMSW__
|
2004-11-17 09:27:06 +00:00
|
|
|
wxChar szWindowStation[256];
|
2004-11-24 00:25:54 +00:00
|
|
|
memset(szWindowStation, 0, sizeof(szWindowStation)/sizeof(wxChar));
|
2005-02-15 06:46:42 +00:00
|
|
|
wxChar szDesktop[256];
|
2005-02-15 06:32:43 +00:00
|
|
|
memset(szDesktop, 0, sizeof(szDesktop)/sizeof(wxChar));
|
2004-11-17 09:27:06 +00:00
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
if (wxWIN95 != wxGetOsVersion(NULL, NULL)) {
|
2004-11-17 09:27:06 +00:00
|
|
|
// Retrieve the current window station and desktop names
|
2005-04-07 07:04:50 +00:00
|
|
|
GetUserObjectInformation(
|
2004-11-17 09:27:06 +00:00
|
|
|
GetProcessWindowStation(),
|
|
|
|
UOI_NAME,
|
|
|
|
szWindowStation,
|
|
|
|
(sizeof(szWindowStation) / sizeof(wxChar)),
|
|
|
|
NULL
|
|
|
|
);
|
2005-04-07 07:04:50 +00:00
|
|
|
GetUserObjectInformation(
|
2004-11-17 09:27:06 +00:00
|
|
|
GetThreadDesktop(GetCurrentThreadId()),
|
|
|
|
UOI_NAME,
|
|
|
|
szDesktop,
|
|
|
|
(sizeof(szDesktop) / sizeof(wxChar)),
|
|
|
|
NULL
|
|
|
|
);
|
2005-02-15 06:32:43 +00:00
|
|
|
m_strDefaultWindowStation = szWindowStation;
|
|
|
|
m_strDefaultDesktop = szDesktop;
|
2004-11-17 09:27:06 +00:00
|
|
|
}
|
|
|
|
|
2005-02-15 06:32:43 +00:00
|
|
|
#else
|
2006-03-23 01:17:07 +00:00
|
|
|
wxString p = wxString(getenv("DISPLAY"), wxConvUTF8);
|
2005-02-15 06:32:43 +00:00
|
|
|
if (p) m_strDefaultDisplay = p;
|
2004-11-17 09:27:06 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2004-11-23 07:45: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
|
|
|
///
|
|
|
|
/// 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)));
|
|
|
|
|
|
|
|
TCHAR *pszProg = strrchr(szPath, '\\');
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-01-23 08:47:05 +00:00
|
|
|
int CBOINCGUIApp::ClientLibraryStartup() {
|
2004-12-14 02:50:16 +00:00
|
|
|
#ifdef __WXMSW__
|
2006-03-02 19:30:39 +00:00
|
|
|
::ClientLibraryStartup();
|
2004-12-14 02:50:16 +00:00
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-08-07 16:59:52 +00:00
|
|
|
int CBOINCGUIApp::IdleTrackerAttach() {
|
|
|
|
#ifdef __WXMSW__
|
|
|
|
::IdleTrackerAttach();
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int CBOINCGUIApp::IdleTrackerDetach() {
|
|
|
|
#ifdef __WXMSW__
|
|
|
|
::IdleTrackerDetach();
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-01-23 08:47:05 +00:00
|
|
|
int CBOINCGUIApp::ClientLibraryShutdown() {
|
2004-12-14 02:50:16 +00:00
|
|
|
#ifdef __WXMSW__
|
2006-03-02 19:30:39 +00:00
|
|
|
::ClientLibraryShutdown();
|
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__
|
2006-03-02 19:30:39 +00:00
|
|
|
return BOINCGetIdleTickCount();
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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;
|
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) {
|
2006-06-23 08:20:08 +00:00
|
|
|
switch(iGUISelection) {
|
|
|
|
case BOINC_SIMPLEGUI:
|
2007-01-09 19:03:20 +00:00
|
|
|
default:
|
2006-06-23 08:20:08 +00:00
|
|
|
// Initialize the simple gui window
|
|
|
|
pNewFrame = new CSimpleFrame(
|
2006-10-20 15:00:14 +00:00
|
|
|
m_pSkinManager->GetAdvanced()->GetApplicationName(),
|
2008-06-23 17:54:44 +00:00
|
|
|
m_pSkinManager->GetAdvanced()->GetApplicationIcon(),
|
|
|
|
m_pSkinManager->GetAdvanced()->GetApplicationIcon32()
|
2006-06-23 08:20:08 +00:00
|
|
|
);
|
|
|
|
break;
|
|
|
|
case BOINC_ADVANCEDGUI:
|
|
|
|
// Initialize the advanced gui window
|
2006-06-24 05:00:57 +00:00
|
|
|
pNewFrame = new CAdvancedFrame(
|
2006-10-20 15:00:14 +00:00
|
|
|
m_pSkinManager->GetAdvanced()->GetApplicationName(),
|
2008-06-23 17:54:44 +00:00
|
|
|
m_pSkinManager->GetAdvanced()->GetApplicationIcon(),
|
|
|
|
m_pSkinManager->GetAdvanced()->GetApplicationIcon32()
|
2006-06-23 08:20:08 +00:00
|
|
|
);
|
|
|
|
break;
|
|
|
|
}
|
- 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
|
2008-10-30 09:14: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
|
|
|
|
2008-10-30 09:33:48 +00:00
|
|
|
// Show the new frame if needed
|
- 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 (pNewFrame && bShowWindow) pNewFrame->Show();
|
|
|
|
|
2006-06-23 08:20:08 +00:00
|
|
|
// Delete the old one if it exists
|
2008-10-30 09:14:33 +00:00
|
|
|
if (pOldFrame) pOldFrame->Destroy();
|
2006-06-23 08:20:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Show the new frame if needed
|
- 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 (m_pFrame && !m_pFrame->IsShown() && bShowWindow) m_pFrame->Show();
|
2006-06-23 08:20:08 +00:00
|
|
|
|
|
|
|
m_iGUISelected = iGUISelection;
|
|
|
|
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));
|
|
|
|
|
2008-11-04 21:42:58 +00:00
|
|
|
// If we are connected to the local core client and the manager is exiting
|
|
|
|
// give the user the option to shutdown the core client, even if the
|
|
|
|
// manager didn't launch the core client anyway.
|
|
|
|
if (!pDoc->m_pClientManager->WasBOINCStartedByManager()) {
|
|
|
|
pDoc->GetConnectedComputerName(strConnectedCompter);
|
|
|
|
if (!pDoc->IsComputerNameLocal(strConnectedCompter)) {
|
|
|
|
// Don't shutdown remote clients
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-11-27 15:50:15 +00:00
|
|
|
#ifndef __WXMSW__
|
2006-11-03 15:18:19 +00:00
|
|
|
// Don't run confirmation dialog if logging out or shutting down
|
|
|
|
if (s_bSkipExitConfirmation)
|
|
|
|
return 1;
|
2008-11-05 12:14:53 +00:00
|
|
|
|
|
|
|
if (!m_iDisplayExitDialog) {
|
|
|
|
return 1; // User doesn't want to display the dialog and wants to shutdown the client.
|
|
|
|
}
|
|
|
|
#else
|
2008-11-05 19:53:32 +00:00
|
|
|
if (!m_iDisplayExitDialog) {
|
|
|
|
return 1; // User doesn't want to display the dialog and just wants to use their previous value
|
|
|
|
}
|
2008-11-04 16:51:31 +00:00
|
|
|
#endif
|
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()) {
|
2008-11-27 15:50:15 +00:00
|
|
|
#ifndef __WXMSW__
|
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;
|
|
|
|
}
|
|
|
|
|
- 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
|
|
|
|
|
|
|
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-24 17:25:16 +00:00
|
|
|
#if defined(__WXMSW__) || defined(__WXMAC__)
|
2008-11-18 13:28:26 +00:00
|
|
|
void CBOINCGUIApp::DeleteTaskBarIcon() {
|
|
|
|
if (m_pTaskBarIcon) {
|
|
|
|
delete m_pTaskBarIcon;
|
|
|
|
}
|
|
|
|
m_pTaskBarIcon = NULL;
|
|
|
|
}
|
2008-11-24 17:25:16 +00:00
|
|
|
#endif
|
2008-11-18 13:28:26 +00:00
|
|
|
|
|
|
|
#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) {
|
|
|
|
if (!m_pDocument) return -1;
|
|
|
|
if (!m_pDocument->WaitingForRPC()) return -1;
|
|
|
|
|
2008-10-14 12:35:48 +00:00
|
|
|
// 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
|
|
|
|
int theEventType = event.GetEventType();
|
|
|
|
|
- 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 ((theEventType == wxEVT_COMMAND_MENU_SELECTED) && (event.GetId() == wxID_OPEN)) {
|
2008-10-14 12:35:48 +00:00
|
|
|
return -1;
|
|
|
|
}
|
2008-10-14 03:28:34 +00:00
|
|
|
|
|
|
|
wxDialog* theRPCWaitDialog = m_pDocument->GetRPCWaitDialog();
|
- 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
|
|
|
wxObject* theObject = event.GetEventObject();
|
2008-10-14 03:28:34 +00:00
|
|
|
while (theObject) {
|
- 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 (!theObject->IsKindOf(CLASSINFO(wxWindow))) break;
|
2008-10-14 03:28:34 +00:00
|
|
|
if (theObject == theRPCWaitDialog) return -1;
|
|
|
|
theObject = ((wxWindow*)theObject)->GetParent();
|
|
|
|
}
|
|
|
|
|
2008-10-30 01:55:11 +00:00
|
|
|
#if 1
|
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-30 01:55:11 +00:00
|
|
|
#else
|
|
|
|
// Reject all events except:
|
|
|
|
// - Taskbar Menu
|
|
|
|
// - Paint
|
|
|
|
// - Erase Background
|
|
|
|
if (theEventType == wxEVT_RPC_FINISHED) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef __WXMSW__
|
|
|
|
if (theEventType == wxEVT_TASKBAR_CONTEXT_MENU) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (theEventType == wxEVT_TASKBAR_RIGHT_DOWN) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (theEventType == wxEVT_TASKBAR_RIGHT_UP) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (theEventType == wxEVT_PAINT) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (theEventType == wxEVT_ERASE_BACKGROUND) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
#endif
|
2008-10-14 03:28:34 +00:00
|
|
|
}
|
|
|
|
|
2005-01-02 18:29:53 +00:00
|
|
|
const char *BOINC_RCSID_487cbf3018 = "$Id$";
|