~ubuntu-branches/ubuntu/precise/boinc/precise

« back to all changes in this revision

Viewing changes to clientgui/CompletionPage.cpp

Tags: 6.12.8+dfsg-1
* New upstream release.
* Simplified debian/rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Berkeley Open Infrastructure for Network Computing
2
 
// http://boinc.berkeley.edu
3
 
// Copyright (C) 2005 University of California
4
 
//
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.
9
 
//
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.
14
 
//
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
19
 
//
20
 
#if defined(__GNUG__) && !defined(__APPLE__)
21
 
#pragma implementation "CompletionPage.h"
22
 
#endif
23
 
 
24
 
#include "stdwx.h"
25
 
#include "diagnostics.h"
26
 
#include "util.h"
27
 
#include "mfile.h"
28
 
#include "miofile.h"
29
 
#include "parse.h"
30
 
#include "error_numbers.h"
31
 
#include "wizardex.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 "WizardAttachProject.h"
39
 
#include "WizardAccountManager.h"
40
 
#include "CompletionPage.h"
41
 
#include "AccountInfoPage.h"
42
 
 
43
 
 
44
 
/*!
45
 
 * CCompletionPage type definition
46
 
 */
47
 
 
48
 
IMPLEMENT_DYNAMIC_CLASS( CCompletionPage, wxWizardPageEx )
49
 
 
50
 
/*!
51
 
 * CCompletionPage event table definition
52
 
 */
53
 
 
54
 
BEGIN_EVENT_TABLE( CCompletionPage, wxWizardPageEx )
55
 
 
56
 
////@begin CCompletionPage event table entries
57
 
    EVT_WIZARDEX_PAGE_CHANGED( -1, CCompletionPage::OnPageChanged )
58
 
    EVT_WIZARDEX_CANCEL( -1, CCompletionPage::OnCancel )
59
 
    EVT_WIZARDEX_FINISHED( ID_COMPLETIONPAGE, CCompletionPage::OnFinished )
60
 
 
61
 
////@end CCompletionPage event table entries
62
 
 
63
 
END_EVENT_TABLE()
64
 
  
65
 
/*!
66
 
 * CCompletionPage constructors
67
 
 */
68
 
 
69
 
CCompletionPage::CCompletionPage( )
70
 
{
71
 
}
72
 
 
73
 
CCompletionPage::CCompletionPage( CBOINCBaseWizard* parent )
74
 
{
75
 
    Create( parent );
76
 
}
77
 
 
78
 
/*!
79
 
 * CCompletionPage creator
80
 
 */
81
 
 
82
 
bool CCompletionPage::Create( CBOINCBaseWizard* parent )
83
 
{
84
 
////@begin CCompletionPage member initialisation
85
 
    m_pCompletionTitle = NULL;
86
 
    m_pCompletionWelcome = NULL;
87
 
    m_pCompletionBrandedMessage = NULL;
88
 
    m_pCompletionMessage = NULL;
89
 
////@end CCompletionPage member initialisation
90
 
 
91
 
////@begin CCompletionPage creation
92
 
    wxBitmap wizardBitmap(wxNullBitmap);
93
 
    wxWizardPageEx::Create( parent, ID_COMPLETIONPAGE, wizardBitmap );
94
 
 
95
 
    CreateControls();
96
 
    GetSizer()->Fit(this);
97
 
////@end CCompletionPage creation
98
 
 
99
 
    return TRUE;
100
 
}
101
 
  
102
 
/*!
103
 
 * Control creation for CCompletionPage
104
 
 */
105
 
 
106
 
void CCompletionPage::CreateControls()
107
 
