changeset 0d03a343abcc in /home/hg/repos/gajim
branches: gtk3 details:http://hg.gajim.org/gajim?cmd=changeset;node=0d03a343abcc description: - regroup display PEP info in roster options - add option to show positive XEP-0184 ack in message window. Fixes 7341
diffstat:
data/gui/preferences_window.ui | 125 +++++++++++++--------------------------- src/common/config.py | 1 + src/config.py | 47 +++++--------- src/conversation_textview.py | 31 ++++++--- 4 files changed, 80 insertions(+), 124 deletions(-)
diffs (truncated from 327 to 300 lines):
diff -r 8c5d6c908de8 -r 0d03a343abcc data/gui/preferences_window.ui --- a/data/gui/preferences_window.ui Thu May 02 21:50:16 2013 +0200 +++ b/data/gui/preferences_window.ui Sun May 12 21:32:29 2013 +0200 @@ -148,6 +148,24 @@ </row> </data> </object> + <object class="GtkListStore" id="status_message_liststore"> + <columns> + <!-- column-name name --> + <column type="gchararray"/> + <!-- column-name text --> + <column type="gchararray"/> + <!-- column-name activity --> + <column type="gchararray"/> + <!-- column-name sub_activity --> + <column type="gchararray"/> + <!-- column-name activity_text --> + <column type="gchararray"/> + <!-- column-name mood --> + <column type="gchararray"/> + <!-- column-name mood_text --> + <column type="gchararray"/> + </columns> + </object> <object class="GtkWindow" id="preferences_window"> <property name="can_focus">False</property> <property name="border_width">6</property> @@ -234,8 +252,8 @@ </packing> </child> <child> - <object class="GtkCheckButton" id="show_mood_in_roster_checkbutton"> - <property name="label" translatable="yes">Display m_ood of contacts in roster</property> + <object class="GtkCheckButton" id="show_pep_in_roster_checkbutton"> + <property name="label" translatable="yes">Display e_xtra information of contacts in roster (mood, activity, ...)m_ood of contacts in roster</property> <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -245,7 +263,7 @@ <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_show_mood_in_roster_checkbutton_toggled" swapped="no"/> + <signal name="toggled" handler="on_show_pep_in_roster_checkbutton_toggled" swapped="no"/> </object> <packing> <property name="expand">False</property> @@ -254,67 +272,6 @@ </packing> </child> <child> - <object class="GtkCheckButton" id="show_activity_in_roster_checkbutton"> - <property name="label" translatable="yes">Display _activity of contacts in roster</property> - <property name="use_action_appearance">False</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="tooltip_text" translatable="yes">If checked, Gajim will display the activity of contacts in the roster window</property> - <property name="use_action_appearance">False</property> - <property name="use_underline">True</property> - <property name="xalign">0</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_show_activity_in_roster_checkbutton_toggled" swapped="no"/> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">3</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="show_tunes_in_roster_checkbutton"> - <property name="label" translatable="yes">Display _tunes of contacts in roster</property> - <property name="use_action_appearance">False</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="tooltip_text" translatable="yes">If checked, Gajim will display the tunes of contacts in the roster window</property> - <property name="use_action_appearance">False</property> - <property name="use_underline">True</property> - <property name="xalign">0</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_show_tunes_in_roster_checkbutton_toggled" swapped="no"/> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">4</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="show_location_in_roster_checkbutton"> - <property name="label" translatable="yes">Display _location of contacts in roster</property> - <property name="use_action_appearance">False</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="has_tooltip">True</property> - <property name="tooltip_text" translatable="yes">If checked, Gajim will display the location of contacts in the roster window</property> - <property name="use_action_appearance">False</property> - <property name="use_underline">True</property> - <property name="xalign">0</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_show_location_in_roster_checkbutton_toggled" swapped="no"/> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">5</property> - </packing> - </child> - <child> <object class="GtkHBox" id="hbox3"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -373,7 +330,7 @@ <packing> <property name="expand">True</property> <property name="fill">True</property> - <property name="position">6</property> + <property name="position">3</property> </packing> </child> </object> @@ -415,7 +372,7 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="n_rows">6</property> + <property name="n_rows">7</property> <property name="n_columns">2</property> <property name="column_spacing">6</property> <property name="row_spacing">6</property> @@ -585,6 +542,24 @@ <property name="bottom_attach">3</property> </packing> </child> + <child> + <object class="GtkCheckButton" id="positive_184_ack_checkbutton"> + <property name="label" translatable="yes">Show icon when your messages are received</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_positive_184_ack_checkbutton_toggled" swapped="no"/> + </object> + <packing> + <property name="right_attach">2</property> + <property name="top_attach">6</property> + <property name="bottom_attach">7</property> + </packing> + </child> </object> </child> </object> @@ -3299,22 +3274,4 @@ </object> </child> </object> - <object class="GtkListStore" id="status_message_liststore"> - <columns> - <!-- column-name name --> - <column type="gchararray"/> - <!-- column-name text --> - <column type="gchararray"/> - <!-- column-name activity --> - <column type="gchararray"/> - <!-- column-name sub_activity --> - <column type="gchararray"/> - <!-- column-name activity_text --> - <column type="gchararray"/> - <!-- column-name mood --> - <column type="gchararray"/> - <!-- column-name mood_text --> - <column type="gchararray"/> - </columns> - </object> </interface> diff -r 8c5d6c908de8 -r 0d03a343abcc src/common/config.py --- a/src/common/config.py Thu May 02 21:50:16 2013 +0200 +++ b/src/common/config.py Sun May 12 21:32:29 2013 +0200 @@ -315,6 +315,7 @@ 'global_proxy': [opt_str, '', _('Proxy used for all outgoing connections if the account does not have a specific proxy configured')], 'ignore_incoming_attention': [opt_bool, False, _('If True, Gajim will ignore incoming attention requestd ("wizz").')], 'remember_opened_chat_controls': [ opt_bool, True, _('If enabled, Gajim will reopen chat windows that were opened last time Gajim was closed.')], + 'positive_184_ack': [ opt_bool, False, _('If enabled, Gajim will show an icon to show that sent message has been received by your contact')], }, {})
__options_per_key = { diff -r 8c5d6c908de8 -r 0d03a343abcc src/config.py --- a/src/config.py Thu May 02 21:50:16 2013 +0200 +++ b/src/config.py Sun May 12 21:32:29 2013 +0200 @@ -128,25 +128,16 @@ self.xml.get_object('show_status_msgs_in_roster_checkbutton'). \ set_active( st)
- # Display mood in roster - st = gajim.config.get('show_mood_in_roster') - self.xml.get_object('show_mood_in_roster_checkbutton'). \ - set_active(st) - - # Display activity in roster - st = gajim.config.get('show_activity_in_roster') - self.xml.get_object('show_activity_in_roster_checkbutton'). \ - set_active(st) - - # Display tunes in roster - st = gajim.config.get('show_tunes_in_roster') - self.xml.get_object('show_tunes_in_roster_checkbutton'). \ - set_active(st) - - # Display location in roster - st = gajim.config.get('show_location_in_roster') - self.xml.get_object('show_location_in_roster_checkbutton'). \ - set_active(st) + # Display PEP in roster + st1 = gajim.config.get('show_mood_in_roster') + st2 = gajim.config.get('show_activity_in_roster') + st3 = gajim.config.get('show_tunes_in_roster') + st4 = gajim.config.get('show_location_in_roster') + w = self.xml.get_object('show_pep_in_roster_checkbutton') + if st1 == st2 == st3 == st4: + w.set_active(st1) + else: + w.set_inconsistent(True)
# Sort contacts by show st = gajim.config.get('sort_by_show_in_roster') @@ -212,6 +203,10 @@ else: self.xml.get_object('speller_checkbutton').set_sensitive(False)
+ # XEP-0184 positive ack + st = gajim.config.get('positive_184_ack') + self.xml.get_object('positive_184_ack_checkbutton').set_active(st) + ### Style tab ### # Themes theme_combobox = self.xml.get_object('theme_combobox') @@ -670,19 +665,10 @@ for ctrl in self._get_all_muc_controls(): ctrl.update_ui()
- def on_show_mood_in_roster_checkbutton_toggled(self, widget): + def on_show_pep_in_roster_checkbutton_toggled(self, widget): self.on_checkbutton_toggled(widget, 'show_mood_in_roster') - gajim.interface.roster.setup_and_draw_roster() - - def on_show_activity_in_roster_checkbutton_toggled(self, widget): self.on_checkbutton_toggled(widget, 'show_activity_in_roster') - gajim.interface.roster.setup_and_draw_roster() - - def on_show_tunes_in_roster_checkbutton_toggled(self, widget): self.on_checkbutton_toggled(widget, 'show_tunes_in_roster') - gajim.interface.roster.setup_and_draw_roster() - - def on_show_location_in_roster_checkbutton_toggled(self, widget): self.on_checkbutton_toggled(widget, 'show_location_in_roster') gajim.interface.roster.setup_and_draw_roster()
@@ -772,6 +758,9 @@ else: self.remove_speller()
+ def on_positive_184_ack_checkbutton_toggled(self, widget): + self.on_checkbutton_toggled(widget, 'positive_184_ack') + def on_theme_combobox_changed(self, widget): model = widget.get_model() active = widget.get_active() diff -r 8c5d6c908de8 -r 0d03a343abcc src/conversation_textview.py --- a/src/conversation_textview.py Thu May 02 21:50:16 2013 +0200 +++ b/src/conversation_textview.py Sun May 12 21:32:29 2013 +0200 @@ -176,6 +176,8 @@ 'gajim-muc_separator') XEP0184_WARNING_PIXBUF = gtkgui_helpers.get_icon_pixmap( 'gajim-receipt_missing') + XEP0184_RECEIVED_PIXBUF = gtkgui_helpers.get_icon_pixmap( + 'gajim-receipt_received') MESSAGE_CORRECTED_PIXBUF = gtkgui_helpers.get_icon_pixmap( 'gajim-message_corrected')
@@ -554,22 +556,29 @@ if id_ not in self.xep0184_marks: return
- if self.xep0184_shown[id_] == NOT_SHOWN: - self.xep0184_shown[id_] = ALREADY_RECEIVED - return - buffer_ = self.tv.get_buffer() buffer_.begin_user_action()
- begin_iter = buffer_.get_iter_at_mark(self.xep0184_marks[id_]) + if self.xep0184_shown[id_] != NOT_SHOWN: + begin_iter = buffer_.get_iter_at_mark(self.xep0184_marks[id_])