[gdm/multi-stack: 40/46] Add gdm_task_list_remove_task



commit 5f14cf302a3ce6bca35e7737437b66f0eb42b9eb
Author: Ray Strode <rstrode redhat com>
Date:   Wed Oct 28 22:09:45 2009 -0400

    Add gdm_task_list_remove_task

 gui/simple-greeter/gdm-task-list.c |   29 +++++++++++++++++++++++++++++
 gui/simple-greeter/gdm-task-list.h |    3 +++
 2 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/gui/simple-greeter/gdm-task-list.c b/gui/simple-greeter/gdm-task-list.c
index be50832..dd77ed6 100644
--- a/gui/simple-greeter/gdm-task-list.c
+++ b/gui/simple-greeter/gdm-task-list.c
@@ -211,6 +211,35 @@ gdm_task_list_add_task (GdmTaskList *task_list,
         }
 }
 
+void
+gdm_task_list_remove_task (GdmTaskList *task_list,
+                           GdmTask     *task)
+{
+        GtkWidget *image;
+        GtkWidget *button;
+        GIcon     *icon;
+        char      *description;
+
+        task_list->priv->tasks = g_list_remove (task_list->priv->tasks, task);
+
+        button = g_object_get_data (G_OBJECT (task), "gdm-task-list-button");
+
+        if (button != NULL) {
+            g_signal_handlers_disconnect_by_func (G_OBJECT (task),
+                                                  G_CALLBACK (on_task_enabled),
+                                                  task_list);
+            g_signal_handlers_disconnect_by_func (G_OBJECT (task),
+                                                  G_CALLBACK (on_task_disabled),
+                                                  task_list);
+            gtk_widget_destroy (button);
+            g_object_set_data (G_OBJECT (task), "gdm-task-list-button", NULL);
+        }
+
+        g_object_unref (task);
+
+        activate_first_available_task (task_list);
+}
+
 static void
 gdm_task_list_class_init (GdmTaskListClass *klass)
 {
diff --git a/gui/simple-greeter/gdm-task-list.h b/gui/simple-greeter/gdm-task-list.h
index 8bc0c0e..3df5415 100644
--- a/gui/simple-greeter/gdm-task-list.h
+++ b/gui/simple-greeter/gdm-task-list.h
@@ -74,6 +74,9 @@ GdmTask *   gdm_task_list_foreach_task (GdmTaskList           *widget,
 void        gdm_task_list_add_task        (GdmTaskList *widget,
                                            GdmTask     *task);
 
+void        gdm_task_list_remove_task        (GdmTaskList *widget,
+                                              GdmTask     *task);
+
 int         gdm_task_list_get_number_of_tasks (GdmTaskList *widget);
 G_END_DECLS
 



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