Ticket #1201 (closed task: fixed)

Opened 5 years ago

Last modified 2 years ago

use gtk modelfilter for roster's treeview

Reported by: nk Owned by: steve-e
Priority: high Milestone: 0.12
Component: roster Version: hg
Severity: blocker Keywords:
Cc: Blocked By:
OS: All Blocking:

Description

we should fill when we get roster the model, and then show only those not offline by default using gtk's modelfilter

this allows us to be super fast when toggling show offline contacts (atm we go to draw all roster from scratch)

also overcomes a bug of GTK 2.8 (well not a reason but will they ever fix? etc..). see #1200, #1040

Attachments

modelfilter.patch (39.9 KB) - added by asterix 3 years ago.
modelfilter_v2.patch (41.3 KB) - added by asterix 3 years ago.
some bugfixes with metacontacts
modelfilter-double-contact.png (54.0 KB) - added by steve-e 3 years ago.
dub bug
modelfilter.2.patch (41.7 KB) - added by asterix 3 years ago.
modelfilter.3.patch (41.5 KB) - added by asterix 3 years ago.
Updated version

Change History

  Changed 5 years ago by asterix

  • type changed from defect to enhancement

  Changed 4 years ago by asterix

  • milestone changed from 0.10 to 0.11

it's not a priority for now

  Changed 4 years ago by asterix

  • milestone set to 0.11 =>

too much work for 0.11

  Changed 3 years ago by anonymous

  • severity changed from normal to major
  • os set to All
  • priority changed from normal to high
  • version set to svn
  • milestone set to 0.12
  • type changed from defect to task

  Changed 3 years ago by lukas@…

I have been looking into this and closing this ticket would mean significantly altering draw_* methods in roster_window.py and probably others - am I right?

I already have model filtering and the row visibility function implemented, but it doesn't work well without significant changes to draw_* methods, which I don't feel like doing yet as I'm still quite new to Gajim.

Is there (or will there be) anyone actively working on this? I don't want to work on anything so complex, when it might be already in the works by someone more skillful. ;)

  Changed 3 years ago by roidelapluie

Asterix is currently working on this ticket.

  Changed 3 years ago by roidelapluie

Let's see when he'll come back from vacation :-)

thanks lukas :-)

follow-up: ↓ 10   Changed 3 years ago by asterix

here is my current patch. It works, but still has some bugs. I won't look at that for one week

good luck to read all that !

Changed 3 years ago by asterix

  Changed 3 years ago by roidelapluie

Asterix's soul is watching us \o/ thx

in reply to: ↑ 8   Changed 3 years ago by anonymous

Replying to asterix:

good luck to read all that !

I have read it through and decided that it'll be better if you finish this. This is way too big for me at the moment.

  Changed 3 years ago by roidelapluie

Hi aterix, there is a tb (when adding a contact I think)

gajim.py:2524: GtkWarning: gtk_tree_model_filter_real_unref_node: assertion `elt->ref_count > 0' failed
  gtk.main()
/usr/local/share/gajim/src/roster_window.py:508: GtkWarning: gtk_tree_model_filter_real_unref_node: assertion `elt->ref_count > 0' failed
  self.modelfilter.refilter()
gajim.py:2524: Warning: g_value_unset: assertion `G_IS_VALUE (value)' failed
  gtk.main()
Traceback (most recent call last):
  File "/usr/local/share/gajim/src/dialogs.py", line 1890, in on_cancel_button_clicked
    self.save_pos()
  File "/usr/local/share/gajim/src/dialogs.py", line 1820, in save_pos
    x, y = self.window.get_position()
AttributeError: SingleMessageWindow instance has no attribute 'window'

Changed 3 years ago by asterix

some bugfixes with metacontacts

  Changed 3 years ago by asterix

here is a new version with some bugfixes about metacontacts. Could some people give me some feedback / tracebacks / GTK warnings ?

  Changed 3 years ago by steve-e

I cannot create MetaContacts and when somebody sends me a message, the contact shows up twice in roster. (I tried this with a contact which is only an Observer)

  Changed 3 years ago by asterix

indeed DnD are not handled yet ...

for the other thing ok I'll look at that, thanks

  Changed 3 years ago by asterix

I can't reproduce yours second pb : the dubble contact in roster. Any TB or GTK error ?

  Changed 3 years ago by steve-e

I don't know when or why this happened. I haven't done anything else than connecting:

/projekte/python/gajim/src/roster_window.py:688: GtkWarning: gtk_tree_model_filter_iter_has_child: assertion `filter->priv->stamp == iter->stamp' failed
  if iter and self.modelfilter.iter_has_child(iter):

During connection an account is minimized to its account row. I find this pretty annoying, because it makes me assume I can unfold it, but this is not possible.

When I send a message from one account to another the contact which receives the messages is dublicated in roster. See attached screenshot. By clicking on the dublicated contact I get the following traceback and gajim freezes:

python/gajim/src/roster_window.py:727: GtkWarning: gtk_tree_model_filter_real_unref_node: assertion `filter->priv->stamp == iter->stamp' failed
  self.model[child_iter][C_IMG] = img

Changed 3 years ago by steve-e

dub bug

Changed 3 years ago by asterix

  Changed 3 years ago by asterix

here is a version with DND working.

Changed 3 years ago by asterix

Updated version

  Changed 3 years ago by steve-e

Traceback (most recent call last):
  File "gajim/src/roster_window.py", line 4988, in visible_func
    return self.contact_is_visible(contact, account)
  File "gajim/src/roster_window.py", line 4942, in contact_is_visible
    if gajim.events.get_nb_roster_events(account, contact.jid) > 0:
AttributeError: 'NoneType' object has no attribute 'jid'

When I get this TB, a contact is duplicated. I don't know if its related to Zeroconf, which is what I use atm.

  Changed 2 years ago by steve-e

  • owner changed from asterix to steve-e
  • severity changed from major to blocker

There is a little progress going on. My changelog has grown to almost 8000 lines.

I really hope that Jim and Asterix don't find to many bugs :-)

  Changed 2 years ago by steve-e

TODO: - Count metacontacts only once. - Fix expand/collapse behaviour. - API cleanup and consistence check.

  Changed 2 years ago by steve-e

Known Bugs:

  • Metacontacts are counted several times
  • GTK warning when we only have one group and one contact. The warning is shown when the contact is offline and we toggle show/hide
  • Edit Groups dialog is working strangely with the default 'General' group.

  Changed 2 years ago by steve-e

(In [da84b38427f5330c94286544c46710cc2dc61f69]) Port roster_window to gtk.TreeModelFilter?.

Contacts are now online hidden when they connect/reconnect and not completely removed/readded. Should come with a great speed improvement for people with big rosters. There are still a few known problems but non that should dalay this patch any longer. Related bugs will be tracked with 'modelfilter' keyword.

See #1201

  Changed 2 years ago by asterix

  • status changed from new to closed
  • resolution set to fixed

let's close this ticket. Bugs of modelfilter are handled in other tickets.

Add/Change #1201 (use gtk modelfilter for roster's treeview)

Author


E-mail address and user name can be saved in the Preferences.


Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Next status will be 'needinfo'
 
Note: See TracTickets for help on using tickets.