summaryrefslogtreecommitdiffstats
path: root/bin/drakids
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2013-11-07 16:57:13 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2013-11-24 11:00:40 +0100
commit4a4453328a1a2051307f44e6c1c200625666ba16 (patch)
tree9fb9eb5089abd561cf1c857e448e3c63fcc4465e /bin/drakids
parent7bf101337af175668274aaae14b6320a5224f480 (diff)
downloaddrakx-net-4a4453328a1a2051307f44e6c1c200625666ba16.tar
drakx-net-4a4453328a1a2051307f44e6c1c200625666ba16.tar.gz
drakx-net-4a4453328a1a2051307f44e6c1c200625666ba16.tar.bz2
drakx-net-4a4453328a1a2051307f44e6c1c200625666ba16.tar.xz
drakx-net-4a4453328a1a2051307f44e6c1c200625666ba16.zip
switch from gtk2 to gtk3
Diffstat (limited to 'bin/drakids')
-rwxr-xr-xbin/drakids38
1 files changed, 19 insertions, 19 deletions
diff --git a/bin/drakids b/bin/drakids
index 50cc786..a51f047 100755
--- a/bin/drakids
+++ b/bin/drakids
@@ -8,15 +8,15 @@ use common;
use standalone;
use Socket;
-use mygtk2 qw(gtknew);
-use ugtk2 qw(:dialogs);
+use mygtk3 qw(gtknew);
+use ugtk3 qw(:dialogs);
use POSIX qw(strftime);
use dbus_object;
use network::ifw;
-use Gtk2::SimpleList;
+use Gtk3::SimpleList;
-use ugtk2 qw(:create :helpers :wrappers);
+use ugtk3 qw(:create :helpers :wrappers);
my $loglist = create_attack_list();
$loglist->get_selection->set_mode('single');
@@ -24,7 +24,7 @@ $loglist->get_selection->set_mode('single');
my $blacklist = create_attack_list();
$blacklist->get_selection->set_mode('multiple');
-my $whitelist = Gtk2::SimpleList->new(addr => 'hidden',
+my $whitelist = Gtk3::SimpleList->new(addr => 'hidden',
N("Allowed addresses") => 'text',
);
$whitelist->get_selection->set_mode('multiple');
@@ -40,13 +40,13 @@ my $blocked_services = create_service_list();
my $title = N("Interactive Firewall");
my $icon = "drakfirewall";
-$ugtk2::wm_icon = $icon;
-my $w = ugtk2->new($title);
+$ugtk3::wm_icon = $icon;
+my $w = ugtk3->new($title);
my $ifw;
eval {
my $bus = dbus_object::system_bus();
- dbus_object::set_gtk2_watch_helper($bus);
+ dbus_object::set_gtk3_watch_helper($bus);
network::ifw::init($bus, sub {
my ($_con, $msg) = @_;
my $member = $msg->get_member;
@@ -76,7 +76,7 @@ init_lists();
gtkadd($w->{window},
gtknew('VBox', spacing => 5, children => [
- $::isEmbedded ? () : (0, Gtk2::Banner->new($icon, $title)),
+ $::isEmbedded ? () : (0, Gtk3::Banner->new($icon, $title)),
1, gtknew('Notebook', children => [
if_($i_m_ifw2,
gtknew('Label', text => N("Log")),
@@ -85,7 +85,7 @@ gtkadd($w->{window},
0, gtknew('HButtonBox', layout => 'edge', children_loose => [
gtknew('Button', text => N("Allow"), clicked => sub {}),
gtknew('Button', text => N("Block"), clicked => sub {}),
- gtknew('Button', text => N("Close"), clicked => sub { Gtk2->main_quit })
+ gtknew('Button', text => N("Close"), clicked => sub { Gtk3->main_quit })
]),
]),
gtknew('Label', text => N("Allowed services")),
@@ -94,7 +94,7 @@ gtkadd($w->{window},
0, gtknew('HButtonBox', layout => 'edge', children_loose => [
gtknew('Button', text => N("Remove"), clicked => sub {}),
gtknew('Button', text => N("Block"), clicked => sub {}),
- gtknew('Button', text => N("Close"), clicked => sub { Gtk2->main_quit })
+ gtknew('Button', text => N("Close"), clicked => sub { Gtk3->main_quit })
]),
]),
gtknew('Label', text => N("Blocked services")),
@@ -103,7 +103,7 @@ gtkadd($w->{window},
0, gtknew('HButtonBox', layout => 'edge', children_loose => [
gtknew('Button', text => N("Remove"), clicked => sub {}),
gtknew('Button', text => N("Allow"), clicked => sub {}),
- gtknew('Button', text => N("Close"), clicked => sub { Gtk2->main_quit })
+ gtknew('Button', text => N("Close"), clicked => sub { Gtk3->main_quit })
]),
]),
),
@@ -114,7 +114,7 @@ gtkadd($w->{window},
gtknew('Button', text => N("Clear logs"), clicked => \&clear_log),
gtknew('Button', text => N("Blacklist"), clicked => sub { blacklist(get_selected_log_seq()) }),
gtknew('Button', text => N("Whitelist"), clicked => sub { whitelist(get_selected_log()) }),
- gtknew('Button', text => N("Close"), clicked => sub { Gtk2->main_quit })
+ gtknew('Button', text => N("Close"), clicked => sub { Gtk3->main_quit })
]),
]),
gtknew('Label', text => N("Blacklist")),
@@ -127,7 +127,7 @@ gtkadd($w->{window},
unblacklist(@addr);
whitelist(@addr);
}),
- gtknew('Button', text => N("Close"), clicked => sub { Gtk2->main_quit })
+ gtknew('Button', text => N("Close"), clicked => sub { Gtk3->main_quit })
]),
]),
gtknew('Label', text => N("Whitelist")),
@@ -135,14 +135,14 @@ gtkadd($w->{window},
1, gtknew('ScrolledWindow', width => 600, height => 260, child => $whitelist),
0, gtknew('HButtonBox', layout => 'edge', children_loose => [
gtknew('Button', text => N("Remove from whitelist"), clicked => sub { unwhitelist(get_selected_whitelist()) }),
- gtknew('Button', text => N("Close"), clicked => sub { Gtk2->main_quit })
+ gtknew('Button', text => N("Close"), clicked => sub { Gtk3->main_quit })
]),
]),
]),
]),
);
$w->show;
-Gtk2->main;
+Gtk3->main;
$w->exit(0);
@@ -160,7 +160,7 @@ sub handle_init() {
sub list_remove_addr {
my ($list, @addr) = @_;
- #- workaround buggy Gtk2::SimpleList array abstraction, it destroys references
+ #- workaround buggy Gtk3::SimpleList array abstraction, it destroys references
@$list = map { member($_->[0], @addr) ? () : [ @$_ ] } @$list;
}
@@ -250,7 +250,7 @@ sub clear_lists() {
}
sub create_attack_list() {
- my $attacklist = Gtk2::SimpleList->new(addr => 'hidden',
+ my $attacklist = Gtk3::SimpleList->new(addr => 'hidden',
seq => 'hidden',
timestamp => 'hidden',
N("Date") => 'text',
@@ -287,7 +287,7 @@ sub attack_list_add {
sub create_service_list {
my ($o_status) = @_;
- my $service_list = Gtk2::SimpleList->new(
+ my $service_list = Gtk3::SimpleList->new(
N("Application") => 'text',
N("Service") => 'text',
if_($o_status, N("Status") => 'text'),