From 2f868df9f35ab4658451bd6eadac5682f796b21f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Buclin?= Date: Sat, 4 Mar 2017 16:15:02 +0100 Subject: Follow more closely the spec about filenames and their location --- mgaapplet | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'mgaapplet') diff --git a/mgaapplet b/mgaapplet index db76ba17..991ac77f 100755 --- a/mgaapplet +++ b/mgaapplet @@ -42,9 +42,6 @@ use Net::DBus qw(:typing); use Rpmdrake::open_db; use Glib::Object::Introspection; -# FIXME: Icon lookup should be done in hicolor theme -use constant IMAGE_FOLDER => '/usr/share/mgaonline/icons/'; - Glib::Object::Introspection->setup( basename => 'StatusNotifier', version => '0.1', @@ -178,7 +175,7 @@ my %actions = ( 'upgrade_distro' => { name => N("Upgrade the system"), launch => \&upgrade }, ); -my $icon = StatusNotifier::Notifier->new_from_icon_name('mgaapplet', 'STATUS_NOTIFIER_CATEGORY_APPLICATION_STATUS', '/usr/share/icons/hicolor/scalable/apps/mgaonline.svg'); +my $icon = StatusNotifier::Notifier->new_from_icon_name('mgaapplet', 'STATUS_NOTIFIER_CATEGORY_APPLICATION_STATUS', 'mgaonline'); $icon->set_title('mgaapplet'); $icon->set_status('STATUS_NOTIFIER_STATUS_ACTIVE'); $icon->register; @@ -241,12 +238,6 @@ Gtk3->main; ugtk3::exit(0); -sub img { - my $file = IMAGE_FOLDER . $_[0] . '.svg'; - warn "File $file not found.\n" unless -f $file; - return $file; -} - sub gnome_shell_exit_overview() { eval { Net::DBus->session->get_service('org.gnome.Shell')->get_object('/org/gnome/Shell', 'org.freedesktop.DBus.Properties')->Set('org.gnome.Shell', 'OverviewActive', dbus_boolean(0)) }; eval { Net::DBus->session->get_service('org.gnome.Shell')->get_object('/org/gnome/Shell', 'org.gnome.Shell')->Eval('Main.messageTray._trayState==2 && Main.messageTray.toggle();') }; @@ -672,8 +663,8 @@ sub setState { my $checkme; state $previous_state; my @arr = @{$state{$state}{menu}}; - my $icon_name = img($state{$state}{colour}[0]); - $icon->set_from_icon_name('STATUS_NOTIFIER_ICON', $icon_name) if $icon_name; + my $icon_name = 'mgaonline-' . $state{$state}{colour}[0]; + $icon->set_from_icon_name('STATUS_NOTIFIER_ICON', $icon_name); $icon->set_tooltip($icon_name, 'mgaapplet', formatAlaTeX(translate($state{$state}{tt}[0]))); my @invisible_states = qw(delayed okay disconnected locked); -- cgit v1.2.1