|
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 #include <hbdevicemessagebox.h> |
|
19 #include <hblabel.h> |
|
20 #include <hbdeviceprogressdialog.h> |
|
21 |
|
22 #include "notifications.h" |
|
23 |
|
24 |
|
25 |
|
26 // --------------------------------------------------------------------------- |
|
27 |
|
28 void Notifications::imageCaptured() |
|
29 { |
|
30 showGlobalNote("Screen shot saved to Media Gallery", HbMessageBox::MessageTypeInformation); |
|
31 } |
|
32 |
|
33 // --------------------------------------------------------------------------- |
|
34 |
|
35 void Notifications::about() |
|
36 { |
|
37 |
|
38 HbMessageBox dlg; |
|
39 |
|
40 dlg.setText("Version 5.0.0 - March 10th 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0."); |
|
41 HbLabel header("About Screen Grabber"); |
|
42 dlg.setHeadingWidget(&header); |
|
43 dlg.setTimeout(HbPopup::NoTimeout); |
|
44 dlg.exec(); |
|
45 } |
|
46 |
|
47 // --------------------------------------------------------------------------- |
|
48 |
|
49 void Notifications::error(const QString& errorMessage) |
|
50 { |
|
51 showGlobalNote(errorMessage, HbMessageBox::MessageTypeWarning); |
|
52 |
|
53 } |
|
54 |
|
55 // --------------------------------------------------------------------------- |
|
56 |
|
57 void Notifications::sequantialImagesCaptured(int amount){ |
|
58 // Code below launches a global note |
|
59 QString text; |
|
60 text.setNum(amount, 10); |
|
61 text.append(" screen shots saved to Media Gallery"); |
|
62 |
|
63 showGlobalNote(text, HbMessageBox::MessageTypeInformation); |
|
64 |
|
65 } |
|
66 |
|
67 // --------------------------------------------------------------------------- |
|
68 |
|
69 void Notifications::videoCaptured() |
|
70 { |
|
71 showGlobalNote("Video saved to Media Gallery", HbMessageBox::MessageTypeInformation); |
|
72 |
|
73 } |
|
74 |
|
75 // --------------------------------------------------------------------------- |
|
76 |
|
77 HbDeviceProgressDialog* Notifications::showProgressBar(int max) |
|
78 { |
|
79 HbDeviceProgressDialog *note = new HbDeviceProgressDialog(HbProgressDialog::ProgressDialog); |
|
80 note->setText("Saving..."); |
|
81 note->setMaximum(max); |
|
82 note->show(); |
|
83 return note; |
|
84 } |
|
85 |
|
86 // --------------------------------------------------------------------------- |
|
87 |
|
88 void Notifications::showGlobalNote(const QString& text, HbMessageBox::MessageBoxType type) |
|
89 { |
|
90 // Code below launches a global note |
|
91 |
|
92 HbDeviceMessageBox note(text, type); |
|
93 note.information(text); |
|
94 |
|
95 } |
|
96 |
|
97 // --------------------------------------------------------------------------- |