diff options
Diffstat (limited to 'ayatanawebmail/application.py')
-rwxr-xr-x | ayatanawebmail/application.py | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/ayatanawebmail/application.py b/ayatanawebmail/application.py index e6abf46..a67532a 100755 --- a/ayatanawebmail/application.py +++ b/ayatanawebmail/application.py @@ -156,15 +156,8 @@ class MessagingMenu(object): else: - try: - - gi.require_version('AyatanaAppIndicator3', '0.1') - self.oAppIndicator = importlib.import_module('gi.repository.AyatanaAppIndicator3') - - except Exception as oException: - - gi.require_version('AppIndicator3', '0.1') - self.oAppIndicator = importlib.import_module('gi.repository.AppIndicator3') + gi.require_version('AyatanaAppIndicator3', '0.1') + self.oAppIndicator = importlib.import_module('gi.repository.AyatanaAppIndicator3') self.oIndicator = self.oAppIndicator.Indicator.new(APPNAME, 'ayatanawebmail-messages', self.oAppIndicator.IndicatorCategory.APPLICATION_STATUS) self.oIndicator.set_attention_icon('ayatanawebmail-messages-new') @@ -1116,6 +1109,12 @@ class AyatanaWebmail(object): oNotification.set_property('body', _('Unable to connect to account "{accountName}", the application will now exit.').format(accountName=oConnection.strLogin)) oNotification.set_hint('desktop-entry', GLib.Variant.new_string(APPNAME)) oNotification.set_timeout(Notify.EXPIRES_NEVER) + bHasSetAppIcon = hasattr (oNotification, "set_app_icon") + + if bHasSetAppIcon: + + oNotification.set_app_icon (APPNAME) + oNotification.show() self.close(1) @@ -1175,6 +1174,12 @@ class AyatanaWebmail(object): oNotification = Notify.Notification.new(basemessage.format(number_of_mails), message, APPNAME) oNotification.set_hint('desktop-entry', GLib.Variant.new_string(APPNAME)) + bHasSetAppIcon = hasattr (oNotification, "set_app_icon") + + if bHasSetAppIcon: + + oNotification.set_app_icon (APPNAME) + oNotification.show() elif number_of_mails: @@ -1188,4 +1193,10 @@ class AyatanaWebmail(object): oNotification = Notify.Notification.new(message, lstNotification[1], APPNAME) oNotification.set_hint('desktop-entry', GLib.Variant.new_string(APPNAME)) + bHasSetAppIcon = hasattr (oNotification, "set_app_icon") + + if bHasSetAppIcon: + + oNotification.set_app_icon (APPNAME) + oNotification.show() |