Philipp Hörist pushed to branch master at gajim / gajim

Commits:
9785f314 by Philipp Hörist at 2017-09-22T16:44:07+02:00
Set lock_image from icon name instead of filepath

Fixes #8673

- - - - -


2 changed files:

- gajim/chat_control.py
- gajim/groupchat_control.py


Changes:

=====================================
gajim/chat_control.py
=====================================
--- a/gajim/chat_control.py
+++ b/gajim/chat_control.py
@@ -856,18 +856,18 @@ class ChatControl(ChatControlBase):
 
         self._show_lock_image(**encryption_state)
 
-    def _show_lock_image(self, visible, enc_type='',
-                         authenticated=False):
+    def _show_lock_image(self, visible, enc_type='', authenticated=False):
         """
         Set lock icon visibility and create tooltip
         """
         if authenticated:
             authenticated_string = _('and authenticated')
-            img_path = gtkgui_helpers.get_icon_path('security-high')
+            self.lock_image.set_from_icon_name(
+                'security-high', Gtk.IconSize.MENU)
         else:
             authenticated_string = _('and NOT authenticated')
-            img_path = gtkgui_helpers.get_icon_path('security-low')
-        self.lock_image.set_from_file(img_path)
+            self.lock_image.set_from_icon_name(
+                'security-low', Gtk.IconSize.MENU)
 
         tooltip = _('%(type)s encryption is active %(authenticated)s.') % 
{'type': enc_type, 'authenticated': authenticated_string}
 


=====================================
gajim/groupchat_control.py
=====================================
--- a/gajim/groupchat_control.py
+++ b/gajim/groupchat_control.py
@@ -785,18 +785,18 @@ class GroupchatControl(ChatControlBase):
 
         self._show_lock_image(**encryption_state)
 
-    def _show_lock_image(self, visible, enc_type='',
-                         authenticated=False):
+    def _show_lock_image(self, visible, enc_type='', authenticated=False):
         """
         Set lock icon visibility and create tooltip
         """
         if authenticated:
             authenticated_string = _('and authenticated')
-            img_path = gtkgui_helpers.get_icon_path('security-high')
+            self.lock_image.set_from_icon_name(
+                'security-high', Gtk.IconSize.MENU)
         else:
             authenticated_string = _('and NOT authenticated')
-            img_path = gtkgui_helpers.get_icon_path('security-low')
-        self.lock_image.set_from_file(img_path)
+            self.lock_image.set_from_icon_name(
+                'security-low', Gtk.IconSize.MENU)
 
         tooltip = _('%(type)s encryption is active %(authenticated)s.') % {
             'type': enc_type, 'authenticated': authenticated_string}



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/9785f314155853d85f1f4a70f3b7482bea308ae3

---
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/9785f314155853d85f1f4a70f3b7482bea308ae3
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