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 "CompletionErrorPage.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 "CompletionErrorPage.h"
42
* CCompletionErrorPage type definition
45
IMPLEMENT_DYNAMIC_CLASS( CCompletionErrorPage, wxWizardPageEx )
48
* CCompletionErrorPage event table definition
51
BEGIN_EVENT_TABLE( CCompletionErrorPage, wxWizardPageEx )
53
////@begin CCompletionErrorPage event table entries
54
EVT_WIZARDEX_PAGE_CHANGED( -1, CCompletionErrorPage::OnPageChanged )
55
EVT_WIZARDEX_CANCEL( -1, CCompletionErrorPage::OnCancel )
57
////@end CCompletionErrorPage event table entries
62
* CCompletionErrorPage constructors
65
CCompletionErrorPage::CCompletionErrorPage( )
69
CCompletionErrorPage::CCompletionErrorPage( CBOINCBaseWizard* parent )
75
* CAccountResultPage creator
78
bool CCompletionErrorPage::Create( CBOINCBaseWizard* parent )
80
////@begin CCompletionErrorPage member initialisation
81
m_pTitleStaticCtrl = NULL;
82
m_pDirectionsStaticCtrl = NULL;
83
m_pServerMessagesDescriptionCtrl = NULL;
84
m_pServerMessagesStaticBoxSizerCtrl = NULL;
85
m_pServerMessagesCtrl = NULL;
86
////@end CCompletionErrorPage member initialisation
88
////@begin CCompletionErrorPage creation
89
wxBitmap wizardBitmap(wxNullBitmap);
90
wxWizardPageEx::Create( parent, ID_COMPLETIONERRORPAGE, wizardBitmap );
93
GetSizer()->Fit(this);
94
////@end CCompletionErrorPage creation
100
* Control creation for CAccountResultPage
103
void CCompletionErrorPage::CreateControls()
105
////@begin CCompletionErrorPage content construction
106
CCompletionErrorPage* itemWizardPage85 = this;
108
wxBoxSizer* itemBoxSizer86 = new wxBoxSizer(wxVERTICAL);
109
itemWizardPage85->SetSizer(itemBoxSizer86);
111
m_pTitleStaticCtrl = new wxStaticText;
112
m_pTitleStaticCtrl->Create( itemWizardPage85, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
113
m_pTitleStaticCtrl->SetFont(wxFont(12, wxSWISS, wxNORMAL, wxBOLD, FALSE, _T("Verdana")));
114
itemBoxSizer86->Add(m_pTitleStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5);
116
itemBoxSizer86->Add(5, 5, 0, wxALIGN_LEFT|wxALL, 5);
118
m_pDirectionsStaticCtrl = new wxStaticText;
119
m_pDirectionsStaticCtrl->Create( itemWizardPage85, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
120
itemBoxSizer86->Add(m_pDirectionsStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5);
122
itemBoxSizer86->Add(5, 5, 0, wxALIGN_LEFT|wxALL, 5);
124
m_pServerMessagesDescriptionCtrl = new wxStaticBox(itemWizardPage85, wxID_ANY, wxEmptyString);
125
m_pServerMessagesStaticBoxSizerCtrl = new wxStaticBoxSizer(m_pServerMessagesDescriptionCtrl, wxVERTICAL);
126
itemBoxSizer86->Add(m_pServerMessagesStaticBoxSizerCtrl, 0, wxGROW|wxALL, 5);
128
m_pServerMessagesCtrl = new wxStaticText;
129
m_pServerMessagesCtrl->Create( itemWizardPage85, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
130
m_pServerMessagesStaticBoxSizerCtrl->Add(m_pServerMessagesCtrl, 0, wxGROW|wxALL, 5);
131
////@end CCompletionErrorPage content construction
135
* Gets the previous page.
138
wxWizardPageEx* CCompletionErrorPage::GetPrev() const
144
* Gets the next page.
147
wxWizardPageEx* CCompletionErrorPage::GetNext() const
153
* Should we show tooltips?
156
bool CCompletionErrorPage::ShowToolTips()
162
* Get bitmap resources
165
wxBitmap CCompletionErrorPage::GetBitmapResource( const wxString& WXUNUSED(name) )
169
////@begin CCompletionErrorPage bitmap retrieval
171
////@end CCompletionErrorPage bitmap retrieval
178
wxIcon CCompletionErrorPage::GetIconResource( const wxString& WXUNUSED(name) )
182
////@begin CCompletionErrorPage icon retrieval
184
////@end CCompletionErrorPage icon retrieval
188
* wxEVT_WIZARD_PAGE_CHANGED event handler for ID_COMPLETIONERRORPAGE
191
void CCompletionErrorPage::OnPageChanged( wxWizardExEvent& event ) {
192
if (event.GetDirection() == false) return;
194
wxASSERT(m_pTitleStaticCtrl);
195
wxASSERT(m_pDirectionsStaticCtrl);
196
wxASSERT(m_pServerMessagesDescriptionCtrl);
197
wxASSERT(m_pServerMessagesStaticBoxSizerCtrl);
198
wxASSERT(m_pServerMessagesCtrl);
200
if (IS_ATTACHTOPROJECTWIZARD()) {
201
m_pTitleStaticCtrl->SetLabel(
202
_("Failed to attach to project")
204
} else if (IS_ACCOUNTMANAGERWIZARD()) {
205
if (IS_ACCOUNTMANAGERUPDATEWIZARD()) {
206
m_pTitleStaticCtrl->SetLabel(
207
_("Failed to update account manager")
209
} else if (IS_ACCOUNTMANAGERUPDATEWIZARD()) {
210
m_pTitleStaticCtrl->SetLabel(
211
_("Failed to remove account manager")
214
m_pTitleStaticCtrl->SetLabel(
215
_("Failed to attach to account manager")
222
if (m_pServerMessagesCtrl->GetLabel().IsEmpty()) {
223
m_pDirectionsStaticCtrl->SetLabel(
224
_("An error has occurred;\n"
225
"check Messages for details.\n"
227
"Click Finish to close.")
230
m_pDirectionsStaticCtrl->SetLabel(
231
_("Click Finish to close.")
235
if (CHECK_CLOSINGINPROGRESS() || m_pServerMessagesCtrl->GetLabel().IsEmpty()) {
236
m_pServerMessagesDescriptionCtrl->Hide();
237
m_pServerMessagesCtrl->Hide();
239
m_pServerMessagesDescriptionCtrl->SetLabel(
240
_("Messages from server:")
242
m_pServerMessagesDescriptionCtrl->Show();
243
m_pServerMessagesCtrl->Show();
250
* wxEVT_WIZARD_CANCEL event handler for ID_COMPLETIONERRORPAGE
253
void CCompletionErrorPage::OnCancel( wxWizardExEvent& event ) {
254
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 "CompletionErrorPage.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 "CompletionErrorPage.h"
40
* CCompletionErrorPage type definition
43
IMPLEMENT_DYNAMIC_CLASS( CCompletionErrorPage, wxWizardPageEx )
46
* CCompletionErrorPage event table definition
49
BEGIN_EVENT_TABLE( CCompletionErrorPage, wxWizardPageEx )
51
////@begin CCompletionErrorPage event table entries
52
EVT_WIZARDEX_PAGE_CHANGED( -1, CCompletionErrorPage::OnPageChanged )
53
EVT_WIZARDEX_CANCEL( -1, CCompletionErrorPage::OnCancel )
55
////@end CCompletionErrorPage event table entries
60
* CCompletionErrorPage constructors
63
CCompletionErrorPage::CCompletionErrorPage( )
67
CCompletionErrorPage::CCompletionErrorPage( CBOINCBaseWizard* parent )
73
* CAccountResultPage creator
76
bool CCompletionErrorPage::Create( CBOINCBaseWizard* parent )
78
////@begin CCompletionErrorPage member initialisation
79
m_pTitleStaticCtrl = NULL;
80
m_pDirectionsStaticCtrl = NULL;
81
m_pServerMessagesDescriptionCtrl = NULL;
82
m_pServerMessagesStaticBoxSizerCtrl = NULL;
83
m_pServerMessagesCtrl = NULL;
84
////@end CCompletionErrorPage member initialisation
86
////@begin CCompletionErrorPage creation
87
wxWizardPageEx::Create( parent, ID_COMPLETIONERRORPAGE );
90
GetSizer()->Fit(this);
91
////@end CCompletionErrorPage creation
97
* Control creation for CAccountResultPage
100
void CCompletionErrorPage::CreateControls()
102
////@begin CCompletionErrorPage content construction
103
CCompletionErrorPage* itemWizardPage85 = this;
105
wxBoxSizer* itemBoxSizer86 = new wxBoxSizer(wxVERTICAL);
106
itemWizardPage85->SetSizer(itemBoxSizer86);
108
m_pTitleStaticCtrl = new wxStaticText;
109
m_pTitleStaticCtrl->Create( itemWizardPage85, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
110
m_pTitleStaticCtrl->SetFont(wxFont(12, wxSWISS, wxNORMAL, wxBOLD, FALSE, _T("Verdana")));
111
itemBoxSizer86->Add(m_pTitleStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5);
113
itemBoxSizer86->Add(5, 5, 0, wxALIGN_LEFT|wxALL, 5);
115
m_pDirectionsStaticCtrl = new wxStaticText;
116
m_pDirectionsStaticCtrl->Create( itemWizardPage85, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
117
itemBoxSizer86->Add(m_pDirectionsStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5);
119
itemBoxSizer86->Add(5, 5, 0, wxALIGN_LEFT|wxALL, 5);
121
m_pServerMessagesDescriptionCtrl = new wxStaticBox(itemWizardPage85, wxID_ANY, wxEmptyString);
122
m_pServerMessagesStaticBoxSizerCtrl = new wxStaticBoxSizer(m_pServerMessagesDescriptionCtrl, wxVERTICAL);
123
itemBoxSizer86->Add(m_pServerMessagesStaticBoxSizerCtrl, 0, wxGROW|wxALL, 5);
125
m_pServerMessagesCtrl = new wxStaticText;
126
m_pServerMessagesCtrl->Create( itemWizardPage85, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
127
m_pServerMessagesStaticBoxSizerCtrl->Add(m_pServerMessagesCtrl, 0, wxGROW|wxALL, 5);
128
////@end CCompletionErrorPage content construction
132
* Gets the previous page.
135
wxWizardPageEx* CCompletionErrorPage::GetPrev() const
141
* Gets the next page.
144
wxWizardPageEx* CCompletionErrorPage::GetNext() const
150
* Should we show tooltips?
153
bool CCompletionErrorPage::ShowToolTips()
159
* Get bitmap resources
162
wxBitmap CCompletionErrorPage::GetBitmapResource( const wxString& WXUNUSED(name) )
166
////@begin CCompletionErrorPage bitmap retrieval
168
////@end CCompletionErrorPage bitmap retrieval
175
wxIcon CCompletionErrorPage::GetIconResource( const wxString& WXUNUSED(name) )
179
////@begin CCompletionErrorPage icon retrieval
181
////@end CCompletionErrorPage icon retrieval
185
* wxEVT_WIZARD_PAGE_CHANGED event handler for ID_COMPLETIONERRORPAGE
188
void CCompletionErrorPage::OnPageChanged( wxWizardExEvent& event ) {
189
if (event.GetDirection() == false) return;
191
wxASSERT(m_pTitleStaticCtrl);
192
wxASSERT(m_pDirectionsStaticCtrl);
193
wxASSERT(m_pServerMessagesDescriptionCtrl);
194
wxASSERT(m_pServerMessagesStaticBoxSizerCtrl);
195
wxASSERT(m_pServerMessagesCtrl);
197
if (IS_ATTACHTOPROJECTWIZARD()) {
198
m_pTitleStaticCtrl->SetLabel(
199
_("Failed to add project")
201
} else if (IS_ACCOUNTMANAGERWIZARD()) {
202
if (IS_ACCOUNTMANAGERUPDATEWIZARD()) {
203
m_pTitleStaticCtrl->SetLabel(
204
_("Failed to update account manager")
206
} else if (IS_ACCOUNTMANAGERUPDATEWIZARD()) {
207
m_pTitleStaticCtrl->SetLabel(
208
_("Failed to remove account manager")
211
m_pTitleStaticCtrl->SetLabel(
212
_("Failed to add account manager")
219
if (m_pServerMessagesCtrl->GetLabel().IsEmpty()) {
220
m_pDirectionsStaticCtrl->SetLabel(
221
_("An error has occurred;\ncheck Messages for details.\n\nClick Finish to close.")
224
m_pDirectionsStaticCtrl->SetLabel(
225
_("Click Finish to close.")
229
if (CHECK_CLOSINGINPROGRESS() || m_pServerMessagesCtrl->GetLabel().IsEmpty()) {
230
m_pServerMessagesDescriptionCtrl->Hide();
231
m_pServerMessagesCtrl->Hide();
233
m_pServerMessagesDescriptionCtrl->SetLabel(
234
_("Messages from server:")
236
m_pServerMessagesDescriptionCtrl->Show();
237
m_pServerMessagesCtrl->Show();
244
* wxEVT_WIZARD_CANCEL event handler for ID_COMPLETIONERRORPAGE
247
void CCompletionErrorPage::OnCancel( wxWizardExEvent& event ) {
248
PROCESS_CANCELEVENT(event);