From 7c1f7767aaead0630bd17ef954171cbc84954d1c Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 2 Jan 2003 08:28:34 +0000 Subject: - perl-gtk2 port - cleanups --- menus_launcher.pl | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'menus_launcher.pl') diff --git a/menus_launcher.pl b/menus_launcher.pl index e598f362..1de58f61 100755 --- a/menus_launcher.pl +++ b/menus_launcher.pl @@ -3,7 +3,7 @@ use strict; use lib qw(/usr/lib/libDrakX); use common; -use my_gtk qw(:helpers :wrappers :various);; +use ugtk2 qw(:helpers :wrappers); use interactive; use standalone; @@ -16,47 +16,47 @@ use standalone; push @::textdomains, 'drakconf'; my $bindir = "/usr/bin/"; -my $my_win = my_gtk->new('print_launcher'); +my $my_win = ugtk2->new('print_launcher'); $my_win->{rwindow}->set_title(N("Menu Configuration Center")) unless $::isEmbedded; $my_win->{window}->signal_connect(delete_event => sub { gtkset_mousecursor_normal(); - my_gtk->exit(0); -} ); -my $vbox = new Gtk::VBox(0, 0); + ugtk2->exit(0); +}); +my $vbox = Gtk2::VBox->new(0, 0); $my_win->{window}->add($vbox); -$vbox->pack_start(new Gtk::Label(N("Menu Configuration Center") . N("\n\nChoose which menu you want to configure")), 0, 0, 5); -$vbox->pack_start(new Gtk::HSeparator, 0, 0, 5); -my $table = new Gtk::Table (3, 2, 0); +$vbox->pack_start(Gtk2::Label->new(N("Menu Configuration Center") . N("\n\nChoose which menu you want to configure")), 0, 0, 5); +$vbox->pack_start(Gtk2::HSeparator->new, 0, 0, 5); +my $table = Gtk2::Table->new(3, 2, 0); $table->set_border_width(5); $table->set_row_spacings(5); $table->set_col_spacings(5); -my $hbox = new Gtk::HBox(0, 0); +my $hbox = Gtk2::HBox->new(0, 0); $vbox->pack_start($hbox, 1, 1, 1); $hbox->pack_start($table, 0, 0, 5); -$table->attach (new Gtk::Label(N("System menu")), 0, 1, 0, 1, 'fill', 'fill', 0, 0); -my $b1 = gtksignal_connect(new Gtk::Button(N("Configure...")), clicked => sub { system("$bindir/menudrake --systemmenu &") } ); -$table->attach ($b1, 1, 2, 0, 1, 'fill', 'fill', 0, 0); -$table->attach (new Gtk::Label(N("User menu")), 0, 1, 1, 2, 'fill', 'fill', 0, 0); +$table->attach(Gtk2::Label->new(N("System menu")), 0, 1, 0, 1, 'fill', 'fill', 0, 0); +my $b1 = gtksignal_connect(Gtk2::Button->new(N("Configure...")), clicked => sub { system("$bindir/menudrake --systemmenu &") }); +$table->attach($b1, 1, 2, 0, 1, 'fill', 'fill', 0, 0); +$table->attach(Gtk2::Label->new(N("User menu")), 0, 1, 1, 2, 'fill', 'fill', 0, 0); my (@user_info, @usernames); setpwent(); do { @user_info = getpwent(); my ($uname, $uid) = @user_info[0, 2]; - push (@usernames, $uname) if $uid > 500 && $uname eq $ENV{INITIAL_USER}; - } while (@user_info); -my $combo = new Gtk::Combo; -$combo->set_popdown_strings (@usernames, "root"); -$table->attach ($combo, 2, 3, 1, 2, 'fill', 'fill', 0, 0); -my $b2 = gtksignal_connect(new Gtk::Button(N("Configure...")), - clicked => sub { system($combo->entry->get_text() eq "root" ? "$bindir/menudrake --usermenu &" : " su $a -c \"$bindir/menudrake &\"") } ); -$table->attach ($b2, 1, 2, 1, 2, 'fill', 'fill', 0, 0); -$vbox->pack_start(new Gtk::HSeparator, 0, 0, 5); -my $bbox = new Gtk::HButtonBox; + push(@usernames, $uname) if $uid > 500 && $uname eq $ENV{INITIAL_USER}; + } while @user_info; +my $combo = Gtk2::Combo->new; +$combo->set_popdown_strings(@usernames, "root"); +$table->attach($combo, 2, 3, 1, 2, 'fill', 'fill', 0, 0); +my $b2 = gtksignal_connect(Gtk2::Button->new(N("Configure...")), + clicked => sub { my $a = $combo->entry->get_text(); system($a eq "root" ? "$bindir/menudrake --usermenu &" : " su $a -c \"$bindir/menudrake &\"") }); +$table->attach($b2, 1, 2, 1, 2, 'fill', 'fill', 0, 0); +$vbox->pack_start(Gtk2::HSeparator->new, 0, 0, 5); +my $bbox = Gtk2::HButtonBox->new; $vbox->pack_start($bbox, 0, 0, 5); -$bbox->set_layout(-end); -my $button_ok = gtksignal_connect(new Gtk::Button(N("Done")), clicked => sub { my_gtk->exit(0) }); +$bbox->set_layout('end'); +my $button_ok = gtksignal_connect(Gtk2::Button->new(N("Done")), clicked => sub { ugtk2->exit(0) }); $button_ok->can_default(1); $bbox->add($button_ok); $my_win->{window}->show_all; $my_win->main; -my_gtk->exit(0); +ugtk2->exit(0); -- cgit v1.2.1