summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2019-01-28 18:56:41 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2019-01-28 18:56:41 +0000
commitee80b1c49ba8b5554af9f58f97bd1ab0f5014171 (patch)
tree1a04b45afb7e303d064ffe4183cb1bed2b811807
parent79c66fb1d889eea37a38f1ac3c4e86484b74c65a (diff)
Change $is_plasma to $is_sni - other DEs support SNI now.
-rwxr-xr-xmgaapplet18
1 files changed, 9 insertions, 9 deletions
diff --git a/mgaapplet b/mgaapplet
index 6b4c7330..eb5aeb52 100755
--- a/mgaapplet
+++ b/mgaapplet
@@ -171,11 +171,11 @@ my %actions = (
'upgrade_distro' => { name => N("Upgrade the system"), launch => \&upgrade },
);
-my ($icon, $is_plasma);
+my ($icon, $is_sni);
# Plasma supports SNI natively. Other DE do not. In that case, we fall back to
# the deprecated GtkStatusIcon.
if ($ENV{DESKTOP_SESSION} =~ /plasma$/i) {
- $is_plasma = 1;
+ $is_sni = 1;
Glib::Object::Introspection->setup(
basename => 'StatusNotifier',
@@ -235,7 +235,7 @@ go2State('delayed');
# is called too early, it seems to be blocked. So we add a timer here to call
# it again to make sure that right-click events will be correctly handled by
# DBusMenu.
-Glib::Timeout->add(100, sub { $icon->set_context_menu($menu); 0 }) if $is_plasma;
+Glib::Timeout->add(100, sub { $icon->set_context_menu($menu); 0 }) if $is_sni;
Glib::Timeout->add_seconds(1, sub {
POSIX::sigprocmask(SIG_UNBLOCK, POSIX::SigSet->new(SIGCHLD));
@@ -517,7 +517,7 @@ sub no_more_supported() {
if ($choice eq 'upgrade') {
really_confirm_upgrade() and real_upgrade();
} elsif ($choice eq 'nothing') {
- $is_plasma ? $icon->set_status('STATUS_NOTIFIER_STATUS_PASSIVE') : $icon->set_visible(0);
+ $is_sni ? $icon->set_status('STATUS_NOTIFIER_STATUS_PASSIVE') : $icon->set_visible(0);
}
undef $no_more_supported_wip;
}
@@ -682,7 +682,7 @@ sub go2State {
state $previous_state;
my @arr = @{$state{$state}{menu}};
my $icon_name = 'mgaonline-' . $state{$state}{colour}[0];
- if ($is_plasma) {
+ if ($is_sni) {
$icon->set_from_icon_name('STATUS_NOTIFIER_ICON', $icon_name);
$icon->set_tooltip($icon_name, 'mgaapplet', formatAlaTeX(translate($state{$state}{tt}[0])));
}
@@ -695,10 +695,10 @@ sub go2State {
my @invisible_states = qw(delayed okay disconnected locked);
# do not show icon while checking if previously hidden:
if (!$::testing && (member($state, @invisible_states) or $state eq 'busy' && member($previous_state, @invisible_states))) {
- $is_plasma ? $icon->set_status('STATUS_NOTIFIER_STATUS_PASSIVE') : $icon->set_visible(0);
+ $is_sni ? $icon->set_status('STATUS_NOTIFIER_STATUS_PASSIVE') : $icon->set_visible(0);
}
else {
- $is_plasma ? $icon->set_status('STATUS_NOTIFIER_STATUS_ACTIVE') : $icon->set_visible(1);
+ $is_sni ? $icon->set_status('STATUS_NOTIFIER_STATUS_ACTIVE') : $icon->set_visible(1);
}
$previous_state = $state;
@@ -736,7 +736,7 @@ sub go2State {
}
# Unset the context menu before destroying it.
- $icon->set_context_menu() if $is_plasma;
+ $icon->set_context_menu() if $is_sni;
$menu->destroy if $menu;
$menu = Gtk3::Menu->new;
foreach (@arr) {
@@ -753,7 +753,7 @@ sub go2State {
$checkme->show;
$menu->append(gtksignal_connect(gtkshow(Gtk3::MenuItem->new_with_label(N("Quit"))), activate => sub { mainQuit() }));
- $icon->set_context_menu($menu) if $is_plasma;
+ $icon->set_context_menu($menu) if $is_sni;
$state_global = $state;
gtkflush();
}