gnome-bluetooth r613 - in trunk: applet common properties



Author: hadess
Date: Wed Apr 15 14:59:19 2009
New Revision: 613
URL: http://svn.gnome.org/viewvc/gnome-bluetooth?rev=613&view=rev

Log:
Change the killswitch state enum to match what's available in the kernel


Modified:
   trunk/applet/main.c
   trunk/common/bluetooth-killswitch.c
   trunk/common/bluetooth-killswitch.h
   trunk/properties/adapter.c

Modified: trunk/applet/main.c
==============================================================================
--- trunk/applet/main.c	(original)
+++ trunk/applet/main.c	Wed Apr 15 14:59:19 2009
@@ -167,7 +167,7 @@
 	active = GPOINTER_TO_INT (g_object_get_data (object, "bt-active"));
 	active = !active;
 	bluetooth_killswitch_set_state (killswitch,
-					active ? KILLSWITCH_STATE_NOT_KILLED : KILLSWITCH_STATE_KILLED);
+					active ? KILLSWITCH_STATE_UNBLOCKED : KILLSWITCH_STATE_SOFT_BLOCKED);
 	g_object_set_data (object, "bt-active", GINT_TO_POINTER (active));
 }
 
@@ -218,11 +218,11 @@
 		sensitive = FALSE;
 		label = NULL;
 		status_label = N_("Bluetooth: Unknown");
-	} else if (state == KILLSWITCH_STATE_KILLED) {
+	} else if (state == KILLSWITCH_STATE_SOFT_BLOCKED) {
 		label = N_("Turn On Bluetooth");
 		status_label = N_("Bluetooth: Off");
 		bstate = FALSE;
-	} else if (state == KILLSWITCH_STATE_NOT_KILLED) {
+	} else if (state == KILLSWITCH_STATE_UNBLOCKED) {
 		label = N_("Turn Off Bluetooth");
 		status_label = N_("Bluetooth: On");
 		bstate = TRUE;

Modified: trunk/common/bluetooth-killswitch.c
==============================================================================
--- trunk/common/bluetooth-killswitch.c	(original)
+++ trunk/common/bluetooth-killswitch.c	Wed Apr 15 14:59:19 2009
@@ -63,10 +63,10 @@
 {
 	switch (power) {
 	case 1: /* RFKILL_STATE_UNBLOCKED */
-		return KILLSWITCH_STATE_NOT_KILLED;
+		return KILLSWITCH_STATE_UNBLOCKED;
 	case 0: /* RFKILL_STATE_SOFT_BLOCKED */
 	case 2: /* RFKILL_STATE_HARD_BLOCKED */
-		return KILLSWITCH_STATE_KILLED;
+		return KILLSWITCH_STATE_SOFT_BLOCKED;
 	default:
 		g_warning ("Unknown power state %d, please file a bug at "PACKAGE_BUGREPORT, power);
 		return KILLSWITCH_STATE_UNKNOWN;
@@ -202,14 +202,14 @@
 	GList *l;
 
 	g_return_if_fail (BLUETOOTH_IS_KILLSWITCH (killswitch));
-	g_return_if_fail (state == KILLSWITCH_STATE_KILLED || state == KILLSWITCH_STATE_NOT_KILLED);
+	g_return_if_fail (state == KILLSWITCH_STATE_SOFT_BLOCKED || state == KILLSWITCH_STATE_UNBLOCKED);
 
 	priv = BLUETOOTH_KILLSWITCH_GET_PRIVATE (killswitch);
 
 	if (priv->num_remaining_answers > 0)
 		return;
 
-	value = (state == KILLSWITCH_STATE_NOT_KILLED);
+	value = (state == KILLSWITCH_STATE_UNBLOCKED);
 
 	for (l = priv->killswitches ; l ; l = l->next) {
 		BluetoothIndKillswitch *ind = l->data;
@@ -259,15 +259,15 @@
 	for (l = priv->killswitches ; l ; l = l->next) {
 		BluetoothIndKillswitch *ind = l->data;
 
-		if (ind->state == KILLSWITCH_STATE_KILLED) {
+		if (ind->state == KILLSWITCH_STATE_SOFT_BLOCKED) {
 			if (state == KILLSWITCH_STATE_UNKNOWN)
-				state = KILLSWITCH_STATE_KILLED;
-			if (state != KILLSWITCH_STATE_KILLED)
+				state = KILLSWITCH_STATE_SOFT_BLOCKED;
+			if (state != KILLSWITCH_STATE_SOFT_BLOCKED)
 				state = KILLSWITCH_STATE_MIXED;
 		} else {
 			if (state == KILLSWITCH_STATE_UNKNOWN)
-				state = KILLSWITCH_STATE_NOT_KILLED;
-			if (state != KILLSWITCH_STATE_NOT_KILLED)
+				state = KILLSWITCH_STATE_UNBLOCKED;
+			if (state != KILLSWITCH_STATE_UNBLOCKED)
 				state = KILLSWITCH_STATE_MIXED;
 		}
 	}

Modified: trunk/common/bluetooth-killswitch.h
==============================================================================
--- trunk/common/bluetooth-killswitch.h	(original)
+++ trunk/common/bluetooth-killswitch.h	Wed Apr 15 14:59:19 2009
@@ -31,8 +31,8 @@
 
 typedef enum {
 	KILLSWITCH_STATE_UNKNOWN = -1,
-	KILLSWITCH_STATE_KILLED = 0,
-	KILLSWITCH_STATE_NOT_KILLED,
+	KILLSWITCH_STATE_SOFT_BLOCKED = 0,
+	KILLSWITCH_STATE_UNBLOCKED,
 	KILLSWITCH_STATE_MIXED,
 } KillswitchState;
 

Modified: trunk/properties/adapter.c
==============================================================================
--- trunk/properties/adapter.c	(original)
+++ trunk/properties/adapter.c	Wed Apr 15 14:59:19 2009
@@ -665,7 +665,7 @@
 button_clicked_cb (GtkButton *button, gpointer user_data)
 {
 	gtk_widget_set_sensitive (GTK_WIDGET (user_data), FALSE);
-	bluetooth_killswitch_set_state (killswitch, KILLSWITCH_STATE_NOT_KILLED);
+	bluetooth_killswitch_set_state (killswitch, KILLSWITCH_STATE_UNBLOCKED);
 }
 
 static void



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