25
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 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 |
*
|
|
15 |
* Description:
|
|
16 |
* The source file of filemanager messagebox
|
|
17 |
*/
|
|
18 |
|
|
19 |
#include "fmmessagebox.h"
|
|
20 |
#include <hbmessagebox.h>
|
|
21 |
|
33
|
22 |
/*!
|
|
23 |
This is a convenience function for showing an information dialog with \a informationText
|
|
24 |
*/
|
|
25 |
void FmMessageBox::information( const QString &informationText,
|
47
|
26 |
HbMessageBox::StandardButtons buttons, bool isBlocking )
|
|
27 |
{
|
|
28 |
HbMessageBox::information( informationText,
|
33
|
29 |
this, SLOT(dialogClosed(HbAction*)), buttons );
|
47
|
30 |
if ( isBlocking ) {
|
|
31 |
mEventLoop.exec();
|
|
32 |
}
|
|
33 |
|
25
|
34 |
}
|
|
35 |
|
33
|
36 |
/*!
|
|
37 |
This is a convenience function for showing a question dialog with \a questionText
|
|
38 |
*/
|
|
39 |
bool FmMessageBox::question( const QString &questionText,
|
|
40 |
HbMessageBox::StandardButtons buttons )
|
25
|
41 |
{
|
47
|
42 |
HbMessageBox::question( questionText,
|
33
|
43 |
this, SLOT(dialogClosed(HbAction*)), buttons );
|
25
|
44 |
mEventLoop.exec();
|
|
45 |
return mRet;
|
|
46 |
}
|
|
47 |
|
47
|
48 |
/*!
|
|
49 |
This is a convenience function for showing a warning dialog with \a warningText
|
|
50 |
*/
|
|
51 |
void FmMessageBox::warning( const QString &warningText,
|
|
52 |
HbMessageBox::StandardButtons buttons, bool isBlocking )
|
|
53 |
{
|
|
54 |
HbMessageBox::warning( warningText,
|
|
55 |
this, SLOT(dialogClosed(HbAction*)), buttons );
|
|
56 |
if ( isBlocking ) {
|
|
57 |
mEventLoop.exec();
|
|
58 |
}
|
|
59 |
}
|
|
60 |
|
25
|
61 |
void FmMessageBox::dialogClosed(HbAction *action)
|
|
62 |
{
|
|
63 |
HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
|
|
64 |
if(action == dlg->actions().at(0))
|
|
65 |
{
|
|
66 |
mRet = true;
|
|
67 |
}
|
|
68 |
else
|
|
69 |
{
|
|
70 |
mRet = false;
|
|
71 |
}
|
|
72 |
mEventLoop.exit();
|
|
73 |
}
|