[Git][gajim/gajim][mainwindow] Fix readmarker breaking merge
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: a45033ce by lovetox at 2021-04-04T23:51:48+02:00 Fix readmarker breaking merge - - - - - 1 changed file: - gajim/gtk/conversation/view.py Changes: = gajim/gtk/conversation/view.py = @@ -236,6 +236,9 @@ def _find_ancestor(self, message): if row is None: return None +if row.type == 'read_marker': +continue + if row.type != 'chat': return None @@ -254,6 +257,9 @@ def _update_descendants(self, message): if row is None: return +if row.type == 'read_marker': +continue + if row.type != 'chat': return View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/a45033ce8f89390dd7765c279918467d3b848360 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/a45033ce8f89390dd7765c279918467d3b848360 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] show info messages
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 5a86aeb2 by lovetox at 2021-04-04T23:45:14+02:00 show info messages - - - - - 1 changed file: - gajim/gtk/conversation/rows/info.py Changes: = gajim/gtk/conversation/rows/info.py = @@ -65,3 +65,4 @@ def __init__(self, graphics=graphics) self.grid.attach(self.textview, 1, 0, 1, 1) +self.show_all() View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/5a86aeb247715ebc31c5f44e159a382591e1eed5 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/5a86aeb247715ebc31c5f44e159a382591e1eed5 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Improve read marker
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 27cdd4a7 by lovetox at 2021-04-04T23:38:23+02:00 Improve read marker - - - - - 2 changed files: - gajim/chat_control.py - gajim/gtk/conversation/view.py Changes: = gajim/chat_control.py = @@ -559,6 +559,8 @@ def _on_message_received(self, event): correct_id=event.correct_id, additional_data=event.additional_data) +self.conversation_view.set_read_marker(event.properties.id) + def _on_message_error(self, event): self.conversation_view.show_error(event.message_id, event.error) = gajim/gtk/conversation/view.py = @@ -311,6 +311,10 @@ def iter_rows(self): yield row def set_read_marker(self, id_): +if id_ is None: +self._read_marker_row.hide() +return + row = self._get_row_by_message_id(id_) if row is None: return View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/27cdd4a72f7d18dbf71df34cf9f60da86bc7ae94 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/27cdd4a72f7d18dbf71df34cf9f60da86bc7ae94 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Remove unused imports
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: f354d46a by lovetox at 2021-04-04T23:24:56+02:00 Remove unused imports - - - - - 1 changed file: - gajim/gtk/conversation/view.py Changes: = gajim/gtk/conversation/view.py = @@ -15,8 +15,6 @@ import logging import time -from bisect import bisect_right -from datetime import datetime from datetime import timedelta from gi.repository import GLib @@ -96,7 +94,6 @@ def set_history_complete(self, complete): self._scroll_hint_row.set_history_complete(complete) def _reset_conversation_view(self): -self._last_incoming_timestamp = datetime.fromtimestamp(0) self._row_count = 0 self.clearing = False View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/f354d46a504a5ce53b9b9e419b0a22948b86ab0b -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/f354d46a504a5ce53b9b9e419b0a22948b86ab0b You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Fix completion state
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 56f4d5eb by lovetox at 2021-04-04T17:50:50+02:00 Fix completion state - - - - - 4 changed files: - gajim/chat_control_base.py - gajim/gtk/conversation/rows/scroll_hint.py - gajim/gtk/conversation/scrolled.py - gajim/gtk/conversation/view.py Changes: = gajim/chat_control_base.py = @@ -1413,7 +1413,7 @@ def fetch_n_lines_history(self, _scrolled, n_lines): n_lines) if not messages: -self._scrolled_view.set_history_complete() +self._scrolled_view.set_history_complete(True) return for msg in messages: = gajim/gtk/conversation/rows/scroll_hint.py = @@ -29,6 +29,7 @@ def __init__(self, account, history_mode=False): self.type = 'system' self.timestamp = datetime.fromtimestamp(0) +self._history_mode = history_mode self.get_style_context().add_class('conversation-system-row') @@ -36,14 +37,16 @@ def __init__(self, account, history_mode=False): self.label.set_hexpand(True) self.label.get_style_context().add_class( 'conversation-meta') +self.grid.attach(self.label, 0, 1, 1, 1) + +self.set_history_complete(False) -if history_mode: +def set_history_complete(self, complete): +if self._history_mode: self.label.set_text(_('Use the calendar to select a specific date')) -self.grid.attach(self.label, 0, 1, 1, 1) return -self.label.set_text(_('Scroll up to load more chat history…')) -self.grid.attach(self.label, 0, 1, 1, 1) - -def set_history_complete(self): -self.label.set_text(_('There is no more history')) +if complete: +self.label.set_text(_('There is no more history')) +else: +self.label.set_text(_('Scroll up to load more chat history…')) = gajim/gtk/conversation/scrolled.py = @@ -56,13 +56,15 @@ def __init__(self, *args, **kwargs): vadjustment.connect('notify::upper', self._on_adj_upper_changed) vadjustment.connect('notify::value', self._on_adj_value_changed) -@property -def autoscroll(self): +def get_autoscroll(self): return self._autoscroll -def set_history_complete(self): -self._complete = True -self.get_child().get_child().set_history_complete() +def get_view(self): +return self.get_child().get_child() + +def set_history_complete(self, complete): +self._complete = complete +self.get_view().set_history_complete(complete) def _on_adj_upper_changed(self, adj, *args): upper = adj.get_upper() @@ -72,6 +74,7 @@ def _on_adj_upper_changed(self, adj, *args): self._current_upper = upper if self._autoscroll: adj.set_value(adj.get_upper() - adj.get_page_size()) + else: # Workaround # https://gitlab.gnome.org/GNOME/gtk/merge_requests/395 = gajim/gtk/conversation/view.py = @@ -108,8 +108,8 @@ def get_first_message_row(self): return row return None -def set_history_complete(self): -self._scroll_hint_row.set_history_complete() +def set_history_complete(self, complete): +self._scroll_hint_row.set_history_complete(complete) def _reset_conversation_view(self): self._first_date = None @@ -203,10 +203,6 @@ def add_message(self, self._insert_message(message, kind, history) -# Check for maximum message count -# if self.autoscroll and self._row_count > self._max_row_count: -# self._reduce_message_count() - def _get_avatar(self, kind, name): scale = self.get_scale_factor() if self._contact.is_groupchat: @@ -344,7 +340,8 @@ def _is_mergeable(row1, row2): return True return False -def _reduce_message_count(self): +def reduce_message_count(self): +successful = False while self._row_count > self._max_row_count: # We want to keep relevant DateRows when removing rows row1 = self.get_row_at_index(1) @@ -354,6 +351,7 @@ def _reduce_message_count(self): # First two rows are date rows, # it’s safe to remove the fist row self.remove(row1) +successful = True self._timestamps_inserted.remove(row1.timestamp) self._first_date = row2.timestamp.strftime('%a, %d %b %Y') self._row_count -= 1 @@ -363,6 +361,7 @@ def _reduce_message_count(self): # First one is a date row,
[Git][gajim/gajim][mainwindow] Fix history mode
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 2561aac3 by lovetox at 2021-04-04T17:18:28+02:00 Fix history mode - - - - - 1 changed file: - gajim/gtk/conversation/view.py Changes: = gajim/gtk/conversation/view.py = @@ -90,7 +90,8 @@ def __init__(self, account, contact, history_mode=False): self._last_incoming_timestamp = datetime.fromtimestamp(0) # Insert the very first row, containing the scroll hint and load button -self._scroll_hint_row = ScrollHintRow(self._account) +self._scroll_hint_row = ScrollHintRow(self._account, + history_mode=self._history_mode) self.add(self._scroll_hint_row) self._timestamps_inserted.append(datetime.fromtimestamp(0)) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2561aac32c0cf6b65a624469dcabaf6418ad2aab -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2561aac32c0cf6b65a624469dcabaf6418ad2aab You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits