From 8fc1cb82feb23034360af987834f6bce8aebe0f3 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Sun, 1 Jul 2001 07:12:56 +0000 Subject: Implemented a "Rename Group" command. Unfortunately, it doesn't work very well due to EShortcutBar breakage. But we'll fix that later. svn path=/trunk/; revision=10653 --- shell/e-shortcuts-view-model.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'shell/e-shortcuts-view-model.c') diff --git a/shell/e-shortcuts-view-model.c b/shell/e-shortcuts-view-model.c index 15e1d3cec1..57d2762fb9 100644 --- a/shell/e-shortcuts-view-model.c +++ b/shell/e-shortcuts-view-model.c @@ -125,6 +125,21 @@ shortcuts_remove_group_cb (EShortcuts *shortcuts, e_shortcut_model_remove_group (E_SHORTCUT_MODEL (shortcuts_view_model), group_num); } +static void +shortcuts_rename_group_cb (EShortcuts *shortcuts, + int group_num, + const char *new_title, + void *data) +{ + EShortcutsViewModel *shortcuts_view_model; + + shortcuts_view_model = E_SHORTCUTS_VIEW_MODEL (data); + + e_shortcut_model_remove_group (E_SHORTCUT_MODEL (shortcuts_view_model), group_num); + e_shortcut_model_add_group (E_SHORTCUT_MODEL (shortcuts_view_model), group_num, new_title); + load_group_into_model (shortcuts_view_model, group_num); +} + static void shortcuts_new_shortcut_cb (EShortcuts *shortcuts, int group_num, @@ -244,6 +259,9 @@ e_shortcuts_view_model_construct (EShortcutsViewModel *model, gtk_signal_connect_while_alive (GTK_OBJECT (priv->shortcuts), "remove_group", GTK_SIGNAL_FUNC (shortcuts_remove_group_cb), model, GTK_OBJECT (model)); + gtk_signal_connect_while_alive (GTK_OBJECT (priv->shortcuts), + "rename_group", GTK_SIGNAL_FUNC (shortcuts_rename_group_cb), model, + GTK_OBJECT (model)); gtk_signal_connect_while_alive (GTK_OBJECT (priv->shortcuts), "new_shortcut", GTK_SIGNAL_FUNC (shortcuts_new_shortcut_cb), model, GTK_OBJECT (model)); -- cgit v1.2.3