summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/drakguard18
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/drakguard b/bin/drakguard
index 1443780..984fffb 100755
--- a/bin/drakguard
+++ b/bin/drakguard
@@ -49,10 +49,12 @@ $users_list->get_selection->set_mode('multiple');
my $whitelist = Gtk2::SimpleList->new(N("Allowed addresses") => 'text');
$whitelist->get_selection->set_mode('multiple');
@{$whitelist->{data}} = read_url_list($whitelist_url_file);
+my $whitelist_entry;
my $blacklist = Gtk2::SimpleList->new(N("Forbidden addresses") => 'text');
$blacklist->get_selection->set_mode('multiple');
@{$blacklist->{data}} = read_url_list($blacklist_url_file);
+my $blacklist_entry;
sub update_time_change() {
gtkval_modify(\$allow_time_change, $enable && $time_control);
@@ -118,6 +120,13 @@ gtkadd($w->{window},
]),
gtknew('Label', text => N("Blacklist")),
gtknew('VBox', spacing => 5, children => [
+ 0, gtknew('HBox', border_width => 5, spacing => 5, children_loose => [
+ $blacklist_entry = gtknew('Entry'),
+ gtknew('Button', text => N("Add"), clicked => sub {
+ blacklist($blacklist_entry->get_text);
+ $blacklist_entry->set_text("");
+ }),
+ ]),
1, gtknew('ScrolledWindow', width => 500, height => 300, child => $blacklist),
0, gtknew('HButtonBox', border_width => 5, layout => 'edge', children_loose => [
gtknew('Button', text => N("Remove from blacklist"), clicked => sub { unblacklist(get_selected_blacklist()) }),
@@ -125,6 +134,13 @@ gtkadd($w->{window},
]),
gtknew('Label', text => N("Whitelist")),
gtknew('VBox', spacing => 5, children => [
+ 0, gtknew('HBox', border_width => 5, spacing => 5, children_loose => [
+ $whitelist_entry = gtknew('Entry'),
+ gtknew('Button', text => N("Add"), clicked => sub {
+ whitelist($whitelist_entry->get_text);
+ $whitelist_entry->set_text("");
+ }),
+ ]),
1, gtknew('ScrolledWindow', width => 500, height => 300, child => $whitelist),
0, gtknew('HButtonBox', border_width => 5, layout => 'edge', children_loose => [
gtknew('Button', text => N("Remove from whitelist"), clicked => sub { unwhitelist(get_selected_whitelist()) }),
@@ -154,6 +170,7 @@ sub get_selected_blacklist() {
sub blacklist {
my @addr = @_;
+ push @{$blacklist->{data}}, $_ foreach @addr;
}
sub unblacklist {
@@ -167,6 +184,7 @@ sub get_selected_whitelist() {
sub whitelist {
my @addr = @_;
+ push @{$whitelist->{data}}, $_ foreach @addr;
}
sub unwhitelist {