{    
108
 
////@begin CCompletionPage content construction
109
 
    CCompletionPage* itemWizardPage79 = this;
110
 
 
111
 
    wxBoxSizer* itemBoxSizer80 = new wxBoxSizer(wxVERTICAL);
112
 
    itemWizardPage79->SetSizer(itemBoxSizer80);
113
 
 
114
 
    m_pCompletionTitle = new wxStaticText;
115
 
    m_pCompletionTitle->Create( itemWizardPage79, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
116
 
    m_pCompletionTitle->SetFont(wxFont(12, wxSWISS, wxNORMAL, wxBOLD, FALSE, wxT("Verdana")));
117
 
    itemBoxSizer80->Add(m_pCompletionTitle, 0, wxALIGN_LEFT|wxALL, 5);
118
 
 
119
 
    m_pCompletionWelcome = new wxStaticText;
120
 
    m_pCompletionWelcome->Create( itemWizardPage79, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
121
 
    m_pCompletionWelcome->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, FALSE));
122
 
    itemBoxSizer80->Add(m_pCompletionWelcome, 0, wxALIGN_LEFT|wxALL, 5);
123
 
 
124
 
    m_pCompletionBrandedMessage = new wxStaticText;
125
 
    m_pCompletionBrandedMessage->Create( itemWizardPage79, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
126
 
    itemBoxSizer80->Add(m_pCompletionBrandedMessage, 0, wxALIGN_LEFT|wxALL, 5);
127
 
 
128
 
    m_pCompletionMessage = new wxStaticText;
129
 
    m_pCompletionMessage->Create( itemWizardPage79, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
130
 
    itemBoxSizer80->Add(m_pCompletionMessage, 0, wxALIGN_LEFT|wxALL, 5);
131
 
////@end CCompletionPage content construction
132
 
}
133
 
  
134
 
/*!
135
 
 * Gets the previous page.
136
 
 */
137
 
 
138
 
wxWizardPageEx* CCompletionPage::GetPrev() const
139
 
{
140
 
    return NULL;
141
 
}
142
 
 
143
 
/*!
144
 
 * Gets the next page.
145
 
 */
146
 
 
147
 
wxWizardPageEx* CCompletionPage::GetNext() const
148
 
{
149
 
    return NULL;
150
 
}
151
 
  
152
 
/*!
153
 
 * Should we show tooltips?
154
 
 */
155
 
 
156
 
bool CCompletionPage::ShowToolTips()
157
 
{
158
 
    return TRUE;
159
 
}
160
 
  
161
 
/*!
162
 
 * Get bitmap resources
163
 
 */
164
 
 
165
 
wxBitmap CCompletionPage::GetBitmapResource( const wxString& WXUNUSED(name) )
166
 
{
167
 
    // Bitmap retrieval
168
 
////@begin CCompletionPage bitmap retrieval
169
 
    return wxNullBitmap;
170
 
////@end CCompletionPage bitmap retrieval
171
 
}
172
 
  
173
 
/*!
174
 
 * Get icon resources
175
 
 */
176
 
 
177
 
wxIcon CCompletionPage::GetIconResource( const wxString& WXUNUSED(name) )
178
 
{
179
 
    // Icon retrieval
180
 
 
181
 
////@begin CCompletionPage icon retrieval
182
 
    return wxNullIcon;
183
 
////@end CCompletionPage icon retrieval
184
 
}
185
 
  
186
 
/*!
187
 
 * wxEVT_WIZARD_PAGE_CHANGED event handler for ID_COMPLETIONPAGE
188
 
 */
189
 
 
190
 
void CCompletionPage::OnPageChanged( wxWizardExEvent& event ) {
191
 
    if (event.GetDirection() == false) return;
192
 
 
193
 
    CWizardAttachProject* pWAP = ((CWizardAttachProject*)GetParent());
194
 
    CSkinAdvanced*        pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced();
195
 
 
196
 
 
197
 
    wxASSERT(pSkinAdvanced);
198
 
    wxASSERT(m_pCompletionTitle);
199
 
    wxASSERT(m_pCompletionWelcome);
200
 
    wxASSERT(m_pCompletionBrandedMessage);
201
 
    wxASSERT(m_pCompletionMessage);
202
 
    wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced));
203
 
 
204
 
 
205
 
    if (IS_ATTACHTOPROJECTWIZARD()) {
206
 
        m_pCompletionTitle->SetLabel(
207
 
            _("Attached to project")
208
 
        );
209
 
 
210
 
        m_pCompletionWelcome->Hide();
211
 
 
212
 
        m_pCompletionBrandedMessage->SetLabel(
213
 
            _("You are now successfully attached to this project.")
214
 
        );
215
 
 
216
 
        if (pWAP->m_AccountInfoPage->m_pAccountCreateCtrl->GetValue()) {
217
 
            m_pCompletionMessage->SetLabel(
218
 
                _("When you click Finish, your web browser will go to a page where\n"
219
 
                  "you can set your account name and preferences.")
220
 
            );
221
 
        } else {
222
 
            m_pCompletionMessage->SetLabel(
223
 
                _("Click Finish to close.")
224
 
            );
225
 
        }
226
 
    } else if (IS_ACCOUNTMANAGERWIZARD()) {
227
 
 
228
 
        if (IS_ACCOUNTMANAGERUPDATEWIZARD()) {
229
 
            // Update completed
230
 
 
231
 
            wxString strTitle;
232
 
            if (pSkinAdvanced->IsBranded()) {
233
 
                // %s is the project name
234
 
                //    i.e. 'GridRepublic'
235
 
                strTitle.Printf(
236
 
                    _("Update from %s completed."),
237
 
                    pSkinAdvanced->GetApplicationShortName().c_str()
238
 
                );
239
 
            } else {
240
 
                strTitle = _("Update completed.");
241
 
            }
242
 
 
243
 
            m_pCompletionTitle->SetLabel( strTitle );
244
 
 
245
 
            m_pCompletionMessage->SetLabel(
246
 
                _("Click Finish to close.")
247
 
            );
248
 
 
249
 
        } else if (IS_ACCOUNTMANAGERREMOVEWIZARD()) {
250
 
            // Remove Completed
251
 
 
252
 
            wxString strTitle;
253
 
            if (pSkinAdvanced->IsBranded()) {
254
 
                // %s is the project name
255
 
                //    i.e. 'GridRepublic'
256
 
                strTitle.Printf(
257
 
                    _("Removal from %s completed."),
258
 
                    pSkinAdvanced->GetApplicationShortName().c_str()
259
 
                );
260
 
            } else {
261
 
                strTitle = _("Removal succeeded!");
262
 
            }
263
 
 
264
 
            m_pCompletionTitle->SetLabel( strTitle );
265
 
 
266
 
            m_pCompletionMessage->SetLabel(
267
 
                _("Click Finish to close.")
268
 
            );
269
 
 
270
 
        } else {
271
 
            // Attach Completed
272
 
 
273
 
            wxString strTitle;
274
 
            if (pSkinAdvanced->IsBranded()) {
275
 
                // %s is the project name
276
 
                //    i.e. 'GridRepublic'
277
 
                strTitle.Printf(
278
 
                    _("Attached to %s"),
279
 
                    pSkinAdvanced->GetApplicationShortName().c_str()
280
 
                );
281
 
            } else {
282
 
                strTitle = _("Attached to account manager");
283
 
            }
284
 
 
285
 
            m_pCompletionTitle->SetLabel( strTitle );
286
 
 
287
 
            if (pSkinAdvanced->IsBranded()) {
288
 
                // %s is the project name
289
 
                //    i.e. 'GridRepublic'
290
 
                wxString strWelcome;
291
 
                strWelcome.Printf(
292
 
                    _("Welcome to %s!"),
293
 
                    pSkinAdvanced->GetApplicationShortName().c_str()
294
 
                );
295
 
 
296
 
                m_pCompletionWelcome->Show();
297
 
                m_pCompletionWelcome->SetLabel( strWelcome );
298
 
            }
299
 
 
300
 
            wxString strBrandedMessage;
301
 
            if (pSkinAdvanced->IsBranded()) {
302
 
                // 1st %s is the project name
303
 
                //    i.e. 'GridRepublic'
304
 
                // 2nd %s is the account manager success message
305
 
                strBrandedMessage.Printf(
306
 
                    _("You are now successfully attached to the %s system."),
307
 
                    pSkinAdvanced->GetApplicationShortName().c_str()
308
 
                );
309
 
            } else {
310
 
                strBrandedMessage = _("You are now successfully attached to this account manager.");
311
 
            }
312
 
 
313
 
            m_pCompletionBrandedMessage->SetLabel( strBrandedMessage );
314
 
 
315
 
            m_pCompletionMessage->SetLabel(
316
 
                _("Click Finish to close.")
317
 
            );
318
 
        }
319
 
    }
320
 
 
321
 
    Fit();
322
 
 
323
 
    // Is this supposed to be completely automated?
324
 
    // If so, then go ahead and close the wizard down now.
325
 
    if (pWAP->close_when_completed) {
326
 
        pWAP->SimulateNextButton();
327
 
    }
328
 
}
329
 
  
330
 
