-
kurion
Could you please explain why TreeView was preferred over ListBox for the roster?
-
lovetox
It's faster with many entries and you can group entries under names, like members, admins, etc
-
kurion
Got it.
-
kurion
I was looking for a way to remove a contact
-
kurion
I see that the roster menu is only _evokable_ with a mouse right click on a contact item in the treeview
-
kurion
Since I need a way to evoke the roster menu without the mouse, I looked for ways so that the menu can be evoked with Gdk.KEY_Menu
-
kurion
But I see that getting the content of treeview item currently under focus is done with checking the position of the cursor✎ -
kurion
But I see that getting the content of treeview item currently under focus is done with checking the position of the cursor (event.x and event.y) ✏
-
kurion
So It seems to me that getting the current roster item from `roster_treeview` is not doable without querying cursor position
-
kurion
And I think it implies that evoking the roster menu for a specific contact item is not doable solely using keyboard events
-
kurion
Please correct me if I'm wrong
-
lovetox
It is. Select with keyboard a contact and on keypress open the menu
-
cal0pteryx
kurion: focus the roster, navigate using arrow keys, press right click button on keyboard, move to correct item by arrow key, enter ?
-
kurion
I tried
-
kurion
But if the cursor is elsewhere (even if roster item is highlighted when navigating with keyboard)
-
lovetox
Menu can not only be opened with cursor position
-
kurion
a right click does not invoke the roster menu for that item
-
lovetox
Read the docs for GTK menu or gio.menu
-
kurion
I see in `_on_roster_button_press_event` that the logical process of determining the jid of the currently selected roster item uses `treeview.get_path_at_pos` first.
-
kurion
Which of course works with cursor position
-
kurion
What I am looking for is something like `treeview.get_selected_child()`
-
kurion
But there is no such method available for treeviews
-
kurion
How can I bypass `get_path_at_pos` and still somehow determine the jid of currently selected/highlighted roster item so that I can call `_show_contact_menu` with the jid?
-
lovetox
You can get the selected node, look better in the docs
-
kurion
I looked for it.
-
kurion
Should I use `get_selected()` from Gtk.TreeSelection class?
-
lovetox
Yes
-
whitepaperkat
That's not good
-
whitepaperkat
Yup
-
meson
kurion: will you open some PR later? :)
-
kurion
Still not sure.
-
kurion
Actually, some of my code contains bad practises like using underscored methods outside of the parent class
-
meson
I'm sure those things can be improved during a review✎ -
meson
I'm sure those things can be improved during the review process ✏
-
Kris
someone is sending spam messages on disroot.org mucs that crash Gajim. Probably too long or so. the messages are random garbage as far as I can tell
-
Kris
other clients seem uneffected
-
☭Mike Yellow
I guess Gajim is difficult to solve it. But it does not matter, I think it is a good thing to urge inexperienced room owners to learn how to prevent from being spammed.
-
kurion
meson: That✎ -
kurion
meson: That's really nice to know. I'll have to learn how to make PRs :P ✏
-
cal0pteryx
Kris: should not be the case with newer gajim versions
-
Kris
I am on 1.7.3
-
Kris
ah I guess the fedora repos are not up to date 😓️
-
Kris
I'll switch to the flatpack 🤷♂️️
-
nicoco
Given how active the development of gajim has been for the past months, thanks to the amazing work by its devs, I’ve happily switched to flatpak for a while. The only annoying issue I have is drag’n’dropping attachments to the chat window does not work for me, but ctrl+C ctrl+V is usually good enough for images.
-
hannibal
nicoco: you need a recent version of gtk on your host system for drag and drop to work with flatpak
-
meson
kurion: one way is to fork Gajim on Gitlab, create a branch for your feature, commit and push your changes to your fork on Gitlab. On Gitlab you'll then find a dialog to create a PR for your changes of your feature branch.
-
jstein
Hi, someone with write access may want to add add https://packages.gentoo.org/packages/net-im/gajim in Packages section on https://dev.gajim.org/gajim/gajim/-/blob/master/README.md
-
cal0pteryx
jstein: dp you know about repology.org ?
-
kurion
After long search sessions and trial-and-error, finally came up with the following: ``` def _on_roster_key_press_event(self, treeview: Gtk.TreeView, event: Gdk.EventKey) -> None: if event.keyval == Gdk.KEY_Menu: selection = treeview.get_selection() (model, iter_)= selection.get_selected() assert iter_ is not None jid = model.get_value(iter_, 3) self._show_contact_menu(jid, treeview, None) ```
-
kurion
TreeViews are complicated indeed
-
kurion
` jid = model.get_value(iter_, 3)` - I admit this line is not great to read.
-
kurion
`contact_store` is defined inside `roster.ui`. So it is not apparently clear to a reader what 3 actually refers to.
-
kurion
will have to add a conditional to check for Groupchat though
-
kurion
IMHO, this short code block looks nicer than the process of determining the jid in `_on_roster_button_press_event`
-
kurion
But I agree that you need to get cursor position to determine exactly where to popup the contact menu
-
kurion
The above method, funny enough, pops up the contact menu pointing to the the middle of the pane/grig divider.✎ -
kurion
The above method, funny enough, pops up the contact menu pointing to the the middle of the pane/grid divider. ✏
-
kurion
Now I will have to do somewhat of a gymnastics exercise to ensure a fluid UX
-
jstein
cal0pteryx, yes. Great project. Perhaps even better to drop all distributions from that list and simply add one repology link or badge https://repology.org/project/gajim/versions
-
lovetox
kurion, why would a blind person care where a popup is located?
-
kurion
The blind person will not care, tbh\
-
kurion
But if I want to make a PR, I guess I should care
-
Link Mauve
lovetox, some people might be blind, but they can still see a tiny bit.
-
Link Mauve
For instance changes in luminosity (imagine an extremely blurry screen for instance), or generic shapes (like a rectangle in some corner).
-
Link Mauve
Some can even read if they put their eye extremely close to the screen, with extremely zoomed in everything.
-
Link Mauve
It always depends from person to person, but some handicaps aren’t on or off.
-
altblex
I need help, whenever I type some words and press space, my entire message gets changed to something else
-
Link Mauve
It also depends on their current state of fatigue, stuff like that.
-
kurion
altblex: do you have acronym expander plugin turned on?
-
kurion
Link Mauve: yes, you could say there's a continuous spectrum of degree of blindness.
-
altblex
Yes, removing that fixed it
-
altblex
Thanks
-
kurion
finally have a working `_on_roster_key_press_event` method. I am hoping that the little bit of hardcoding I used here is harmless
-
kurion
``` https://conference.gajim.org:5281/pastebin/1d88e322-1c49-47e6-bfab-a00179774580
-
kurion
Still missing the check for Groupchat. But I'm not sure how to do it.
-
kurion
didn't want to touch any other method to accept a Gdk.EventKey along with the Gdk.EventButton
-
kurion
So ended up creating an EventButton
-
kurion
Very non-standard, I admit
-
kurion
If this little UX thing is worth the time and effort of a PR review process, I will make a PR. What do you say?
-
kurion
I have made several other modifications (mostly EventKey handling) during the last month. I will try push most of them eventually.
-
lovetox
im working since 20 years with computers
-
lovetox
TIL there is a menu button
-
lovetox
its not on my keyboard though
-
lovetox
i think its useful feature, but we have many context menus ..
-
lovetox
hard to keep all working with a menu button if only very few people use this
-
lovetox
i think if you make just for that a PR we could work to get it in, to have at least an example how to make a menu key for context menus work
-
lovetox
about the code
-
lovetox
look at _on_roster_button_press_event(), use the Column Enum to access columns in a more readable way
-
lovetox
Column.IS_CONTACT tells you if its a group or contact
-
lovetox
you need to convert the path with path = self._modelfilter.convert_path_to_child_path(path)
-
lovetox
otherwise your code will show a wrong menu, when a filter is applied to the roster
-
lovetox
further if we do this more often the GajimPopover should be refactored to take a rectangle instead of a EventButton
-
lovetox
then we can save the dummy EventButton creation