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 "ProxyInfoPage.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 "ProxyInfoPage.h"
42
* CErrProxyInfoPage type definition
45
IMPLEMENT_DYNAMIC_CLASS( CErrProxyInfoPage, wxWizardPageEx )
48
* CErrProxyInfoPage event table definition
51
BEGIN_EVENT_TABLE( CErrProxyInfoPage, wxWizardPageEx )
53
////@begin CErrProxyInfoPage event table entries
54
EVT_WIZARDEX_PAGE_CHANGED( -1, CErrProxyInfoPage::OnPageChanged )
55
EVT_WIZARDEX_CANCEL( -1, CErrProxyInfoPage::OnCancel )
57
////@end CErrProxyInfoPage event table entries
62
* CErrProxyInfoPage constructors
65
CErrProxyInfoPage::CErrProxyInfoPage( )
69
CErrProxyInfoPage::CErrProxyInfoPage( CBOINCBaseWizard* parent )
75
* CErrProxyInfoPage creator
78
bool CErrProxyInfoPage::Create( CBOINCBaseWizard* parent )
80
////@begin CErrProxyInfoPage member initialisation
81
m_pTitleStaticCtrl = NULL;
82
m_pDescriptionStaticCtrl = NULL;
83
m_pDirectionsStaticCtrl = NULL;
84
////@end CErrProxyInfoPage member initialisation
86
////@begin CErrProxyInfoPage creation
87
wxBitmap wizardBitmap(wxNullBitmap);
88
wxWizardPageEx::Create( parent, ID_ERRPROXYINFOPAGE, wizardBitmap );
91
GetSizer()->Fit(this);
92
////@end CErrProxyInfoPage creation
98
* Control creation for CErrProxyInfoPage
101
void CErrProxyInfoPage::CreateControls()
103
////@begin CErrProxyInfoPage content construction
104
CErrProxyInfoPage* itemWizardPage126 = this;
106
wxBoxSizer* itemBoxSizer127 = new wxBoxSizer(wxVERTICAL);
107
itemWizardPage126->SetSizer(itemBoxSizer127);
109
m_pTitleStaticCtrl = new wxStaticText;
110
m_pTitleStaticCtrl->Create( itemWizardPage126, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
111
m_pTitleStaticCtrl->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, FALSE, _T("Verdana")));
112
itemBoxSizer127->Add(m_pTitleStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5);
114
itemBoxSizer127->Add(5, 5, 0, wxALIGN_LEFT|wxALL, 5);
116
m_pDescriptionStaticCtrl = new wxStaticText;
117
m_pDescriptionStaticCtrl->Create( itemWizardPage126, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
118
itemBoxSizer127->Add(m_pDescriptionStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5);
120
itemBoxSizer127->Add(5, 5, 0, wxALIGN_LEFT|wxALL, 5);
122
m_pDirectionsStaticCtrl = new wxStaticText;
123
m_pDirectionsStaticCtrl->Create( itemWizardPage126, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
124
itemBoxSizer127->Add(m_pDirectionsStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5);
125
////@end CErrProxyInfoPage content construction
129
* Gets the previous page.
132
wxWizardPageEx* CErrProxyInfoPage::GetPrev() const
134
return PAGE_TRANSITION_BACK;
138
* Gets the next page.
141
wxWizardPageEx* CErrProxyInfoPage::GetNext() const
143
if (CHECK_CLOSINGINPROGRESS()) {
144
// Cancel Event Detected
145
return PAGE_TRANSITION_NEXT(ID_COMPLETIONERRORPAGE);
147
return PAGE_TRANSITION_NEXT(ID_ERRPROXYPAGE);
153
* Should we show tooltips?
156
bool CErrProxyInfoPage::ShowToolTips()
162
* Get bitmap resources
165
wxBitmap CErrProxyInfoPage::GetBitmapResource( const wxString& WXUNUSED(name) )
168
////@begin CErrProxyInfoPage bitmap retrieval
170
////@end CErrProxyInfoPage bitmap retrieval
177
wxIcon CErrProxyInfoPage::GetIconResource( const wxString& WXUNUSED(name) )
181
////@begin CErrProxyInfoPage icon retrieval
183
////@end CErrProxyInfoPage icon retrieval
187
* wxEVT_WIZARD_PAGE_CHANGED event handler for ID_ERRPROXYINFOPAGE
190
void CErrProxyInfoPage::OnPageChanged( wxWizardExEvent& event ) {
191
if (event.GetDirection() == false) return;
193
wxASSERT(m_pTitleStaticCtrl);
194
wxASSERT(m_pDescriptionStaticCtrl);
195
wxASSERT(m_pDirectionsStaticCtrl);
197
m_pTitleStaticCtrl->SetLabel(
198
_("Network communication failure")
201
m_pDescriptionStaticCtrl->SetLabel(
202
_("The World Community Grid - BOINC software failed to communicate\n"
203
"over the Internet. The most likely reasons are:\n"
205
"1) Connectivity problem. Check your network or modem connection\n"
206
"and then click Back to try again.\n"
208
"2) Personal firewall software is blocking the World Community\n"
209
"Grid - BOINC software. Configure your personal firewall to let\n"
210
"BOINC and BOINC Manager communicate on port 80 and port 443,\n"
211
"then click Back to try again.\n"
213
"3) You are using a proxy server.\n"
214
"Click Next to configure BOINC's proxy settings."
218
m_pDescriptionStaticCtrl->SetLabel(
219
_("BOINC failed to communicate on the Internet.\n"
220
"The most likely reasons are:\n"
222
"1) Connectivity problem. Check your network\n"
223
"or modem connection and then click Back to try again.\n"
225
"2) Personal firewall software is blocking BOINC.\n"
226
"Configure your personal firewall to let BOINC and\n"
227
"BOINC Manager communicate on port 80,\n"
228
"then click Back to try again.\n"
230
"3) You are using a proxy server.\n"
231
"Click Next to configure BOINC's proxy settings."
240
* wxEVT_WIZARD_CANCEL event handler for ID_ERRPROXYINFOPAGE
243
void CErrProxyInfoPage::OnCancel( wxWizardExEvent& event ) {
244
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 "ProxyInfoPage.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 "ProxyInfoPage.h"
40
* CErrProxyInfoPage type definition
43
IMPLEMENT_DYNAMIC_CLASS( CErrProxyInfoPage, wxWizardPageEx )
46
* CErrProxyInfoPage event table definition
49
BEGIN_EVENT_TABLE( CErrProxyInfoPage, wxWizardPageEx )
51
////@begin CErrProxyInfoPage event table entries
52
EVT_WIZARDEX_PAGE_CHANGED( -1, CErrProxyInfoPage::OnPageChanged )
53
EVT_WIZARDEX_CANCEL( -1, CErrProxyInfoPage::OnCancel )
55
////@end CErrProxyInfoPage event table entries
60
* CErrProxyInfoPage constructors
63
CErrProxyInfoPage::CErrProxyInfoPage( )
67
CErrProxyInfoPage::CErrProxyInfoPage( CBOINCBaseWizard* parent )
73
* CErrProxyInfoPage creator
76
bool CErrProxyInfoPage::Create( CBOINCBaseWizard* parent )
78
////@begin CErrProxyInfoPage member initialisation
79
m_pTitleStaticCtrl = NULL;
80
m_pDescriptionStaticCtrl = NULL;
81
m_pDirectionsStaticCtrl = NULL;
82
////@end CErrProxyInfoPage member initialisation
84
////@begin CErrProxyInfoPage creation
85
wxWizardPageEx::Create( parent, ID_ERRPROXYINFOPAGE );
88
GetSizer()->Fit(this);
89
////@end CErrProxyInfoPage creation
95
* Control creation for CErrProxyInfoPage
98
void CErrProxyInfoPage::CreateControls()
100
////@begin CErrProxyInfoPage content construction
101
CErrProxyInfoPage* itemWizardPage126 = this;
103
wxBoxSizer* itemBoxSizer127 = new wxBoxSizer(wxVERTICAL);
104
itemWizardPage126->SetSizer(itemBoxSizer127);
106
m_pTitleStaticCtrl = new wxStaticText;
107
m_pTitleStaticCtrl->Create( itemWizardPage126, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
108
m_pTitleStaticCtrl->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, FALSE, _T("Verdana")));
109
itemBoxSizer127->Add(m_pTitleStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5);
111
itemBoxSizer127->Add(5, 5, 0, wxALIGN_LEFT|wxALL, 5);
113
m_pDescriptionStaticCtrl = new wxStaticText;
114
m_pDescriptionStaticCtrl->Create( itemWizardPage126, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
115
itemBoxSizer127->Add(m_pDescriptionStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5);
117
itemBoxSizer127->Add(5, 5, 0, wxALIGN_LEFT|wxALL, 5);
119
m_pDirectionsStaticCtrl = new wxStaticText;
120
m_pDirectionsStaticCtrl->Create( itemWizardPage126, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
121
itemBoxSizer127->Add(m_pDirectionsStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5);
122
////@end CErrProxyInfoPage content construction
126
* Gets the previous page.
129
wxWizardPageEx* CErrProxyInfoPage::GetPrev() const
131
return PAGE_TRANSITION_BACK;
135
* Gets the next page.
138
wxWizardPageEx* CErrProxyInfoPage::GetNext() const
140
if (CHECK_CLOSINGINPROGRESS()) {
141
// Cancel Event Detected
142
return PAGE_TRANSITION_NEXT(ID_COMPLETIONERRORPAGE);
144
return PAGE_TRANSITION_NEXT(ID_ERRPROXYPAGE);
150
* Should we show tooltips?
153
bool CErrProxyInfoPage::ShowToolTips()
159
* Get bitmap resources
162
wxBitmap CErrProxyInfoPage::GetBitmapResource( const wxString& WXUNUSED(name) )
165
////@begin CErrProxyInfoPage bitmap retrieval
167
////@end CErrProxyInfoPage bitmap retrieval
174
wxIcon CErrProxyInfoPage::GetIconResource( const wxString& WXUNUSED(name) )
178
////@begin CErrProxyInfoPage icon retrieval
180
////@end CErrProxyInfoPage icon retrieval
184
* wxEVT_WIZARD_PAGE_CHANGED event handler for ID_ERRPROXYINFOPAGE
187
void CErrProxyInfoPage::OnPageChanged( wxWizardExEvent& event ) {
188
if (event.GetDirection() == false) return;
190
wxASSERT(m_pTitleStaticCtrl);
191
wxASSERT(m_pDescriptionStaticCtrl);
192
wxASSERT(m_pDirectionsStaticCtrl);
194
m_pTitleStaticCtrl->SetLabel(
195
_("Network communication failure")
198
m_pDescriptionStaticCtrl->SetLabel(
199
_("The World Community Grid - BOINC software failed to communicate\nover the Internet. The most likely reasons are:\n\n1) Connectivity problem. Check your network or modem connection\nand then click Back to try again.\n\n2) Personal firewall software is blocking the World Community\nGrid - BOINC software. Configure your personal firewall to let\nBOINC and BOINC Manager communicate on port 80 and port 443,\nthen click Back to try again.\n\n3) You are using a proxy server.\nClick Next to configure BOINC's proxy settings.")
202
m_pDescriptionStaticCtrl->SetLabel(
203
_("BOINC failed to communicate on the Internet.\nThe most likely reasons are:\n\n1) Connectivity problem. Check your network\nor modem connection and then click Back to try again.\n\n2) Personal firewall software is blocking BOINC.\nConfigure your personal firewall to let BOINC and\nBOINC Manager communicate on port 80,\nthen click Back to try again.\n\n3) You are using a proxy server.\nClick Next to configure BOINC's proxy settings.")
211
* wxEVT_WIZARD_CANCEL event handler for ID_ERRPROXYINFOPAGE
214
void CErrProxyInfoPage::OnCancel( wxWizardExEvent& event ) {
215
PROCESS_CANCELEVENT(event);