diff options
Diffstat (limited to 'draksnapshot-applet')
-rw-r--r--[-rwxr-xr-x] | draksnapshot-applet | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/draksnapshot-applet b/draksnapshot-applet index 4a2012a..b5074ec 100755..100644 --- a/draksnapshot-applet +++ b/draksnapshot-applet @@ -34,16 +34,16 @@ use MDV::Snapshot::Hal; BEGIN { unshift @::textdomains, 'draksnapshot' } -use mygtk2 qw(gtknew); #- do not import gtkadd which conflicts with ugtk2 version -use ugtk2 qw(:all); +use mygtk3 qw(gtknew); #- do not import gtkadd which conflicts with ugtk2 version +use ugtk3 qw(:all); use lib qw(/usr/lib/libDrakX/drakfirsttime); -use Gtk2::Notify '-init', 'draksnapshot'; +use Gtk3::Notify '-init', 'draksnapshot'; if (my $pid = is_running('draksnapshot-ap')) { die "draksnapshot-applet already running ($pid)\n"; } -ugtk2::add_icon_path("/usr/share/draksnapshot/pixmaps/"); +ugtk3::add_icon_path("/usr/share/draksnapshot/pixmaps/"); my $menu; @@ -75,7 +75,7 @@ my %actions = ( # create status icon: -my $icon = Gtk2::StatusIcon->new; +my $icon = Gtk3::StatusIcon->new; $icon->signal_connect(popup_menu => sub { my ($_icon, $button, $time) = @_; $menu and $menu->popup(undef, undef, undef, undef, $button, $time); @@ -129,7 +129,7 @@ if ($dbus && $do) { # make icon actually visible so that notification gots proper positionning: gtkflush(); my $bubble = - Gtk2::Notify->new(N("Error. Service disabled."), + Gtk3::Notify::Notification->new(N("Error. Service disabled."), join("\n", formatAlaTeX(N("Error while initializing DBus:")), $dbus_error, @@ -141,10 +141,10 @@ if ($dbus && $do) { my $timeout_bubble = 5000; $bubble->set_timeout($timeout_bubble); eval { $bubble->show }; - Glib::Timeout->add($timeout_bubble + 100, sub { Gtk2->exit; exit(1) }); + Glib::Timeout->add($timeout_bubble + 100, sub { Gtk3::exit; exit(1) }); 0; }); - Gtk2->main; + Gtk3->main; exit(1); } @@ -165,10 +165,10 @@ $SIG{CHLD} = \&harvester; run_program::raw({ detach => 1 }, 'ionice', '-p', $$, '-n7'); -$do and $do->set_gtk2_watch; -Gtk2->main; +$do and $do->set_gtk3_watch; +Gtk3->main; -ugtk2::exit(0); +ugtk3::exit(0); my $config_pid; @@ -203,7 +203,7 @@ sub refresh_gui { } sub configure() { - $config_pid = fork_exec('/usr/sbin/draksnapshot-config'); + $config_pid = fork_exec('/usr/bin/draksnapshot-config'); go2State('config_in_progress'); } @@ -230,29 +230,29 @@ sub setState { my ($state_type) = @_; my $checkme; my $arr = $state{$state_type}{menu}; - $icon->set_tooltip(formatAlaTeX(translate($state{$state_type}{tt}[0]))); + $icon->set_tooltip_text(formatAlaTeX(translate($state{$state_type}{tt}[0]))); $icon->set_visible($state_type ne 'okay'); gtkflush(); # so that bubbles are displayed on right icon select(undef, undef, undef, 0.1); #- hackish :-( - if ($state{$state_type}{tt}[0] && $icon->isa('Gtk2::StatusIcon') && !$state{$state_type}{do_not_use_bubble}) { - my $bubble = Gtk2::Notify->new(N("Info"), formatAlaTeX(translate($state{$state_type}{tt}[0])) . "\n", + if ($state{$state_type}{tt}[0] && $icon->isa('Gtk3::StatusIcon') && !$state{$state_type}{do_not_use_bubble}) { + my $bubble = Gtk3::Notify::Notification->new(N("Info"), formatAlaTeX(translate($state{$state_type}{tt}[0])) . "\n", '/usr/share/icons/draksnapshot.png'); $bubble->set_timeout(5000); eval { $bubble->show }; } - my $menu = Gtk2::Menu->new; + my $menu = Gtk3::Menu->new; foreach (@$arr) { - $menu->append(gtksignal_connect(gtkshow(Gtk2::MenuItem->new_with_label($actions{$_}{name})), activate => $actions{$_}{launch})); + $menu->append(gtksignal_connect(gtkshow(Gtk3::MenuItem->new_with_label($actions{$_}{name})), activate => $actions{$_}{launch})); } - $menu->append(gtkshow(Gtk2::SeparatorMenuItem->new)); + $menu->append(gtkshow(Gtk3::SeparatorMenuItem->new)); $menu->append( gtksignal_connect( - gtkshow(Gtk2::MenuItem->new_with_label(N("About..."))), + gtkshow(Gtk3::MenuItem->new_with_label(N("About..."))), activate => sub { - my $ver = 1; # automatically set from spec file + my $ver = '0.20.3-18.mga7'; # automatically set from spec file my $w = gtknew('AboutDialog', name => N("DrakSnapshot %s", $ver), copyright => N("Copyright (C) %s by Mandriva", '2008'), license => join('', cat_('/usr/share/common-licenses/GPL')), @@ -272,9 +272,9 @@ sub setState { return 1; })); - $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; } @@ -300,5 +300,5 @@ sub setAutoStart { } sub mainQuit() { - Gtk2->main_quit; + Gtk3->main_quit; } |