aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shortcuts.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-09-27 03:01:28 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-09-27 03:01:28 +0800
commita03e2e75297c4d1b99890cdc90c3443088eb7ce8 (patch)
treeffbd588e7ebf1708235bc06900b40ebe6b6e1324 /shell/e-shortcuts.c
parentd9f93b90ee08a8576e5ff447b66e0281e49287bf (diff)
downloadgsoc2013-evolution-a03e2e75297c4d1b99890cdc90c3443088eb7ce8.tar
gsoc2013-evolution-a03e2e75297c4d1b99890cdc90c3443088eb7ce8.tar.gz
gsoc2013-evolution-a03e2e75297c4d1b99890cdc90c3443088eb7ce8.tar.bz2
gsoc2013-evolution-a03e2e75297c4d1b99890cdc90c3443088eb7ce8.tar.lz
gsoc2013-evolution-a03e2e75297c4d1b99890cdc90c3443088eb7ce8.tar.xz
gsoc2013-evolution-a03e2e75297c4d1b99890cdc90c3443088eb7ce8.tar.zst
gsoc2013-evolution-a03e2e75297c4d1b99890cdc90c3443088eb7ce8.zip
Fix a bunch of EShortcutView problems. It's still buggy, but at least
it's usable now. Also, implemented a "new group" command (which doesn't quite work right yet for some reason) and a "remove group" one. svn path=/trunk/; revision=5595
Diffstat (limited to 'shell/e-shortcuts.c')
-rw-r--r--shell/e-shortcuts.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/shell/e-shortcuts.c b/shell/e-shortcuts.c
index 4befb87cb7..7f044dd129 100644
--- a/shell/e-shortcuts.c
+++ b/shell/e-shortcuts.c
@@ -697,6 +697,9 @@ e_shortcuts_add_shortcut (EShortcuts *shortcuts,
group = (ShortcutGroup *) p->data;
+ if (num == -1)
+ num = g_list_length (group->shortcuts);
+
group->shortcuts = g_list_insert (group->shortcuts, g_strdup (uri), num);
gtk_signal_emit (GTK_OBJECT (shortcuts), signals[NEW_SHORTCUT], group_num, num);
@@ -748,6 +751,9 @@ e_shortcuts_add_group (EShortcuts *shortcuts,
group->title = g_strdup (group_name);
group->shortcuts = NULL;
+ if (group_num == -1)
+ group_num = g_list_length (priv->groups);
+
priv->groups = g_list_insert (priv->groups, group, group_num);
gtk_signal_emit (GTK_OBJECT (shortcuts), signals[NEW_GROUP], group_num);
@@ -761,6 +767,7 @@ e_shortcuts_get_group_title (EShortcuts *shortcuts,
int group_num)
{
EShortcutsPrivate *priv;
+ GList *group_element;
const ShortcutGroup *group;
g_return_val_if_fail (shortcuts != NULL, NULL);
@@ -768,10 +775,12 @@ e_shortcuts_get_group_title (EShortcuts *shortcuts,
priv = shortcuts->priv;
- group = g_list_nth (priv->groups, group_num);
- if (group == NULL)
+ group_element = g_list_nth (priv->groups, group_num);
+ if (group_element == NULL)
return NULL;
+ group = (ShortcutGroup *) group_element->data;
+
return group->title;
}