summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2013-11-18 15:41:22 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2013-12-03 12:41:59 +0100
commit9566b9f9abbb375d73bb583191502b0859507665 (patch)
tree121ad3b6f1ab658000ec3c92adeec0127b4056d7
parent6c1fa5cd83b0d46528ee8cecda42f9b1adca0b32 (diff)
downloadmgaonline-9566b9f9abbb375d73bb583191502b0859507665.tar
mgaonline-9566b9f9abbb375d73bb583191502b0859507665.tar.gz
mgaonline-9566b9f9abbb375d73bb583191502b0859507665.tar.bz2
mgaonline-9566b9f9abbb375d73bb583191502b0859507665.tar.xz
mgaonline-9566b9f9abbb375d73bb583191502b0859507665.zip
use Gtk3 namespace instead of Gtk2
-rwxr-xr-xmgaapplet28
-rw-r--r--mgaapplet_gui.pm6
-rw-r--r--mgaonline.pm2
3 files changed, 18 insertions, 18 deletions
diff --git a/mgaapplet b/mgaapplet
index 4597687f..11c593d9 100755
--- a/mgaapplet
+++ b/mgaapplet
@@ -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;
}
diff --git a/mgaapplet_gui.pm b/mgaapplet_gui.pm
index 605cf3c8..a0273618 100644
--- a/mgaapplet_gui.pm
+++ b/mgaapplet_gui.pm
@@ -62,7 +62,7 @@ our $localfile = "$localdir/mgaonline";
mkdir_p($localdir) if !-d $localdir;
-e "$ENV{HOME}/.mgaonline" and system("mv", "$ENV{HOME}/.mgaonline", $localfile);
-interactive::gtk::add_padding(Gtk2::Label->new);
+interactive::gtk::add_padding(Gtk3::Label->new);
our %local_config;
read_local_config();
@@ -113,7 +113,7 @@ sub fill_n_run_portable_dialog {
sub new_link_button {
my ($url, $text) = @_;
- my $link = Gtk2::LinkButton->new($url, $text);
+ my $link = Gtk3::LinkButton->new($url, $text);
$link->set_uri_hook(sub {
my (undef, $url) = @_;
run_program::raw({ detach => 1, setuid => get_parent_uid() }, 'www-browser', $url);
@@ -160,7 +160,7 @@ sub run_ask_credentials_dialog {
$password_text = $password_w->get_text;
$email_text = $email_w->get_text;
$ok_clicked = 1;
- Gtk2->main_quit;
+ Gtk3->main_quit;
};
my @widgets = (
diff --git a/mgaonline.pm b/mgaonline.pm
index 5433952f..a397099a 100644
--- a/mgaonline.pm
+++ b/mgaonline.pm
@@ -172,7 +172,7 @@ sub get_banner_icon() {
sub get_banner {
my ($o_title) = @_;
- Gtk2::Banner->new(get_banner_icon(), $o_title || N("Distribution Upgrade"));
+ Gtk3::Banner->new(get_banner_icon(), $o_title || N("Distribution Upgrade"));
}
sub get_urpmi_options() {