author | hgs |
Thu, 24 Jun 2010 10:49:51 +0300 | |
changeset 39 | 7b3e49e4608a |
parent 19 | 10810c91db26 |
child 53 | bdc64aa9b954 |
permissions | -rw-r--r-- |
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
39 | 5 |
* under the terms of "Eclipse Public License v1.0" |
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* WPS Wizard Page: Step 3 Push button number |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
* |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
*/ |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
// System includes |
39 | 20 |
#include <HbDocumentLoader> |
21 |
#include <HbWidget> |
|
22 |
#include <HbRadioButtonList> |
|
23 |
#include <HbLineEdit> |
|
24 |
#include <HbLabel> |
|
25 |
#include <HbMainwindow> |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
26 |
|
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
27 |
// User includes |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
28 |
#include "wpswizardstepthreebutton.h" |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
29 |
#include "wpswizard_p.h" |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
|
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
31 |
// Trace includes |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
#include "OstTraceDefinitions.h" |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
#ifdef OST_TRACE_COMPILER_IN_USE |
39 | 34 |
#include "wpswizardstepthreebuttonTraces.h" |
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
#endif |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
|
39 | 37 |
// External function prototypes |
38 |
||
39 |
// Local constants |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
40 |
|
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
/*! |
39 | 42 |
\class WpsPageStepThreeButton |
43 |
\brief Implementation of wps wizard page for step three button press mode. |
|
44 |
*/ |
|
45 |
||
46 |
// ======== LOCAL FUNCTIONS ======== |
|
47 |
||
48 |
// ======== MEMBER FUNCTIONS ======== |
|
49 |
||
50 |
/*! |
|
51 |
Constructor for WPS page three button |
|
52 |
||
53 |
@param [in] parent Pointer to the WPS wizard private implementation |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
54 |
*/ |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
55 |
WpsPageStepThreeButton::WpsPageStepThreeButton(WpsWizardPrivate* parent) : |
39 | 56 |
WpsWizardPage(parent), |
57 |
mWidget(NULL), |
|
58 |
mHeading(NULL), |
|
59 |
mLoader(NULL) |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
60 |
{ |
39 | 61 |
OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_WPSPAGESTEPTHREEBUTTON_ENTRY, this); |
62 |
OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_WPSPAGESTEPTHREEBUTTON_EXIT, this); |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
63 |
|
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
64 |
} |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
65 |
|
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
66 |
/*! |
39 | 67 |
Destructor |
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
68 |
*/ |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
69 |
WpsPageStepThreeButton::~WpsPageStepThreeButton() |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
{ |
39 | 71 |
OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_WPSPAGESTEPTHREEBUTTON_DESTRUCTOR_ENTRY, this); |
72 |
delete mLoader; |
|
73 |
OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_WPSPAGESTEPTHREEBUTTON_DESTRUCTOR_EXIT, this); |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
74 |
} |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
75 |
|
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
76 |
/*! |
39 | 77 |
Loads the page with all the widgets |
78 |
||
79 |
@return HbWidget* Returns the view widget |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
80 |
*/ |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
81 |
HbWidget* WpsPageStepThreeButton::initializePage() |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
82 |
{ |
39 | 83 |
OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_INITIALIZEPAGE_ENTRY, this); |
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
84 |
|
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
85 |
if (!mWidget) { |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
86 |
bool ok; |
39 | 87 |
mLoader = new HbDocumentLoader(mWizard->mainWindow()); |
88 |
||
89 |
mLoader->load(":/docml/occ_wps_02_03.docml", &ok); |
|
90 |
Q_ASSERT(ok); |
|
91 |
||
92 |
// Initialize orientation |
|
93 |
loadDocmlSection(mWizard->mainWindow()->orientation()); |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
94 |
|
39 | 95 |
mWidget = qobject_cast<HbWidget*> (mLoader->findWidget("occ_wps_P2")); |
96 |
Q_ASSERT(mWidget); |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
97 |
|
39 | 98 |
mHeading = qobject_cast<HbLabel*> (mLoader->findWidget("label_heading")); |
99 |
Q_ASSERT(mHeading); |
|
100 |
||
101 |
mHeading->setPlainText(hbTrId("txt_occ_dialog_first_press_button_on_the_wireless")); |
|
102 |
||
103 |
bool connectOk = connect( |
|
104 |
mWizard->mainWindow(), |
|
105 |
SIGNAL(orientationChanged(Qt::Orientation)), |
|
106 |
this, |
|
107 |
SLOT(loadDocmlSection(Qt::Orientation))); |
|
108 |
Q_ASSERT(connectOk); |
|
109 |
} |
|
110 |
||
111 |
OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_INITIALIZEPAGE_EXIT, this); |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
112 |
return mWidget; |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
113 |
} |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
114 |
|
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
115 |
/*! |
39 | 116 |
Funtion to determine the next page to be displayed in the wizard process |
117 |
||
118 |
@param [out] removeFromStack bool indicating whether the current page should be |
|
119 |
removed from the stack |
|
120 |
||
121 |
@return int Page Id of the next page to be displayed. |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
122 |
*/ |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
123 |
int WpsPageStepThreeButton::nextId(bool &removeFromStack) const |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
124 |
{ |
39 | 125 |
OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_NEXTID_ENTRY, this); |
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
126 |
removeFromStack = false; |
39 | 127 |
OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_NEXTID_EXIT, this); |
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
128 |
|
39 | 129 |
return WpsWizardPage::PageWpsWizardStep4; |
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
130 |
} |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
131 |
|
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
132 |
/*! |
39 | 133 |
Determines the Number of steps to move backwards when 'Prev' Button |
134 |
is clicked |
|
135 |
||
136 |
@return int Number of pages to move backwards |
|
137 |
*/ |
|
138 |
int WpsPageStepThreeButton::previousTriggered() |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
139 |
{ |
39 | 140 |
OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_PREVIOUSTRIGGERED_ENTRY, this); |
141 |
OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_PREVIOUSTRIGGERED_EXIT, this); |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
142 |
return (PageWpsWizardStep3_Button - PageWpsWizardStep2); |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
143 |
} |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
144 |
|
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
145 |
/*! |
39 | 146 |
Loads docml at initialization phase and when HbMainWindow sends |
147 |
orientation() signal. |
|
148 |
||
149 |
@param [in] orientation orientation to be loaded. |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
150 |
*/ |
39 | 151 |
void WpsPageStepThreeButton::loadDocmlSection(Qt::Orientation orientation) |
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
152 |
{ |
39 | 153 |
bool ok = false; |
154 |
||
155 |
// Load the orientation specific section |
|
156 |
if (orientation == Qt::Horizontal) { |
|
157 |
mLoader->load(":/docml/occ_wps_02_03.docml", "landscape", &ok); |
|
158 |
Q_ASSERT(ok); |
|
159 |
} else { |
|
160 |
Q_ASSERT(orientation == Qt::Vertical); |
|
161 |
mLoader->load(":/docml/occ_wps_02_03.docml", "portrait", &ok); |
|
162 |
Q_ASSERT(ok); |
|
163 |
} |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
164 |
} |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
165 |