added missing implementation.
authorRodrigo Moya <rodrigo@novell.com>
Mon, 10 Jan 2005 17:56:36 +0000 (17:56 +0000)
committerRodrigo Moya <rodrigo@src.gnome.org>
Mon, 10 Jan 2005 17:56:36 +0000 (17:56 +0000)
2005-01-10  Rodrigo Moya <rodrigo@novell.com>

* e-categories-dialog.c (delete_button_clicked_cb): added missing
implementation.

libedataserverui/ChangeLog
libedataserverui/e-categories-dialog.c

index 99905c9..e99de72 100644 (file)
@@ -1,5 +1,10 @@
 2005-01-10  Rodrigo Moya <rodrigo@novell.com>
 
+       * e-categories-dialog.c (delete_button_clicked_cb): added missing
+       implementation.
+
+2005-01-10  Rodrigo Moya <rodrigo@novell.com>
+
        * e-categories-dialog.glade: replaced the 'Edit master ...' button
        with buttons for adding, editing and removing categories.
        Added the category properties dialog.
index 9ffd605..a8a8f84 100644 (file)
@@ -293,6 +293,25 @@ edit_button_clicked_cb (GtkButton *button, gpointer user_data)
 static void
 delete_button_clicked_cb (GtkButton *button, gpointer user_data)
 {
+       ECategoriesDialog *dialog;
+       ECategoriesDialogPrivate *priv;
+       GtkTreeIter iter;
+       GtkTreeModel *model;
+       char *category_name;
+
+       dialog = user_data;
+       priv = dialog->priv;
+
+       /* get the currently selected item */
+       model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->categories_list));
+
+       if (!gtk_tree_selection_get_selected (gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->categories_list)),
+                                             NULL, &iter))
+               return;
+
+       gtk_tree_model_get (model, &iter, 1, &category_name, -1);
+       e_categories_remove (category_name);
+       gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
 }
 
 static void