1
// Berkeley Open Infrastructure for Network Computing
2
// http://boinc.berkeley.edu
3
// Copyright (C) 2005 University of California
5
// This is free software; you can redistribute it and/or
6
// modify it under the terms of the GNU Lesser General Public
7
// License as published by the Free Software Foundation;
8
// either version 2.1 of the License, or (at your option) any later version.
10
// This software is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
// See the GNU Lesser General Public License for more details.
15
// To view the GNU Lesser General Public License visit
16
// http://www.gnu.org/copyleft/lesser.html
17
// or write to the Free Software Foundation, Inc.,
18
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
#if defined(__GNUG__) && !defined(__APPLE__)
21
#pragma implementation "UnavailablePage.h"
25
#include "diagnostics.h"
30
#include "error_numbers.h"
32
#include "error_numbers.h"
33
#include "BOINCGUIApp.h"
34
#include "SkinManager.h"
35
#include "MainDocument.h"
36
#include "BOINCWizards.h"
37
#include "BOINCBaseWizard.h"
38
#include "UnavailablePage.h"
42
* CErrUnavailablePage type definition
45
IMPLEMENT_DYNAMIC_CLASS( CErrUnavailablePage, wxWizardPageEx )
48
* CErrUnavailablePage event table definition
51
BEGIN_EVENT_TABLE( CErrUnavailablePage, wxWizardPageEx )
53
////@begin CErrUnavailablePage event table entries
54
EVT_WIZARDEX_PAGE_CHANGED( -1, CErrUnavailablePage::OnPageChanged )
55
EVT_WIZARDEX_CANCEL( -1, CErrUnavailablePage::OnCancel )
57
////@end CErrUnavailablePage event table entries
62
* CErrUnavailablePage constructors
65
CErrUnavailablePage::CErrUnavailablePage( )
69
CErrUnavailablePage::CErrUnavailablePage( CBOINCBaseWizard* parent )
75
* CErrUnavailablePage creator
78
bool CErrUnavailablePage::Create( CBOINCBaseWizard* parent )
80
////@begin CErrUnavailablePage member initialisation
81
m_pTitleStaticCtrl = NULL;
82
m_pDirectionsStaticCtrl = NULL;
83
////@end CErrUnavailablePage member initialisation
85
////@begin CErrUnavailablePage creation
86
wxBitmap wizardBitmap(wxNullBitmap);
87
wxWizardPageEx::Create( parent, ID_ERRUNAVAILABLEPAGE, wizardBitmap );
90
GetSizer()->Fit(this);
91
////@end CErrUnavailablePage creation
97
* Control creation for CErrUnavailablePage
100
void CErrUnavailablePage::CreateControls()
102
////@begin CErrUnavailablePage content construction
103
CErrUnavailablePage* itemWizardPage96 = this;
105
wxBoxSizer* itemBoxSizer97 = new wxBoxSizer(wxVERTICAL);
106
itemWizardPage96->SetSizer(itemBoxSizer97);
108
m_pTitleStaticCtrl = new wxStaticText;
109
m_pTitleStaticCtrl->Create( itemWizardPage96, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
110
m_pTitleStaticCtrl->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, FALSE, _T("Verdana")));
111
itemBoxSizer97->Add(m_pTitleStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5);
113
itemBoxSizer97->Add(5, 5, 0, wxALIGN_LEFT|wxALL, 5);
115
m_pDirectionsStaticCtrl = new wxStaticText;
116
m_pDirectionsStaticCtrl->Create( itemWizardPage96, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
117
itemBoxSizer97->Add(m_pDirectionsStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5);
118
////@end CErrUnavailablePage content construction
122
* Gets the previous page.
125
wxWizardPageEx* CErrUnavailablePage::GetPrev() const
127
return PAGE_TRANSITION_BACK;
131
* Gets the next page.
134
wxWizardPageEx* CErrUnavailablePage::GetNext() const
140
* Should we show tooltips?
143
bool CErrUnavailablePage::ShowToolTips()
149
* Get bitmap resources
152
wxBitmap CErrUnavailablePage::GetBitmapResource( const wxString& WXUNUSED(name) )
156
////@begin CErrUnavailablePage bitmap retrieval
158
////@end CErrUnavailablePage bitmap retrieval
165
wxIcon CErrUnavailablePage::GetIconResource( const wxString& WXUNUSED(name) )
169
////@begin CErrUnavailablePage icon retrieval
171
////@end CErrUnavailablePage icon retrieval
175
* wxEVT_WIZARD_PAGE_CHANGED event handler for ID_ERRPROJECTUNAVAILABLEPAGE
178
void CErrUnavailablePage::OnPageChanged( wxWizardExEvent& event ) {
179
if (event.GetDirection() == false) return;
181
wxASSERT(m_pTitleStaticCtrl);
182
wxASSERT(m_pDirectionsStaticCtrl);
184
if (IS_ATTACHTOPROJECTWIZARD()) {
185
m_pTitleStaticCtrl->SetLabel(
186
_("Project temporarily unavailable")
188
m_pDirectionsStaticCtrl->SetLabel(
189
_("The project is temporarily unavailable.\n\nPlease try again later.")
191
} else if (IS_ACCOUNTMANAGERWIZARD()) {
192
m_pTitleStaticCtrl->SetLabel(
193
_("Account manager temporarily unavailable")
195
m_pDirectionsStaticCtrl->SetLabel(
196
_("The account manager is temporarily unavailable.\n\nPlease try again later.")
206
* wxEVT_WIZARD_CANCEL event handler for ID_ERRPROJECTUNAVAILABLEPAGE
209
void CErrUnavailablePage::OnCancel( wxWizardExEvent& event ) {
210
PROCESS_CANCELEVENT(event);
1
// This file is part of BOINC.
2
// http://boinc.berkeley.edu
3
// Copyright (C) 2008 University of California
5
// BOINC is free software; you can redistribute it and/or modify it
6
// under the terms of the GNU Lesser General Public License
7
// as published by the Free Software Foundation,
8
// either version 3 of the License, or (at your option) any later version.
10
// BOINC is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
// See the GNU Lesser General Public License for more details.
15
// You should have received a copy of the GNU Lesser General Public License
16
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
18
#if defined(__GNUG__) && !defined(__APPLE__)
19
#pragma implementation "UnavailablePage.h"
23
#include "diagnostics.h"
28
#include "error_numbers.h"
30
#include "error_numbers.h"
31
#include "BOINCGUIApp.h"
32
#include "SkinManager.h"
33
#include "MainDocument.h"
34
#include "BOINCBaseWizard.h"
35
#include "WizardAttach.h"
36
#include "UnavailablePage.h"
40
* CErrUnavailablePage type definition
43
IMPLEMENT_DYNAMIC_CLASS( CErrUnavailablePage, wxWizardPageEx )
46
* CErrUnavailablePage event table definition
49
BEGIN_EVENT_TABLE( CErrUnavailablePage, wxWizardPageEx )
51
////@begin CErrUnavailablePage event table entries
52
EVT_WIZARDEX_PAGE_CHANGED( -1, CErrUnavailablePage::OnPageChanged )
53
EVT_WIZARDEX_CANCEL( -1, CErrUnavailablePage::OnCancel )
55
////@end CErrUnavailablePage event table entries
60
* CErrUnavailablePage constructors
63
CErrUnavailablePage::CErrUnavailablePage( )
67
CErrUnavailablePage::CErrUnavailablePage( CBOINCBaseWizard* parent )
73
* CErrUnavailablePage creator
76
bool CErrUnavailablePage::Create( CBOINCBaseWizard* parent )
78
////@begin CErrUnavailablePage member initialisation
79
m_pTitleStaticCtrl = NULL;
80
m_pDirectionsStaticCtrl = NULL;
81
////@end CErrUnavailablePage member initialisation
83
////@begin CErrUnavailablePage creation
84
wxWizardPageEx::Create( parent, ID_ERRUNAVAILABLEPAGE );
87
GetSizer()->Fit(this);
88
////@end CErrUnavailablePage creation
94
* Control creation for CErrUnavailablePage
97
void CErrUnavailablePage::CreateControls()
99
////@begin CErrUnavailablePage content construction
100
CErrUnavailablePage* itemWizardPage96 = this;
102
wxBoxSizer* itemBoxSizer97 = new wxBoxSizer(wxVERTICAL);
103
itemWizardPage96->SetSizer(itemBoxSizer97);
105
m_pTitleStaticCtrl = new wxStaticText;
106
m_pTitleStaticCtrl->Create( itemWizardPage96, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
107
m_pTitleStaticCtrl->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, FALSE, _T("Verdana")));
108
itemBoxSizer97->Add(m_pTitleStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5);
110
itemBoxSizer97->Add(5, 5, 0, wxALIGN_LEFT|wxALL, 5);
112
m_pDirectionsStaticCtrl = new wxStaticText;
113
m_pDirectionsStaticCtrl->Create( itemWizardPage96, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
114
itemBoxSizer97->Add(m_pDirectionsStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5);
115
////@end CErrUnavailablePage content construction
119
* Gets the previous page.
122
wxWizardPageEx* CErrUnavailablePage::GetPrev() const
124
return PAGE_TRANSITION_BACK;
128
* Gets the next page.
131
wxWizardPageEx* CErrUnavailablePage::GetNext() const
137
* Should we show tooltips?
140
bool CErrUnavailablePage::ShowToolTips()
146
* Get bitmap resources
149
wxBitmap CErrUnavailablePage::GetBitmapResource( const wxString& WXUNUSED(name) )
153
////@begin CErrUnavailablePage bitmap retrieval
155
////@end CErrUnavailablePage bitmap retrieval
162
wxIcon CErrUnavailablePage::GetIconResource( const wxString& WXUNUSED(name) )
166
////@begin CErrUnavailablePage icon retrieval
168
////@end CErrUnavailablePage icon retrieval
172
* wxEVT_WIZARD_PAGE_CHANGED event handler for ID_ERRPROJECTUNAVAILABLEPAGE
175
void CErrUnavailablePage::OnPageChanged( wxWizardExEvent& event ) {
176
if (event.GetDirection() == false) return;
178
wxASSERT(m_pTitleStaticCtrl);
179
wxASSERT(m_pDirectionsStaticCtrl);
181
if (IS_ATTACHTOPROJECTWIZARD()) {
182
m_pTitleStaticCtrl->SetLabel(
183
_("Project temporarily unavailable")
185
m_pDirectionsStaticCtrl->SetLabel(
186
_("The project is temporarily unavailable.\n\nPlease try again later.")
188
} else if (IS_ACCOUNTMANAGERWIZARD()) {
189
m_pTitleStaticCtrl->SetLabel(
190
_("Account manager temporarily unavailable")
192
m_pDirectionsStaticCtrl->SetLabel(
193
_("The account manager is temporarily unavailable.\n\nPlease try again later.")
203
* wxEVT_WIZARD_CANCEL event handler for ID_ERRPROJECTUNAVAILABLEPAGE
206
void CErrUnavailablePage::OnCancel( wxWizardExEvent& event ) {
207
PROCESS_CANCELEVENT(event);