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


Commits:
cf182e23 by Daniel Brötzmann at 2020-01-09T09:47:52+01:00
GroupChatInfo: Sort features consistently

- - - - -


1 changed file:

- gajim/gtk/groupchat_info.py


Changes:

=====================================
gajim/gtk/groupchat_info.py
=====================================
@@ -33,30 +33,6 @@ from gajim.gtk.util import make_href_markup
 
 
 MUC_FEATURES = {
-    'mam': (
-        'feather-server-symbolic',
-        Q_('?Group chat feature:Archiving'),
-        _('Messages are archived on the server')),
-    'muc_persistent': (
-        'feather-hard-drive-symbolic',
-        Q_('?Group chat feature:Persistent'),
-        _('This group chat persists '
-          'even if there are no participants')),
-    'muc_temporary': (
-        'feather-clock-symbolic',
-        Q_('?Group chat feature:Temporary'),
-        _('This group chat will be destroyed '
-          'once the last participant left')),
-    'muc_moderated': (
-        'feather-mic-off-symbolic',
-        Q_('?Group chat feature:Moderated'),
-        _('Participants entering this group chat need '
-          'to request permission to send messages')),
-    'muc_unmoderated': (
-        'feather-mic-symbolic',
-        Q_('?Group chat feature:Not Moderated'),
-        _('Participants entering this group chat are '
-          'allowed to send messages')),
     'muc_open': (
         'feather-globe-symbolic',
         Q_('?Group chat feature:Open'),
@@ -66,14 +42,6 @@ MUC_FEATURES = {
         Q_('?Group chat feature:Members Only'),
         _('This group chat is restricted '
           'to members only')),
-    'muc_public': (
-        'feather-eye-symbolic',
-        Q_('?Group chat feature:Public'),
-        _('Group chat can be found via search')),
-    'muc_hidden': (
-        'feather-eye-off-symbolic',
-        Q_('?Group chat feature:Hidden'),
-        _('This group chat can not be found via search')),
     'muc_nonanonymous': (
         'feather-shield-off-symbolic',
         Q_('?Group chat feature:Not Anonymous'),
@@ -83,6 +51,24 @@ MUC_FEATURES = {
         'feather-shield-symbolic',
         Q_('?Group chat feature:Semi-Anonymous'),
         _('Only moderators can see your XMPP address')),
+    'muc_moderated': (
+        'feather-mic-off-symbolic',
+        Q_('?Group chat feature:Moderated'),
+        _('Participants entering this group chat need '
+          'to request permission to send messages')),
+    'muc_unmoderated': (
+        'feather-mic-symbolic',
+        Q_('?Group chat feature:Not Moderated'),
+        _('Participants entering this group chat are '
+          'allowed to send messages')),
+    'muc_public': (
+        'feather-eye-symbolic',
+        Q_('?Group chat feature:Public'),
+        _('Group chat can be found via search')),
+    'muc_hidden': (
+        'feather-eye-off-symbolic',
+        Q_('?Group chat feature:Hidden'),
+        _('This group chat can not be found via search')),
     'muc_passwordprotected': (
         'feather-lock-symbolic',
         Q_('?Group chat feature:Password Required'),
@@ -93,6 +79,20 @@ MUC_FEATURES = {
         Q_('?Group chat feature:No Password Required'),
         _('This group chat does not require '
           'a password upon entry')),
+    'muc_persistent': (
+        'feather-hard-drive-symbolic',
+        Q_('?Group chat feature:Persistent'),
+        _('This group chat persists '
+          'even if there are no participants')),
+    'muc_temporary': (
+        'feather-clock-symbolic',
+        Q_('?Group chat feature:Temporary'),
+        _('This group chat will be destroyed '
+          'once the last participant left')),
+    'mam': (
+        'feather-server-symbolic',
+        Q_('?Group chat feature:Archiving'),
+        _('Messages are archived on the server')),
 }
 
 
@@ -211,13 +211,16 @@ class GroupChatInfoScrolled(Gtk.ScrolledWindow):
             features.append('mam')
 
         row = 10
-        for feature in features:
-            icon, name, tooltip = MUC_FEATURES.get(feature, (None, None, None))
-            if icon is None:
-                continue
-            grid.attach(self._get_feature_icon(icon, tooltip), 0, row, 1, 1)
-            grid.attach(self._get_feature_label(name), 1, row, 1, 1)
-            row += 1
+
+        for feature in MUC_FEATURES:
+            if feature in features:
+                icon, name, tooltip = MUC_FEATURES.get(feature,
+                                                       (None, None, None))
+                if icon is None:
+                    continue
+                grid.attach(self._get_feature_icon(icon, tooltip), 0, row, 1, 
1)
+                grid.attach(self._get_feature_label(name), 1, row, 1, 1)
+                row += 1
         grid.show_all()
 
     @staticmethod



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

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