/*!
331
 
 * wxEVT_WIZARD_CANCEL event handler for ID_COMPLETIONPAGE
332
 
 */
333
 
 
334
 
void CCompletionPage::OnCancel( wxWizardExEvent& event ) {
335
 
    PROCESS_CANCELEVENT(event);
336
 
}
337
 
 
338
 
/*!
339
 
 * wxEVT_WIZARD_FINISHED event handler for ID_COMPLETIONPAGE
340
 
 */
341
 
 
342
 
void CCompletionPage::OnFinished( wxWizardExEvent& event ) {
343
 
    event.Skip();
344
 
}
345
 
 
 
1
// This file is part of BOINC.
 
2
// http://boinc.berkeley.edu
 
3
// Copyright (C) 2008 University of California
 
4
//
 
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.
 
9
//
 
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.
 
14
//
 
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/>.
 
17
//
 
18
#if defined(__GNUG__) && !defined(__APPLE__)
 
19
#pragma implementation "CompletionPage.h"
 
20
#endif
 
21
 
 
22
#include "stdwx.h"
 
23
#include "diagnostics.h"
 
24
#include "util.h"
 
25
#include "mfile.h"
 
26
#include "miofile.h"
 
27
#include "parse.h"
 
28
#include "error_numbers.h"
 
