diff options
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/aboutdialog.cpp | 20 | ||||
-rw-r--r-- | src/aboutdialog.h | 18 | ||||
-rw-r--r-- | src/aboutdialog.ui | 101 | ||||
-rw-r--r-- | src/mainwindow.cpp | 4 |
5 files changed, 145 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c5daebf..83d8b99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,9 @@ set(PROJECT_SOURCES src/settingsdialog.cpp src/settingsdialog.h src/settingsdialog.ui + src/aboutdialog.cpp + src/aboutdialog.h + src/aboutdialog.ui src/settings_interface.cpp src/settings_interface.h src/widgets/status_info.cpp diff --git a/src/aboutdialog.cpp b/src/aboutdialog.cpp new file mode 100644 index 0000000..0a96e59 --- /dev/null +++ b/src/aboutdialog.cpp @@ -0,0 +1,20 @@ +#include "aboutdialog.h" +#include <qsizepolicy.h> + +AboutDialog::AboutDialog(QWidget* parent) + : QDialog(parent, Qt::Dialog), ui(new Ui::AboutDialog) +{ + ui->setupUi(this); + + // TODO: show version or git build in about text + //ui->label->setText(ui->label->text().arg("aaa")); + + // I have been saved by https://stackoverflow.com/a/22565649 + // It's not more complicated than that… thankfully + adjustSize(); + setFixedSize(sizeHint()); +} + +AboutDialog::~AboutDialog() { + delete ui; +} diff --git a/src/aboutdialog.h b/src/aboutdialog.h new file mode 100644 index 0000000..f37f0e9 --- /dev/null +++ b/src/aboutdialog.h @@ -0,0 +1,18 @@ +#pragma once +#include <QDialog> +#include "./ui_aboutdialog.h" + +QT_BEGIN_NAMESPACE +namespace Ui { class AboutDialog; } +QT_END_NAMESPACE + +class AboutDialog : public QDialog { + Q_OBJECT + +public: + AboutDialog(QWidget *parent = nullptr); + ~AboutDialog(); + +private: + Ui::AboutDialog* ui; +}; diff --git a/src/aboutdialog.ui b/src/aboutdialog.ui new file mode 100644 index 0000000..dd31ae1 --- /dev/null +++ b/src/aboutdialog.ui @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>AboutDialog</class> + <widget class="QDialog" name="AboutDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>400</width> + <height>300</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>1000</width> + <height>900</height> + </size> + </property> + <property name="windowTitle"> + <string>About</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string extracomment="about dialog"><html><head/><body><p><span style=" font-size:16pt; font-weight:600;">ActorViewer</span><span style=" font-weight:600;"> %1</span><br/></p><p>ActorViewer is an application that allow one to browse through Fediverse data exports via the help of a Qt-based user interface. It permits one to filter through different types of posts, search through them and view all embedded content related to an Activity.</p><p>This application is licensed under the GNU General Public License, version 3. Please see the LICENSE file, which lists your rights as a user, available in the source code repository's root directory.</p><p>The source code is available at the following web address: <a href="https://git.twilightsparkle.space/ActorViewer/about/"><span style=" text-decoration: underline; color:#ae82c1;">https://git.twilightsparkle.space/ActorViewer/</span></a></p></body></html></string> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Close</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>AboutDialog</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>AboutDialog</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> diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index b54a767..c2a9820 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3,6 +3,7 @@ #include "src/archive/base_archive.h" #include "src/command_line.h" #include "src/settingsdialog.h" +#include "src/aboutdialog.h" #include "src/widgets/tab_activity_list.h" #include <QFileDialog> @@ -105,7 +106,8 @@ void MainWindow::on_actionQuit_triggered(bool checked) { } void MainWindow::on_actionAbout_triggered(bool checked) { - QMessageBox::information(this, "title", "text"); + AboutDialog about_dialog(this); + about_dialog.exec(); } void MainWindow::open_file(const QString &filename) { |