26
|
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 |
*
|
|
14 |
* Description: Prompt Dialog implementation
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "eapfastprovnotsuccessnotedialog.h"
|
|
19 |
#include "OstTraceDefinitions.h"
|
|
20 |
#ifdef OST_TRACE_COMPILER_IN_USE
|
|
21 |
#endif
|
|
22 |
|
|
23 |
// The index numbers of the button of the dialog
|
|
24 |
const int okButtonIndex = 1;
|
|
25 |
|
|
26 |
/**
|
|
27 |
* The constructor
|
|
28 |
*/
|
|
29 |
EapFastProvNotSuccessNoteDialog::EapFastProvNotSuccessNoteDialog(const QVariantMap ¶meters)
|
|
30 |
:HbMessageBox("default text...",HbMessageBox::MessageTypeWarning),
|
|
31 |
mActionOk(NULL),
|
|
32 |
mTranslator(new HbTranslator("eapprompts"))
|
|
33 |
{
|
|
34 |
OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_EAPMSCHAPV2PWDEXPNOTEDIALOG_ENTRY );
|
|
35 |
qDebug("EapFastProvNotSuccessNoteDialog::EapFastProvNotSuccessNoteDialog ENTER");
|
|
36 |
|
|
37 |
createDialog( parameters );
|
|
38 |
|
|
39 |
mOkActionPressed = false;
|
|
40 |
|
|
41 |
OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_EAPMSCHAPV2PWDEXPNOTEDIALOG_EXIT );
|
|
42 |
qDebug("EapFastProvNotSuccessNoteDialog::EapFastProvNotSuccessNoteDialog EXIT");
|
|
43 |
}
|
|
44 |
|
|
45 |
|
|
46 |
/**
|
|
47 |
* The construction of the dialog
|
|
48 |
*/
|
|
49 |
void EapFastProvNotSuccessNoteDialog::createDialog(const QVariantMap ¶meters )
|
|
50 |
{
|
|
51 |
OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_CREATEDIALOG_ENTRY );
|
|
52 |
qDebug("EapFastProvNotSuccessNoteDialog::createDialog ENTER");
|
|
53 |
|
|
54 |
QString text = QString(hbTrId("txt_occ_info_provisioning_not_successful_reactiv"));
|
|
55 |
|
|
56 |
Q_UNUSED(parameters)
|
|
57 |
|
|
58 |
//Set the dialog to be on the screen until user reacts
|
|
59 |
//by pressing the Action button
|
|
60 |
this->setModal(true);
|
|
61 |
this->setTimeout(HbPopup::NoTimeout);
|
|
62 |
this->setDismissPolicy(HbPopup::NoDismiss);
|
|
63 |
|
|
64 |
this->setText(text);
|
|
65 |
this->setIconVisible(true);
|
|
66 |
|
|
67 |
QList<QAction*> action_list = this->actions();
|
|
68 |
|
|
69 |
for ( int i = 0; i < action_list.count(); i++ ) {
|
|
70 |
this->removeAction(action_list.at(i));
|
|
71 |
}
|
|
72 |
|
|
73 |
mActionOk = new HbAction(hbTrId("txt_common_button_ok_single_dialog"),this);
|
|
74 |
this->addAction(mActionOk);
|
|
75 |
|
|
76 |
disconnect(mActionOk, SIGNAL(triggered()),this, SLOT(close()));
|
|
77 |
bool connected = connect(mActionOk, SIGNAL(triggered()), this, SLOT(okPressed()));
|
|
78 |
Q_ASSERT(connected == true);
|
|
79 |
|
|
80 |
// Connect the about to close and hide signals, so that we are able to inform
|
|
81 |
// the caller that the dialog was closed
|
|
82 |
connected = connect(this, SIGNAL(aboutToClose()), this, SLOT(closingDialog()));
|
|
83 |
Q_ASSERT(connected == true);
|
|
84 |
connected = connect(this, SIGNAL(aboutToHide()), this, SLOT(closingDialog()));
|
|
85 |
Q_ASSERT(connected == true);
|
|
86 |
|
|
87 |
OstTraceFunctionExit0( DUP1_EAPMSCHAPV2PWDEXPNOTEDIALOG_CREATEDIALOG_EXIT );
|
|
88 |
qDebug("EapFastProvNotSuccessNoteDialog::createDialog EXIT");
|
|
89 |
}
|
|
90 |
|
|
91 |
/**
|
|
92 |
* Destructor
|
|
93 |
*/
|
|
94 |
EapFastProvNotSuccessNoteDialog::~EapFastProvNotSuccessNoteDialog()
|
|
95 |
{
|
|
96 |
OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_DEAPMSCHAPV2PWDEXPNOTEDIALOG_ENTRY );
|
|
97 |
|
|
98 |
// The dialog widgets are deleted as the dialog is deleted
|
|
99 |
|
|
100 |
OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_DEAPMSCHAPV2PWDEXPNOTEDIALOG_EXIT );
|
|
101 |
}
|
|
102 |
|
|
103 |
/**
|
|
104 |
* Function is called when the Ok Action button is pressed
|
|
105 |
*/
|
|
106 |
void EapFastProvNotSuccessNoteDialog::okPressed()
|
|
107 |
{
|
|
108 |
OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_OKBUTTONPRESSED_ENTRY );
|
|
109 |
qDebug("EapFastProvNotSuccessNoteDialog::okPressed ENTER");
|
|
110 |
|
|
111 |
if ( mOkActionPressed == false ) {
|
|
112 |
|
|
113 |
mOkActionPressed = true;
|
|
114 |
|
|
115 |
QVariantMap data;
|
|
116 |
QVariant variant(okButtonIndex);
|
|
117 |
data.insert("okbutton", variant);
|
|
118 |
// emit the data of the selected button and close the dialog
|
|
119 |
qDebug("EapFastProvNotSuccessNoteDialog::okPressed: emit deviceDialogData");
|
|
120 |
emit deviceDialogData(data);
|
|
121 |
|
|
122 |
closeDeviceDialog(true);
|
|
123 |
}
|
|
124 |
OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_OKBUTTONPRESSED_EXIT );
|
|
125 |
qDebug("EapFastProvNotSuccessNoteDialog::okPressed EXIT");
|
|
126 |
}
|
|
127 |
|
|
128 |
/**
|
|
129 |
* Function is called when the dialog is about to close
|
|
130 |
*
|
|
131 |
*/
|
|
132 |
void EapFastProvNotSuccessNoteDialog::closingDialog()
|
|
133 |
{
|
|
134 |
OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_CLOSINGDIALOG_ENTRY );
|
|
135 |
qDebug("EapFastProvNotSuccessNoteDialog::closingDialog ENTER");
|
|
136 |
|
|
137 |
closeDeviceDialog(false);
|
|
138 |
|
|
139 |
qDebug("EapFastProvNotSuccessNoteDialog::closingDialog EXIT");
|
|
140 |
OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_CLOSINGDIALOG_EXIT );
|
|
141 |
}
|
|
142 |
|
|
143 |
/**
|
|
144 |
* Updating the dialog during its showing is not allowed.
|
|
145 |
*/
|
|
146 |
bool EapFastProvNotSuccessNoteDialog::setDeviceDialogParameters
|
|
147 |
(const QVariantMap ¶meters)
|
|
148 |
{
|
|
149 |
OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_SETDEVICEDIALOGPARAMETERS_ENTRY );
|
|
150 |
|
|
151 |
Q_UNUSED(parameters)
|
|
152 |
// changing the dialog after presenting it is not supported.
|
|
153 |
|
|
154 |
OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_SETDEVICEDIALOGPARAMETERS_EXIT );
|
|
155 |
return true;
|
|
156 |
}
|
|
157 |
|
|
158 |
/**
|
|
159 |
* Not supported, 0 always returned
|
|
160 |
*/
|
|
161 |
int EapFastProvNotSuccessNoteDialog::deviceDialogError() const
|
|
162 |
{
|
|
163 |
OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_DEVICEDIALOGERROR_ENTRY );
|
|
164 |
OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_DEVICEDIALOGERROR_EXIT);
|
|
165 |
return 0;
|
|
166 |
}
|
|
167 |
|
|
168 |
/**
|
|
169 |
* Dialog is closed and the signal about closing is emitted
|
|
170 |
*/
|
|
171 |
void EapFastProvNotSuccessNoteDialog::closeDeviceDialog(bool byClient)
|
|
172 |
{
|
|
173 |
OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_CLOSEDEVICEDIALOG_ENTRY );
|
|
174 |
qDebug("EapFastProvNotSuccessNoteDialog::closeDeviceDialog ENTER");
|
|
175 |
|
|
176 |
if ( byClient == true ) {
|
|
177 |
emit deviceDialogClosed();
|
|
178 |
}
|
|
179 |
|
|
180 |
qDebug("EapFastProvNotSuccessNoteDialog::closeDeviceDialog EXIT");
|
|
181 |
OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_CLOSEDEVICEDIALOG_EXIT );
|
|
182 |
}
|
|
183 |
|
|
184 |
/**
|
|
185 |
* This dialog widget is returned to the caller
|
|
186 |
*/
|
|
187 |
HbPopup *EapFastProvNotSuccessNoteDialog::deviceDialogWidget() const
|
|
188 |
{
|
|
189 |
OstTraceFunctionEntry0( EAPMSCHAPV2PWDEXPNOTEDIALOG_DEVICEDIALOGWIDGET_ENTRY );
|
|
190 |
qDebug("EapFastProvNotSuccessNoteDialog::deviceDialogWidget ENTER");
|
|
191 |
|
|
192 |
qDebug("EapFastProvNotSuccessNoteDialog::deviceDialogWidget EXIT");
|
|
193 |
OstTraceFunctionExit0( EAPMSCHAPV2PWDEXPNOTEDIALOG_DEVICEDIALOGWIDGET_EXIT );
|
|
194 |
|
|
195 |
return const_cast<EapFastProvNotSuccessNoteDialog*>(this);
|
|
196 |
}
|
|
197 |
|