2008-09-29 15:59:31

by Stefan Seyfried

[permalink] [raw]
Subject: bluez-gnome: how to turn adapter off?

Hi,

I now got several bugreports from people searching for the button to turn
their bluetooth device off in the bluetooth-applet. I seem to remember that
there was the setting "off" (in addition to "Hidden", "Always visible",
"Temporary visible") in previous versions. So what's the rationale for
removing it (users seem to expect to find it there)? And if I remember
incorrectly: could we place such a button there?

Thanks,

Stefan

--
Stefan Seyfried
R&D Team Mobile Devices | "Any ideas, John?"
SUSE LINUX Products GmbH, N?rnberg | "Well, surrounding them's out."

This footer brought to you by insane German lawmakers:
SUSE Linux Products GmbH, GF: Markus Rex, HRB 16746 (AG N?rnberg)


2008-09-30 10:29:21

by Marcel Holtmann

[permalink] [raw]
Subject: Re: bluez-gnome: how to turn adapter off?

Hi Bastien,

> > > > Ok, so I remembered wrong ;-) How about adding a "disable this adapter"
> > > > option? Would a patch that implements this be welcome?
> > >
> > > I'd like a patch implementing HAL killswitching. DannyK can explain to
> > > you how that's supposed to work.
> > >
> > > I saw this as a single toggle menu item in the right-click, allowing you
> > > to enable/disable the main Bluetooth adapter on laptops. If there's a
> > > killswitch present, and there's 0 or 1 adapter (and the adapter matches
> > > the expected device) then the Bluetooth icon would shown grayed out.
> >
> > so I added killswitch support to bluetooth-properties. Works pretty good
> > enough for me.
> >
> > I like having a grayed out icon, but for that to work, we first need to
> > have some who actually draws it in all resolutions for us.
>
> GTK+ doesn't use separate pixbufs for those type of icons, but generates
> them on the fly with gdk_pixbuf_saturate_and_pixelate().
>
> new_pixbuf = gdk_pixbuf_copy (original);
> gdk_pixbuf_saturate_and_pixelate(original, new_pixbuf, 0.8, TRUE);
>
> And then set "new_pixbuf" as the image for the status icon. This will be
> a bit convoluted in the actual code as you're using icon names, and we'd
> need to 1) know whether we have a killswitch, and whether it's enabled
> and 2) modify the status icon to use the pixbuf.

as long as we have to poll the killswitch from HAL, this is never going
to get merged into bluez-gnome. I want async notifications.

Regards

Marcel



2008-09-30 10:17:21

by Bastien Nocera

[permalink] [raw]
Subject: Re: bluez-gnome: how to turn adapter off?

On Tue, 2008-09-30 at 05:18 +0200, Marcel Holtmann wrote:
> Hi Bastien,
>
> > > Ok, so I remembered wrong ;-) How about adding a "disable this adapter"
> > > option? Would a patch that implements this be welcome?
> >
> > I'd like a patch implementing HAL killswitching. DannyK can explain to
> > you how that's supposed to work.
> >
> > I saw this as a single toggle menu item in the right-click, allowing you
> > to enable/disable the main Bluetooth adapter on laptops. If there's a
> > killswitch present, and there's 0 or 1 adapter (and the adapter matches
> > the expected device) then the Bluetooth icon would shown grayed out.
>
> so I added killswitch support to bluetooth-properties. Works pretty good
> enough for me.
>
> I like having a grayed out icon, but for that to work, we first need to
> have some who actually draws it in all resolutions for us.

GTK+ doesn't use separate pixbufs for those type of icons, but generates
them on the fly with gdk_pixbuf_saturate_and_pixelate().

new_pixbuf = gdk_pixbuf_copy (original);
gdk_pixbuf_saturate_and_pixelate(original, new_pixbuf, 0.8, TRUE);

And then set "new_pixbuf" as the image for the status icon. This will be
a bit convoluted in the actual code as you're using icon names, and we'd
need to 1) know whether we have a killswitch, and whether it's enabled
and 2) modify the status icon to use the pixbuf.

2008-09-30 03:18:54

by Marcel Holtmann

[permalink] [raw]
Subject: Re: bluez-gnome: how to turn adapter off?

Hi Bastien,

> > Ok, so I remembered wrong ;-) How about adding a "disable this adapter"
> > option? Would a patch that implements this be welcome?
>
> I'd like a patch implementing HAL killswitching. DannyK can explain to
> you how that's supposed to work.
>
> I saw this as a single toggle menu item in the right-click, allowing you
> to enable/disable the main Bluetooth adapter on laptops. If there's a
> killswitch present, and there's 0 or 1 adapter (and the adapter matches
> the expected device) then the Bluetooth icon would shown grayed out.

so I added killswitch support to bluetooth-properties. Works pretty good
enough for me.

I like having a grayed out icon, but for that to work, we first need to
have some who actually draws it in all resolutions for us.

Regards

Marcel



2008-09-29 23:44:42

by Marcel Holtmann

[permalink] [raw]
Subject: Re: bluez-gnome: how to turn adapter off?

Hi Bastien,

