diff -r 48060abbbeaf -r b3cee849fa46 loadgen/ui/hb/src/notifications.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/loadgen/ui/hb/src/notifications.cpp Tue Aug 31 15:15:20 2010 +0300 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include + +#include "notifications.h" + + +// --------------------------------------------------------------------------- + +void Notifications::about() +{ + HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation); + 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."); + HbLabel *header = new HbLabel("About LoadGen", messageBox); + messageBox->setHeadingWidget(header); + messageBox->setAttribute(Qt::WA_DeleteOnClose); + messageBox->setTimeout(HbPopup::NoTimeout); + messageBox->open(); +} + +// --------------------------------------------------------------------------- + +void Notifications::error(const QString& errorMessage) +{ + showGlobalNote(errorMessage, HbMessageBox::MessageTypeWarning ); +} + +// --------------------------------------------------------------------------- + +void Notifications::showGlobalNote(const QString& text, HbMessageBox::MessageBoxType type, HbPopup::DefaultTimeout timeout) +{ + HbMessageBox *messageBox = new HbMessageBox(type); + messageBox->setText(text); + messageBox->setTimeout(timeout); + messageBox->setAttribute(Qt::WA_DeleteOnClose); + messageBox->open(); +} + +// ---------------------------------------------------------------------------