[gnome-system-tools] Fix handling of services



commit 2be284b58711c477a2a95c13e3847a6edc3470ae
Author: Milan Bouchet-Valat <nalimilan club fr>
Date:   Mon Oct 5 11:33:14 2009 +0200

    Fix handling of services
    
    Use a new feature in liboobs that allows passing priority 0 to either keep the previous value, or use the default. This fixes scripts being reset to priority 50 when re-enabled. Also set services as either started or stopped for a given runlevel, instead of using OOBS_SERVICE_IGNORE. This is the correct way of disabling scripts, and allows us to store the priority in the file name.

 configure.in             |    2 +-
 src/services/callbacks.c |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/configure.in b/configure.in
index 9d1d7a8..8e38d38 100644
--- a/configure.in
+++ b/configure.in
@@ -28,7 +28,7 @@ dnl glib-genmarshal
 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
 
 STB_REQUIRED=2.8
-LIBOOBS_REQUIRED=2.21.3
+LIBOOBS_REQUIRED=2.29.1
 GTK_REQUIRED=2.16
 GLIB_REQUIRED=2.15.2
 GCONF_REQUIRED=2.2.0
diff --git a/src/services/callbacks.c b/src/services/callbacks.c
index d92b53e..a3a938c 100644
--- a/src/services/callbacks.c
+++ b/src/services/callbacks.c
@@ -159,9 +159,9 @@ on_service_toggled (GtkCellRenderer *renderer, gchar *path_str, gpointer data)
 		
 		rl = (OobsServicesRunlevel *) GST_SERVICES_TOOL (tool)->default_runlevel;
 		oobs_service_set_runlevel_configuration (service, rl,
-							 (new_value) ? OOBS_SERVICE_START : OOBS_SERVICE_IGNORE,
-							 /* FIXME: hardcoded value... */
-							 50);
+							 (new_value) ? OOBS_SERVICE_START : OOBS_SERVICE_STOP,
+							 /* Keep previous priority, see how liboobs handles this */
+							 0);
 		gst_tool_commit (tool, GST_SERVICES_TOOL (tool)->services_config);
 
 		gtk_list_store_set (GTK_LIST_STORE (model),



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