1 /* |
|
2 * Copyright (c) 2007-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: This file contains the implementation of IAUpdateWaitDialog |
|
15 * class member functions. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include <hbprogressdialog.h> |
|
23 |
|
24 #include "iaupdatewaitdialog.h" |
|
25 #include "iaupdatewaitdialogobserver.h" |
|
26 |
|
27 |
|
28 |
|
29 // ========================= MEMBER FUNCTIONS ================================ |
|
30 |
|
31 // ----------------------------------------------------------------------------- |
|
32 // IAUpdateWaitDialog::IAUpdateWaitDialog |
|
33 // ----------------------------------------------------------------------------- |
|
34 // |
|
35 IAUpdateWaitDialog::IAUpdateWaitDialog() |
|
36 { |
|
37 mCallback = NULL; |
|
38 mWaitDialog = NULL; |
|
39 } |
|
40 |
|
41 // ----------------------------------------------------------------------------- |
|
42 // IAUpdateWaitDialog::~IAUpdateWaitDialog |
|
43 // Destructor |
|
44 // ----------------------------------------------------------------------------- |
|
45 // |
|
46 IAUpdateWaitDialog::~IAUpdateWaitDialog() |
|
47 { |
|
48 if (mWaitDialog) |
|
49 { |
|
50 //mWaitDialog->close(); //TODO: is there need to close/delete progressdialog, it's selfdeleted in close() |
|
51 } |
|
52 } |
|
53 |
|
54 // --------------------------------------------------------------------------- |
|
55 // IAUpdateWaitDialog::showDialog() |
|
56 // --------------------------------------------------------------------------- |
|
57 // |
|
58 int IAUpdateWaitDialog::showDialog(const QString& text) |
|
59 { |
|
60 if (!mWaitDialog) |
|
61 { |
|
62 mWaitDialog = new HbProgressDialog(HbProgressDialog::WaitDialog); |
|
63 connect(mWaitDialog, SIGNAL(cancelled()), this, SLOT(dialogCancelled())); |
|
64 } |
|
65 mWaitDialog->setText(text); |
|
66 mWaitDialog->setTimeout(HbPopup::NoTimeout); |
|
67 mWaitDialog->show(); |
|
68 return 0; |
|
69 } |
|
70 // --------------------------------------------------------------------------- |
|
71 // IAUpdateWaitDialog::SetCallback |
|
72 // --------------------------------------------------------------------------- |
|
73 // |
|
74 void IAUpdateWaitDialog::SetCallback(MIAUpdateWaitDialogObserver* callback) |
|
75 { |
|
76 mCallback = callback; |
|
77 } |
|
78 |
|
79 void IAUpdateWaitDialog::close() |
|
80 { |
|
81 if (mWaitDialog) |
|
82 { |
|
83 mWaitDialog->close(); |
|
84 } |
|
85 } |
|
86 |
|
87 void IAUpdateWaitDialog::dialogCancelled() |
|
88 { |
|
89 if (mCallback) |
|
90 { |
|
91 mCallback->HandleWaitDialogCancel(); |
|
92 } |
|
93 } |
|
94 // End of File |
|