aboutsummaryrefslogtreecommitdiff
path: root/src/forms
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-02-03 14:24:29 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2017-02-03 14:24:29 +0100
commit3284722993773ab7d9a54bfcef36dab0c804f83d (patch)
treeab231c385e41388ba141e389901921e5b0624312 /src/forms
parentAdded loading bar to status bar (diff)
downloadsmolbote-3284722993773ab7d9a54bfcef36dab0c804f83d.tar.xz
Listing rules in Blocker dialog
Slightly better rule parsing
Diffstat (limited to 'src/forms')
-rw-r--r--src/forms/blockerdialog.cpp9
-rw-r--r--src/forms/blockerdialog.ui32
2 files changed, 37 insertions, 4 deletions
diff --git a/src/forms/blockerdialog.cpp b/src/forms/blockerdialog.cpp
index da5fae6..5377c97 100644
--- a/src/forms/blockerdialog.cpp
+++ b/src/forms/blockerdialog.cpp
@@ -23,6 +23,7 @@
#include "settings.h"
#include <QLabel>
+#include <QListWidget>
BlockerDialog::BlockerDialog(QWidget *parent) :
QDialog(parent),
@@ -43,6 +44,14 @@ BlockerDialog::BlockerDialog(QWidget *parent) :
ui->version->setText(m_subscription->version());
ui->lastModified->setText(m_subscription->lastModified().toString());
ui->expires->setText(m_subscription->expires().toString());
+
+ // show subscription items
+ for(BlockerRule *rule : m_subscription->urlBlacklist()) {
+ ui->blacklist_listWidget->addItem(rule->pattern());
+ }
+ for(BlockerRule *rule : m_subscription->urlWhitelist()) {
+ ui->whitelist_listWidget->addItem(rule->pattern());
+ }
}
BlockerDialog::~BlockerDialog()
diff --git a/src/forms/blockerdialog.ui b/src/forms/blockerdialog.ui
index dc0a1f4..a84dac8 100644
--- a/src/forms/blockerdialog.ui
+++ b/src/forms/blockerdialog.ui
@@ -11,13 +11,13 @@
</rect>
</property>
<property name="windowTitle">
- <string>Dialog</string>
+ <string>Blocker</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
- <string>GroupBox</string>
+ <string>Subscription</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
@@ -116,7 +116,31 @@
</widget>
</item>
<item>
- <widget class="QListWidget" name="listWidget"/>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="blacklist_tab">
+ <attribute name="title">
+ <string>URL Blacklist</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QListWidget" name="blacklist_listWidget"/>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="whitelist_tab">
+ <attribute name="title">
+ <string>URL Whitelist</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QListWidget" name="whitelist_listWidget"/>
+ </item>
+ </layout>
+ </widget>
+ </widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
@@ -124,7 +148,7 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ <set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>