diff options
Diffstat (limited to 'mgaapplet')
-rwxr-xr-x | mgaapplet | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -36,7 +36,7 @@ use ugtk3 qw(:all); use lib qw(/usr/lib/libDrakX/drakfirsttime); use mgaonline; use mgaapplet_gui; -use Gtk2::Notify '-init', 'mgaapplet'; +use Gtk3::Notify '-init', 'mgaapplet'; use Net::DBus qw(:typing); use Rpmdrake::open_db; @@ -203,7 +203,7 @@ my %actions = ( 'upgrade_distro' => { name => N("Upgrade the system"), launch => \&upgrade }, ); -my $icon = Gtk2::StatusIcon->new; +my $icon = Gtk3::StatusIcon->new; #$icon->shape_combine_mask($img, 0, 0); $icon->signal_connect(popup_menu => sub { my ($_icon, $button, $time) = @_; @@ -260,7 +260,7 @@ $SIG{HUP} = \&restart_applet; run_program::raw({ detach => 1 }, 'ionice', '-p', $$, '-n7'); -Gtk2->main; +Gtk3->main; ugtk3::exit(0); @@ -391,7 +391,7 @@ sub confirm_upgrade() { my $browse; $browse = gtksignal_connect( - Gtk2::FileChooserButton->new(N("Browse"), 'select-folder'), + Gtk3::FileChooserButton->new(N("Browse"), 'select-folder'), 'current-folder-changed' => sub { $temp_dir = $_[0]->get_current_folder; my $ok = -d $temp_dir && ! -l $temp_dir && ((stat($temp_dir))[4] == 0); @@ -793,8 +793,8 @@ sub setState { gtkflush(); # so that bubbles are displayed on right icon - if ($state{$state}{tt}[0] && $icon->isa('Gtk2::StatusIcon') && !$state{$state}{do_not_use_bubble}) { - my $bubble = Gtk2::Notify->new(N("Warning"), formatAlaTeX(translate($state{$state}{tt}[0])) . "\n", + if ($state{$state}{tt}[0] && $icon->isa('Gtk3::StatusIcon') && !$state{$state}{do_not_use_bubble}) { + my $bubble = Gtk3::Notify->new(N("Warning"), formatAlaTeX(translate($state{$state}{tt}[0])) . "\n", '/usr/share/icons/mgaonline.png'); if ($state eq 'new_distribution') { $bubble->add_action('clicked', N("More Information"), \&upgrade); @@ -818,20 +818,20 @@ sub setState { eval { $bubble->show }; } - my $menu = Gtk2::Menu->new; + my $menu = Gtk3::Menu->new; foreach (@arr) { my $action = $actions{$_}; next if !ref($action->{launch}); - $menu->append(gtksignal_connect(gtkshow(Gtk2::MenuItem->new_with_label($action->{name})), activate => $action->{launch})); + $menu->append(gtksignal_connect(gtkshow(Gtk3::MenuItem->new_with_label($action->{name})), activate => $action->{launch})); } - $menu->append(gtkshow(Gtk2::SeparatorMenuItem->new)); - $menu->append(gtksignal_connect(gtkshow(Gtk2::MenuItem->new_with_label(N("About..."))), + $menu->append(gtkshow(Gtk3::SeparatorMenuItem->new)); + $menu->append(gtksignal_connect(gtkshow(Gtk3::MenuItem->new_with_label(N("About..."))), activate => \&about_dialog)); - $menu->append(gtksignal_connect(gtkshow(Gtk2::MenuItem->new_with_label(N("Updates Configuration"))), + $menu->append(gtksignal_connect(gtkshow(Gtk3::MenuItem->new_with_label(N("Updates Configuration"))), activate => sub { run_program::raw({ detach => 1 }, 'mgaapplet-config') })); - $menu->append(gtksignal_connect(gtkset_active($checkme = Gtk2::CheckMenuItem->new_with_label(N("Always launch on startup")), shouldStart()), toggled => sub { setAutoStart(uc(bool2text($checkme->get_active))) })); + $menu->append(gtksignal_connect(gtkset_active($checkme = Gtk3::CheckMenuItem->new_with_label(N("Always launch on startup")), shouldStart()), toggled => sub { setAutoStart(uc(bool2text($checkme->get_active))) })); $checkme->show; - $menu->append(gtksignal_connect(gtkshow(Gtk2::MenuItem->new_with_label(N("Quit"))), activate => sub { mainQuit() })); + $menu->append(gtksignal_connect(gtkshow(Gtk3::MenuItem->new_with_label(N("Quit"))), activate => sub { mainQuit() })); $menu; } @@ -852,5 +852,5 @@ sub mainQuit() { # setAutoStart('FALSE'); Glib::Source->remove($timeout) if $timeout; Glib::Source->remove($network_timeout) if $network_timeout; - Gtk2->main_quit; + Gtk3->main_quit; } |