BuddiesOfBudgie / budgie-desktop

Budgie Desktop is a familiar, modern desktop environment.
https://buddiesofbudgie.org
GNU General Public License v2.0
957 stars 50 forks source link

Implement a new Bluetooth indicator #459

Closed EbonJaeger closed 9 months ago

EbonJaeger commented 1 year ago

Description

The Bluetooth rewrite is finally here! GNOME Bluetooth is entirely dropped from Budgie Desktop; we now use Bluez and UPower directly, giving us full control over how Bluetooth is interacted with. You will now be able to connect to and disconnect from your Bluetooth devices from the panel without having to go to the Control Center. You will still have to visit the Control Center to pair new devices, however. With the direct usage of UPower, you will also see the battery power of devices that report it right in the applet popover.

This also includes our own implementation of Sendto in order to send and receive files over Bluetooth. Budgie Sendto is very heavily inspired by Elementary's own Bluetooth Sendto implementation. It runs in the background to listen for file transfer requests from other devices, showing a notification when one is received, enabling you to accept or reject the transfer. To send a file, you can open the Bluetooth indicator popover and hit the Send button to open a dialog to choose what device you want to send to.

Closes #197

Submitter Checklist

fossfreedom commented 10 months ago

FYI - Debian has now marked the usage of libgnome-bluetooth13 as something to be removed before its next release since upstream has dropped support.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1030130 and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1059486

So great news that we have this PR - nice one @EbonJaeger

This also dropping support from BCC as well - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1059485 ...

but with the need to pair devices via BCC that's more problematic - we would have to rewrite this whole section in BCC ... either with the suggested new gnome library ... or a complete rewrite to use bluez?

EDIT: or maybe less elegant but very little work - just drop bluetooth from BCC entirely - and add here a callout to blueman to-do the GUI pairing aspects?

JoshStrobl commented 9 months ago

Rebased it, ignore noise on the billion commits after my suggestions :D

EbonJaeger commented 9 months ago

I was wondering why some of the review items were showing "outdated" xD

EbonJaeger commented 9 months ago

The latest commit addresses the duplicated code and estimated time calculation. If you could test receiving a file via Bluetooth, that would be great. I'm not getting the notification to reject or accept the transfer, and I have no idea if it's the code, my phone, or the deity of Bluetooth deciding to mess with me.

JoshStrobl commented 9 months ago

@EbonJaeger I am able to send files from my desktop to the test phone just fine but sending from my test phone to the desktop, getting the notification to accept and accepting it, does not work. Just to be sure, I tested it with a unique file not on my desktop.

Also as a note, we need a newline between the From: FILEPATH and "Sent to: DEVICE". Otherwise it all melds into one line.

Will continue testing but hopefully @fossfreedom can do some further testing on his end too since he uses sendto functionality (or at the very least I know he certainly does with more frequency than me -- which is never :D)


Otherwise, LGTM. Send-to dialog looked good, though we may want to consider filtering out devices you really can't send to like headphones and wireless keyboards.

fossfreedom commented 9 months ago

some quick thoughts.

  1. with bluetooth disabled the popover has both a bluetooth settings button in the top section and a big bluetooth button in the popover body. The latter is perhaps superfluous

  2. similarly with nothing paired the second button is there.
    image

  3. the send-to button is enabled even though my phone is marked as disconnected. Can this be disabled until a bluetooth device is connected? image

  4. image

in BCC you click on a connected device and then you send a file directly. in the popover you click the send files in the top of the popover that then displays this

image

and then you have a whirring discovery option at the top of the dialog and a separate "send" button on the device to send to.

I'm pretty sure this was discussed in #general ... but too far to scroll back - did we discount having a send button next to the disconnect option to directly send to the chosen device - i.e. one click like BCC rather than two clicks via the popover to send a file ?

  1. disconnect buttons look a little vertically stretched

image

Tested with Qogir, Arc and Pocillo

  1. in that screenshot the second button (Qogir) has a border around the button. Is this trying to say something specifically about this disconnect button? Or should both phones disconnect buttons have borders so that the buttons look like buttons?

Tested with a couple of connected phones sending files back and forth. works nicely

EbonJaeger commented 9 months ago

@fossfreedom

  1. & 2. Good point. Removed the button in the placeholder
  2. Good idea. Done. (Superseded by below)
  3. Ended up being way easier to do than I thought. Devices that support file sending (desktops, laptops, and smartphones; are there any others in this list?) now have their own individual send button that bypasses the first dialog.
  4. Still can't get this to happen :/
  5. I've noticed that sometimes, buttons don't quite follow their set relief style. Been this way for a while, now.
fossfreedom commented 9 months ago

4. Still can't get this to happen :/

hmm - I'm wonder if the send and disconnect buttons should be added to a buttonbox rather than pack-start within a box?

If I connect to a phone via the popover the disconnect button appears in the popover. Good. However the send button doesn't appear. If I restart the panel then both the send button and disconnect buttons appear in the popover.

EbonJaeger commented 9 months ago

@fossfreedom I think I might have it this time. Can you try the latest commit?

fossfreedom commented 9 months ago

Nice work! Relief issues have been resolved.

Connected my phone - send files button enabled.

Connected my airpods - connected - no send files button - so thats good news.

fossfreedom commented 9 months ago

good to be merged IMHO.