From 89afb2dd3ae1a0e321f2a7aed8f3a3bee33e1e42 Mon Sep 17 00:00:00 2001 From: Denes Matetelki Date: Wed, 15 Jun 2011 14:13:25 +0200 Subject: [PATCH] no need for aboutdialog.ui, can be done with QMessageBox with 6 lines --- aboutdialog.cpp | 17 ------- aboutdialog.h | 22 --------- aboutdialog.ui | 126 ------------------------------------------------ mainwindow.cpp | 22 ++++----- mainwindow.h | 3 -- qtmindmap.pro | 7 +-- 6 files changed, 11 insertions(+), 186 deletions(-) delete mode 100644 aboutdialog.cpp delete mode 100644 aboutdialog.h delete mode 100644 aboutdialog.ui diff --git a/aboutdialog.cpp b/aboutdialog.cpp deleted file mode 100644 index d451eb1..0000000 --- a/aboutdialog.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "aboutdialog.h" -#include "ui_aboutdialog.h" - - -AboutDialog::AboutDialog(QWidget *parent) : - QDialog(parent), - m_ui(new Ui::AboutDialog) -{ - m_ui->setupUi(this); - connect(this, SIGNAL(finished(int)), parent, - SLOT(aboutDestroyed())); -} - -AboutDialog::~AboutDialog() -{ - delete m_ui; -} diff --git a/aboutdialog.h b/aboutdialog.h deleted file mode 100644 index 8c7082c..0000000 --- a/aboutdialog.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef ABOUTDIALOG_H -#define ABOUTDIALOG_H - -#include - -namespace Ui { - class AboutDialog; -} - -class AboutDialog : public QDialog -{ - Q_OBJECT - -public: - explicit AboutDialog(QWidget *parent = 0); - ~AboutDialog(); - -private: - Ui::AboutDialog *m_ui; -}; - -#endif // ABOUTDIALOG_H diff --git a/aboutdialog.ui b/aboutdialog.ui deleted file mode 100644 index 43b0e0e..0000000 --- a/aboutdialog.ui +++ /dev/null @@ -1,126 +0,0 @@ - - - AboutDialog - - - true - - - - 0 - 0 - 329 - 142 - - - - - 0 - 0 - - - - About QtMindMap - - - false - - - - - 100 - 100 - 211 - 31 - - - - Qt::Horizontal - - - QDialogButtonBox::Close - - - - - - 10 - 0 - 101 - 31 - - - - QtMindMap 0.1 - - - - - - 30 - 40 - 181 - 16 - - - - Mindmap software in QT - - - - - - 30 - 70 - 291 - 16 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Denes Matetelki <a href="mailto:denes.matetelki@gmail.com"><span style=" text-decoration: underline; color:#508ed8;">denes.matetelki@gmail.com</span></a></p></body></html> - - - Qt::RichText - - - - - - - buttonBox - accepted() - AboutDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - AboutDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/mainwindow.cpp b/mainwindow.cpp index b922232..45b025e 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,9 +1,9 @@ #include "mainwindow.h" #include "ui_mainwindow.h" -#include "aboutdialog.h" #include #include +#include //#include @@ -32,8 +32,7 @@ extern void exportScaneToPng(QGraphicsScene *scene, MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), - m_ui(new Ui::MainWindow), - m_aboutDialog(0) + m_ui(new Ui::MainWindow) { m_graphicsView = new GraphWidget(this); @@ -56,7 +55,6 @@ MainWindow::MainWindow(QWidget *parent) : MainWindow::~MainWindow() { delete m_ui; - if (m_aboutDialog) delete m_aboutDialog; } void MainWindow::klakk() @@ -104,15 +102,13 @@ void MainWindow::exportScene() void MainWindow::about() { - setDisabled(true); - if (m_aboutDialog == 0) m_aboutDialog = new AboutDialog(this); - m_aboutDialog->setEnabled(true); // children inherits enabled status - m_aboutDialog->show(); -} - -void MainWindow::aboutDestroyed() -{ - setEnabled(true); + QMessageBox msgBox(this); + msgBox.setWindowTitle(tr("About QtMindMap")); + msgBox.setText(tr("MindMap software written in Qt.")); + msgBox.setInformativeText(tr("Homepage: https://gitorious.org/qtmindmap\n\nReport bugs to: denes.matetelki@gmail.com")); + QPixmap pixMap(":/heart.svg"); + msgBox.setIconPixmap(pixMap.scaled(50,50)); + msgBox.exec(); } QStatusBar * MainWindow::getStatusBar() diff --git a/mainwindow.h b/mainwindow.h index 3f80555..38c7223 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -4,7 +4,6 @@ #include #include -#include "aboutdialog.h" #include "graphwidget.h" namespace Ui { @@ -26,12 +25,10 @@ public slots: void klakk(); void exportScene(); void about(); - void aboutDestroyed(); private: Ui::MainWindow *m_ui; - AboutDialog *m_aboutDialog; GraphWidget *m_graphicsView; QString m_fileName; diff --git a/qtmindmap.pro b/qtmindmap.pro index 131b63b..3b29aec 100644 --- a/qtmindmap.pro +++ b/qtmindmap.pro @@ -10,9 +10,8 @@ TARGET = qtmindmap TEMPLATE = app -SOURCES += main.cpp\ +SOURCES += main.cpp \ mainwindow.cpp \ - aboutdialog.cpp \ graphwidget.cpp \ node.cpp \ edge.cpp \ @@ -20,15 +19,13 @@ SOURCES += main.cpp\ argumentparser.cpp HEADERS += mainwindow.h \ - aboutdialog.h \ graphwidget.h \ node.h \ edge.h \ systemtray.h \ argumentparser.h -FORMS += mainwindow.ui \ - aboutdialog.ui +FORMS += mainwindow.ui RESOURCES = qtmindmap.qrc