* [Bluez-devel] bluez-gnome: No GUI way to switch from "off" mode
@ 2007-04-30 15:16 Stanislav Brabec
2007-04-30 19:38 ` Daniel Gollub
0 siblings, 1 reply; 5+ messages in thread
From: Stanislav Brabec @ 2007-04-30 15:16 UTC (permalink / raw)
To: bluez-devel
Hallo.
I am just curious, whether no chance to enable Bluetooth from the GNOME
Bluetooth is deliberate or not. I guess, that it is not deliberate.
How to reproduce:
1. apitest SetMode off
2. Run bluetooth-properties.
3. Mode selection is completely shaded out and there is no way to enable
Bluetooth.
Proposed change:
- Convert "Mode of operation" radio buttons to checkboxes.
- "Other devices can connect":
Will never be shaded out.
If it is off: Mode is off.
If it is on, than "Visible and connectable for other devices" is
unshaded.
- "Visible and connectable for other devices":
If it is unshaded and off: Mode is connectable
If it is unshaded and on: Mode is discoverable and "Make adapter
invisible after" is unshaded.
Is it more acceptable behavior?
Reference:
Bluetooth in GNOME does not work in default installation
https://bugzilla.novell.com/show_bug.cgi?id=3D226137
-- =
Best Regards / S pozdravem,
Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o. e-mail: sbrabec@suse.cz
Lihovarsk=E1 1060/12 tel: +420 284 028 966
190 00 Praha 9 fax: +420 284 028 951
Czech Republic http://www.suse.cz/
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bluez-devel] bluez-gnome: No GUI way to switch from "off" mode
2007-04-30 15:16 [Bluez-devel] bluez-gnome: No GUI way to switch from "off" mode Stanislav Brabec
@ 2007-04-30 19:38 ` Daniel Gollub
2007-05-03 17:25 ` Stanislav Brabec
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Gollub @ 2007-04-30 19:38 UTC (permalink / raw)
To: bluez-devel
[-- Attachment #1: Type: text/plain, Size: 330 bytes --]
On Monday 30 April 2007 17:16:41 Stanislav Brabec wrote:
> Hallo.
>
> I am just curious, whether no chance to enable Bluetooth from the GNOME
> Bluetooth is deliberate or not. I guess, that it is not deliberate.
Not quite sure if this was intended or not ... attachted is the suggested
change by Stanislav.
best regards,
Daniel
[-- Attachment #2: bluez-gnome_modeoff.diff --]
[-- Type: text/x-diff, Size: 3205 bytes --]
? properties/.deps
? properties/Makefile
? properties/Makefile.in
? properties/bluetooth-properties
? properties/bluetooth-properties.desktop
Index: properties/main.c
===================================================================
RCS file: /cvsroot/bluez/gnome/properties/main.c,v
retrieving revision 1.33
diff -u -p -r1.33 main.c
--- properties/main.c 26 Feb 2007 10:46:50 -0000 1.33
+++ properties/main.c 30 Apr 2007 19:37:59 -0000
@@ -757,6 +757,7 @@ struct adapter_data {
char *path;
int attached;
GtkWidget *child;
+ GtkWidget *button_off;
GtkWidget *button_connect;
GtkWidget *button_visible;
GtkWidget *timeout_label;
@@ -817,6 +818,9 @@ static void mode_callback(GtkWidget *but
} else if (button == adapter->button_visible) {
sensitive = TRUE;
mode = "discoverable";
+ } else if (button == adapter->button_off) {
+ sensitive = FALSE;
+ mode = "off";
} else
return;
@@ -981,14 +985,26 @@ static void create_adapter(struct adapte
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
button = gtk_radio_button_new_with_label(group,
- _("Other devices can connect"));
+ _("Off. No devices can connect"));
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(button));
gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
if (mode && !strcmp(mode, "off"))
- gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
+
+ adapter->button_off = button;
+
+ g_signal_connect(G_OBJECT(button), "toggled",
+ G_CALLBACK(mode_callback), adapter);
+
+ button = gtk_radio_button_new_with_label(group,
+ _("Other devices can connect"));
+
+ group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(button));
+
+ gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
if (mode && !strcmp(mode, "connectable"))
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
@@ -1005,9 +1021,6 @@ static void create_adapter(struct adapte
gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
- if (mode && !strcmp(mode, "off"))
- gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE);
-
if (mode && !strcmp(mode, "discoverable"))
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
@@ -1125,15 +1138,14 @@ static void mode_changed(DBusGProxy *obj
if (list && list->data) {
struct adapter_data *adapter = list->data;
GtkWidget *button = NULL;
- gboolean sensitive;
+ gboolean sensitive = TRUE;
if (!adapter->attached)
return;
- sensitive = strcmp(mode, "off") ? TRUE : FALSE;
-
gtk_widget_set_sensitive(GTK_WIDGET(adapter->button_connect), sensitive);
gtk_widget_set_sensitive(GTK_WIDGET(adapter->button_visible), sensitive);
+ gtk_widget_set_sensitive(GTK_WIDGET(adapter->button_off), sensitive);
if (!strcmp(mode, "connectable")) {
sensitive = FALSE;
@@ -1141,6 +1153,9 @@ static void mode_changed(DBusGProxy *obj
} else if (!strcmp(mode, "discoverable")) {
sensitive = TRUE;
button = adapter->button_visible;
+ } else if (!strcmp(mode, "off")) {
+ sensitive = FALSE;
+ button = adapter->button_off;
}
gtk_widget_set_sensitive(GTK_WIDGET(adapter->timeout_label), sensitive);
[-- Attachment #3: Type: text/plain, Size: 286 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
[-- Attachment #4: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bluez-devel] bluez-gnome: No GUI way to switch from "off" mode
2007-04-30 19:38 ` Daniel Gollub
@ 2007-05-03 17:25 ` Stanislav Brabec
2007-05-03 23:32 ` Bastien Nocera
0 siblings, 1 reply; 5+ messages in thread
From: Stanislav Brabec @ 2007-05-03 17:25 UTC (permalink / raw)
To: BlueZ development
[-- Attachment #1: Type: text/plain, Size: 725 bytes --]
Daniel Gollub wrote:
> Not quite sure if this was intended or not ... attachted is the suggested
> change by Stanislav.
Here is an alternative patch. The same improvement but different GUI
(see attached screenshots). I have changed second checkbox label.
Please decide what looks more intuitive and check-in.
--
Best Regards / S pozdravem,
Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o. e-mail: sbrabec@suse.cz
Lihovarská 1060/12 tel: +420 284 028 966
190 00 Praha 9 fax: +420 284 028 951
Czech Republic http://www.suse.cz/
[-- Attachment #2: gnome-off-support.patch --]
[-- Type: text/x-patch, Size: 6434 bytes --]
Index: properties/main.c
===================================================================
RCS file: /cvsroot/bluez/gnome/properties/main.c,v
retrieving revision 1.33
diff -u -r1.33 main.c
--- properties/main.c 26 Feb 2007 10:46:50 -0000 1.33
+++ properties/main.c 3 May 2007 17:21:40 -0000
@@ -757,8 +757,8 @@
char *path;
int attached;
GtkWidget *child;
- GtkWidget *button_connect;
- GtkWidget *button_visible;
+ GtkWidget *checkbox_connect;
+ GtkWidget *checkbox_visible;
GtkWidget *timeout_label;
GtkWidget *timeout_scale;
GtkWidget *entry;
@@ -801,33 +801,24 @@
return strcmp(adapter->path, path);
}
-static void mode_callback(GtkWidget *button, gpointer user_data)
+static void mode_callback(GtkWidget *checkbox, gpointer user_data)
{
struct adapter_data *adapter = user_data;
const char *mode;
DBusGProxy *object;
- gboolean sensitive;
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)) == FALSE)
- return;
-
- if (button == adapter->button_connect) {
- sensitive = FALSE;
- mode = "connectable";
- } else if (button == adapter->button_visible) {
- sensitive = TRUE;
+ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(adapter->checkbox_connect)) == FALSE)
+ mode = "off";
+ else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(adapter->checkbox_visible)) == TRUE)
mode = "discoverable";
- } else
- return;
+ else
+ mode = "connectable";
object = dbus_g_proxy_new_for_name(conn, "org.bluez",
adapter->path, "org.bluez.Adapter");
dbus_g_proxy_call(object, "SetMode", NULL,
G_TYPE_STRING, mode, G_TYPE_INVALID, G_TYPE_INVALID);
-
- gtk_widget_set_sensitive(GTK_WIDGET(adapter->timeout_label), sensitive);
- gtk_widget_set_sensitive(GTK_WIDGET(adapter->timeout_scale), sensitive);
}
static void scale_callback(GtkWidget *scale, gpointer user_data)
@@ -933,13 +924,13 @@
GtkWidget *vbox;
GtkWidget *label;
- GtkWidget *button;
+ GtkWidget *checkbox;
GtkWidget *scale;
GtkWidget *entry;
GtkWidget *combobox;
- GSList *group = NULL;
gdouble value;
gint index;
+ gboolean is_not_off = FALSE, is_discoverable = FALSE;
object = dbus_g_proxy_new_for_name(conn, "org.bluez",
adapter->path, "org.bluez.Adapter");
@@ -978,42 +969,38 @@
label = create_label(_("Mode of operation"));
+ if (!strcmp(mode, "connectable")) {
+ is_not_off = TRUE;
+ } else if (!strcmp(mode, "discoverable")) {
+ is_not_off = TRUE;
+ is_discoverable = TRUE;
+ }
+
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
- button = gtk_radio_button_new_with_label(group,
+ checkbox = gtk_check_button_new_with_label(
_("Other devices can connect"));
- group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(button));
+ gtk_box_pack_start(GTK_BOX(vbox), checkbox, FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox), is_not_off);
- if (mode && !strcmp(mode, "off"))
- gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE);
+ adapter->checkbox_connect = checkbox;
- if (mode && !strcmp(mode, "connectable"))
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
-
- adapter->button_connect = button;
-
- g_signal_connect(G_OBJECT(button), "toggled",
+ g_signal_connect(G_OBJECT(checkbox), "toggled",
G_CALLBACK(mode_callback), adapter);
- button = gtk_radio_button_new_with_label(group,
- _("Visible and connectable for other devices"));
-
- group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(button));
+ checkbox = gtk_check_button_new_with_label(
+ _("Visible for other devices"));
- gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), checkbox, FALSE, FALSE, 0);
- if (mode && !strcmp(mode, "off"))
- gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE);
+ gtk_widget_set_sensitive(GTK_WIDGET(checkbox), is_not_off);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox), is_discoverable);
- if (mode && !strcmp(mode, "discoverable"))
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
+ adapter->checkbox_visible = checkbox;
- adapter->button_visible = button;
-
- g_signal_connect(G_OBJECT(button), "toggled",
+ g_signal_connect(G_OBJECT(checkbox), "toggled",
G_CALLBACK(mode_callback), adapter);
label = gtk_label_new(_("Make adapter invisible after:"));
@@ -1053,10 +1040,8 @@
g_signal_connect(G_OBJECT(scale), "format-value",
G_CALLBACK(format_callback), NULL);
- if (mode && strcmp(mode, "discoverable")) {
- gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE);
- gtk_widget_set_sensitive(GTK_WIDGET(scale), FALSE);
- }
+ gtk_widget_set_sensitive(GTK_WIDGET(label), is_discoverable);
+ gtk_widget_set_sensitive(GTK_WIDGET(scale), is_discoverable);
label = create_label(_("\nAdapter name"));
@@ -1124,32 +1109,26 @@
list = g_list_find_custom(adapter_list, path, adapter_compare);
if (list && list->data) {
struct adapter_data *adapter = list->data;
- GtkWidget *button = NULL;
- gboolean sensitive;
+ gboolean is_not_off = FALSE, is_discoverable = FALSE;
if (!adapter->attached)
return;
- sensitive = strcmp(mode, "off") ? TRUE : FALSE;
-
- gtk_widget_set_sensitive(GTK_WIDGET(adapter->button_connect), sensitive);
- gtk_widget_set_sensitive(GTK_WIDGET(adapter->button_visible), sensitive);
-
if (!strcmp(mode, "connectable")) {
- sensitive = FALSE;
- button = adapter->button_connect;
+ is_not_off = TRUE;
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(adapter->checkbox_visible), FALSE);
} else if (!strcmp(mode, "discoverable")) {
- sensitive = TRUE;
- button = adapter->button_visible;
+ is_not_off = TRUE;
+ is_discoverable = TRUE;
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(adapter->checkbox_visible), TRUE);
+ } else {
+ /* mode == "off" or unknown */
}
- gtk_widget_set_sensitive(GTK_WIDGET(adapter->timeout_label), sensitive);
- gtk_widget_set_sensitive(GTK_WIDGET(adapter->timeout_scale), sensitive);
-
- if (!button)
- return;
-
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(adapter->checkbox_connect), is_not_off);
+ gtk_widget_set_sensitive(GTK_WIDGET(adapter->checkbox_visible), is_not_off);
+ gtk_widget_set_sensitive(GTK_WIDGET(adapter->timeout_label), is_discoverable);
+ gtk_widget_set_sensitive(GTK_WIDGET(adapter->timeout_scale), is_discoverable);
}
}
[-- Attachment #3: new_patch.png --]
[-- Type: image/png, Size: 20643 bytes --]
[-- Attachment #4: old_patch.png --]
[-- Type: image/png, Size: 23172 bytes --]
[-- Attachment #5: Type: text/plain, Size: 286 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
[-- Attachment #6: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bluez-devel] bluez-gnome: No GUI way to switch from "off" mode
2007-05-03 17:25 ` Stanislav Brabec
@ 2007-05-03 23:32 ` Bastien Nocera
2007-05-04 6:45 ` Marcel Holtmann
0 siblings, 1 reply; 5+ messages in thread
From: Bastien Nocera @ 2007-05-03 23:32 UTC (permalink / raw)
To: BlueZ development
On Thu, 2007-05-03 at 19:25 +0200, Stanislav Brabec wrote:
> Daniel Gollub wrote:
>
> > Not quite sure if this was intended or not ... attachted is the suggested
> > change by Stanislav.
>
> Here is an alternative patch. The same improvement but different GUI
> (see attached screenshots). I have changed second checkbox label.
>
> Please decide what looks more intuitive and check-in.
This should optionally (ie. if HAL is available at compile and run-time)
use the new HAL API that allows to enable/disable builtin Bluetooth
devices completely (ie. not just not configured to accept anything, but
completely disabled, unplugged, and not consuming one bit of power).
The HAL API is pretty straight forward:
http://people.freedesktop.org/~david/hal-spec/hal-spec.html#device-properties-killswitch
and
http://people.freedesktop.org/~david/hal-spec/hal-spec.html#interface-device-killswitch
It's implemented for Sony and Dell laptops, with another opened RFE for
IBM laptops:
http://bugs.freedesktop.org/show_bug.cgi?id=10053
It should be dead-easy to implement for someone with access to an IBM
laptop (unlike me).
--
Bastien Nocera <hadess@hadess.net>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bluez-devel] bluez-gnome: No GUI way to switch from "off" mode
2007-05-03 23:32 ` Bastien Nocera
@ 2007-05-04 6:45 ` Marcel Holtmann
0 siblings, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2007-05-04 6:45 UTC (permalink / raw)
To: BlueZ development
Hi Bastien,
> > > Not quite sure if this was intended or not ... attachted is the suggested
> > > change by Stanislav.
> >
> > Here is an alternative patch. The same improvement but different GUI
> > (see attached screenshots). I have changed second checkbox label.
> >
> > Please decide what looks more intuitive and check-in.
>
> This should optionally (ie. if HAL is available at compile and run-time)
> use the new HAL API that allows to enable/disable builtin Bluetooth
> devices completely (ie. not just not configured to accept anything, but
> completely disabled, unplugged, and not consuming one bit of power).
>
> The HAL API is pretty straight forward:
> http://people.freedesktop.org/~david/hal-spec/hal-spec.html#device-properties-killswitch
> and
> http://people.freedesktop.org/~david/hal-spec/hal-spec.html#interface-device-killswitch
>
> It's implemented for Sony and Dell laptops, with another opened RFE for
> IBM laptops:
> http://bugs.freedesktop.org/show_bug.cgi?id=10053
>
> It should be dead-easy to implement for someone with access to an IBM
> laptop (unlike me).
the off operation doesn't make any real sense for desktop system. It is
mainly there for embedded systems without HAL or where the kernel driver
has to put the device into deep-sleep mode.
An integration with HAL's killswitch is the correct way.
Regards
Marcel
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-05-04 6:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-30 15:16 [Bluez-devel] bluez-gnome: No GUI way to switch from "off" mode Stanislav Brabec
2007-04-30 19:38 ` Daniel Gollub
2007-05-03 17:25 ` Stanislav Brabec
2007-05-03 23:32 ` Bastien Nocera
2007-05-04 6:45 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).