[gnome-system-tools/users-ui-redesign] tmp services



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

    tmp services

 src/services/callbacks.c     |    8 +++++---
 src/services/services-tool.c |    9 ++++++++-
 2 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/src/services/callbacks.c b/src/services/callbacks.c
index d92b53e..f55db58 100644
--- a/src/services/callbacks.c
+++ b/src/services/callbacks.c
@@ -159,9 +159,11 @@ 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);
+							/* If the user toggled this service, we have to assume
+							 * we must not ignore it, i.e. start or stop it */
+							 (new_value) ? OOBS_SERVICE_START : OOBS_SERVICE_STOP,
+							 /* Keep the previous priority */
+							 0);
 		gst_tool_commit (tool, GST_SERVICES_TOOL (tool)->services_config);
 
 		gtk_list_store_set (GTK_LIST_STORE (model),
diff --git a/src/services/services-tool.c b/src/services/services-tool.c
index b5124a9..a6ca2e9 100644
--- a/src/services/services-tool.c
+++ b/src/services/services-tool.c
@@ -65,18 +65,25 @@ static void
 gst_services_tool_update_gui (GstTool *tool)
 {
 	OobsServicesConfig *config;
+	OobsServicesRunlevel *rl;
 	OobsList *list;
 	OobsListIter iter;
 	GObject *service;
 	gboolean valid;
+	guint status;
 
 	config = OOBS_SERVICES_CONFIG (GST_SERVICES_TOOL (tool)->services_config);
 	list = oobs_services_config_get_services (config);
 	valid = oobs_list_get_iter_first (list, &iter);
 
+	rl = (OobsServicesRunlevel *) GST_SERVICES_TOOL (tool)->default_runlevel;
+
 	while (valid) {
 		service = oobs_list_get (list, &iter);
-		table_add_service (service, &iter);
+		/* Don't add services not listed for this runlevel, as this status is not valid */
+		oobs_service_get_runlevel_configuration (OOBS_SERVICE (service), rl, &status, NULL);
+		if (status != OOBS_SERVICE_IGNORE);
+			table_add_service (service, &iter);
 		g_object_unref (service);
 
 		valid = oobs_list_iter_next (list, &iter);



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