From 933ba0f066f65a7c8a91205540e41c46b0a7a45e Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 17 Feb 2012 08:38:02 -0500 Subject: Bug 670280 - Remove "Recent Documents" attachment feature GTK's file chooser dialog provides one-click access to recently used documents now, so we can remove the redundancy from Evolution's mail composer main menu and calendar component editor main menu and leave it at "Insert -> Attachment". --- widgets/misc/e-attachment-view.c | 54 ---------------------------------------- widgets/misc/e-attachment-view.h | 4 --- 2 files changed, 58 deletions(-) (limited to 'widgets/misc') diff --git a/widgets/misc/e-attachment-view.c b/widgets/misc/e-attachment-view.c index b066d29fa0..e8f9af8fdb 100644 --- a/widgets/misc/e-attachment-view.c +++ b/widgets/misc/e-attachment-view.c @@ -243,31 +243,6 @@ action_properties_cb (GtkAction *action, g_list_free (list); } -static void -action_recent_cb (GtkAction *action, - EAttachmentView *view) -{ - GtkRecentChooser *chooser; - EAttachmentStore *store; - EAttachment *attachment; - gpointer parent; - gchar *uri; - - chooser = GTK_RECENT_CHOOSER (action); - store = e_attachment_view_get_store (view); - - parent = gtk_widget_get_toplevel (GTK_WIDGET (view)); - parent = gtk_widget_is_toplevel (parent) ? parent : NULL; - - uri = gtk_recent_chooser_get_current_uri (chooser); - attachment = e_attachment_new_for_uri (uri); - e_attachment_store_add_attachment (store, attachment); - e_attachment_load_async ( - attachment, (GAsyncReadyCallback) - e_attachment_load_handle_error, parent); - g_free (uri); -} - static void action_remove_cb (GtkAction *action, EAttachmentView *view) @@ -1899,35 +1874,6 @@ e_attachment_view_get_ui_manager (EAttachmentView *view) return priv->ui_manager; } -GtkAction * -e_attachment_view_recent_action_new (EAttachmentView *view, - const gchar *action_name, - const gchar *action_label) -{ - GtkAction *action; - GtkRecentChooser *chooser; - - g_return_val_if_fail (E_IS_ATTACHMENT_VIEW (view), NULL); - g_return_val_if_fail (action_name != NULL, NULL); - - action = gtk_recent_action_new ( - action_name, action_label, NULL, NULL); - gtk_recent_action_set_show_numbers (GTK_RECENT_ACTION (action), TRUE); - - chooser = GTK_RECENT_CHOOSER (action); - gtk_recent_chooser_set_show_icons (chooser, TRUE); - gtk_recent_chooser_set_show_not_found (chooser, FALSE); - gtk_recent_chooser_set_show_private (chooser, FALSE); - gtk_recent_chooser_set_show_tips (chooser, TRUE); - gtk_recent_chooser_set_sort_type (chooser, GTK_RECENT_SORT_MRU); - - g_signal_connect ( - action, "item-activated", - G_CALLBACK (action_recent_cb), view); - - return action; -} - void e_attachment_view_show_popup_menu (EAttachmentView *view, GdkEventButton *event, diff --git a/widgets/misc/e-attachment-view.h b/widgets/misc/e-attachment-view.h index 0f5bcf1c0c..87274d0c63 100644 --- a/widgets/misc/e-attachment-view.h +++ b/widgets/misc/e-attachment-view.h @@ -227,10 +227,6 @@ GtkWidget * e_attachment_view_get_popup_menu (EAttachmentView *view); GtkUIManager * e_attachment_view_get_ui_manager (EAttachmentView *view); -GtkAction * e_attachment_view_recent_action_new - (EAttachmentView *view, - const gchar *action_name, - const gchar *action_label); void e_attachment_view_show_popup_menu (EAttachmentView *view, GdkEventButton *event, -- cgit v1.2.3