From 56c1e4a88bd135e7a9ec1ec0cedfcf996d856912 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 29 Nov 2018 16:06:37 +0100 Subject: [PATCH] Added about boxes. --- ComunicMessages.pro | 9 ++-- widgets/aboutthisappdialog.cpp | 14 ++++++ widgets/aboutthisappdialog.h | 28 ++++++++++++ widgets/aboutthisappdialog.ui | 83 ++++++++++++++++++++++++++++++++++ widgets/mainwindow.cpp | 11 +++++ widgets/mainwindow.h | 11 +++++ widgets/mainwindow.ui | 24 ++++++++++ 7 files changed, 177 insertions(+), 3 deletions(-) create mode 100644 widgets/aboutthisappdialog.cpp create mode 100644 widgets/aboutthisappdialog.h create mode 100644 widgets/aboutthisappdialog.ui diff --git a/ComunicMessages.pro b/ComunicMessages.pro index 577c525..13d60c9 100644 --- a/ComunicMessages.pro +++ b/ComunicMessages.pro @@ -13,7 +13,8 @@ SOURCES += \ data/apirequestslist.cpp \ helpers/configurationhelper.cpp \ data/accountlogintokens.cpp \ - widgets/mainwindow.cpp + widgets/mainwindow.cpp \ + widgets/aboutthisappdialog.cpp HEADERS += \ helpers/accounthelper.h \ @@ -28,8 +29,10 @@ HEADERS += \ data/apirequestslist.h \ helpers/configurationhelper.h \ data/accountlogintokens.h \ - widgets/mainwindow.h + widgets/mainwindow.h \ + widgets/aboutthisappdialog.h FORMS += \ widgets/loginwidget.ui \ - widgets/mainwindow.ui + widgets/mainwindow.ui \ + widgets/aboutthisappdialog.ui diff --git a/widgets/aboutthisappdialog.cpp b/widgets/aboutthisappdialog.cpp new file mode 100644 index 0000000..08e249e --- /dev/null +++ b/widgets/aboutthisappdialog.cpp @@ -0,0 +1,14 @@ +#include "aboutthisappdialog.h" +#include "ui_aboutthisappdialog.h" + +AboutThisAppDialog::AboutThisAppDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::AboutThisAppDialog) +{ + ui->setupUi(this); +} + +AboutThisAppDialog::~AboutThisAppDialog() +{ + delete ui; +} diff --git a/widgets/aboutthisappdialog.h b/widgets/aboutthisappdialog.h new file mode 100644 index 0000000..726a019 --- /dev/null +++ b/widgets/aboutthisappdialog.h @@ -0,0 +1,28 @@ +/** + * About this app dialog + * + * @author Pierre HUBERT + */ + +#ifndef ABOUTTHISAPPDIALOG_H +#define ABOUTTHISAPPDIALOG_H + +#include + +namespace Ui { +class AboutThisAppDialog; +} + +class AboutThisAppDialog : public QDialog +{ + Q_OBJECT + +public: + explicit AboutThisAppDialog(QWidget *parent = nullptr); + ~AboutThisAppDialog(); + +private: + Ui::AboutThisAppDialog *ui; +}; + +#endif // ABOUTTHISAPPDIALOG_H diff --git a/widgets/aboutthisappdialog.ui b/widgets/aboutthisappdialog.ui new file mode 100644 index 0000000..684d72b --- /dev/null +++ b/widgets/aboutthisappdialog.ui @@ -0,0 +1,83 @@ + + + AboutThisAppDialog + + + + 0 + 0 + 400 + 300 + + + + About ComunicMessages + + + + + + <!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:'Ubuntu'; font-size:11pt; 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;">This application is a client of the free and OpenSource social network Comunic.</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The philosophy of Comunic is to respect its users privacy by all means.</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Comunic is available everywhere :</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">* In your browser : https://comunic.io/</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">* In your smartphone : Search &quot;Comunic&quot; in the Play Store.</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; text-decoration: underline; color:#007af4;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">This application has been built by Pierre HUBERT.</p></body></html> + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + AboutThisAppDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + AboutThisAppDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 49d64fc..4832695 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -1,5 +1,6 @@ #include "mainwindow.h" #include "ui_mainwindow.h" +#include "aboutthisappdialog.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), @@ -12,3 +13,13 @@ MainWindow::~MainWindow() { delete ui; } + +void MainWindow::on_actionAbout_Qt_triggered() +{ + QApplication::aboutQt(); +} + +void MainWindow::on_actionAbout_this_App_triggered() +{ + AboutThisAppDialog(this).exec(); +} diff --git a/widgets/mainwindow.h b/widgets/mainwindow.h index 9353441..87dd69d 100644 --- a/widgets/mainwindow.h +++ b/widgets/mainwindow.h @@ -1,3 +1,9 @@ +/** + * Main window of the project + * + * @author Pierre HUBERT + */ + #ifndef MAINWINDOW_H #define MAINWINDOW_H @@ -15,6 +21,11 @@ public: explicit MainWindow(QWidget *parent = nullptr); ~MainWindow(); +private slots: + void on_actionAbout_Qt_triggered(); + + void on_actionAbout_this_App_triggered(); + private: Ui::MainWindow *ui; }; diff --git a/widgets/mainwindow.ui b/widgets/mainwindow.ui index 6545006..e0899ea 100644 --- a/widgets/mainwindow.ui +++ b/widgets/mainwindow.ui @@ -23,8 +23,32 @@ 22 + + + Account + + + + + Help + + + + + + + + + About Qt + + + + + About this App + +