From 5e154d32dcd20032f29e70690ef2718416d1ef9d Mon Sep 17 00:00:00 2001 From: Roman Moravcik Date: Thu, 3 Mar 2011 22:15:49 +0100 Subject: [PATCH] Added empty about dialog --- medard.pro | 6 ++++-- src/aboutdialog.cpp | 26 ++++++++++++++++++++++++++ src/aboutdialog.h | 33 +++++++++++++++++++++++++++++++++ src/mainwindow.cpp | 11 +++++++++++ src/mainwindow.h | 1 + 5 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 src/aboutdialog.cpp create mode 100644 src/aboutdialog.h diff --git a/medard.pro b/medard.pro index b69ddad..b48a224 100644 --- a/medard.pro +++ b/medard.pro @@ -29,11 +29,13 @@ SOURCES += \ src/forecastwidget.cpp \ src/medarddownloader.cpp \ src/mainwindow.cpp \ - src/main.cpp + src/main.cpp \ + src/aboutdialog.cpp HEADERS += \ src/forecastwidget.h \ src/medarddownloader.h \ - src/mainwindow.h + src/mainwindow.h \ + src/aboutdialog.h FORMS += TRANSLATIONS += \ diff --git a/src/aboutdialog.cpp b/src/aboutdialog.cpp new file mode 100644 index 0000000..74b509f --- /dev/null +++ b/src/aboutdialog.cpp @@ -0,0 +1,26 @@ +/* + * Medard for Maemo. + * Copyright (C) 2011 Roman Moravcik + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "aboutdialog.h" + +AboutDialog::AboutDialog(QMainWindow *parent) : QMainWindow(parent) +{ +} diff --git a/src/aboutdialog.h b/src/aboutdialog.h new file mode 100644 index 0000000..87e5ff0 --- /dev/null +++ b/src/aboutdialog.h @@ -0,0 +1,33 @@ +/* + * Medard for Maemo. + * Copyright (C) 2011 Roman Moravcik + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef ABOUTDIALOG_H +#define ABOUTDIALOG_H + +#include + +class AboutDialog : public QMainWindow +{ + Q_OBJECT + +public: + AboutDialog(QMainWindow *parent = 0); +}; + +#endif // ABOUTDIALOG_H diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d76a17c..e215c34 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -20,6 +20,7 @@ #include #include +#include "aboutdialog.h" #include "mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) @@ -145,6 +146,10 @@ void MainWindow::setupMenu() QAction *temperatureAction = new QAction(tr("Temperature"), this); menu->addAction(temperatureAction); connect(temperatureAction, SIGNAL(triggered()), this, SLOT(temperatureMenuClicked())); + + QAction *aboutAction = new QAction(tr("About"), this); + menu->addAction(aboutAction); + connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutMenuClicked())); } void MainWindow::loadSettings() @@ -253,6 +258,12 @@ void MainWindow::temperatureMenuClicked() forecastTypeChanged(tr("Temperature"), MedardDownloader::Temperature); } +void MainWindow::aboutMenuClicked() +{ + AboutDialog *dialog = new AboutDialog(); + dialog->show(); +} + void MainWindow::downloadAgainClicked() { m_forecast->clearImage(false); diff --git a/src/mainwindow.h b/src/mainwindow.h index a281e5b..c4f224e 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -42,6 +42,7 @@ private slots: void windVelocityMenuClicked(); void cloudinessMenuClicked(); void temperatureMenuClicked(); + void aboutMenuClicked(); void downloadAgainClicked(); -- 1.7.9.5