diff options
Diffstat (limited to 'perl-install/services.pm')
-rw-r--r-- | perl-install/services.pm | 47 |
1 files changed, 15 insertions, 32 deletions
diff --git a/perl-install/services.pm b/perl-install/services.pm index c7260d549..7805f0141 100644 --- a/perl-install/services.pm +++ b/perl-install/services.pm @@ -23,6 +23,7 @@ It can also be used for shutting down the machine when the battery is low."), atd => N_("Runs commands scheduled by the at command at the time specified when at was run, and runs batch commands when the load average is low enough."), 'avahi-deamon' => N_("Avahi is a ZeroConf daemon which implements an mDNS stack"), +chronyd => N_("An NTP client/server"), cpufreq => N_("Set CPU frequency settings"), crond => N_("cron is a standard UNIX program that runs user-specified programs at periodic scheduled times. vixie cron adds a number of features to the basic @@ -219,45 +220,32 @@ sub ask_standalone_gtk { my ($l, $on_services) = services(); my @xinetd_services = map { $_->[0] } xinetd_services(); - require ugtk2; - ugtk2->import(qw(:wrappers :create)); - - my $W = ugtk2->new(N("Services")); - my ($x, $y, $w_popup); - my $nopop = sub { $w_popup and $w_popup->destroy; undef $w_popup }; - my $display = sub { - my ($text) = @_; - $nopop->(); - 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($text), 'left'))), - button_press_event => sub { $nopop->() } - )))->move($x, $y) if $text; - }; + require ugtk3; + ugtk3->import(qw(:wrappers :create)); + + my $W = ugtk3->new(N("Services")); my $update_service = sub { my ($service, $label) = @_; my $started = is_service_running($service); $label->set_label($started ? N("running") : N("stopped")); }; - my $b = Gtk2::EventBox->new; - $b->set_events('pointer_motion_mask'); + my $b = Gtk3::EventBox->new; + $b->set_events(${ Gtk3::Gdk::EventMask->new("pointer_motion_mask") }); gtkadd($W->{window}, gtkadd($b, gtkpack_($W->create_box_with_title, - 0, mygtk2::gtknew('Title1', label => N("Services and daemons")), + 0, mygtk3::gtknew('Title1', label => N("Services and daemons")), 1, gtkset_size_request(create_scrolled_window(create_packtable({ col_spacings => 10, row_spacings => 3 }, map { my $service = $_; my $is_xinetd_service = member($service, @xinetd_services); my $infos = warp_text(description($_), 40); $infos ||= N("No additional information\nabout this service, sorry."); - my $label = gtkset_justify(Gtk2::Label->new, 'left'); + my $label = gtkset_justify(Gtk3::Label->new, 'left'); $update_service->($service, $label) if !$is_xinetd_service; - [ gtkpack__(Gtk2::HBox->new(0,0), $_), - gtkpack__(Gtk2::HBox->new(0,0), $label), - gtkpack__(Gtk2::HBox->new(0,0), gtksignal_connect(Gtk2::Button->new(N("Info")), clicked => sub { $display->($infos) })), + [ gtkpack__(Gtk3::HBox->new(0,0), gtkset_tip(Gtk3::Label->new($_), $infos)), + gtkpack__(Gtk3::HBox->new(0,0), $label), - gtkpack__(Gtk2::HBox->new(0,0), gtkset_active(gtksignal_connect( - Gtk2::CheckButton->new($is_xinetd_service ? N("Start when requested") : N("On boot")), + gtkpack__(Gtk3::HBox->new(0,0), gtkset_active(gtksignal_connect( + Gtk3::CheckButton->new($is_xinetd_service ? N("Start when requested") : N("On boot")), clicked => sub { if ($_[0]->get_active) { push @$on_services, $service if !member($service, @$on_services); } else { @@ -265,7 +253,7 @@ sub ask_standalone_gtk { } }), member($service, @$on_services))), map { my $a = $_; - gtkpack__(Gtk2::HBox->new(0,0), gtksignal_connect(Gtk2::Button->new(translate($a)), + gtkpack__(Gtk3::HBox->new(0,0), gtksignal_connect(Gtk3::Button->new(translate($a)), clicked => sub { my $action = $a eq "Start" ? 'restart' : 'stop'; log::explanations(qq(GP_LANG="UTF-8" service $service $action)); @@ -273,19 +261,14 @@ sub ask_standalone_gtk { local $_ = `GP_LANG="UTF-8" service $service $action 2>&1`; s/\033\[[^mG]*[mG]//g; c::set_tagged_utf8($_); $update_service->($service, $label); - $display->($_); })) if !$is_xinetd_service; } (N_("Start"), N_("Stop")) ]; } @$l), [ $::isEmbedded ? 'automatic' : 'never', 'automatic' ]), -1, $::isEmbedded ? -1 : 400), - 0, gtkpack(gtkset_border_width(Gtk2::HBox->new(0,0),5), $W->create_okcancel) + 0, gtkpack(gtkset_border_width(Gtk3::HBox->new(0,0),5), $W->create_okcancel) )) ); - $b->signal_connect(motion_notify_event => sub { my ($w, $e) = @_; - my ($ox, $oy) = $w->window->get_origin; - $x = $e->x+$ox; $y = $e->y+$oy }); - $b->signal_connect(button_press_event => sub { $nopop->() }); $::isEmbedded and gtkflush(); $W->main or return; $on_services; |