Daniel Brötzmann pushed to branch mainwindow at gajim / gajim


Commits:
14fa1c30 by wurstsalat at 2021-11-22T21:14:39+01:00
StatusIcon: Make use of libappindicator configurable

- - - - -


2 changed files:

- gajim/common/setting_values.py
- gajim/gtk/status_icon.py


Changes:

=====================================
gajim/common/setting_values.py
=====================================
@@ -124,6 +124,7 @@ class _ACCOUNT_DEFAULT:
     'groupchat_roster_width': 210,
     'dev_force_bookmark_2': False,
     'developer_modus': False,
+    'use_libappindicator': False,
     'show_help_start_chat': True,
     'gc_notify_on_all_messages_private_default': True,
     'gc_notify_on_all_messages_public_default': False,
@@ -398,6 +399,7 @@ class _ACCOUNT_DEFAULT:
         'gc_notify_on_all_messages_public_default': '',
         'metacontacts_enabled': '',
         'developer_modus': '',
+        'use_libappindicator': _('Enables libappindicator, an alternative tray 
icon provider'),
     },
 }
 


=====================================
gajim/gtk/status_icon.py
=====================================
@@ -60,6 +60,7 @@ def __init__(self):
         self._popup_menus = []
         self._hide_menuitem_added = False
         self._status_icon = None
+        self._use_libappindicator = app.settings.get('use_libappindicator')
 
         self._ui.sounds_mute_menuitem.set_active(
             not app.settings.get('sounds_on'))
@@ -86,7 +87,7 @@ def _on_account_state(self, _event):
 
     def show_icon(self):
         if not self._status_icon:
-            if HAS_INDICATOR:
+            if HAS_INDICATOR and self._use_libappindicator:
                 self._status_icon = appindicator.Indicator.new(
                     'Gajim',
                     'dcraven-online',
@@ -112,7 +113,7 @@ def show_icon(self):
         self.update_icon()
 
     def hide_icon(self):
-        if HAS_INDICATOR:
+        if HAS_INDICATOR and self._use_libappindicator:
             self._status_icon.set_status(appindicator.IndicatorStatus.PASSIVE)
         else:
             self._status_icon.set_visible(False)
@@ -126,14 +127,14 @@ def update_icon(self, *args, count=0):
         if not app.interface.systray_enabled:
             return
         if app.settings.get('trayicon') == 'always':
-            if HAS_INDICATOR:
+            if HAS_INDICATOR and self._use_libappindicator:
                 self._status_icon.set_status(
                     appindicator.IndicatorStatus.ACTIVE)
             else:
                 self._status_icon.set_visible(True)
         if count > 0:
             icon_name = 'dcraven-message-new'
-            if HAS_INDICATOR:
+            if HAS_INDICATOR and self._use_libappindicator:
                 self._status_icon.set_icon_full(icon_name, _('Pending Event'))
             else:
                 self._status_icon.set_visible(True)
@@ -141,7 +142,7 @@ def update_icon(self, *args, count=0):
             return
 
         if app.settings.get('trayicon') == 'on_event':
-            if HAS_INDICATOR:
+            if HAS_INDICATOR and self._use_libappindicator:
                 self._status_icon.set_status(
                     appindicator.IndicatorStatus.PASSIVE)
             else:
@@ -149,7 +150,7 @@ def update_icon(self, *args, count=0):
 
         show = get_global_show()
         icon_name = get_icon_name(show)
-        if HAS_INDICATOR:
+        if HAS_INDICATOR and self._use_libappindicator:
             self._status_icon.set_icon_full(icon_name, show)
             self._status_icon.set_status(appindicator.IndicatorStatus.ACTIVE)
         else:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/14fa1c30663200665f5b3487add1b311c7e9bde5

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/14fa1c30663200665f5b3487add1b311c7e9bde5
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to