loadgen/ui/hb/src/notifications.cpp
branchRCL_3
changeset 22 fad26422216a
parent 21 b3cee849fa46
child 23 f8280f3bfeb7
equal deleted inserted replaced
21:b3cee849fa46 22:fad26422216a
     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 <hblabel.h>
       
    20 #include <QString>
       
    21 
       
    22 #include "notifications.h"
       
    23 
       
    24 
       
    25 // ---------------------------------------------------------------------------
       
    26 
       
    27 void Notifications::about()
       
    28 {
       
    29     HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation);
       
    30     messageBox->setText("Version 1.5.0 - March 10th 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.");
       
    31     HbLabel *header = new HbLabel("About LoadGen", messageBox);
       
    32     messageBox->setHeadingWidget(header);
       
    33     messageBox->setAttribute(Qt::WA_DeleteOnClose);
       
    34     messageBox->setTimeout(HbPopup::NoTimeout);
       
    35     messageBox->open();
       
    36 }
       
    37 
       
    38 // ---------------------------------------------------------------------------
       
    39 
       
    40 void Notifications::error(const QString& errorMessage)
       
    41 {
       
    42 	showGlobalNote(errorMessage, HbMessageBox::MessageTypeWarning );
       
    43 }
       
    44 
       
    45 // ---------------------------------------------------------------------------
       
    46 
       
    47 void Notifications::showGlobalNote(const QString& text, HbMessageBox::MessageBoxType type, HbPopup::DefaultTimeout timeout)
       
    48 {
       
    49     HbMessageBox *messageBox = new HbMessageBox(type);
       
    50     messageBox->setText(text);
       
    51     messageBox->setTimeout(timeout);
       
    52     messageBox->setAttribute(Qt::WA_DeleteOnClose);
       
    53     messageBox->open();
       
    54 }
       
    55 
       
    56 // ---------------------------------------------------------------------------