Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite the SendTo dialog to use a Gtk.Listbox #2552

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

infirit
Copy link
Contributor

@infirit infirit commented Dec 11, 2024

Rewrite the sendto device list to use the much simpler and flexible Gtk.ListBox.

The list has only one job now which is present a list of devices to the user. It doesn't manage any state for devices or adapters.

The list now also contains devices from all Adapters and filters based on the selection in the combobox. No more rebuilding the whole list when a different adapter is selected.

In the process I also changed the following:

  • Remove the paired and trused icons as they imo serve little purpose.
  • Add a warning icon when the device doesn't advertise it can handle ObjectPush.
  • Changed the adapter selection combobox to also allow it to show all devices from all adapters.
Old description This is a rough, mostly working, proof of concept to replace the TreeView in blueman-sendto we currently have with a much simpler and flexible Gtk.ListBox. Before I go further I'd like some feedback on the overall design of it. I do want to move the bluez.Manager and bluez.AnyDevice signal handling further up into apps/blueman-sendto as we already have them there anyway.

I do want to make the Gtk.ListBox and Gtk.ListBoxRow only be responsible for presenting the data. Not have it handle state on adapters/devices internally, this will be done through methods. Using properties for the row in blueman-manager may not be ideal so maybe I should use some sort of properties_update method and pass in all the changes in one go.

I like to treat this as a blueprint for when I start working on the Gtk.ListBox for blueman-manager so we can finally implement some of the designs done by users some time ago.

ps: I'm sure mypy will be unhappy with me but it's just a proof of concept for now.

@cschramm
Copy link
Member

I did not review this in detail, but it makes a lot of sense to me 👌

@infirit infirit force-pushed the sendtodevicelistbox branch from b669ef1 to a09945d Compare December 27, 2024 15:38
@infirit
Copy link
Contributor Author

infirit commented Dec 27, 2024

Decided to remove the trusted and paired icons from the list as afaics they really serve no purpose when sending files over bluetooth. I added a new icon to indicate if the device advertises obex object push. Also added a togglebutton but not sure if this is useful (not happy with how it looks regardless).

image

@infirit infirit force-pushed the sendtodevicelistbox branch 3 times, most recently from bf3d614 to d483437 Compare December 29, 2024 00:07
This drops the refcount and python destroys the DBusObjectManager
@infirit infirit force-pushed the sendtodevicelistbox branch 2 times, most recently from 6db6849 to 668042e Compare December 31, 2024 00:58
@infirit
Copy link
Contributor Author

infirit commented Dec 31, 2024

I'm mostly done with it and will undraft it soon. Here is a quick recording of the list.
Screencast_20241231_020140.webm

@infirit infirit force-pushed the sendtodevicelistbox branch from 66a7348 to 1e26be1 Compare March 2, 2025 14:19
Copy link

sonarqubecloud bot commented Mar 2, 2025

@infirit infirit changed the title Concept Listbox use for blueman device list(s) Rewrite the SendTo dialog to use a Gtk.Listbox Mar 2, 2025
@infirit infirit marked this pull request as ready for review March 2, 2025 14:29
@infirit infirit requested a review from cschramm March 2, 2025 14:29
@infirit
Copy link
Contributor Author

infirit commented Mar 2, 2025

I'm happy with this now. So ready for review and testing :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants