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 "eapfastprovwaitnotedialog.h"
|
|
19 |
#include "OstTraceDefinitions.h"
|
|
20 |
#include <QGraphicsLinearLayout>
|
|
21 |
#ifdef OST_TRACE_COMPILER_IN_USE
|
|
22 |
#endif
|
|
23 |
|
|
24 |
/**
|
|
25 |
* The constructor
|
|
26 |
*/
|
|
27 |
EapFastProvWaitNoteDialog::EapFastProvWaitNoteDialog(const QVariantMap ¶meters)
|
|
28 |
:mTranslator(new HbTranslator("eapprompts"))
|
|
29 |
{
|
|
30 |
OstTraceFunctionEntry0( EAPFASTPROVWAITNOTEDIALOG_EAPFASTPROVWAITNOTEDIALOG_ENTRY );
|
|
31 |
qDebug("EapFastProvWaitNoteDialog::EapFastProvWaitNoteDialog ENTER");
|
|
32 |
|
|
33 |
createDialog( parameters );
|
|
34 |
|
|
35 |
OstTraceFunctionExit0( EAPFASTPROVWAITNOTEDIALOG_EAPFASTPROVWAITNOTEDIALOG_EXIT );
|
|
36 |
qDebug("EapFastProvWaitNoteDialog::EapFastProvWaitNoteDialog EXIT");
|
|
37 |
}
|
|
38 |
|
|
39 |
|
|
40 |
/**
|
|
41 |
* The construction of the dialog
|
|
42 |
*/
|
|
43 |
void EapFastProvWaitNoteDialog::createDialog(const QVariantMap ¶meters )
|
|
44 |
{
|
|
45 |
OstTraceFunctionEntry0( EAPFASTPROVWAITNOTEDIALOG_CREATEDIALOG_ENTRY );
|
|
46 |
qDebug("EapFastProvWaitNoteDialog::createDialog ENTER");
|
|
47 |
|
|
48 |
QString mainText;
|
|
49 |
QString key = QString("notificationtxt");
|
|
50 |
|
|
51 |
bool authProvWaitNote = false;
|
|
52 |
|
|
53 |
if ( parameters.empty() == false ) {
|
|
54 |
if ( parameters.contains(key) ) {
|
|
55 |
QVariant variant = parameters.value(key);
|
|
56 |
authProvWaitNote = variant.toBool();
|
|
57 |
}
|
|
58 |
}
|
|
59 |
|
|
60 |
if ( authProvWaitNote ) {
|
|
61 |
mainText = QString(hbTrId("txt_occ_dpopinfo_authenticated_provisioning_in_pro"));
|
|
62 |
} else {
|
|
63 |
mainText = QString(hbTrId("txt_occ_dpopinfo_unauthenticated_provisioning_in_p"));
|
|
64 |
}
|
|
65 |
|
|
66 |
// Set the dialog to be on the screen for 4 seconds.
|
|
67 |
this->setTimeout(4000);
|
|
68 |
this->setTitle(mainText);
|
|
69 |
|
|
70 |
// Connect the about to close and hide signals, so that we are able to inform
|
|
71 |
// the caller that the dialog was closed
|
|
72 |
bool connected = connect(this, SIGNAL(aboutToClose()), this, SLOT(closingDialog()));
|
|
73 |
Q_ASSERT(connected == true);
|
|
74 |
connected = connect(this, SIGNAL(aboutToHide()), this, SLOT(closingDialog()));
|
|
75 |
Q_ASSERT(connected == true);
|
|
76 |
|
|
77 |
OstTraceFunctionExit0( DUP1_EAPFASTPROVWAITNOTEDIALOG_CREATEDIALOG_EXIT );
|
|
78 |
qDebug("EapFastProvWaitNoteDialog::createDialog EXIT");
|
|
79 |
}
|
|
80 |
|
|
81 |
/**
|
|
82 |
* Destructor
|
|
83 |
*/
|
|
84 |
EapFastProvWaitNoteDialog::~EapFastProvWaitNoteDialog()
|
|
85 |
{
|
|
86 |
OstTraceFunctionEntry0( EAPFASTPROVWAITNOTEDIALOG_DEAPFASTPROVWAITNOTEDIALOG_ENTRY );
|
|
87 |
qDebug("EapFastProvWaitNoteDialog::~EapFastProvWaitNoteDialog ENTER");
|
|
88 |
|
|
89 |
// The dialog widgets are deleted as the dialog is deleted
|
|
90 |
|
|
91 |
qDebug("EapFastProvWaitNoteDialog::~EapFastProvWaitNoteDialog EXIT");
|
|
92 |
OstTraceFunctionExit0( EAPFASTPROVWAITNOTEDIALOG_DEAPFASTPROVWAITNOTEDIALOG_EXIT );
|
|
93 |
}
|
|
94 |
|
|
95 |
/**
|
|
96 |
* Function is called when the dialog is about to close
|
|
97 |
*
|
|
98 |
*/
|
|
99 |
void EapFastProvWaitNoteDialog::closingDialog()
|
|
100 |
{
|
|
101 |
OstTraceFunctionEntry0( EAPFASTPROVWAITNOTEDIALOG_CLOSINGDIALOG_ENTRY );
|
|
102 |
qDebug("EapFastProvWaitNoteDialog::closingDialog ENTER");
|
|
103 |
|
|
104 |
closeDeviceDialog(false);
|
|
105 |
|
|
106 |
qDebug("EapFastProvWaitNoteDialog::closingDialog EXIT");
|
|
107 |
OstTraceFunctionExit0( EAPFASTPROVWAITNOTEDIALOG_CLOSINGDIALOG_EXIT );
|
|
108 |
}
|
|
109 |
|
|
110 |
/**
|
|
111 |
* Updating the dialog during its showing is not allowed.
|
|
112 |
*/
|
|
113 |
bool EapFastProvWaitNoteDialog::setDeviceDialogParameters
|
|
114 |
(const QVariantMap ¶meters)
|
|
115 |
{
|
|
116 |
OstTraceFunctionEntry0( EAPFASTPROVWAITNOTEDIALOG_SETDEVICEDIALOGPARAMETERS_ENTRY );
|
|
117 |
|
|
118 |
Q_UNUSED(parameters)
|
|
119 |
// changing the dialog after presenting it is not supported.
|
|
120 |
|
|
121 |
OstTraceFunctionExit0( EAPFASTPROVWAITNOTEDIALOG_SETDEVICEDIALOGPARAMETERS_EXIT );
|
|
122 |
return true;
|
|
123 |
}
|
|
124 |
|
|
125 |
/**
|
|
126 |
* Not supported, 0 always returned
|
|
127 |
*/
|
|
128 |
int EapFastProvWaitNoteDialog::deviceDialogError() const
|
|
129 |
{
|
|
130 |
OstTraceFunctionEntry0( EAPFASTPROVWAITNOTEDIALOG_DEVICEDIALOGERROR_ENTRY );
|
|
131 |
OstTraceFunctionExit0( EAPFASTPROVWAITNOTEDIALOG_DEVICEDIALOGERROR_EXIT);
|
|
132 |
return 0;
|
|
133 |
}
|
|
134 |
|
|
135 |
/**
|
|
136 |
* Dialog is closed and the signal about closing is emitted
|
|
137 |
*/
|
|
138 |
void EapFastProvWaitNoteDialog::closeDeviceDialog(bool byClient)
|
|
139 |
{
|
|
140 |
OstTraceFunctionEntry0( EAPFASTPROVWAITNOTEDIALOG_CLOSEDEVICEDIALOG_ENTRY );
|
|
141 |
qDebug("EapFastProvWaitNoteDialog::closeDeviceDialog ENTER");
|
|
142 |
|
|
143 |
Q_UNUSED(byClient)
|
|
144 |
|
|
145 |
emit deviceDialogClosed();
|
|
146 |
|
|
147 |
qDebug("EapFastProvWaitNoteDialog::closeDeviceDialog EXIT");
|
|
148 |
OstTraceFunctionExit0( EAPFASTPROVWAITNOTEDIALOG_CLOSEDEVICEDIALOG_EXIT );
|
|
149 |
}
|
|
150 |
|
|
151 |
/**
|
|
152 |
* This dialog widget is returned to the caller
|
|
153 |
*/
|
|
154 |
HbPopup *EapFastProvWaitNoteDialog::deviceDialogWidget() const
|
|
155 |
{
|
|
156 |
OstTraceFunctionEntry0( EAPFASTPROVWAITNOTEDIALOG_DEVICEDIALOGWIDGET_ENTRY );
|
|
157 |
qDebug("EapFastProvWaitNoteDialog::deviceDialogWidget ENTER");
|
|
158 |
|
|
159 |
qDebug("EapFastProvWaitNoteDialog::deviceDialogWidget EXIT");
|
|
160 |
OstTraceFunctionExit0( EAPFASTPROVWAITNOTEDIALOG_DEVICEDIALOGWIDGET_EXIT );
|
|
161 |
|
|
162 |
return const_cast<EapFastProvWaitNoteDialog*>(this);
|
|
163 |
}
|
|
164 |
|