Implementation of about dialog using MMessageBox.
[medard] / src / aboutdialog.cpp
index e383f5f..99c7c19 100644 (file)
 #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)