From 1f711778075f6f9cece140acec41ce56a904f985 Mon Sep 17 00:00:00 2001 From: matlabbe Date: Thu, 24 Nov 2011 19:11:30 +0000 Subject: [PATCH] Added About dialog git-svn-id: http://find-object.googlecode.com/svn/trunk/find_object@47 620bd6b2-0a58-f614-fd9a-1bd335dccda9 --- app/CMakeLists.txt | 3 + src/AboutDialog.cpp | 35 +++++++ src/AboutDialog.h | 42 +++++++++ src/MainWindow.cpp | 3 + src/MainWindow.h | 2 + src/ui/aboutDialog.ui | 209 ++++++++++++++++++++++++++++++++++++++++++ src/ui/mainWindow.ui | 35 ++++--- 7 files changed, 316 insertions(+), 13 deletions(-) create mode 100644 src/AboutDialog.cpp create mode 100644 src/AboutDialog.h create mode 100644 src/ui/aboutDialog.ui diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index dee61f35..4e2f3e1e 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -7,11 +7,13 @@ SET(headers_ui ../src/ObjWidget.h ../src/Camera.h ../src/ParametersToolBox.h + ../src/AboutDialog.h ) SET(uis ../src/ui/mainWindow.ui ../src/ui/addObjectDialog.ui + ../src/ui/aboutDialog.ui ) #SET(qrc @@ -39,6 +41,7 @@ SET(SRC_FILES ../src/ParametersToolBox.cpp ../src/Settings.cpp ../src/ObjWidget.cpp + ../src/AboutDialog.cpp ${moc_srcs} ${moc_uis} #${srcs_qrc} diff --git a/src/AboutDialog.cpp b/src/AboutDialog.cpp new file mode 100644 index 00000000..e32ec7f3 --- /dev/null +++ b/src/AboutDialog.cpp @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2010-2011, Mathieu Labbe and IntRoLab - Universite de Sherbrooke + * + * This file is part of RTAB-Map. + * + * RTAB-Map 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 3 of the License, or + * (at your option) any later version. + * + * RTAB-Map 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 RTAB-Map. If not, see . + */ + +#include "AboutDialog.h" +#include "ui_aboutDialog.h" + +AboutDialog::AboutDialog(QWidget * parent) : + QDialog(parent) +{ + _ui = new Ui_aboutDialog(); + _ui->setupUi(this); + _ui->label_version->setText(PROJECT_VERSION); +} + +AboutDialog::~AboutDialog() +{ + delete _ui; +} + diff --git a/src/AboutDialog.h b/src/AboutDialog.h new file mode 100644 index 00000000..6ad29e5e --- /dev/null +++ b/src/AboutDialog.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2010-2011, Mathieu Labbe and IntRoLab - Universite de Sherbrooke + * + * This file is part of RTAB-Map. + * + * RTAB-Map 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 3 of the License, or + * (at your option) any later version. + * + * RTAB-Map 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 RTAB-Map. If not, see . + */ + +#ifndef ABOUTDIALOG_H_ +#define ABOUTDIALOG_H_ + +#include +#include + +class Ui_aboutDialog; + +class AboutDialog : public QDialog +{ + Q_OBJECT + +public: + AboutDialog(QWidget * parent = 0); + + virtual ~AboutDialog(); + +private: + Ui_aboutDialog * _ui; +}; + + +#endif /* ABOUTDIALOG_H_ */ diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index e2cf7127..0063330c 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -8,6 +8,7 @@ #include "Camera.h" #include "Settings.h" #include "ParametersToolBox.h" +#include "AboutDialog.h" #include #include @@ -31,6 +32,7 @@ MainWindow::MainWindow(Camera * camera, QWidget * parent) : { ui_ = new Ui_mainWindow(); ui_->setupUi(this); + aboutDialog_ = new AboutDialog(this); if(!camera_) { @@ -69,6 +71,7 @@ MainWindow::MainWindow(Camera * camera, QWidget * parent) : connect(ui_->actionExit, SIGNAL(triggered()), this, SLOT(close())); connect(ui_->actionSave_objects, SIGNAL(triggered()), this, SLOT(saveObjects())); connect(ui_->actionLoad_objects, SIGNAL(triggered()), this, SLOT(loadObjects())); + connect(ui_->actionAbout, SIGNAL(triggered()), aboutDialog_ , SLOT(exec())); startProcessing(); } diff --git a/src/MainWindow.h b/src/MainWindow.h index c5ef36b9..4b1f3d03 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -17,6 +17,7 @@ class ObjWidget; class Camera; class ParametersToolBox; class QLabel; +class AboutDialog; class MainWindow : public QMainWindow { @@ -55,6 +56,7 @@ private: private: Ui_mainWindow * ui_; Camera * camera_; + AboutDialog * aboutDialog_; QList objects_; cv::Mat dataTree_; QList dataRange_; diff --git a/src/ui/aboutDialog.ui b/src/ui/aboutDialog.ui new file mode 100644 index 00000000..3a706a7e --- /dev/null +++ b/src/ui/aboutDialog.ui @@ -0,0 +1,209 @@ + + + aboutDialog + + + + 0 + 0 + 404 + 257 + + + + + 0 + 0 + + + + About Find-Object + + + + + + QFrame::Box + + + QFrame::Raised + + + + + + <!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:'Lucida Grande'; font-size:13pt; 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;"><span style=" font-family:'MS Shell Dlg 2'; font-size:14pt; font-weight:600;">Find-Object</span></p></body></html> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + + + + + + + Author : + + + + + + + Link : + + + + + + + Version : + + + + + + + <!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:'Lucida Grande'; font-size:13pt; 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;"><a href="http://www.code.google.com/p/find-object"><span style=" text-decoration: underline; color:#0000ff;">Home page</span></a></p></body></html> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + + + + + Mathieu Labbé, matlabbe@gmail.com + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + Qt::Vertical + + + + 20 + 1 + + + + + + + + + + + :/images/IntRoLabSmall.png + + + Qt::AlignCenter + + + + + + + Copyright (C) 2011 IntRoLab - Université de Sherbrooke + + + Qt::AlignCenter + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + + + + + buttonBox + accepted() + aboutDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + aboutDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/ui/mainWindow.ui b/src/ui/mainWindow.ui index 36277721..939d4167 100644 --- a/src/ui/mainWindow.ui +++ b/src/ui/mainWindow.ui @@ -6,12 +6,12 @@ 0 0 - 864 + 871 533 - Find object + Find-Object @@ -130,8 +130,8 @@ 0 0 - 864 - 25 + 871 + 22 @@ -156,15 +156,22 @@ View + + + ? + + + + 300 - 180 + 194 @@ -188,8 +195,8 @@ 0 0 - 282 - 401 + 276 + 393 @@ -204,9 +211,6 @@ 0 - - 0 - @@ -345,7 +349,7 @@ 300 - 121 + 128 @@ -372,8 +376,8 @@ 0 0 - 280 - 463 + 274 + 459 @@ -430,6 +434,11 @@ Load objects... + + + About... + +