Philipp Hörist pushed to branch gajim_1.2 at gajim / gajim
Commits: dc9a2085 by André Apitzsch at 2020-06-20T13:47:24+02:00 Remove nonworking network state simulation
Fixes #10134.
- - - - - 1261fdb3 by lovetox at 2020-06-20T13:47:24+02:00 StartChat: Improve global muc search
- Don't clear the search entry when pressing the global search button - Start a search automatically after pressing the button
- - - - - 31076874 by Daniel Brötzmann at 2020-06-20T13:47:24+02:00 StartChat: Add infobar
- - - - - d3de5585 by Daniel Brötzmann at 2020-06-20T13:47:24+02:00 Preferences: Add reset button for hints
- - - - - 0ba59983 by Daniel Brötzmann at 2020-06-20T13:47:24+02:00 InfoBar: Add CSS styling for different types
- - - - - 607ef6e5 by lovetox at 2020-06-20T13:47:24+02:00 Disable client cert support until nbxmpp support is back
- - - - - 0a501031 by lovetox at 2020-06-20T13:47:24+02:00 Disable zeroconf support until its working again
- - - - -
10 changed files:
- gajim/application.py - gajim/common/config.py - gajim/data/gui/preferences_window.ui - gajim/data/gui/start_chat_dialog.ui - gajim/data/style/gajim-dark.css - gajim/data/style/gajim.css - gajim/gtk/accounts.py - gajim/gtk/preferences.py - gajim/gtk/start_chat.py - gajim/gui_interface.py
Changes:
===================================== gajim/application.py ===================================== @@ -152,21 +152,6 @@ class GajimApplication(Gtk.Application): GLib.OptionArg.NONE, _('Start a new chat'))
- self.add_main_option( - 'simulate-network-lost', - 0, - GLib.OptionFlags.NONE, - GLib.OptionArg.NONE, - _('Simulate loss of connectivity')) - - self.add_main_option( - 'simulate-network-connected', - 0, - GLib.OptionFlags.NONE, - GLib.OptionArg.NONE, - _('Simulate regaining connectivity')) - - self.add_main_option_entries(self._get_remaining_entry())
self.connect('handle-local-options', self._handle_local_options) @@ -327,14 +312,6 @@ class GajimApplication(Gtk.Application): self.activate_action(cmd) return 0
- if options.contains('simulate-network-lost'): - app.interface.network_status_changed(None, False) - return 0 - - if options.contains('simulate-network-connected'): - app.interface.network_status_changed(None, True) - return 0 - if remaining is not None: self._open_uris(remaining.unpack()) return 0
===================================== gajim/common/config.py ===================================== @@ -249,6 +249,7 @@ class Config: 'command_system_execute': [opt_bool, False, _('If enabled, Gajim will execute commands (/show, /sh, /execute, /exec).')], 'groupchat_roster_width': [opt_int, 210, _('Width of group chat roster in pixel')], 'dev_force_bookmark_2': [opt_bool, False, _('Force Bookmark 2 usage')], + 'show_help_start_chat': [opt_bool, True, _('Shows an info bar with helpful hints in the Start / Join Chat dialog')], }, {}) # type: Tuple[Dict[str, List[Any]], Dict[Any, Any]]
__options_per_key = {
===================================== gajim/data/gui/preferences_window.ui ===================================== @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.22.2 --> +<!-- Generated with glade 3.36.0 --> <interface> <requires lib="gtk+" version="3.22"/> <object class="GtkAdjustment" id="adjustment_status_auto_away"> @@ -2529,7 +2529,6 @@ to discover one from the server. (Example: stun.iptel.org)</property> <property name="use_underline">True</property> <property name="justify">right</property> <property name="mnemonic_widget">proxies_combobox</property> - <property name="angle">0.01</property> <style> <class name="dim-label"/> </style> @@ -2652,6 +2651,23 @@ to discover one from the server. (Example: stun.iptel.org)</property> <property name="position">2</property> </packing> </child> + <child> + <object class="GtkButton" id="reset_help"> + <property name="label" translatable="yes">_Reset Hints</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">In order to introduce you to features, Gajim displays some hints. This button will reset all these hints.</property> + <property name="halign">start</property> + <property name="use_underline">True</property> + <signal name="clicked" handler="_on_reset_help_clicked" swapped="no"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> </object> </child> <child type="label">
===================================== gajim/data/gui/start_chat_dialog.ui ===================================== @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.22.1 --> +<!-- Generated with glade 3.36.0 --> <interface> - <requires lib="gtk+" version="3.20"/> + <requires lib="gtk+" version="3.22"/> <object class="GtkListStore" id="account_store"> <columns> <!-- column-name icon --> @@ -17,55 +17,68 @@ <property name="can_focus">False</property> <signal name="notify::visible-child-name" handler="_on_page_changed" swapped="no"/> <child> - <object class="GtkBox" id="box"> + <object class="GtkBox"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="border_width">18</property> <property name="orientation">vertical</property> - <property name="spacing">6</property> <child> - <object class="GtkBox"> + <object class="GtkInfoBar" id="infobar"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="spacing">6</property> - <child> - <object class="GtkSearchEntry" id="search_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="has_focus">True</property> - <property name="is_focus">True</property> - <property name="hexpand">True</property> - <property name="primary_icon_name">edit-find-symbolic</property> - <property name="primary_icon_activatable">False</property> - <property name="primary_icon_sensitive">False</property> + <property name="homogeneous">True</property> + <property name="show_close_button">True</property> + <signal name="response" handler="_on_infobar_response" swapped="no"/> + <child internal-child="action_area"> + <object class="GtkButtonBox"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <placeholder/> + </child> </object> <packing> <property name="expand">False</property> - <property name="fill">True</property> + <property name="fill">False</property> <property name="position">0</property> </packing> </child> - <child> - <object class="GtkToggleButton" id="global_search_toggle"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="tooltip_text" translatable="yes">Global Group Chat Search</property> - <property name="halign">end</property> - <property name="relief">half</property> - <signal name="toggled" handler="_on_global_search_toggle" swapped="no"/> + <child internal-child="content_area"> + <object class="GtkBox"> + <property name="can_focus">False</property> + <property name="spacing">6</property> <child> <object class="GtkImage"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="icon_name">feather-globe-symbolic</property> + <property name="icon_name">dialog-information-symbolic</property> + <property name="icon_size">3</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Start a new chat, join a group chat or search for new group chats globally. You can also enter an XMPP address.</property> + <property name="wrap">True</property> + <property name="max_width_chars">46</property> + <property name="xalign">0</property> </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> </child> </object> <packing> <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> + <property name="fill">False</property> + <property name="position">0</property> </packing> </child> </object> @@ -76,25 +89,91 @@ </packing> </child> <child> - <object class="GtkScrolledWindow" id="scrolledwindow"> + <object class="GtkBox" id="box"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hscrollbar_policy">never</property> - <property name="shadow_type">in</property> + <property name="can_focus">False</property> + <property name="border_width">18</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> <child> - <object class="GtkViewport"> + <object class="GtkBox"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="spacing">6</property> + <child> + <object class="GtkSearchEntry" id="search_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="has_focus">True</property> + <property name="is_focus">True</property> + <property name="hexpand">True</property> + <property name="primary_icon_name">edit-find-symbolic</property> + <property name="primary_icon_activatable">False</property> + <property name="primary_icon_sensitive">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkToggleButton" id="global_search_toggle"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Global Group Chat Search</property> + <property name="halign">end</property> + <property name="relief">half</property> + <signal name="toggled" handler="_on_global_search_toggle" swapped="no"/> + <child> + <object class="GtkImage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="icon_name">feather-globe-symbolic</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkScrolledWindow" id="scrolledwindow"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">never</property> + <property name="shadow_type">in</property> <child> - <object class="GtkListBox" id="listbox"> - <property name="name">StartChatListBox</property> + <object class="GtkViewport"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="selection_mode">browse</property> - <property name="activate_on_single_click">False</property> + <child> + <object class="GtkListBox" id="listbox"> + <property name="name">StartChatListBox</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="selection_mode">browse</property> + <property name="activate_on_single_click">False</property> + </object> + </child> </object> </child> </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> </child> </object> <packing>
===================================== gajim/data/style/gajim-dark.css ===================================== @@ -1 +1,19 @@ /* Gajim Dark Application CSS File */ + +/* InfoBar */ +infobar.info > revealer > box { + color: #D9EDF7; + background-color: #3A87AD; +} +infobar.question > revealer > box { + color: #D9EDF7; + background-color: #295A72; +} +infobar.warning > revealer > box { + color: #FCF8E3; + background-color: #D2822B; +} +infobar.error > revealer > box { + color: #FCE5D5; + background-color: #D64937; +}
===================================== gajim/data/style/gajim.css ===================================== @@ -101,6 +101,24 @@ list.settings > row > box { margin: 6px 18px; }
+/* InfoBar */ +infobar.info > revealer > box { + color: #3A87AD; + background-color: #D9EDF7; +} +infobar.question > revealer > box { + color: #295A72; + background-color: #AFDAF0; +} +infobar.warning > revealer > box { + color: #D06821; + background-color: #FFEBC0; +} +infobar.error > revealer > box { + color: #B94A48; + background-color: #F2DEDE; +} + /*SendFileDialog*/ #SendFileDialog grid list > row { padding: 10px 20px 10px 10px; }
===================================== gajim/gtk/accounts.py ===================================== @@ -61,6 +61,9 @@ class AccountsWindow(Gtk.ApplicationWindow): self.add(box)
for account in app.get_accounts_sorted(): + if account == 'Local': + # Disable zeroconf support until its working again + continue self.add_account(account, initial=True)
self._menu.connect('menu-activated', self._on_menu_activated) @@ -615,8 +618,10 @@ class GeneralPage(GenericSettingPage): SettingType.ACTION, '-import-contacts', props={'account': account}),
- Setting(SettingKind.DIALOG, _('Client Certificate'), - SettingType.DIALOG, props={'dialog': CertificateDialog}), + # Currently not supported by nbxmpp + # + # Setting(SettingKind.DIALOG, _('Client Certificate'), + # SettingType.DIALOG, props={'dialog': CertificateDialog}),
Setting(SettingKind.SWITCH, _('Connect on startup'), SettingType.ACCOUNT_CONFIG, 'autoconnect'),
===================================== gajim/gtk/preferences.py ===================================== @@ -1059,5 +1059,13 @@ class Preferences(Gtk.ApplicationWindow): def _on_debug_folder_clicked(self, _widget): open_file(configpaths.get('DEBUG'))
+ def _on_reset_help_clicked(self, widget): + widget.set_sensitive(False) + helping_hints = [ + 'start_chat', + ] + for hint in helping_hints: + app.config.set('show_help_%s' % hint, True) + def on_open_advanced_editor_button_clicked(self, _widget): open_window('AdvancedConfig')
===================================== gajim/gtk/start_chat.py ===================================== @@ -52,7 +52,7 @@ class StartChatDialog(Gtk.ApplicationWindow): self.set_application(app.app) self.set_position(Gtk.WindowPosition.CENTER) self.set_show_menubar(False) - self.set_title(_('Start New Conversation')) + self.set_title(_('Start / Join Chat')) self.set_default_size(-1, 400) self.ready_to_destroy = False self._parameter_form = None @@ -96,6 +96,8 @@ class StartChatDialog(Gtk.ApplicationWindow): self._muc_info_box = GroupChatInfoScrolled() self._ui.info_box.add(self._muc_info_box)
+ self._ui.infobar.set_revealed(app.config.get('show_help_start_chat')) + self.connect('key-press-event', self._on_key_press) self.connect('destroy', self._destroy)
@@ -259,6 +261,11 @@ class StartChatDialog(Gtk.ApplicationWindow): self._ui.search_entry.grab_focus_without_selecting() return Gdk.EVENT_PROPAGATE
+ def _on_infobar_response(self, _widget, response): + if response == Gtk.ResponseType.CLOSE: + self._ui.infobar.set_revealed(False) + app.config.set('show_help_start_chat', False) + def _start_new_chat(self, row): if row.new: try: @@ -370,15 +377,17 @@ class StartChatDialog(Gtk.ApplicationWindow): return box == Search.GLOBAL
def _on_global_search_toggle(self, button): - self._ui.search_entry.set_text('') self._ui.search_entry.grab_focus() image_style_context = button.get_children()[0].get_style_context() if button.get_active(): image_style_context.add_class('selected-color') self._set_listbox(self._global_search_listbox) + if self._ui.search_entry.get_text(): + self._start_search() self._remove_new_jid_row() self._ui.listbox.invalidate_filter() else: + self._ui.search_entry.set_text('') image_style_context.remove_class('selected-color') self._set_listbox(self._ui.listbox) self._global_search_listbox.remove_all()
===================================== gajim/gui_interface.py ===================================== @@ -1969,10 +1969,10 @@ class Interface: self.register_core_handlers()
self.create_zeroconf_default_config() - if app.config.get_per('accounts', app.ZEROCONF_ACC_NAME, 'active') \ - and app.is_installed('ZEROCONF'): - app.connections[app.ZEROCONF_ACC_NAME] = \ - connection_zeroconf.ConnectionZeroconf(app.ZEROCONF_ACC_NAME) + # if app.config.get_per('accounts', app.ZEROCONF_ACC_NAME, 'active') \ + # and app.is_installed('ZEROCONF'): + # app.connections[app.ZEROCONF_ACC_NAME] = \ + # connection_zeroconf.ConnectionZeroconf(app.ZEROCONF_ACC_NAME)
for account in app.config.get_per('accounts'): if not app.config.get_per('accounts', account, 'is_zeroconf') and\
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/6b482a1177e7dcae397af2a29af3eebc...