diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2002-12-03 13:12:23 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2002-12-03 13:12:23 +0000 |
commit | 6c11366dd6fea8ce8ff8039873aa30ecd4a60be5 (patch) | |
tree | 5996b94fb57a3866decf68e449a00a95db7a3dfe /perl-install/services.pm | |
parent | 23c259c90cbed0280c9e23b3c9763363c148c472 (diff) | |
download | drakx-6c11366dd6fea8ce8ff8039873aa30ecd4a60be5.tar drakx-6c11366dd6fea8ce8ff8039873aa30ecd4a60be5.tar.gz drakx-6c11366dd6fea8ce8ff8039873aa30ecd4a60be5.tar.bz2 drakx-6c11366dd6fea8ce8ff8039873aa30ecd4a60be5.tar.xz drakx-6c11366dd6fea8ce8ff8039873aa30ecd4a60be5.zip |
gtk2
Diffstat (limited to 'perl-install/services.pm')
-rw-r--r-- | perl-install/services.pm | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/perl-install/services.pm b/perl-install/services.pm index 456317555..5d5140161 100644 --- a/perl-install/services.pm +++ b/perl-install/services.pm @@ -185,16 +185,16 @@ sub ask_standalone_gtk { my ($in, $prefix) = @_; my ($l, $on_services) = services($prefix); - require my_gtk; - my_gtk->import(qw(:helpers :wrappers)); + require ugtk2; + ugtk2->import(qw(:wrappers :create)); - my $W = my_gtk->new(N("Services")); + my $W = ugtk2->new(N("Services")); my ($x, $y, $w_popup); my $nopop = sub { $w_popup and $w_popup->destroy }; - my $display = sub { $nopop->(); $_[0] and gtkmove(gtkshow(gtkadd($w_popup = new Gtk::Window('-popup'), - gtksignal_connect(gtkadd(new Gtk::EventBox(), - gtkadd(gtkset_shadow_type(new Gtk::Frame, 'etched_out'), - gtkset_justify(new Gtk::Label($_[0]), 0))), + my $display = sub { $nopop->(); $_[0] and gtkmove(gtkshow(gtkadd($w_popup = Gtk2::Window->new('popup'), + gtksignal_connect(gtkadd(Gtk2::EventBox->new, + gtkadd(gtkset_shadow_type(Gtk2::Frame->new, 'etched_out'), + gtkset_justify(Gtk2::Label->new($_[0]), 0))), button_press_event => sub { $nopop->() } ))), $x, $y) }; my $update_service = sub { @@ -212,28 +212,28 @@ sub ask_standalone_gtk { } $infos .= $infos_old; }; - my $b = new Gtk::EventBox(); - $b->set_events(["pointer_motion_mask"]); + my $b = Gtk2::EventBox->new; + $b->set_events('pointer_motion_mask'); gtkadd($W->{window}, gtkadd($b, gtkpack_($W->create_box_with_title(N("Services and deamons")), - 1, gtkset_usize(createScrolledWindow(create_packtable({ col_spacings => 10, row_spacings => 3 }, + 1, gtkset_size_request(createScrolledWindow(create_packtable({ col_spacings => 10, row_spacings => 3 }, map { my $service = $_; my $infos = $strip->(description($_, $prefix)); $infos ||= N("No additional information\nabout this service, sorry."); - my $l = new Gtk::Label(); + my $l = Gtk2::Label->new; my ($started, $action) = $update_service->($service, gtkset_justify($l, 0)); - [ gtkpack__(new Gtk::HBox(0,0), $_), - gtkpack__(new Gtk::HBox(0,0), $l), - gtkpack__(new Gtk::HBox(0,0), gtksignal_connect(new Gtk::Button(N("Info")), clicked => sub { $display->($infos) })), - gtkpack__(new Gtk::HBox(0,0), gtkset_active(gtksignal_connect( - new Gtk::CheckButton(N("On boot")), + [ gtkpack__(Gtk2::HBox->new(0,0), $_), + gtkpack__(Gtk2::HBox->new(0,0), $l), + gtkpack__(Gtk2::HBox->new(0,0), gtksignal_connect(Gtk2::Button->new(N("Info")), clicked => sub { $display->($infos) })), + gtkpack__(Gtk2::HBox->new(0,0), gtkset_active(gtksignal_connect( + Gtk2::CheckButton->new(N("On boot")), clicked => sub { if ($_[0]->active) { push @$on_services, $service if !member($service, @$on_services); } else { @$on_services = grep { $_ ne $service } @$on_services; } }), member($service, @$on_services))), map { my $a = $_; - gtkpack__(new Gtk::HBox(0,0), gtksignal_connect(new Gtk::Button(translate($a)), + gtkpack__(Gtk2::HBox->new(0,0), gtksignal_connect(Gtk2::Button->new(translate($a)), clicked => sub { my $c = "service $service " . (lc($a) eq "start" ? "restart" : lc($a)) . " 2>&1"; local $_ = `$c`; s/\033\[[^mG]*[mG]//g; ($started, $action) = $update_service->($service, $l); $display->($_); @@ -242,7 +242,7 @@ sub ask_standalone_gtk { ] } @$l)), 500, 400), - 0, gtkpack(gtkset_border_width(new Gtk::HBox(0,0),5), $W->create_okcancel) + 0, gtkpack(gtkset_border_width(Gtk2::HBox->new(0,0),5), $W->create_okcancel) )) ); $b->signal_connect(motion_notify_event => sub { my ($w, $e) = @_; |