Re: bluez-gnome: how to turn adapter off?

Bastien Nocera
2008-09-30T10:17:21Z

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.