Skip to contentSkip to conversation

Removing features

Bluez-devel Bastien Nocera 2 participants 5 messages Dec 23, 2006 – Dec 24, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Heya,

I was taking a look at the properties and applet in the bluez-gnome tree, and thought that some things could be changed to make it more GNOME-ish.

I've attached an obviously unfinished patch that would remove the "Adapter class" combobox from the properties capplet, and have the applet setup the class depending on the "system.formfactor" property given out by HAL[1].

If this sort of thing would accepted into the tree, I have some more patches lined up (including finishing up this one).

Cheers

[1]: See the output of "hal-device | grep formfactor" to check your machine

Signature · 1 line
Bastien Nocera <[email protected]>

Index: configure.in
===================================================================
RCS file: /cvsroot/bluez/gnome/configure.in,v
retrieving revision 1.30

configure.in +6 -0
diff -u -p -u -p -r1.30 configure.in
@@ -57,6 +57,12 @@ PKG_CHECK_MODULES(NOTIFY, libnotify >= 0
 AC_SUBST(NOTIFY_CFLAGS)
 AC_SUBST(NOTIFY_LIBS)
 
+PKG_CHECK_MODULES(HAL, hal >= 0.5.8, [
+	AC_DEFINE(HAVE_HAL, 1, [Define to 1 if you have HAL support.])
+], AC_MSG_RESULT(no))
+AC_SUBST(HAL_CFLAGS)
+AC_SUBST(HAL_LIBS)
+
 PKG_CHECK_MODULES(OPENOBEX, libopenobex-glib >= 1.4, dummy=yes, AC_MSG_RESULT(no))
 AC_SUBST(OPENOBEX_CFLAGS)
 AC_SUBST(OPENOBEX_LIBS)

Index: applet/main.c
===================================================================
RCS file: /cvsroot/bluez/gnome/applet/main.c,v
retrieving revision 1.49

main.c +13 -0
diff -u -p -u -p -r1.49 main.c
@@ -935,6 +935,15 @@ static int attached_adapters(void)
 	return count;
 }
 
