diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2001-07-01 15:12:56 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2001-07-01 15:12:56 +0800 |
commit | 8fc1cb82feb23034360af987834f6bce8aebe0f3 (patch) | |
tree | c0b0045ee2e03dc09364de2107ac63b8b467f358 /shell/e-shortcuts.c | |
parent | 6077a94d84eb66bd81e52a92d3703db72ab5614a (diff) | |
download | gsoc2013-evolution-8fc1cb82feb23034360af987834f6bce8aebe0f3.tar.gz gsoc2013-evolution-8fc1cb82feb23034360af987834f6bce8aebe0f3.tar.zst gsoc2013-evolution-8fc1cb82feb23034360af987834f6bce8aebe0f3.zip |
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
Diffstat (limited to 'shell/e-shortcuts.c')
-rw-r--r-- | shell/e-shortcuts.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/shell/e-shortcuts.c b/shell/e-shortcuts.c index 20d12cce2d..5f1614a964 100644 --- a/shell/e-shortcuts.c +++ b/shell/e-shortcuts.c @@ -107,6 +107,7 @@ struct _EShortcutsPrivate { enum { NEW_GROUP, REMOVE_GROUP, + RENAME_GROUP, NEW_SHORTCUT, REMOVE_SHORTCUT, UPDATE_SHORTCUT, @@ -627,6 +628,16 @@ class_init (EShortcutsClass *klass) GTK_TYPE_NONE, 1, GTK_TYPE_INT); + signals[RENAME_GROUP] + = gtk_signal_new ("rename_group", + GTK_RUN_FIRST, + object_class->type, + GTK_SIGNAL_OFFSET (EShortcutsClass, rename_group), + gtk_marshal_NONE__INT_POINTER, + GTK_TYPE_NONE, 2, + GTK_TYPE_INT, + GTK_TYPE_STRING); + signals[NEW_SHORTCUT] = gtk_signal_new ("new_shortcut", GTK_RUN_FIRST, @@ -990,6 +1001,34 @@ e_shortcuts_remove_group (EShortcuts *shortcuts, } void +e_shortcuts_rename_group (EShortcuts *shortcuts, + int group_num, + const char *new_title) +{ + EShortcutsPrivate *priv; + GSList *p; + ShortcutGroup *group; + + g_return_if_fail (shortcuts != NULL); + g_return_if_fail (E_IS_SHORTCUTS (shortcuts)); + + priv = shortcuts->priv; + + p = g_slist_nth (priv->groups, group_num); + g_return_if_fail (p != NULL); + + group = (ShortcutGroup *) p->data; + if (group->title != new_title) { + g_free (group->title); + group->title = g_strdup (new_title); + } + + gtk_signal_emit (GTK_OBJECT (shortcuts), signals[RENAME_GROUP], group_num, new_title); + + make_dirty (shortcuts); +} + +void e_shortcuts_add_group (EShortcuts *shortcuts, int group_num, const char *group_name) |