2008-08-06 18:36:30 +00:00
|
|
|
// This file is part of BOINC.
|
2006-06-23 08:20:08 +00:00
|
|
|
// http://boinc.berkeley.edu
|
2008-08-06 18:36:30 +00:00
|
|
|
// Copyright (C) 2008 University of California
|
2006-06-23 08:20:08 +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.
|
2006-06-23 08:20:08 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
2006-06-23 08:20:08 +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.
|
|
|
|
//
|
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/>.
|
2006-06-23 08:20:08 +00:00
|
|
|
|
|
|
|
#ifndef _BOINCBASEFRAME_H_
|
|
|
|
#define _BOINCBASEFRAME_H_
|
|
|
|
|
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
|
|
|
#pragma interface "BOINCBaseFrame.cpp"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class CFrameEvent;
|
|
|
|
class CFrameAlertEvent;
|
2006-06-23 22:30:47 +00:00
|
|
|
class CBOINCDialUpManager;
|
2006-06-23 08:20:08 +00:00
|
|
|
|
|
|
|
enum FrameAlertEventType {
|
|
|
|
AlertNormal = 0,
|
|
|
|
AlertProcessResponse
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CBOINCBaseFrame : public wxFrame {
|
|
|
|
|
|
|
|
DECLARE_DYNAMIC_CLASS( CBOINCBaseFrame )
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
CBOINCBaseFrame();
|
2006-07-20 08:05:49 +00:00
|
|
|
CBOINCBaseFrame(
|
2006-06-23 08:20:08 +00:00
|
|
|
wxWindow *parent,
|
|
|
|
const wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos,
|
|
|
|
const wxSize& size,
|
|
|
|
const long style
|
|
|
|
);
|
|
|
|
|
|
|
|
~CBOINCBaseFrame();
|
|
|
|
|
2008-07-25 11:44:21 +00:00
|
|
|
void OnPeriodicRPC( wxTimerEvent& event );
|
2006-06-23 21:49:50 +00:00
|
|
|
void OnDocumentPoll( wxTimerEvent& event );
|
2006-06-23 22:30:47 +00:00
|
|
|
void OnAlertPoll( wxTimerEvent& event );
|
2008-07-29 13:06:28 +00:00
|
|
|
virtual void OnRefreshView( CFrameEvent& event );
|
2006-06-23 22:30:47 +00:00
|
|
|
|
2006-06-23 21:49:50 +00:00
|
|
|
void OnInitialized( CFrameEvent& event );
|
|
|
|
|
|
|
|
virtual void OnAlert( CFrameAlertEvent& event );
|
|
|
|
virtual void OnClose( wxCloseEvent& event );
|
2006-12-12 01:08:16 +00:00
|
|
|
virtual void OnCloseWindow( wxCommandEvent& event );
|
|
|
|
virtual void OnExit( wxCommandEvent& event );
|
- 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
|
|
|
|
|
|
|
int GetCurrentViewPage();
|
|
|
|
|
2006-06-23 08:20:08 +00:00
|
|
|
int GetReminderFrequency() { return m_iReminderFrequency; }
|
|
|
|
wxString GetDialupConnectionName() { return m_strNetworkDialupConnectionName; }
|
|
|
|
|
|
|
|
void FireInitialize();
|
|
|
|
void FireRefreshView();
|
|
|
|
void FireConnect();
|
2006-10-25 14:09:47 +00:00
|
|
|
void FireReloadSkin();
|
2008-01-11 17:56:21 +00:00
|
|
|
void ShowConnectionBadPasswordAlert( bool bUsedDefaultPassword, int m_iReadGUIRPCAuthFailure );
|
2006-06-23 08:20:08 +00:00
|
|
|
void ShowConnectionFailedAlert();
|
2008-01-30 06:09:34 +00:00
|
|
|
void ShowDaemonStartFailedAlert();
|
2006-06-23 08:20:08 +00:00
|
|
|
void ShowNotCurrentlyConnectedAlert();
|
2006-12-29 16:35:33 +00:00
|
|
|
|
|
|
|
virtual void StartTimers();
|
|
|
|
virtual void StopTimers();
|
|
|
|
|
2006-06-23 08:20:08 +00:00
|
|
|
void UpdateStatusText( const wxChar* szStatus );
|
|
|
|
|
|
|
|
void ShowAlert(
|
|
|
|
const wxString title,
|
|
|
|
const wxString message,
|
|
|
|
const int style,
|
|
|
|
const bool notification_only = false,
|
|
|
|
const FrameAlertEventType alert_event_type = AlertNormal
|
|
|
|
);
|
|
|
|
|
|
|
|
void ExecuteBrowserLink( const wxString& strLink );
|
|
|
|
|
2008-10-30 09:14:33 +00:00
|
|
|
bool Show( bool bShow = true );
|
2006-10-30 04:07:41 +00:00
|
|
|
|
2009-03-12 09:25:31 +00:00
|
|
|
virtual bool SaveState();
|
|
|
|
|
2006-06-23 08:20:08 +00:00
|
|
|
protected:
|
|
|
|
|
2006-06-23 22:30:47 +00:00
|
|
|
CBOINCDialUpManager* m_pDialupManager;
|
|
|
|
|
|
|
|
wxTimer* m_pDocumentPollTimer;
|
|
|
|
wxTimer* m_pAlertPollTimer;
|
2008-07-25 11:44:21 +00:00
|
|
|
wxTimer* m_pPeriodicRPCTimer;
|
2006-06-23 21:49:50 +00:00
|
|
|
|
2006-06-23 22:30:47 +00:00
|
|
|
int m_iSelectedLanguage;
|
|
|
|
int m_iReminderFrequency;
|
2006-06-23 08:20:08 +00:00
|
|
|
|
2006-06-23 22:30:47 +00:00
|
|
|
wxString m_strNetworkDialupConnectionName;
|
2006-06-23 08:20:08 +00:00
|
|
|
|
2006-06-23 22:30:47 +00:00
|
|
|
wxArrayString m_aSelectedComputerMRU;
|
2006-06-23 08:20:08 +00:00
|
|
|
|
2008-07-01 03:46:59 +00:00
|
|
|
bool m_bShowConnectionFailedAlert;
|
|
|
|
|
- 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
|
|
|
virtual int _GetCurrentViewPage();
|
|
|
|
|
2006-06-23 22:30:47 +00:00
|
|
|
virtual bool RestoreState();
|
2006-06-23 08:20:08 +00:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CFrameEvent : public wxEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CFrameEvent(wxEventType evtType, CBOINCBaseFrame *frame)
|
|
|
|
: wxEvent(-1, evtType)
|
|
|
|
{
|
|
|
|
SetEventObject(frame);
|
|
|
|
}
|
|
|
|
|
|
|
|
CFrameEvent(wxEventType evtType, CBOINCBaseFrame *frame, wxString message)
|
|
|
|
: wxEvent(-1, evtType), m_message(message)
|
|
|
|
{
|
|
|
|
SetEventObject(frame);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual wxEvent *Clone() const { return new CFrameEvent(*this); }
|
|
|
|
|
|
|
|
wxString m_message;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CFrameAlertEvent : public wxEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CFrameAlertEvent(wxEventType evtType, CBOINCBaseFrame *frame, wxString title, wxString message, int style, bool notification_only, FrameAlertEventType alert_event_type)
|
|
|
|
: wxEvent(-1, evtType), m_title(title), m_message(message), m_style(style), m_notification_only(notification_only), m_alert_event_type(alert_event_type)
|
|
|
|
{
|
|
|
|
SetEventObject(frame);
|
|
|
|
}
|
|
|
|
|
|
|
|
CFrameAlertEvent(wxEventType evtType, CBOINCBaseFrame *frame, wxString title, wxString message, int style, bool notification_only)
|
|
|
|
: wxEvent(-1, evtType), m_title(title), m_message(message), m_style(style), m_notification_only(notification_only)
|
|
|
|
{
|
|
|
|
SetEventObject(frame);
|
|
|
|
m_alert_event_type = AlertNormal;
|
|
|
|
}
|
|
|
|
|
|
|
|
CFrameAlertEvent(const CFrameAlertEvent& event)
|
|
|
|
: wxEvent(event)
|
|
|
|
{
|
|
|
|
m_title = event.m_title;
|
|
|
|
m_message = event.m_message;
|
|
|
|
m_style = event.m_style;
|
|
|
|
m_notification_only = event.m_notification_only;
|
|
|
|
m_alert_event_type = event.m_alert_event_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual wxEvent *Clone() const { return new CFrameAlertEvent(*this); }
|
|
|
|
virtual void ProcessResponse(const int response) const;
|
|
|
|
|
|
|
|
wxString m_title;
|
|
|
|
wxString m_message;
|
|
|
|
int m_style;
|
|
|
|
bool m_notification_only;
|
|
|
|
FrameAlertEventType m_alert_event_type;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
BEGIN_DECLARE_EVENT_TYPES()
|
|
|
|
DECLARE_EVENT_TYPE( wxEVT_FRAME_ALERT, 10000 )
|
|
|
|
DECLARE_EVENT_TYPE( wxEVT_FRAME_CONNECT, 10001 )
|
|
|
|
DECLARE_EVENT_TYPE( wxEVT_FRAME_INITIALIZED, 10004 )
|
|
|
|
DECLARE_EVENT_TYPE( wxEVT_FRAME_REFRESHVIEW, 10005 )
|
|
|
|
DECLARE_EVENT_TYPE( wxEVT_FRAME_UPDATESTATUS, 10006 )
|
2006-10-25 14:09:47 +00:00
|
|
|
DECLARE_EVENT_TYPE( wxEVT_FRAME_RELOADSKIN, 10007 )
|
2008-10-30 01:55:11 +00:00
|
|
|
|
2006-06-23 08:20:08 +00:00
|
|
|
END_DECLARE_EVENT_TYPES()
|
|
|
|
|
|
|
|
#define EVT_FRAME_ALERT(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_FRAME_ALERT, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL),
|
|
|
|
#define EVT_FRAME_CONNECT(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_FRAME_CONNECT, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL),
|
|
|
|
#define EVT_FRAME_INITIALIZED(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_FRAME_INITIALIZED, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL),
|
|
|
|
#define EVT_FRAME_REFRESH(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_FRAME_REFRESHVIEW, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL),
|
|
|
|
#define EVT_FRAME_UPDATESTATUS(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_FRAME_UPDATESTATUS, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL),
|
2006-10-26 18:58:52 +00:00
|
|
|
#define EVT_FRAME_RELOADSKIN(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_FRAME_RELOADSKIN, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL),
|
2008-10-30 01:55:11 +00:00
|
|
|
|
2006-06-23 08:20:08 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|