Added about boxes.

This commit is contained in:
Pierre HUBERT 2018-11-29 16:06:37 +01:00
parent 1a3169bc16
commit 56c1e4a88b
7 changed files with 177 additions and 3 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -0,0 +1,28 @@
/**
* About this app dialog
*
* @author Pierre HUBERT
*/
#ifndef ABOUTTHISAPPDIALOG_H
#define ABOUTTHISAPPDIALOG_H
#include <QDialog>
namespace Ui {
class AboutThisAppDialog;
}
class AboutThisAppDialog : public QDialog
{
Q_OBJECT
public:
explicit AboutThisAppDialog(QWidget *parent = nullptr);
~AboutThisAppDialog();
private:
Ui::AboutThisAppDialog *ui;
};
#endif // ABOUTTHISAPPDIALOG_H

View File

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AboutThisAppDialog</class>
<widget class="QDialog" name="AboutThisAppDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>About ComunicMessages</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTextBrowser" name="textBrowser">
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;This application is a client of the free and OpenSource social network Comunic.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;The philosophy of Comunic is to respect its users privacy by all means.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Comunic is available everywhere :&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;* In your browser : https://comunic.io/&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;* In your smartphone : Search &amp;quot;Comunic&amp;quot; in the Play Store.&lt;/p&gt;
&lt;p style=&quot;-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;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;This application has been built by Pierre HUBERT.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>AboutThisAppDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>AboutThisAppDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -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();
}

View File

@ -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;
};

View File

@ -23,8 +23,32 @@
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuAccount">
<property name="title">
<string>Account</string>
</property>
</widget>
<widget class="QMenu" name="menuHelp">
<property name="title">
<string>Help</string>
</property>
<addaction name="actionAbout_this_App"/>
<addaction name="actionAbout_Qt"/>
</widget>
<addaction name="menuAccount"/>
<addaction name="menuHelp"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="actionAbout_Qt">
<property name="text">
<string>About Qt</string>
</property>
</action>
<action name="actionAbout_this_App">
<property name="text">
<string>About this App</string>
</property>
</action>
</widget>
<resources/>
<connections/>