From 6d778b9fa21e33d502a6b6c98639cb19dd8becfb Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Wed, 31 Jul 2002 22:10:37 +0000 Subject: New, implement a right-click -> "Add Default Shortcuts" menu item. * e-shortcuts-view.c (create_default_shortcuts_cb): New, implement a right-click -> "Add Default Shortcuts" menu item. (rename_group_cb): Remove double casts. *lol* * e-shortcuts.c (e_shortcuts_add_default_shortcuts): New. (e_shortcuts_add_default_group): Use e_shortcuts_add_default_shortcuts(). svn path=/trunk/; revision=17663 --- shell/e-shortcuts-view.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'shell/e-shortcuts-view.c') diff --git a/shell/e-shortcuts-view.c b/shell/e-shortcuts-view.c index ab3841b3aa..50641c2f2f 100644 --- a/shell/e-shortcuts-view.c +++ b/shell/e-shortcuts-view.c @@ -215,15 +215,28 @@ rename_group_cb (GtkWidget *widget, /* Remember the group and flip back to it. FIXME: This is a workaround to an actual ShortcutBar bug. */ - group = e_group_bar_get_current_group_num (E_GROUP_BAR (E_SHORTCUT_BAR (shortcuts_view))); + group = e_group_bar_get_current_group_num (E_GROUP_BAR (shortcuts_view)); original_view_type = e_shortcut_bar_get_view_type (E_SHORTCUT_BAR (menu_data->shortcuts_view), group); e_shortcuts_rename_group (shortcuts, menu_data->group_num, new_name); g_free (new_name); - e_group_bar_set_current_group_num (E_GROUP_BAR (E_SHORTCUT_BAR (shortcuts_view)), group, FALSE); + e_group_bar_set_current_group_num (E_GROUP_BAR (shortcuts_view), group, FALSE); e_shortcut_bar_set_view_type (E_SHORTCUT_BAR (menu_data->shortcuts_view), group, original_view_type); } +static void +create_default_shortcuts_cb (GtkWidget *widget, + void *data) +{ + RightClickMenuData *menu_data; + EShortcutsView *shortcuts_view; + + menu_data = (RightClickMenuData *) data; + shortcuts_view = menu_data->shortcuts_view; + e_shortcuts_add_default_shortcuts (shortcuts_view->priv->shortcuts, + e_group_bar_get_current_group_num (E_GROUP_BAR (shortcuts_view))); +} + static GnomeUIInfo icon_size_radio_group_uiinfo[] = { { GNOME_APP_UI_ITEM, N_("_Small Icons"), N_("Show the shortcuts as small icons"), toggle_small_icons_cb, NULL, @@ -256,6 +269,12 @@ static GnomeUIInfo right_click_menu_uiinfo[] = { N_("Hide the shortcut bar"), hide_shortcut_bar_cb, NULL, NULL, 0, 0, 0, 0 }, + GNOMEUIINFO_SEPARATOR, + + { GNOME_APP_UI_ITEM, N_("Create _Default Shortcuts"), + N_("Create Default Shortcuts"), create_default_shortcuts_cb, NULL, + NULL, 0, 0, 0, 0 }, + GNOMEUIINFO_END }; -- cgit v1.2.3