diff -r 454d022d514b -r aefcba28a3e0 piprofilerui/ui/hb/src/notifications.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/piprofilerui/ui/hb/src/notifications.cpp Tue May 25 12:43:15 2010 +0300 @@ -0,0 +1,73 @@ +/* +* 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 +#include +#include +#include + +#include "notifications.h" + +// --------------------------------------------------------------------------- + +void Notifications::showInformationNote(const QString &text) +{ + + // Create new dialog + HbDialog *infoNote = new HbDialog(); + infoNote->setAttribute(Qt::WA_DeleteOnClose); + + // set dismiss policy + infoNote->setTimeout(0); // + + // create text item for popup + HbTextItem *label = new HbTextItem(text, infoNote); + label->setAlignment(Qt::AlignCenter); + infoNote->setContentWidget(label); + infoNote->setPrimaryAction(new HbAction("Ok")); + + infoNote->show(); +} + +// --------------------------------------------------------------------------- + +void Notifications::showMessageBox(const QString &text) +{ + HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeInformation ); + note->setAttribute(Qt::WA_DeleteOnClose); + note->setTimeout(0); + note->setText(text); + note->show(); + +} + +// --------------------------------------------------------------------------- + +void Notifications::showErrorNote(const QString &text) +{ + HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeWarning ); + note->setAttribute(Qt::WA_DeleteOnClose); + note->setTimeout(0); + note->setText(text); + note->show(); + +} + +// ---------------------------------------------------------------------------