filemanager/src/filemanager/src/components/fmmessagebox.cpp
changeset 25 b7bfdea70ca2
child 33 328cf6fbe40c
equal deleted inserted replaced
16:ada7962b4308 25:b7bfdea70ca2
       
     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 
       
    22 void FmMessageBox::information( const QString &informationText )
       
    23 {
       
    24     HbMessageBox::information ( informationText,
       
    25          this, SLOT(dialogClosed(HbAction*)) );
       
    26     mEventLoop.exec();
       
    27 }
       
    28 
       
    29 bool FmMessageBox::question( const QString &questionText, const QString &primaryButtonText,
       
    30         const QString &secondaryButtonText )
       
    31 {
       
    32     HbMessageBox::question ( questionText,
       
    33             this, SLOT(dialogClosed(HbAction*)), primaryButtonText, secondaryButtonText );
       
    34     mEventLoop.exec();
       
    35     return mRet;
       
    36 }
       
    37 
       
    38 void FmMessageBox::dialogClosed(HbAction *action)
       
    39 {
       
    40     HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
       
    41     if(action == dlg->actions().at(0)) 
       
    42     {
       
    43         mRet = true;
       
    44     }
       
    45     else
       
    46     {
       
    47         mRet = false;
       
    48     }
       
    49     mEventLoop.exit();
       
    50 }