|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <hblabel.h> |
|
20 //#include <hbdeviceprogressdialog.h> |
|
21 #include <hbmessagebox.h> |
|
22 |
|
23 #include "notifications.h" |
|
24 |
|
25 |
|
26 // --------------------------------------------------------------------------- |
|
27 |
|
28 void Notifications::showMessageBox(HbMessageBox::MessageBoxType type, const QString &text, const QString &label, int timeout) |
|
29 { |
|
30 HbMessageBox *messageBox = new HbMessageBox(type); |
|
31 messageBox->setText(text); |
|
32 if (label.length()) { |
|
33 HbLabel *header = new HbLabel(label, messageBox); |
|
34 messageBox->setHeadingWidget(header); |
|
35 } |
|
36 messageBox->setAttribute(Qt::WA_DeleteOnClose); |
|
37 messageBox->setTimeout(timeout); |
|
38 messageBox->open(); |
|
39 } |
|
40 |
|
41 void Notifications::showAboutNote() |
|
42 { |
|
43 showMessageBox(HbMessageBox::MessageTypeInformation, |
|
44 "Version 5.0.0 - 23h April 2010. Copyright © 2010 Nokia Corporation" |
|
45 "and/or its subsidiary(-ies). All rights reserved." |
|
46 "Licensed under Eclipse Public License v1.0.", |
|
47 "About File Browser" |
|
48 ); |
|
49 } |
|
50 |
|
51 // --------------------------------------------------------------------------- |
|
52 |
|
53 //HbDeviceProgressDialog* Notifications::showWaitDialog(const QString &text) |
|
54 //{ |
|
55 // HbDeviceProgressDialog *note = new HbDeviceProgressDialog( HbProgressDialog::WaitDialog ); |
|
56 // note->setText( text ); |
|
57 // note->show(); |
|
58 // return note; |
|
59 //} |
|
60 |
|
61 // --------------------------------------------------------------------------- |
|
62 |
|
63 void Notifications::showInformationNote(const QString &text, const QString &title) |
|
64 { |
|
65 showMessageBox(HbMessageBox::MessageTypeInformation, text, title, false); |
|
66 } |
|
67 |
|
68 // --------------------------------------------------------------------------- |
|
69 |
|
70 void Notifications::showErrorNote(const QString &text, bool noTimeout) |
|
71 { |
|
72 showMessageBox(HbMessageBox::MessageTypeWarning, text, "", noTimeout ? HbPopup::NoTimeout : HbPopup::StandardTimeout); |
|
73 } |
|
74 |
|
75 // --------------------------------------------------------------------------- |
|
76 |
|
77 void Notifications::showConfirmationNote(const QString &text, bool noTimeout) |
|
78 { |
|
79 showMessageBox(HbMessageBox::MessageTypeWarning, text, "", noTimeout ? HbPopup::NoTimeout : HbPopup::ConfirmationNoteTimeout); |
|
80 } |
|
81 |
|
82 // --------------------------------------------------------------------------- |
|
83 |
|
84 bool Notifications::showConfirmationQuery(const QString &aText) |
|
85 { |
|
86 return false; //HbMessageBox::question(aText); |
|
87 } |
|
88 |
|
89 // --------------------------------------------------------------------------- |