29
#include "wizardex.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 "CompletionPage.h"
 
37
#include "AccountInfoPage.h"
 
38
 
 
39
 
 
40
/*!
 
41
 * CCompletionPage type definition
 
42
 */
 
43
 
 
44
IMPLEMENT_DYNAMIC_CLASS( CCompletionPage, wxWizardPageEx )
 
45
 
 
46
/*!
 
47
 * CCompletionPage event table definition
 
48
 */
 
49
 
 
50
BEGIN_EVENT_TABLE( CCompletionPage, wxWizardPageEx )
 
51
 
 
52
////@begin CCompletionPage event table entries
 
53
    EVT_WIZARDEX_PAGE_CHANGED( -1, CCompletionPage::OnPageChanged )
 
54
    EVT_WIZARDEX_CANCEL( -1, CCompletionPage::OnCancel )
 
55
    EVT_WIZARDEX_FINISHED( ID_COMPLETIONPAGE, CCompletionPage::OnFinished )
 
56
////@end CCompletionPage event table entries
 
57
 
 
58
END_EVENT_TABLE()
 
59
  
 
60
/*!
 
61
 * CCompletionPage constructors
 
62
 */
 
63
 
 
64
CCompletionPage::CCompletionPage( )
 
65
{
 
66
}
 
67
 
 
68
CCompletionPage::CCompletionPage( CBOINCBaseWizard* parent )
 
69
{
 
70
    Create( parent );
 
71
}
 
72
 
 
73
/*!
 
74
 * CCompletionPage creator
 
75
 */
 
76
 
 
77
bool CCompletionPage::Create( CBOINCBaseWizard* parent )
 
78
{
 
79
////@begin CCompletionPage member initialisation
 
80
    m_pCompletionTitle = NULL;
 
81
    m_pCompletionWelcome = NULL;
 
82
    m_pCompletionBrandedMessage = NULL;
 
83
    m_pCompletionMessage = NULL;
 
84
////@end CCompletionPage member initialisation
 
85
 
 
86
////@begin CCompletionPage creation
 
87
    wxWizardPageEx::Create( parent, ID_COMPLETIONPAGE );
 
88
 
 
89
    CreateControls();
 
90
    GetSizer()->Fit(this);
 
91
////@end CCompletionPage creation
 
92
 
 
93
    return TRUE;
 
94
}
 
95
  
 
96
/*!
 
97
 * Control creation for CCompletionPage
 
98
 */
 
99
 
 
100
void CCompletionPage::CreateControls()
 
