diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2017-03-04 16:15:02 +0100 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2017-03-04 16:15:02 +0100 |
commit | 2f868df9f35ab4658451bd6eadac5682f796b21f (patch) | |
tree | fc12235ba60124119ae6bbd3bf18985d776118ee /mgaapplet | |
parent | 0faef1449d6718b06b5dc1c2d43de86e91e867a5 (diff) | |
download | mgaonline-2f868df9f35ab4658451bd6eadac5682f796b21f.tar mgaonline-2f868df9f35ab4658451bd6eadac5682f796b21f.tar.gz mgaonline-2f868df9f35ab4658451bd6eadac5682f796b21f.tar.bz2 mgaonline-2f868df9f35ab4658451bd6eadac5682f796b21f.tar.xz mgaonline-2f868df9f35ab4658451bd6eadac5682f796b21f.zip |
Follow more closely the spec about filenames and their location
Diffstat (limited to 'mgaapplet')
-rwxr-xr-x | mgaapplet | 15 |
1 files changed, 3 insertions, 12 deletions
@@ -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); |