From 0250559bcf5764fb8cf3a8ccc4e330b8ed855f96 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Tue, 24 Jan 2017 16:09:07 +0100 Subject: Blocker UI --- src/forms/blockerdialog.cpp | 31 ++++++++ src/forms/blockerdialog.h | 24 +++++++ src/forms/blockerdialog.ui | 168 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 223 insertions(+) create mode 100644 src/forms/blockerdialog.cpp create mode 100644 src/forms/blockerdialog.h create mode 100644 src/forms/blockerdialog.ui (limited to 'src/forms') 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 + +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 +#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 @@ + + + UrlInterceptorDialog + + + + 0 + 0 + 640 + 480 + + + + Dialog + + + + + + GroupBox + + + + + + + + Title + + + + + + + TextLabel + + + + + + + Homepage + + + + + + + TextLabel + + + + + + + License + + + + + + + TextLabel + + + + + + + + + + + Version + + + + + + + TextLabel + + + + + + + Last Modified + + + + + + + TextLabel + + + + + + + Expires + + + + + + + TextLabel + + + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + UrlInterceptorDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + UrlInterceptorDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + -- cgit v1.2.1