aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorConfuSomu2024-01-05 14:58:51 +0100
committerConfuSomu2024-01-05 14:58:51 +0100
commit6a07ef99d9f98b1db4fad91b3cd69e6146c1f01e (patch)
tree760dc8478dd6868a97cb5ee311a3f0932c9b48e8
parent6db1c2645d6c5b7f8e4b13b8f58b4673ea5457f3 (diff)
downloadActorViewer-6a07ef99d9f98b1db4fad91b3cd69e6146c1f01e.tar
ActorViewer-6a07ef99d9f98b1db4fad91b3cd69e6146c1f01e.tar.gz
ActorViewer-6a07ef99d9f98b1db4fad91b3cd69e6146c1f01e.zip
Implement about dialog
-rw-r--r--CMakeLists.txt3
-rw-r--r--src/aboutdialog.cpp20
-rw-r--r--src/aboutdialog.h18
-rw-r--r--src/aboutdialog.ui101
-rw-r--r--src/mainwindow.cpp4
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">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:16pt; font-weight:600;&quot;&gt;ActorViewer&lt;/span&gt;&lt;span style=&quot; font-weight:600;&quot;&gt; %1&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;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.&lt;/p&gt;&lt;p&gt;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.&lt;/p&gt;&lt;p&gt;The source code is available at the following web address: &lt;a href=&quot;https://git.twilightsparkle.space/ActorViewer/about/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#ae82c1;&quot;&gt;https://git.twilightsparkle.space/ActorViewer/&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</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) {