aboutsummaryrefslogtreecommitdiff
path: root/lib/about
diff options
context:
space:
mode:
Diffstat (limited to 'lib/about')
-rw-r--r--lib/about/aboutdialog.cpp71
-rw-r--r--lib/about/aboutdialog.h31
-rw-r--r--lib/about/aboutdialog.ui186
-rw-r--r--lib/about/aboutplugin.cpp111
-rw-r--r--lib/about/aboutplugin.h31
-rw-r--r--lib/about/aboutplugin.ui196
-rw-r--r--lib/about/meson.build12
7 files changed, 0 insertions, 638 deletions
diff --git a/lib/about/aboutdialog.cpp b/lib/about/aboutdialog.cpp
deleted file mode 100644
index 99fb7ce..0000000
--- a/lib/about/aboutdialog.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * This file is part of smolbote. It's copyrighted by the contributors recorded
- * in the version control history of the file, available from its original
- * location: https://neueland.iserlohn-fortress.net/gitea/aqua/smolbote
- *
- * SPDX-License-Identifier: GPL-3.0
- */
-
-#include "aboutdialog.h"
-#include "ui_aboutdialog.h"
-#include <version.h>
-
-// compiler
-// clang also defines __GNUC__, so we need to check for clang first
-#if defined(__clang__)
-#define compiler "Clang " __clang_version__
-#elif defined(__GNUC__)
-#define compiler "GCC " __VERSION__
-#elif defined(_MSC_VER)
-#define compiler "MSVC"
-#else
-#define compiler "unknown compiler"
-#endif
-
-AboutDialog::AboutDialog(QWidget *parent)
- : QDialog(parent)
- , ui(new Ui::AboutDialog)
-{
- setAttribute(Qt::WA_DeleteOnClose, true);
- ui->setupUi(this);
-
- ui->icon->setPixmap(qApp->windowIcon().pixmap(72, 72));
-
- ui->aboutLabel->setText(tr("<h2>smolbote %1</h2>"
- "<p><i>yet another no-frills browser</i></p>"
- "<p>This program is free software, see <i>License</i> for more information.</p>")
- .arg(qApp->applicationVersion()));
-
- ui->licenseLabel->setText(tr("<p>Copyright 2017 - 2019 aqua</p>"
- "<p>This program is free software, and you are welcome to use it under the conditions set by the GNU GPLv3.<br>"
- "This is a short summary: <ul>"
- "<li> the freedom to use the software for any purpose,</li>"
- "<li> the freedom to change the software to suit your needs,</li>"
- "<li> the freedom to share the software with anyone,</li>"
- "<li> the freedom to share the changes you make, and</li>"
- "<li> the responsibility to grant the same freedoms when sharing the software.</li>"
- "</ul>"
- "<p>This program is distributed in the hope that it will be useful, but without any warranty.</p>"
- "<p>You can read the full terms of the license on <a href='https://www.gnu.org/licenses/gpl-3.0.en.html'>the GNU website</a>.</p>"));
-
- ui->detailsLabel->setText(tr("<p>Version " poi_Version "</p>"
- "<p>Compiled with " compiler "</p>"
- "<p>Libraries: <ul>"
- "<li><a href='https://www.qt.io/'>Qt5</a> " QT_VERSION_STR "</li>"
- "<li>spdlog</li>"
- "<li><a href='https://github.com/Taywee/args'>args.hxx</a></li>"
- "<li><a href='https://github.com/itay-grudev/SingleApplication'>SingleApplication</a></li>"
-#ifdef CONFIG_USEPLASMA
- "<li><a href='https://community.kde.org/Frameworks'>KDE Frameworks</a></li>"
-#endif
-#ifdef CONFIG_USEBREAKPAD
- "<li><a href='https://chromium.googlesource.com/breakpad/breakpad'>Breakpad</a></li>"
-#endif
- "</ul></p>"));
-
-}
-
-AboutDialog::~AboutDialog()
-{
- delete ui;
-}
diff --git a/lib/about/aboutdialog.h b/lib/about/aboutdialog.h
deleted file mode 100644
index 1d33d3e..0000000
--- a/lib/about/aboutdialog.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * This file is part of smolbote. It's copyrighted by the contributors recorded
- * in the version control history of the file, available from its original
- * location: https://neueland.iserlohn-fortress.net/gitea/aqua/smolbote
- *
- * SPDX-License-Identifier: GPL-3.0
- */
-
-#ifndef SMOLBOTE_ABOUTDIALOG_H
-#define SMOLBOTE_ABOUTDIALOG_H
-
-#include <QDialog>
-
-namespace Ui
-{
-class AboutDialog;
-}
-
-class AboutDialog : public QDialog
-{
- Q_OBJECT
-
-public:
- explicit AboutDialog(QWidget *parent = nullptr);
- ~AboutDialog() override;
-
-private:
- Ui::AboutDialog *ui;
-};
-
-#endif // SMOLBOTE_ABOUTDIALOG_H
diff --git a/lib/about/aboutdialog.ui b/lib/about/aboutdialog.ui
deleted file mode 100644
index 0af877d..0000000
--- a/lib/about/aboutdialog.ui
+++ /dev/null
@@ -1,186 +0,0 @@
-<?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>500</width>
- <height>600</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>About</string>
- </property>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <widget class="QLabel" name="icon">
- <property name="minimumSize">
- <size>
- <width>72</width>
- <height>72</height>
- </size>
- </property>
- <property name="text">
- <string>TextLabel</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QToolBox" name="toolBox">
- <property name="currentIndex">
- <number>0</number>
- </property>
- <widget class="QWidget" name="aboutPage">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>406</width>
- <height>450</height>
- </rect>
- </property>
- <attribute name="label">
- <string>About</string>
- </attribute>
- <layout class="QVBoxLayout" name="verticalLayout_4">
- <item>
- <widget class="QLabel" name="aboutLabel">
- <property name="text">
- <string>TextLabel</string>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="licensePage">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>406</width>
- <height>450</height>
- </rect>
- </property>
- <attribute name="label">
- <string>License</string>
- </attribute>
- <layout class="QVBoxLayout" name="verticalLayout_5">
- <item>
- <widget class="QLabel" name="licenseLabel">
- <property name="text">
- <string>TextLabel</string>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- <property name="openExternalLinks">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="detailsPage">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>406</width>
- <height>450</height>
- </rect>
- </property>
- <attribute name="label">
- <string>Details</string>
- </attribute>
- <layout class="QVBoxLayout" name="verticalLayout_3">
- <item>
- <widget class="QLabel" name="detailsLabel">
- <property name="text">
- <string>TextLabel</string>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- <property name="openExternalLinks">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </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>
- </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/lib/about/aboutplugin.cpp b/lib/about/aboutplugin.cpp
deleted file mode 100644
index 99c04ec..0000000
--- a/lib/about/aboutplugin.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * This file is part of smolbote. It's copyrighted by the contributors recorded
- * in the version control history of the file, available from its original
- * location: https://neueland.iserlohn-fortress.net/gitea/aqua/smolbote
- *
- * SPDX-License-Identifier: GPL-3.0
- */
-
-#include "aboutplugin.h"
-#include "ui_aboutplugin.h"
-#include <QJsonArray>
-#include <QPluginLoader>
-
-QTreeWidgetItem *createItem(const QString &key, const QJsonValue &json, QTreeWidgetItem *parent)
-{
- auto *item = new QTreeWidgetItem(parent, { key, QLatin1String("---") });
-
- switch(json.type()) {
- case QJsonValue::Bool:
- item->setText(1, json.toBool() ? QLatin1String("true") : QLatin1String("false"));
- break;
-
- case QJsonValue::Double:
- item->setText(1, QString::number(json.toDouble()));
- break;
-
- case QJsonValue::String:
- item->setText(1, json.toString());
- break;
-
- case QJsonValue::Array:
- item->setText(1, QString());
- for(const auto &v : json.toArray()) {
- createItem(QString(), v, item);
- }
- break;
-
- case QJsonValue::Object:
- item->setText(1, QString());
- for(const QString &k : json.toObject().keys()) {
- createItem(k, json.toObject()[k], item);
- }
- break;
-
- case QJsonValue::Null:
- item->setText(1, QLatin1String("null"));
- break;
-
- case QJsonValue::Undefined:
- item->setText(1, QLatin1String("undefined"));
- break;
- }
-
- return item;
-}
-
-AboutPluginDialog::AboutPluginDialog(QPluginLoader *loader, QWidget *parent)
- : QDialog(parent)
- , ui(new Ui::AboutPluginDialog)
-{
- setAttribute(Qt::WA_DeleteOnClose, true);
- ui->setupUi(this);
-
- // load button icon
- {
- QIcon load_icon;
- load_icon.addPixmap(style()->standardPixmap(QStyle::SP_MediaPlay), QIcon::Normal, QIcon::On);
- load_icon.addPixmap(style()->standardPixmap(QStyle::SP_MediaStop), QIcon::Normal, QIcon::Off);
- ui->load->setIcon(load_icon);
- }
-
- auto metaData = loader->metaData()["MetaData"].toObject();
-
- this->setWindowTitle(metaData["name"].toString());
-
- ui->path->setText(loader->fileName());
- ui->load->setChecked(loader->isLoaded());
-
- connect(ui->load, &QToolButton::clicked, this, [this, loader](bool checked) {
- if(checked) {
- // load plugin
- if(!loader->load()) {
- ui->load->setChecked(false);
- ui->error->setText(loader->errorString());
- }
- } else {
- // unload plugin
- if(!loader->unload()) {
- ui->load->setChecked(true);
- ui->error->setText(loader->errorString());
- }
- }
- });
-
- ui->name->setText(metaData[QLatin1String("name")].toString());
- ui->author->setText(metaData[QLatin1String("author")].toString());
- ui->license->setText(metaData[QLatin1String("license")].toString());
- ui->shortcut->setText(metaData[QLatin1String("shortcut")].toString());
-
- for(const QString &key : loader->metaData().keys()) {
- auto *i = createItem(key, loader->metaData()[key], nullptr);
-
- if(i != nullptr)
- ui->details_treeWidget->insertTopLevelItem(0, i);
- }
-}
-
-AboutPluginDialog::~AboutPluginDialog()
-{
- delete ui;
-}
diff --git a/lib/about/aboutplugin.h b/lib/about/aboutplugin.h
deleted file mode 100644
index 9651060..0000000
--- a/lib/about/aboutplugin.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * This file is part of smolbote. It's copyrighted by the contributors recorded
- * in the version control history of the file, available from its original
- * location: https://neueland.iserlohn-fortress.net/gitea/aqua/smolbote
- *
- * SPDX-License-Identifier: GPL-3.0
- */
-
-#ifndef SMOLBOTE_ABOUTPLUGIN_H
-#define SMOLBOTE_ABOUTPLUGIN_H
-
-#include <QDialog>
-
-namespace Ui
-{
-class AboutPluginDialog;
-}
-class QPluginLoader;
-class AboutPluginDialog : public QDialog
-{
- Q_OBJECT
-
-public:
- explicit AboutPluginDialog(QPluginLoader *loader, QWidget *parent = nullptr);
- ~AboutPluginDialog() override;
-
-private:
- Ui::AboutPluginDialog *ui;
-};
-
-#endif // SMOLBOTE_ABOUTPLUGIN_H
diff --git a/lib/about/aboutplugin.ui b/lib/about/aboutplugin.ui
deleted file mode 100644
index 31e20c6..0000000
--- a/lib/about/aboutplugin.ui
+++ /dev/null
@@ -1,196 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>AboutPluginDialog</class>
- <widget class="QDialog" name="AboutPluginDialog">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>474</width>
- <height>329</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Dialog</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QTabWidget" name="tabWidget">
- <property name="currentIndex">
- <number>0</number>
- </property>
- <widget class="QWidget" name="general_tab">
- <attribute name="title">
- <string>General</string>
- </attribute>
- <layout class="QFormLayout" name="formLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="name_label">
- <property name="text">
- <string>Name</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLabel" name="name">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="author_label">
- <property name="text">
- <string>Author</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLabel" name="author">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="shortcut_label">
- <property name="text">
- <string>Shortcut</string>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QLabel" name="shortcut">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="4" column="1">
- <layout class="QHBoxLayout" name="controls_layout"/>
- </item>
- <item row="2" column="1">
- <widget class="QLabel" name="license">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="license_label">
- <property name="text">
- <string>License</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="details_tab">
- <attribute name="title">
- <string>Details</string>
- </attribute>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <widget class="QLabel" name="path">
- <property name="text">
- <string>TextLabel</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QTreeWidget" name="details_treeWidget">
- <column>
- <property name="text">
- <string>Key</string>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Value</string>
- </property>
- </column>
- </widget>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="controls_tab">
- <attribute name="title">
- <string>Controls</string>
- </attribute>
- <layout class="QFormLayout" name="formLayout_2">
- <item row="0" column="1">
- <widget class="QToolButton" name="load">
- <property name="text">
- <string>Load</string>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLabel" name="error">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="error_label">
- <property name="text">
- <string>Status</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </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>AboutPluginDialog</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>AboutPluginDialog</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/lib/about/meson.build b/lib/about/meson.build
deleted file mode 100644
index 531355d..0000000
--- a/lib/about/meson.build
+++ /dev/null
@@ -1,12 +0,0 @@
-about_moc = mod_qt5.preprocess(
- moc_headers: ['aboutdialog.h', 'aboutplugin.h'],
- ui_files: ['aboutdialog.ui', 'aboutplugin.ui'],
- dependencies: dep_qt5
-)
-
-dep_about = declare_dependency(
- include_directories: include_directories('.'),
- link_with: static_library('about',
- ['aboutdialog.cpp', 'aboutplugin.cpp', about_moc, version_h],
- dependencies: [dep_qt5])
-)