gnome-bluetooth r435 - trunk/applet



Author: hadess
Date: Tue Mar  3 15:53:46 2009
New Revision: 435
URL: http://svn.gnome.org/viewvc/gnome-bluetooth?rev=435&view=rev

Log:
Add some killswitch support

Set the icon to disabled when there are no adapters, and,
drumroll, and we have a killswitch.



Modified:
   trunk/applet/main.c

Modified: trunk/applet/main.c
==============================================================================
--- trunk/applet/main.c	(original)
+++ trunk/applet/main.c	Tue Mar  3 15:53:46 2009
@@ -34,6 +34,7 @@
 
 #include <bluetooth-client.h>
 #include <bluetooth-chooser.h>
+#include <bluetooth-killswitch.h>
 
 #include "notify.h"
 #include "agent.h"
@@ -55,6 +56,7 @@
 #define PREF_ICON_POLICY	PREF_DIR "/icon_policy"
 
 static GConfClient* gconf;
+static BluetoothKillswitch *killswitch = NULL;
 
 static GtkWidget *menuitem_setup = NULL;
 static GtkWidget *menuitem_sendto = NULL;
@@ -320,16 +322,17 @@
 
 static void update_icon_visibility()
 {
+	if (num_adapters_powered == 0)
+		set_icon (FALSE);
+	else
+		set_icon (TRUE);
+
 	if (icon_policy == ICON_POLICY_NEVER)
 		hide_icon();
 	else if (icon_policy == ICON_POLICY_ALWAYS)
 		show_icon();
 	else if (icon_policy == ICON_POLICY_PRESENT) {
-		if (num_adapters_powered == 0)
-			set_icon (FALSE);
-		else
-			set_icon (TRUE);
-		if (num_adapters_present > 0)
+		if (num_adapters_present > 0 || killswitch != NULL)
 			show_icon();
 		else
 			hide_icon();
@@ -444,6 +447,12 @@
 
 	gtk_window_set_default_icon_name("bluetooth");
 
+	killswitch = bluetooth_killswitch_new ();
+	if (bluetooth_killswitch_has_killswitches (killswitch) == FALSE) {
+		g_object_unref (killswitch);
+		killswitch = NULL;
+	}
+
 	client = bluetooth_client_new();
 
 	adapter_model = bluetooth_client_get_adapter_model(client);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]