From: Roman Moravcik Date: Wed, 29 Jun 2011 08:20:07 +0000 (+0200) Subject: Implementation of about dialog using MMessageBox. X-Git-Url: https://vcs.maemo.org/git/?p=medard;a=commitdiff_plain;h=c767e098f3300373c78f6f91a0eb2092ad84fb44 Implementation of about dialog using MMessageBox. --- diff --git a/src/aboutdialog.cpp b/src/aboutdialog.cpp index e383f5f..99c7c19 100644 --- a/src/aboutdialog.cpp +++ b/src/aboutdialog.cpp @@ -26,36 +26,21 @@ #include "aboutdialog.h" #ifdef Q_WS_MAEMO_6 -AboutDialog::AboutDialog(QGraphicsItem *parent) : MApplicationPage(parent) +AboutDialog::AboutDialog(QGraphicsItem *parent) : MMessageBox("", M::OkButton) { - setAttribute(Qt::WA_LockPortraitOrientation, true); - setWindowTitle(tr("About")); - setPannable(false); - - QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical); - centralWidget()->setLayout(layout); + Q_UNUSED(parent); - MLabel *application = new MLabel(); - application->setText("Medard 0.2"); - application->setStyleName ("CommonHeader"); - application->setAlignment(Qt::AlignCenter); - layout->addItem(application); + setObjectName("messageBox"); - MLabel *applicationCopyright = new MLabel(); - applicationCopyright->setText(tr("Copyright(c) 2011 Roman Moravcik")); - applicationCopyright->setAlignment(Qt::AlignCenter); - layout->addItem(applicationCopyright); - - MLabel *weatherDataCopyright = new MLabel(); - weatherDataCopyright->setWordWrap(true); - weatherDataCopyright->setText(tr("\n" - "Weather data:\n" - "Project MEDARD, Institute of Computer Science,\n" - "Academy of Sciences of the Czech Republic, Prague\n" - "\n" - "Copyright(c) Institute of Computer Science AS CR 2003-2009.\n" - "MM5: PSU/NCAR, USA (c) CAMx: EVNIRON Corp., USA")); - layout->addItem(weatherDataCopyright); + setTitle("Medard 0.2\n"); + setText(tr("Copyright(c) 2011 Roman Moravcik\n" + "\n" + "Weather data:\n" + "Project MEDARD, Institute of Computer Science,\n" + "Academy of Sciences of the Czech Republic, Prague\n" + "\n" + "Copyright(c) Institute of Computer Science AS CR 2003-2009.\n" + "MM5: PSU/NCAR, USA (c) CAMx: EVNIRON Corp., USA")); } #else AboutDialog::AboutDialog(QDialog *parent) : QDialog(parent) diff --git a/src/aboutdialog.h b/src/aboutdialog.h index d81f45e..34be26c 100644 --- a/src/aboutdialog.h +++ b/src/aboutdialog.h @@ -21,13 +21,13 @@ #define ABOUTDIALOG_H #ifdef Q_WS_MAEMO_6 -#include +#include #else #include #endif #ifdef Q_WS_MAEMO_6 -class AboutDialog : public MApplicationPage +class AboutDialog : public MMessageBox #else class AboutDialog : public QDialog #endif diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 6a41c92..a410ce2 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -408,7 +408,7 @@ void MainWindow::aboutMenuClicked() { AboutDialog *dialog = new AboutDialog(); #ifdef Q_WS_MAEMO_6 - dialog->appear(scene(), MSceneWindow::DestroyWhenDismissed); + dialog->appear(MSceneWindow::DestroyWhenDismissed); #else dialog->exec(); #endif