Daniel Brötzmann pushed to branch master at gajim / gajim
Commits: 46f6ef16 by wurstsalat at 2022-10-10T22:59:25+02:00 change: Preferences: Reorder "Chat" settings and add a "General" section
- - - - - 49b5591e by wurstsalat at 2022-10-10T22:59:25+02:00 change: Preferences: Add escape_key_closes to "Chat" section
- - - - -
3 changed files:
- gajim/common/setting_values.py - gajim/data/gui/preferences.ui - gajim/gtk/preferences.py
Changes:
===================================== gajim/common/setting_values.py ===================================== @@ -651,7 +651,7 @@ class WorkspaceSettings(TypedDict): 'account in the Accounts window. BE CAREFUL, when you are logged ' 'in with a negative priority, you will NOT receive any message ' 'from your server.'), - 'escape_key_closes': _('If enabled, pressing Esc closes a tab/window.'), + 'escape_key_closes': _('Close a chat by pressing the Escape key'), 'file_transfers_port': '', 'ft_add_hosts_to_send': _( 'List of send hosts (comma separated) in '
===================================== gajim/data/gui/preferences.ui ===================================== @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.38.2 --> +<!-- Generated with glade 3.40.0 --> <interface> <requires lib="gtk+" version="3.20"/> <!-- n-columns=3 n-rows=3 --> @@ -114,6 +114,59 @@ <property name="can-focus">False</property> <property name="orientation">vertical</property> <property name="spacing">24</property> + <child> + <!-- n-columns=3 n-rows=3 --> + <object class="GtkGrid" id="general"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="orientation">vertical</property> + <property name="row-spacing">12</property> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes">General</property> + <property name="xalign">0</property> + <style> + <class name="bold"/> + </style> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> <child> <!-- n-columns=3 n-rows=3 --> <object class="GtkGrid" id="chats"> @@ -164,7 +217,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">0</property> + <property name="position">1</property> </packing> </child> <child> @@ -217,7 +270,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">1</property> + <property name="position">2</property> </packing> </child> <child> @@ -270,7 +323,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> <child>
===================================== gajim/gtk/preferences.py ===================================== @@ -86,6 +86,7 @@ def __init__(self) -> None: prefs: list[tuple[str, Type[PreferenceBox]]] = [ ('window_behaviour', WindowBehaviour), ('plugins', Plugins), + ('general', General), ('chats', Chats), ('group_chats', GroupChats), ('file_preview', FilePreview), @@ -259,7 +260,7 @@ def __init__(self, *args: Any) -> None: PreferenceBox.__init__(self, settings)
-class Chats(PreferenceBox): +class General(PreferenceBox): def __init__(self, *args: Any) -> None:
speller_desc = None @@ -268,41 +269,29 @@ def __init__(self, *args: Any) -> None:
settings = [ Setting(SettingKind.SWITCH, - _('Spell Checking'), - SettingType.CONFIG, - 'use_speller', - desc=speller_desc, - enabled_func=self._speller_available), - - Setting(SettingKind.SWITCH, - _('Message Receipts (✔)'), + _('Close with Escape'), SettingType.CONFIG, - 'positive_184_ack', - desc=_('Add a checkmark to received messages')), - - # Setting(SettingKind.SWITCH, - # _('XHTML Formatting'), - # SettingType.CONFIG, - # 'show_xhtml', - # desc=_('Render XHTML styles (colors, etc.) of incoming ' - # 'messages')), + 'escape_key_closes', + desc=_('Close a chat by pressing the Escape key')),
Setting(SettingKind.SWITCH, _('Show Send Message Button'), SettingType.CONFIG, 'show_send_message_button', callback=self._on_show_send_message_button), + + Setting(SettingKind.SWITCH, + _('Spell Checking'), + SettingType.CONFIG, + 'use_speller', + desc=speller_desc, + enabled_func=self._speller_available), + Setting(SettingKind.SWITCH, _('Emoji Shortcodes'), SettingType.CONFIG, 'enable_emoji_shortcodes', desc=_('Show suggestions for shortcodes, e.g. :+1:')), - Setting(SettingKind.SWITCH, - _('Show Status Changes'), - SettingType.CONFIG, - 'print_status_in_chats', - desc=_('For example: "Julia is now online"')), - ]
PreferenceBox.__init__(self, settings) @@ -318,6 +307,27 @@ def _on_show_send_message_button(show_button: bool, *args: Any) -> None: app.settings.set('send_on_ctrl_enter', show_button)
+class Chats(PreferenceBox): + def __init__(self, *args: Any) -> None: + + settings = [ + Setting(SettingKind.SWITCH, + _('Message Receipts (✔)'), + SettingType.CONFIG, + 'positive_184_ack', + desc=_('Add a checkmark to received messages')), + + Setting(SettingKind.SWITCH, + _('Show Status Changes'), + SettingType.CONFIG, + 'print_status_in_chats', + desc=_('For example: "Julia is now online"')), + + ] + + PreferenceBox.__init__(self, settings) + + class GroupChats(PreferenceBox): def __init__(self, *args: Any) -> None:
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/59e6de350b04cf07516483dcaba76e6c...