aboutsummaryrefslogtreecommitdiff
path: root/src/forms
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-01-24 16:09:07 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2017-01-24 16:09:07 +0100
commit0250559bcf5764fb8cf3a8ccc4e330b8ed855f96 (patch)
tree2283350e44f78e83a8c0257b66c184939cd95a98 /src/forms
parentMade Profile menu a regular menu (diff)
downloadsmolbote-0250559bcf5764fb8cf3a8ccc4e330b8ed855f96.tar.xz
Blocker UI
Diffstat (limited to 'src/forms')
-rw-r--r--src/forms/blockerdialog.cpp31
-rw-r--r--src/forms/blockerdialog.h24
-rw-r--r--src/forms/blockerdialog.ui168
3 files changed, 223 insertions, 0 deletions
diff --git a/src/forms/blockerdialog.cpp b/src/forms/blockerdialog.cpp
new file mode 100644
index 0000000..f755af6
--- /dev/null
+++ b/src/forms/blockerdialog.cpp
@@ -0,0 +1,31 @@
+#include "blockerdialog.h"
+#include "ui_blockerdialog.h"
+
+#include "settings.h"
+#include <QLabel>
+
+BlockerDialog::BlockerDialog(QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::UrlInterceptorDialog)
+{
+ Settings settings;
+ ui->setupUi(this);
+
+ subscription = new BlockerSubscription(this);
+ QString sublocation = settings.value("blocker/subscription").toString();
+ if(!sublocation.isEmpty()) {
+ subscription->loadFromFile(sublocation);
+ }
+
+ ui->title->setText(subscription->title());
+ ui->homepage->setText(subscription->homepage());
+ ui->license->setText(subscription->license());
+ ui->version->setText(subscription->version());
+ ui->lastModified->setText(subscription->lastModified().toString());
+ ui->expires->setText(subscription->expires().toString());
+}
+
+BlockerDialog::~BlockerDialog()
+{
+ delete ui;
+}
diff --git a/src/forms/blockerdialog.h b/src/forms/blockerdialog.h
new file mode 100644
index 0000000..0c8e8ba
--- /dev/null
+++ b/src/forms/blockerdialog.h
@@ -0,0 +1,24 @@
+#ifndef URLINTERCEPTORDIALOG_H
+#define URLINTERCEPTORDIALOG_H
+
+#include <QDialog>
+#include "webengine/blockersubscription.h"
+
+namespace Ui {
+class UrlInterceptorDialog;
+}
+
+class BlockerDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit BlockerDialog(QWidget *parent = 0);
+ ~BlockerDialog();
+
+private:
+ Ui::UrlInterceptorDialog *ui;
+ BlockerSubscription *subscription;
+};
+
+#endif // URLINTERCEPTORDIALOG_H
diff --git a/src/forms/blockerdialog.ui b/src/forms/blockerdialog.ui
new file mode 100644
index 0000000..dc0a1f4
--- /dev/null
+++ b/src/forms/blockerdialog.ui
@@ -0,0 +1,168 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>UrlInterceptorDialog</class>
+ <widget class="QDialog" name="UrlInterceptorDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>640</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
+ <string>GroupBox</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <layout class="QFormLayout" name="leftFormLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="title_label">
+ <property name="text">
+ <string>Title</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLabel" name="title">
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="homepage_label">
+ <property name="text">
+ <string>Homepage</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="homepage">
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="license_label">
+ <property name="text">
+ <string>License</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLabel" name="license">
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QFormLayout" name="rightFormLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="version_label">
+ <property name="text">
+ <string>Version</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLabel" name="version">
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="lastModified_label">
+ <property name="text">
+ <string>Last Modified</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="lastModified">
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="expires_label">
+ <property name="text">
+ <string>Expires</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLabel" name="expires">
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QListWidget" name="listWidget"/>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>UrlInterceptorDialog</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>UrlInterceptorDialog</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>