34
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
36
|
14 |
* Description: EAP-FAST Provisioning not successfull note Dialog implementation
|
34
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
/*
|
36
|
19 |
* %version: 4 %
|
34
|
20 |
*/
|
|
21 |
|
36
|
22 |
// System includes
|
34
|
23 |
#include <HbAction>
|
|
24 |
#include <HbTranslator>
|
36
|
25 |
|
|
26 |
// User includes
|
34
|
27 |
#include "eapfastprovnotsuccessnotedialog.h"
|
|
28 |
#include "OstTraceDefinitions.h"
|
|
29 |
#ifdef OST_TRACE_COMPILER_IN_USE
|
|
30 |
#endif
|
|
31 |
|
36
|
32 |
/*!
|
|
33 |
* \class EapFastProvNotSuccessNoteDialog
|
|
34 |
* \brief Implements EAP-MSCHAPv2 New Password Input Dialog.
|
|
35 |
*/
|
|
36 |
|
|
37 |
// External function prototypes
|
|
38 |
|
|
39 |
// Local constants
|
34
|
40 |
|
36
|
41 |
//! The index numbers of the button of the dialog
|
|
42 |
static const int okButtonIndex = 1;
|
|
43 |
|
|
44 |
// ======== LOCAL FUNCTIONS ========
|
|
45 |
|
|
46 |
// ======== MEMBER FUNCTIONS ========
|
|
47 |
|
|
48 |
/*!
|
|
49 |
* Constructor.
|
|
50 |
*
|
|
51 |
* @param [in] parameters Parameters for the Constructor.
|
34
|
52 |
*/
|
|
53 |
EapFastProvNotSuccessNoteDialog::EapFastProvNotSuccessNoteDialog(const QVariantMap ¶meters)
|
36
|
54 |
:HbMessageBox(HbMessageBox::MessageTypeWarning),
|
34
|
55 |
mTranslator(new HbTranslator("eapprompts")),
|
|
56 |
mOkActionPressed(false)
|
|
57 |
{
|
|
58 |
OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_EAPFASTPROVNOTSUCCESSNOTEDIALOG_ENTRY );
|
|
59 |
qDebug("EapFastProvNotSuccessNoteDialog::EapFastProvNotSuccessNoteDialog ENTER");
|
36
|
60 |
|
|
61 |
Q_UNUSED(parameters)
|
34
|
62 |
|
36
|
63 |
createDialog();
|
34
|
64 |
|
|
65 |
OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_EAPFASTPROVNOTSUCCESSNOTEDIALOG_EXIT );
|
|
66 |
qDebug("EapFastProvNotSuccessNoteDialog::EapFastProvNotSuccessNoteDialog EXIT");
|
|
67 |
}
|
|
68 |
|
36
|
69 |
/*!
|
34
|
70 |
* The construction of the dialog
|
|
71 |
*/
|
36
|
72 |
void EapFastProvNotSuccessNoteDialog::createDialog()
|
34
|
73 |
{
|
|
74 |
OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_CREATEDIALOG_ENTRY );
|
|
75 |
qDebug("EapFastProvNotSuccessNoteDialog::createDialog ENTER");
|
|
76 |
|
|
77 |
QString text(hbTrId("txt_occ_info_provisioning_not_successful_reactiv"));
|
36
|
78 |
|
34
|
79 |
//Set the dialog to be on the screen until user reacts
|
|
80 |
//by pressing the Action button
|
|
81 |
this->setModal(true);
|
|
82 |
this->setTimeout(HbPopup::NoTimeout);
|
|
83 |
this->setDismissPolicy(HbPopup::NoDismiss);
|
|
84 |
this->setText(text);
|
|
85 |
this->setIconVisible(true);
|
|
86 |
|
|
87 |
//Remove all default actions from the dialog
|
|
88 |
QList<QAction*> action_list = this->actions();
|
|
89 |
for ( int i = 0; i < action_list.count(); i++ ) {
|
|
90 |
this->removeAction(action_list.at(i));
|
|
91 |
}
|
|
92 |
|
|
93 |
//Add a new Ok button action
|
|
94 |
HbAction* actionOk = new HbAction(hbTrId("txt_common_button_ok_single_dialog"),this);
|
|
95 |
this->addAction(actionOk);
|
|
96 |
|
|
97 |
//Disconnect action Ok from the default SLOT and connect to
|
|
98 |
//a SLOT owned by this class
|
|
99 |
disconnect(actionOk, SIGNAL(triggered()),this, SLOT(close()));
|
|
100 |
bool connected = connect(actionOk, SIGNAL(triggered()), this, SLOT(okPressed()));
|
|
101 |
Q_ASSERT(connected == true);
|
|
102 |
|
|
103 |
// Connect the about to close and hide signals, so that we are able to inform
|
|
104 |
// the caller that the dialog was closed
|
|
105 |
connected = connect(this, SIGNAL(aboutToClose()), this, SLOT(closingDialog()));
|
|
106 |
Q_ASSERT(connected == true);
|
|
107 |
connected = connect(this, SIGNAL(aboutToHide()), this, SLOT(closingDialog()));
|
|
108 |
Q_ASSERT(connected == true);
|
|
109 |
|
|
110 |
OstTraceFunctionExit0( DUP1_EAPFASTPROVNOTSUCCESSNOTEDIALOG_CREATEDIALOG_EXIT );
|
|
111 |
qDebug("EapFastProvNotSuccessNoteDialog::createDialog EXIT");
|
|
112 |
}
|
|
113 |
|
36
|
114 |
/*!
|
|
115 |
* Destructor.
|
34
|
116 |
*/
|
|
117 |
EapFastProvNotSuccessNoteDialog::~EapFastProvNotSuccessNoteDialog()
|
|
118 |
{
|
|
119 |
OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_DEAPFASTPROVNOTSUCCESSNOTEDIALOG_ENTRY );
|
|
120 |
|
|
121 |
// The dialog widgets are deleted as the dialog is deleted
|
|
122 |
|
|
123 |
OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_DEAPFASTPROVNOTSUCCESSNOTEDIALOG_EXIT );
|
|
124 |
}
|
|
125 |
|
36
|
126 |
/*!
|
34
|
127 |
* Function is called when the Ok Action button is pressed
|
|
128 |
*/
|
|
129 |
void EapFastProvNotSuccessNoteDialog::okPressed()
|
|
130 |
{
|
|
131 |
OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_OKBUTTONPRESSED_ENTRY );
|
|
132 |
qDebug("EapFastProvNotSuccessNoteDialog::okPressed ENTER");
|
|
133 |
|
|
134 |
if ( mOkActionPressed == false ) {
|
|
135 |
|
|
136 |
mOkActionPressed = true;
|
|
137 |
|
|
138 |
QVariantMap data;
|
36
|
139 |
data["okbutton"] = okButtonIndex;
|
|
140 |
|
34
|
141 |
// emit the data of the selected button and close the dialog
|
|
142 |
qDebug("EapFastProvNotSuccessNoteDialog::okPressed: emit deviceDialogData");
|
|
143 |
emit deviceDialogData(data);
|
|
144 |
|
|
145 |
closeDeviceDialog(true);
|
|
146 |
}
|
|
147 |
OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_OKBUTTONPRESSED_EXIT );
|
|
148 |
qDebug("EapFastProvNotSuccessNoteDialog::okPressed EXIT");
|
|
149 |
}
|
|
150 |
|
36
|
151 |
/*!
|
34
|
152 |
* Function is called when the dialog is about to close
|
|
153 |
*
|
|
154 |
*/
|
|
155 |
void EapFastProvNotSuccessNoteDialog::closingDialog()
|
|
156 |
{
|
|
157 |
OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_CLOSINGDIALOG_ENTRY );
|
|
158 |
qDebug("EapFastProvNotSuccessNoteDialog::closingDialog ENTER");
|
|
159 |
|
|
160 |
qDebug("EapFastProvNotSuccessNoteDialog::closingDialog EXIT");
|
|
161 |
OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_CLOSINGDIALOG_EXIT );
|
|
162 |
}
|
|
163 |
|
36
|
164 |
/*!
|
|
165 |
* Device dialog parameters to be set while dialog is displayed.
|
|
166 |
* Not supported.
|
|
167 |
*
|
|
168 |
* @param [in] parameters NOT USED
|
|
169 |
* @return true always.
|
|
170 |
*/
|
34
|
171 |
bool EapFastProvNotSuccessNoteDialog::setDeviceDialogParameters
|
|
172 |
(const QVariantMap ¶meters)
|
|
173 |
{
|
|
174 |
OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_SETDEVICEDIALOGPARAMETERS_ENTRY );
|
|
175 |
|
|
176 |
Q_UNUSED(parameters)
|
|
177 |
// changing the dialog after presenting it is not supported.
|
|
178 |
|
|
179 |
OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_SETDEVICEDIALOGPARAMETERS_EXIT );
|
|
180 |
return true;
|
|
181 |
}
|
|
182 |
|
36
|
183 |
/*!
|
|
184 |
* Not supported
|
|
185 |
*
|
|
186 |
* @return 0 always returned.
|
34
|
187 |
*/
|
|
188 |
int EapFastProvNotSuccessNoteDialog::deviceDialogError() const
|
|
189 |
{
|
|
190 |
OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_DEVICEDIALOGERROR_ENTRY );
|
|
191 |
OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_DEVICEDIALOGERROR_EXIT);
|
|
192 |
return 0;
|
|
193 |
}
|
|
194 |
|
36
|
195 |
/*!
|
34
|
196 |
* Dialog is closed and the signal about closing is emitted
|
36
|
197 |
*
|
|
198 |
* @param [in] byClient indicates when the user closes the dialog
|
34
|
199 |
*/
|
|
200 |
void EapFastProvNotSuccessNoteDialog::closeDeviceDialog(bool byClient)
|
|
201 |
{
|
|
202 |
OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_CLOSEDEVICEDIALOG_ENTRY );
|
|
203 |
qDebug("EapFastProvNotSuccessNoteDialog::closeDeviceDialog ENTER");
|
|
204 |
|
|
205 |
if ( byClient == true ) {
|
|
206 |
emit deviceDialogClosed();
|
|
207 |
}
|
|
208 |
|
|
209 |
qDebug("EapFastProvNotSuccessNoteDialog::closeDeviceDialog EXIT");
|
|
210 |
OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_CLOSEDEVICEDIALOG_EXIT );
|
|
211 |
}
|
|
212 |
|
36
|
213 |
/*!
|
34
|
214 |
* This dialog widget is returned to the caller
|
36
|
215 |
*
|
|
216 |
* @return this dialog widget
|
34
|
217 |
*/
|
|
218 |
HbPopup *EapFastProvNotSuccessNoteDialog::deviceDialogWidget() const
|
|
219 |
{
|
|
220 |
OstTraceFunctionEntry0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_DEVICEDIALOGWIDGET_ENTRY );
|
|
221 |
qDebug("EapFastProvNotSuccessNoteDialog::deviceDialogWidget ENTER");
|
|
222 |
|
|
223 |
qDebug("EapFastProvNotSuccessNoteDialog::deviceDialogWidget EXIT");
|
|
224 |
OstTraceFunctionExit0( EAPFASTPROVNOTSUCCESSNOTEDIALOG_DEVICEDIALOGWIDGET_EXIT );
|
|
225 |
|
|
226 |
return const_cast<EapFastProvNotSuccessNoteDialog*>(this);
|
|
227 |
}
|
|
228 |
|