diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-03-27 00:10:12 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-03-27 00:10:12 +0000 |
commit | a846fbabbe18c6fc3334bc7476aa00bca040e405 (patch) | |
tree | aac623620b17855a8799c0c7826a37e48a37f857 /bin | |
parent | bbfe4dc74056e628ef16bad080e2099544524ea5 (diff) | |
download | drakguard-a846fbabbe18c6fc3334bc7476aa00bca040e405.tar drakguard-a846fbabbe18c6fc3334bc7476aa00bca040e405.tar.gz drakguard-a846fbabbe18c6fc3334bc7476aa00bca040e405.tar.bz2 drakguard-a846fbabbe18c6fc3334bc7476aa00bca040e405.tar.xz drakguard-a846fbabbe18c6fc3334bc7476aa00bca040e405.zip |
allow to add entries to whitelist/blacklist
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/drakguard | 18 |
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 { |