+#ifdef HAVE_HAL
+static void
+class_setup (struct adapter_data *adapter)
+{
+	//FIXME
+	g_message ("setup the class from the system.formfactor");
+}
+#endif
+
 static void add_adapter(const char *path)
 {
 	GList *list;
@@ -956,6 +965,10 @@ static void add_adapter(const char *path
 	adapter->path = g_strdup(path);
 	adapter->attached = 1;
 
+#ifdef HAVE_HAL
+	class_setup (adapter);
+#endif
+
 	adapter_list = g_list_append(adapter_list, adapter);
 
 	object = dbus_g_proxy_new_for_name(conn, "org.bluez",

Index: properties/main.c
===================================================================
RCS file: /cvsroot/bluez/gnome/properties/main.c,v retrieving revision 1.24

main.c +51 -38

115 lines not on this page · raw message

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#1 lore raw

Hi Bastien,

Quoted 11 lines

I was taking a look at the properties and applet in the bluez-gnome tree, and thought that some things could be changed to make it more GNOME-ish.

I've attached an obviously unfinished patch that would remove the "Adapter class" combobox from the properties capplet, and have the applet setup the class depending on the "system.formfactor" property given out by HAL[1].

If this sort of thing would accepted into the tree, I have some more patches lined up (including finishing up this one).

actually I am a little bit against a compile time option against HAL. This should be a runtime check if HAL is available.

The other thing is that this doesn't really belong into bluetooth-applet and should be moved directly into hcid. However this might give some crazy dependency chain.

I am open for suggestions here.

Regards

Marcel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#2 lore raw
Quoted 11 lines · Marcel Holtmann

Hi Bastien,

Quoted 9 lines

I was taking a look at the properties and applet in the bluez-gnome tree, and thought that some things could be changed to make it more GNOME-ish.

I've attached an obviously unfinished patch that would remove the "Adapter class" combobox from the properties capplet, and have the applet setup the class depending on the "system.formfactor" property given out by HAL[1].

Quoted 5 lines
Quoted 2 lines

If this sort of thing would accepted into the tree, I have some more patches lined up (including finishing up this one).

actually I am a little bit against a compile time option against HAL. This should be a runtime check if HAL is available.

I can certainly make it both a compile-time and run-time check. Ie. if HAL is available at compile-time, but not at run-time, show the combobox.

Did you want to make HAL a hard dependency, or should it be optional as now?

I'll finish that up now.

Quoted 3 lines

The other thing is that this doesn't really belong into bluetooth-applet and should be moved directly into hcid. However this might give some crazy dependency chain.

I don't think such a policy should be in hcid, but rather in the desktop bits. (Currently, the bluetooth daemons are started a long time before HAL is, at least in Fedora, and Matthew Garrett's HAL bits need the bluetooth daemon running, so, yeah, crazy deps).

Cheers

Signature · 12 lines
Bastien Nocera <[email protected]>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
maintainer
#3 lore raw

Hi Bastien,

Quoted 15 lines
Quoted 9 lines
Quoted 9 lines

I was taking a look at the properties and applet in the bluez-gnome tree, and thought that some things could be changed to make it more GNOME-ish.

I've attached an obviously unfinished patch that would remove the "Adapter class" combobox from the properties capplet, and have the applet setup the class depending on the "system.formfactor" property given out by HAL[1].

Quoted 5 lines
Quoted 2 lines

If this sort of thing would accepted into the tree, I have some more patches lined up (including finishing up this one).

actually I am a little bit against a compile time option against HAL. This should be a runtime check if HAL is available.

Quoted 8 lines

I can certainly make it both a compile-time and run-time check. Ie. if HAL is available at compile-time, but not at run-time, show the combobox.

Did you want to make HAL a hard dependency, or should it be optional as now?

I'll finish that up now.

do we need something? I thought they are D-Bus calls only.

Quoted 8 lines
Quoted 3 lines

The other thing is that this doesn't really belong into bluetooth-applet and should be moved directly into hcid. However this might give some crazy dependency chain.

I don't think such a policy should be in hcid, but rather in the desktop bits. (Currently, the bluetooth daemons are started a long time before HAL is, at least in Fedora, and Matthew Garrett's HAL bits need the bluetooth daemon running, so, yeah, crazy deps).

In general you are right, but tell that to the Bluetooth specification. The class of device is really a per adapter thing and not a per user thing unless we can assign specific hardware only to one particular user.

Regards

Marcel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#4 lore raw

Hey Marcel,

Quoted 1 line · Marcel Holtmann

Hi Bastien,

<snip>

Quoted 6 lines
Quoted 4 lines

Did you want to make HAL a hard dependency, or should it be optional as now?

I'll finish that up now.

do we need something? I thought they are D-Bus calls only.

Yep, libhal. Reimplementing the query functions, etc. would be a PITA. See attached patch.

Quoted 9 lines
Quoted 8 lines
Quoted 3 lines

The other thing is that this doesn't really belong into bluetooth-applet and should be moved directly into hcid. However this might give some crazy dependency chain.

I don't think such a policy should be in hcid, but rather in the desktop bits. (Currently, the bluetooth daemons are started a long time before HAL is, at least in Fedora, and Matthew Garrett's HAL bits need the bluetooth daemon running, so, yeah, crazy deps).

Quoted 4 lines

In general you are right, but tell that to the Bluetooth specification. The class of device is really a per adapter thing and not a per user thing unless we can assign specific hardware only to one particular user.

I understand that. But hcid can be run on other types of Linux devices, which wouldn't have HAL available, or need more flexibility than what the bluez GNOME applets and properties might allow. As the properties and applet are integrated together, it makes sense to have them rely on each other.

As for the Bluetooth specs saying there can only be one class per adapter, I don't see how that's different from the properties allowing different users to set a different visible name for the adapter. Similar problem to users having different power preferences with gnome-power-manager, or network settings with NetworkManager. This is something to revisit when ConsoleKit reaches maturity.