> > Ok, so I remembered wrong ;-) How about adding a "disable this adapter"
> > option? Would a patch that implements this be welcome?
>
> I'd like a patch implementing HAL killswitching. DannyK can explain to
> you how that's supposed to work.
>
> I saw this as a single toggle menu item in the right-click, allowing you
> to enable/disable the main Bluetooth adapter on laptops. If there's a
> killswitch present, and there's 0 or 1 adapter (and the adapter matches
> the expected device) then the Bluetooth icon would shown grayed out.
>
> This would probably also require more work like this:
> <match key="@info.parent:system.product" contains="VGN-S1XP">
> <merge key="killswitch.expected_usb_vendor_id"
> type="int">0x44e</merge>
> <merge key="killswitch.expected_usb_product_id"
> type="int">0x3007</merge>
> </match>

can we not just reference the UDI the killswitch belongs to. The vendor
and product things can be misleading.

Regards

Marcel



2008-09-29 23:43:08

by Marcel Holtmann

[permalink] [raw]
Subject: Re: bluez-gnome: how to turn adapter off?

Hi Stefan,

> >> I now got several bugreports from people searching for the button to turn
> >> their bluetooth device off in the bluetooth-applet. I seem to remember that
> >> there was the setting "off" (in addition to "Hidden", "Always visible",
> >> "Temporary visible") in previous versions. So what's the rationale for
> >> removing it (users seem to expect to find it there)? And if I remember
> >> incorrectly: could we place such a button there?
> >
> > There was never an "off" switch. There was:
> > - Other devices can connect
> > - Visible and connectable for other devices
> > - Limited discoverable and connectable
> >
> > The last 2 were folded into a single option.
>
> Ok, so I remembered wrong ;-) How about adding a "disable this adapter"
> option? Would a patch that implements this be welcome?

you might have been right, because some distros shipped a patch to add
an "off" selection to it. This wouldn't have done anything useful on the
desktop, but they did it without knowing what they are doing.

Regards

Marcel



2008-09-29 20:39:56

by Bastien Nocera

[permalink] [raw]
Subject: Re: bluez-gnome: how to turn adapter off?

On Mon, 2008-09-29 at 18:20 +0200, Stefan Seyfried wrote:
<snip>
> Ok, so I remembered wrong ;-) How about adding a "disable this adapter"
> option? Would a patch that implements this be welcome?

I'd like a patch implementing HAL killswitching. DannyK can explain to
you how that's supposed to work.

I saw this as a single toggle menu item in the right-click, allowing you
to enable/disable the main Bluetooth adapter on laptops. If there's a
killswitch present, and there's 0 or 1 adapter (and the adapter matches
the expected device) then the Bluetooth icon would shown grayed out.

This would probably also require more work like this:
<match key="@info.parent:system.product" contains="VGN-S1XP">
<merge key="killswitch.expected_usb_vendor_id"
type="int">0x44e</merge>
<merge key="killswitch.expected_usb_product_id"
type="int">0x3007</merge>
</match>

To make sure the killswitch controls (or tries to control) the correct
adapter.

Cheers


2008-09-29 16:20:31

by Stefan Seyfried

[permalink] [raw]
Subject: Re: bluez-gnome: how to turn adapter off?

Bastien Nocera wrote:
> On Mon, 2008-09-29 at 17:59 +0200, Stefan Seyfried wrote:
>> Hi,
>>
>> I now got several bugreports from people searching for the button to turn
>> their bluetooth device off in the bluetooth-applet. I seem to remember that
>> there was the setting "off" (in addition to "Hidden", "Always visible",
>> "Temporary visible") in previous versions. So what's the rationale for
>> removing it (users seem to expect to find it there)? And if I remember
>> incorrectly: could we place such a button there?
>
> There was never an "off" switch. There was:
> - Other devices can connect
> - Visible and connectable for other devices
> - Limited discoverable and connectable
>
> The last 2 were folded into a single option.

Ok, so I remembered wrong ;-) How about adding a "disable this adapter"
option? Would a patch that implements this be welcome?
--
Stefan Seyfried
R&D Team Mobile Devices | "Any ideas, John?"
SUSE LINUX Products GmbH, N?rnberg | "Well, surrounding them's out."

This footer brought to you by insane German lawmakers:
SUSE Linux Products GmbH, GF: Markus Rex, HRB 16746 (AG N?rnberg)

2008-09-29 16:05:57

by Bastien Nocera

[permalink] [raw]
Subject: Re: bluez-gnome: how to turn adapter off?

On Mon, 2008-09-29 at 17:59 +0200, Stefan Seyfried wrote:
> Hi,
>
> I now got several bugreports from people searching for the button to turn
> their bluetooth device off in the bluetooth-applet. I seem to remember that
> there was the setting "off" (in addition to "Hidden", "Always visible",
> "Temporary visible") in previous versions. So what's the rationale for
> removing it (users seem to expect to find it there)? And if I remember
> incorrectly: could we place such a button there?

There was never an "off" switch. There was:
- Other devices can connect
- Visible and connectable for other devices
- Limited discoverable and connectable

The last 2 were folded into a single option.