101
{    
 
102
////@begin CCompletionPage content construction
 
103
    CCompletionPage* itemWizardPage79 = this;
 
104
 
 
105
    wxBoxSizer* itemBoxSizer80 = new wxBoxSizer(wxVERTICAL);
 
106
    itemWizardPage79->SetSizer(itemBoxSizer80);
 
107
 
 
108
    m_pCompletionTitle = new wxStaticText;
 
109
    m_pCompletionTitle->Create( itemWizardPage79, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
 
110
    m_pCompletionTitle->SetFont(wxFont(12, wxSWISS, wxNORMAL, wxBOLD, FALSE, wxT("Verdana")));
 
111
    itemBoxSizer80->Add(m_pCompletionTitle, 0, wxALIGN_LEFT|wxALL, 5);
 
112
 
 
113
    m_pCompletionWelcome = new wxStaticText;
 
114
    m_pCompletionWelcome->Create( itemWizardPage79, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
 
115
    m_pCompletionWelcome->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, FALSE));
 
116
    itemBoxSizer80->Add(m_pCompletionWelcome, 0, wxALIGN_LEFT|wxALL, 5);
 
117
 
 
118
    m_pCompletionBrandedMessage = new wxStaticText;
 
119
    m_pCompletionBrandedMessage->Create( itemWizardPage79, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
 
120
    itemBoxSizer80->Add(m_pCompletionBrandedMessage, 0, wxALIGN_LEFT|wxALL, 5);
 
121
 
 
122
    m_pCompletionMessage = new wxStaticText;
 
123
    m_pCompletionMessage->Create( itemWizardPage79, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
 
124
    itemBoxSizer80->Add(m_pCompletionMessage, 0, wxALIGN_LEFT|wxALL, 5);
 
125
    
 
126
#ifdef __WXMAC__
 
127
    //Accessibility
 
128
    HIViewRef textView = (HIViewRef)m_pCompletionTitle->GetHandle();
 
129
    HIObjectRef   theObject = (HIObjectRef)HIViewGetSuperview(textView);
 
130
    HIObjectSetAccessibilityIgnored(theObject, true);
 
131
#endif
 
132
    ////@end CCompletionPage content construction
 
133
}
 
134
  
 
135
/*!
 
136
 * Gets the previous page.
 
137
 */
 
138
 
 
139
wxWizardPageEx* CCompletionPage::GetPrev() const
 
140
{
 
141
    return NULL;
 
142
}
 
143
 
 
144
/*!
 
145
 * Gets the next page.
 
146
 */
 
147
 
 
148
wxWizardPageEx* CCompletionPage::GetNext() const
 
149
{
 
150
    return NULL;
 
151
}
 
152
  
 
153
/*!
 
154
 * Should we show tooltips?
 
155
 */
 
156
 
 
157
bool CCompletionPage::ShowToolTips()
 
158
{
 
159
    return TRUE;
 
160
}
 
161
  
 
162
/*!
 
163
 * Get bitmap resources
 
164
 */
 
165
 
 
166
wxBitmap CCompletionPage::GetBitmapResource( const wxString& WXUNUSED(name) )
 
167
{
 
168
    // Bitmap retrieval
 
169
////@begin CCompletionPage bitmap retrieval
 
170
    return wxNullBitmap;
 
171
////@end CCompletionPage bitmap retrieval
 
172
}
 
173
  
 
174
/*!
 
175
 * Get icon resources
 
176
 */
 
177
 
 
178
wxIcon CCompletionPage::GetIconResource( const wxString& WXUNUSED(name) )
 
179
{
 
180
    // Icon retrieval
 
181
////@begin CCompletionPage icon retrieval
 
182
    return wxNullIcon;
 
183
////@end CCompletionPage icon retrieval
 
184
}
 
185
  
 
186
/*!
 
187
 * wxEVT_WIZARD_PAGE_CHANGED event handler for ID_COMPLETIONPAGE
 
188
 */
 
189
 
 
190
void CCompletionPage::OnPageChanged( wxWizardExEvent& event ) {
 
191
    if (event.GetDirection() == false) return;
 
192
 
 
193
    CWizardAttach* pWAP = ((CWizardAttach*)GetParent());
 
194
    CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced();
 
195
 
 
196
 
 
197
    wxASSERT(pSkinAdvanced);
 
198
    wxASSERT(m_pCompletionTitle);
 
199
    wxASSERT(m_pCompletionWelcome);
 
200
    wxASSERT(m_pCompletionBrandedMessage);
 
201
    wxASSERT(m_pCompletionMessage);
 
202
    wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced));
 
203
 
 
204
 
 
205
    if (IS_ATTACHTOPROJECTWIZARD()) {
 
206
        m_pCompletionTitle->SetLabel(
 
207
            _("Project added")
 
208
        );
 
209
 
 
210
        m_pCompletionWelcome->Hide();
 
211
 
 
212
        m_pCompletionBrandedMessage->SetLabel(
 
213
            _("This project has been successfully added.")
 
214
        );
 
215
 
 
216
        if (pWAP->m_AccountInfoPage->m_pAccountCreateCtrl->GetValue()) {
 
217
            m_pCompletionMessage->SetLabel(
 
218
                _("When you click Finish, your web browser will go to a page where\nyou can set your account name and preferences.")
 
219
            );
 
220
        } else {
 
221
            m_pCompletionMessage->SetLabel(
 
222
                _("Click Finish to close.")
 
223
            );
 
224
        }
 
225
    } else if (IS_ACCOUNTMANAGERWIZARD()) {
 
226
 
 
227
        if (IS_ACCOUNTMANAGERUPDATEWIZARD()) {
 
228
            // Update completed
 
229
            wxString strTitle;
 
230
            if (pSkinAdvanced->IsBranded()) {
 
231
                strTitle.Printf(
 
232
                    _("Update from %s completed."),
 
233
                    pWAP->project_config.name.c_str() 
 
234
                );
 
235
            } else {
 
236
                strTitle = _("Update completed.");
 
237
            }
 
238
 
 
239
            m_pCompletionTitle->SetLabel( strTitle );
 
240
 
 
241
            m_pCompletionMessage->SetLabel(
 
242
                _("Click Finish to close.")
 
243
            );
 
244
 
 
245
        } else {
 
246
            // Attach Completed
 
247
            m_pCompletionTitle->SetLabel(_("Now using account manager"));
 
248
 
 
249
            if (pSkinAdvanced->IsBranded()) {
 
250
                wxString strWelcome;
 
251
                strWelcome.Printf(
 
252
                    _("Welcome to %s!"),
 
253
                    pWAP->project_config.name.c_str() 
 
254
                );
 
255
 
 
256
                m_pCompletionWelcome->Show();
 
257
                m_pCompletionWelcome->SetLabel( strWelcome );
 
258
            }
 
259
 
 
260
            wxString strBrandedMessage;
 
261
            if (pSkinAdvanced->IsBranded()) {
 
262
                strBrandedMessage.Printf(
 
263
                    _("You are now using %s to manage accounts."),
 
264
                    pWAP->project_config.name.c_str() 
 
265
                );
 
266
            } else {
 
267
                strBrandedMessage = _("You are now using this account manager.");
 
268
            }
 
269
 
 
270
            m_pCompletionBrandedMessage->SetLabel( strBrandedMessage );
 
271
 
 
272
            m_pCompletionMessage->SetLabel(
 
273
                _("Click Finish to close.")
 
274
            );
 
275
        }
 
276
    }
 
277
 
 
278
    Fit();
 
279
    int x, y, x1, y1, w, h;
 
280
    GetPosition(&x, &y);
 
281
    m_pCompletionBrandedMessage->GetPosition(&x1, &y1);
 
282
    pWAP->GetSize(&w, &h);
 
283
    m_pCompletionBrandedMessage->Wrap(w - x - x1 - 5);
 
284
    Fit();
 
285
    
 
286
    // Is this supposed to be completely automated?
 
287
    // If so, then go ahead and close the wizard down now.
 
288
    if (pWAP->close_when_completed) {
 
289
        pWAP->SimulateNextButton();
 
290
    }
 
291
}
 
292
  
 
293
/*!
 
294
 * wxEVT_WIZARD_CANCEL event handler for ID_COMPLETIONPAGE
 
295
 */
 
296
 
 
297
void CCompletionPage::OnCancel( wxWizardExEvent& event ) {
 
298
    PROCESS_CANCELEVENT(event);
 
299
}
 
300
 
 
301
/*!
 
302
 * wxEVT_WIZARD_FINISHED event handler for ID_COMPLETIONPAGE
 
303
 */
 
304
 
 
305
void CCompletionPage::OnFinished( wxWizardExEvent& event ) {
 
306
    event.Skip();
 
307
}
 
308