From d801d2df671bea7e08711f0027fbf8f3dc873b01 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Sun, 1 Jul 2001 05:11:43 +0000 Subject: Change the internal structure for shortucts, so that it contains a type and a name too. The name will allow renaming shortcuts (thus decoupling the name of the folder the shortcuts points to from the name of the shortcut); the type member is used to cache the type of the folder we point to so that we can still display the right icon even if the folder is currently not in the storage (e.g. this happens for IMAP folders when you haven't opened the corresponding IMAP node yet). I don't like the way this is designed at all (mainly, the responsibility for saving the values should be moved elsewhere), but I'll fix it later. Also, I added an "Open in New Window" right-click menu item for shortcuts. svn path=/trunk/; revision=10649 --- shell/e-shortcuts-view.c | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) (limited to 'shell/e-shortcuts-view.c') diff --git a/shell/e-shortcuts-view.c b/shell/e-shortcuts-view.c index bfde8d02c4..76939f1941 100644 --- a/shell/e-shortcuts-view.c +++ b/shell/e-shortcuts-view.c @@ -346,15 +346,13 @@ struct _ShortcutRightClickMenuData { typedef struct _ShortcutRightClickMenuData ShortcutRightClickMenuData; static void -activate_shortcut_cb (GtkWidget *widget, - void *data) +open_shortcut_helper (ShortcutRightClickMenuData *menu_data, + gboolean in_new_window) { - ShortcutRightClickMenuData *menu_data; EShortcutsView *shortcuts_view; EShortcuts *shortcuts; const EShortcutItem *shortcut_item; - menu_data = (ShortcutRightClickMenuData *) data; shortcuts_view = menu_data->shortcuts_view; shortcuts = shortcuts_view->priv->shortcuts; @@ -363,7 +361,21 @@ activate_shortcut_cb (GtkWidget *widget, return; gtk_signal_emit (GTK_OBJECT (shortcuts_view), signals[ACTIVATE_SHORTCUT], - shortcuts, shortcut_item->uri); + shortcuts, shortcut_item->uri, in_new_window); +} + +static void +open_shortcut_cb (GtkWidget *widget, + void *data) +{ + open_shortcut_helper ((ShortcutRightClickMenuData *) data, FALSE); +} + +static void +open_shortcut_in_new_window_cb (GtkWidget *widget, + void *data) +{ + open_shortcut_helper ((ShortcutRightClickMenuData *) data, TRUE); } static void @@ -382,8 +394,10 @@ remove_shortcut_cb (GtkWidget *widget, } static GnomeUIInfo shortcut_right_click_menu_uiinfo[] = { - GNOMEUIINFO_ITEM (N_("Activate"), N_("Activate this shortcut"), - activate_shortcut_cb, NULL), + GNOMEUIINFO_ITEM (N_("Open"), N_("Open the folder linked to this shortcut"), + open_shortcut_cb, NULL), + GNOMEUIINFO_ITEM (N_("Open in New Window"), N_("Open the folder linked to this shortcut in a new window"), + open_shortcut_in_new_window_cb, NULL), GNOMEUIINFO_SEPARATOR, GNOMEUIINFO_ITEM_STOCK (N_("Remove"), N_("Remove this shortcut from the shortcut bar"), remove_shortcut_cb, GNOME_STOCK_MENU_CLOSE), @@ -468,7 +482,7 @@ item_selected (EShortcutBar *shortcut_bar, return; gtk_signal_emit (GTK_OBJECT (shortcuts_view), signals[ACTIVATE_SHORTCUT], - shortcuts, shortcut_item->uri); + shortcuts, shortcut_item->uri, FALSE); } static void @@ -523,10 +537,11 @@ class_init (EShortcutsViewClass *klass) GTK_RUN_LAST | GTK_RUN_ACTION, object_class->type, GTK_SIGNAL_OFFSET (EShortcutsViewClass, activate_shortcut), - gtk_marshal_NONE__POINTER_POINTER, - GTK_TYPE_NONE, 2, + e_marshal_NONE__POINTER_POINTER_INT, + GTK_TYPE_NONE, 3, GTK_TYPE_POINTER, - GTK_TYPE_STRING); + GTK_TYPE_STRING, + GTK_TYPE_BOOL); signals[HIDE_REQUESTED] = gtk_signal_new ("hide_requested", -- cgit v1.2.3