I hope you like the attached patch.

Cheers (and merry Christmas ;)

Signature · 1 line
Bastien Nocera <[email protected]>

Index: configure.in
===================================================================
RCS file: /cvsroot/bluez/gnome/configure.in,v
retrieving revision 1.30

configure.in +6 -0
diff -u -p -u -p -r1.30 configure.in
@@ -57,6 +57,12 @@ PKG_CHECK_MODULES(NOTIFY, libnotify >= 0
 AC_SUBST(NOTIFY_CFLAGS)
 AC_SUBST(NOTIFY_LIBS)
 
+PKG_CHECK_MODULES(HAL, hal >= 0.5.8, [
+	AC_DEFINE(HAVE_HAL, 1, [Define to 1 if you have HAL support.])
+], AC_MSG_RESULT(no))
+AC_SUBST(HAL_CFLAGS)
+AC_SUBST(HAL_LIBS)
+
 PKG_CHECK_MODULES(OPENOBEX, libopenobex-glib >= 1.4, dummy=yes, AC_MSG_RESULT(no))
 AC_SUBST(OPENOBEX_CFLAGS)
 AC_SUBST(OPENOBEX_LIBS)

Index: applet/Makefile.am
===================================================================
RCS file: /cvsroot/bluez/gnome/applet/Makefile.am,v retrieving revision 1.14

Makefile.am +2 -2
diff -u -p -u -p -r1.14 Makefile.am
@@ -3,9 +3,9 @@ bin_PROGRAMS = bluetooth-applet
 
 bluetooth_applet_SOURCES = main.c
 
-bluetooth_applet_LDADD = @NOTIFY_LIBS@ @GTK_LIBS@ @GCONF_LIBS@ @DBUS_LIBS@ $(top_builddir)/compat/libcompat.a
+bluetooth_applet_LDADD = @NOTIFY_LIBS@ @GTK_LIBS@ @GCONF_LIBS@ @DBUS_LIBS@ @HAL_LIBS@ $(top_builddir)/compat/libcompat.a
 
-AM_CFLAGS = @DBUS_CFLAGS@ @GCONF_CFLAGS@ @GTK_CFLAGS@ @NOTIFY_CFLAGS@
+AM_CFLAGS = @DBUS_CFLAGS@ @GCONF_CFLAGS@ @GTK_CFLAGS@ @NOTIFY_CFLAGS@ @HAL_CFLAGS@
 
 INCLUDES = -I$(top_srcdir)/compat
 

Index: applet/main.c
===================================================================
RCS file: /cvsroot/bluez/gnome/applet/main.c,v
retrieving revision 1.49

main.c +82 -0

100 lines not on this page · raw message

Index: properties/Makefile.am
===================================================================
RCS file: /cvsroot/bluez/gnome/properties/Makefile.am,v retrieving revision 1.6

Makefile.am +2 -2
diff -u -p -u -p -r1.6 Makefile.am
@@ -3,10 +3,10 @@ bin_PROGRAMS = bluetooth-properties
 
 bluetooth_properties_SOURCES = main.c
 
-bluetooth_properties_LDADD = @GTK_LIBS@ @GCONF_LIBS@ @DBUS_LIBS@ \
+bluetooth_properties_LDADD = @GTK_LIBS@ @GCONF_LIBS@ @DBUS_LIBS@ @HAL_LIBS@ \
 				$(top_builddir)/common/libcommon.a
 
-AM_CFLAGS = @DBUS_CFLAGS@ @GCONF_CFLAGS@ @GTK_CFLAGS@
+AM_CFLAGS = @DBUS_CFLAGS@ @GCONF_CFLAGS@ @GTK_CFLAGS@ @HAL_CFLAGS@
 
 desktopdir = $(datadir)/applications
 

Index: properties/main.c
===================================================================
RCS file: /cvsroot/bluez/gnome/properties/main.c,v retrieving revision 1.24

main.c +103 -42

207 lines not on this page · raw message

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel