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:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include <hbmessagebox.h>
|
|
19 |
#include <hbpopup.h>
|
|
20 |
#include <hbaction.h>
|
|
21 |
#include <hblabel.h>
|
|
22 |
#include <hbdialog.h>
|
|
23 |
#include <hbaction.h>
|
|
24 |
#include <hbtextitem.h>
|
|
25 |
|
|
26 |
#include "notifications.h"
|
|
27 |
|
|
28 |
// ---------------------------------------------------------------------------
|
|
29 |
|
|
30 |
void Notifications::showInformationNote(const QString &text)
|
|
31 |
{
|
|
32 |
|
|
33 |
// Create new dialog
|
|
34 |
HbDialog *infoNote = new HbDialog();
|
|
35 |
infoNote->setAttribute(Qt::WA_DeleteOnClose);
|
|
36 |
|
|
37 |
// set dismiss policy
|
|
38 |
infoNote->setTimeout(0); //
|
|
39 |
|
|
40 |
// create text item for popup
|
|
41 |
HbTextItem *label = new HbTextItem(text, infoNote);
|
|
42 |
label->setAlignment(Qt::AlignCenter);
|
|
43 |
infoNote->setContentWidget(label);
|
|
44 |
infoNote->setPrimaryAction(new HbAction("Ok"));
|
|
45 |
|
|
46 |
infoNote->show();
|
|
47 |
}
|
|
48 |
|
|
49 |
// ---------------------------------------------------------------------------
|
|
50 |
|
|
51 |
void Notifications::showMessageBox(const QString &text)
|
|
52 |
{
|
|
53 |
HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeInformation );
|
|
54 |
note->setAttribute(Qt::WA_DeleteOnClose);
|
|
55 |
note->setTimeout(0);
|
|
56 |
note->setText(text);
|
|
57 |
note->show();
|
|
58 |
|
|
59 |
}
|
|
60 |
|
|
61 |
// ---------------------------------------------------------------------------
|
|
62 |
|
|
63 |
void Notifications::showErrorNote(const QString &text)
|
|
64 |
{
|
|
65 |
HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeWarning );
|
|
66 |
note->setAttribute(Qt::WA_DeleteOnClose);
|
|
67 |
note->setTimeout(0);
|
|
68 |
note->setText(text);
|
|
69 |
note->show();
|
|
70 |
|
|
71 |
}
|
|
72 |
|
|
73 |
// ---------------------------------------------------------------------------
|