38 const QVariantMap ¶meters) : HbProgressDialog(progressDialogType) |
38 const QVariantMap ¶meters) : HbProgressDialog(progressDialogType) |
39 { |
39 { |
40 TRACE_ENTRY |
40 TRACE_ENTRY |
41 mLastError = NoError; |
41 mLastError = NoError; |
42 mProgressDialogType = progressDialogType; |
42 mProgressDialogType = progressDialogType; |
43 mShowEventReceived = false; |
43 mCloseEventReceived = false; |
44 mAction = 0; |
44 mAction = 0; |
45 resetProperties(); |
45 resetProperties(); |
46 constructDialog(parameters); |
46 constructDialog(parameters); |
47 if (!mAction) { |
47 if (!mAction) { |
48 // If HbProgressDialog default button is used, connect into its triggered signal. |
48 // If HbProgressDialog default button is used, connect into its triggered signal. |
90 void HbDeviceProgressDialogWidget::closeDeviceDialog(bool byClient) |
91 void HbDeviceProgressDialogWidget::closeDeviceDialog(bool byClient) |
91 { |
92 { |
92 TRACE_ENTRY |
93 TRACE_ENTRY |
93 Q_UNUSED(byClient); |
94 Q_UNUSED(byClient); |
94 cancel(); |
95 cancel(); |
95 // If show event has been received, close is signalled from hide event. If not, |
|
96 // hide event does not come and close is signalled from here. |
|
97 if (!mShowEventReceived) { |
|
98 emit deviceDialogClosed(); |
|
99 } |
|
100 TRACE_EXIT |
96 TRACE_EXIT |
101 } |
97 } |
102 |
98 |
103 // Return display widget |
99 // Return display widget |
104 HbDialog *HbDeviceProgressDialogWidget::deviceDialogWidget() const |
100 HbDialog *HbDeviceProgressDialogWidget::deviceDialogWidget() const |
275 HbIconAnimationManager *manager = HbIconAnimationManager::global(); |
271 HbIconAnimationManager *manager = HbIconAnimationManager::global(); |
276 manager->addDefinitionFile(animationDefinition); |
272 manager->addDefinitionFile(animationDefinition); |
277 mAnimationDefinition = animationDefinition; |
273 mAnimationDefinition = animationDefinition; |
278 } |
274 } |
279 |
275 |
|
276 void HbDeviceProgressDialogWidget::setShowLevel(int level) |
|
277 { |
|
278 // Level can only be set on construction |
|
279 Q_UNUSED(level) |
|
280 } |
|
281 |
|
282 int HbDeviceProgressDialogWidget::showLevel() const |
|
283 { |
|
284 return 0; |
|
285 } |
|
286 |
280 // Widget is about to hide. Closing effect has ended. |
287 // Widget is about to hide. Closing effect has ended. |
281 void HbDeviceProgressDialogWidget::hideEvent(QHideEvent *event) |
288 void HbDeviceProgressDialogWidget::hideEvent(QHideEvent *event) |
282 { |
289 { |
283 HbProgressDialog::hideEvent(event); |
290 HbProgressDialog::hideEvent(event); |
284 emit deviceDialogClosed(); |
291 if (mCloseEventReceived) { |
285 } |
292 emit deviceDialogClosed(); |
286 |
293 } |
287 // Widget is about to show |
294 } |
288 void HbDeviceProgressDialogWidget::showEvent(QShowEvent *event) |
295 |
289 { |
296 // Widget is about to close, close() has been called |
290 HbProgressDialog::showEvent(event); |
297 void HbDeviceProgressDialogWidget::closeEvent(QCloseEvent * event) |
291 mShowEventReceived = true; |
298 { |
|
299 HbProgressDialog::closeEvent(event); |
|
300 mCloseEventReceived = true; |
|
301 // If widget is visible, close is signalled from hide event. If not, |
|
302 // hide event does not come and close is signalled from here. |
|
303 if (!isVisible()) { |
|
304 emit deviceDialogClosed(); |
|
305 } |
292 } |
306 } |
293 |
307 |
294 // Primary action triggered |
308 // Primary action triggered |
295 void HbDeviceProgressDialogWidget::cancelTriggered() |
309 void HbDeviceProgressDialogWidget::cancelTriggered() |
296 { |
310 { |
297 TRACE_ENTRY |
311 TRACE_ENTRY |
298 QVariantMap data; |
312 QVariantMap data; |
299 data.insert("act", "c"); |
313 data.insert("act", "c"); |
300 emit deviceDialogData(data); |
314 emit deviceDialogData(data); |
301 TRACE_EXIT |
315 close(); |
302 } |
316 TRACE_EXIT |
|
317 } |