[evolution] Bug 670280 - Remove "Recent Documents" attachment feature



commit 933ba0f066f65a7c8a91205540e41c46b0a7a45e
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Feb 17 08:38:02 2012 -0500

    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".

 calendar/gui/dialogs/comp-editor.c |   37 ------------------------
 composer/e-composer-private.c      |   34 ----------------------
 composer/evolution-composer.ui     |    1 -
 widgets/misc/e-attachment-view.c   |   54 ------------------------------------
 widgets/misc/e-attachment-view.h   |    4 --
 5 files changed, 0 insertions(+), 130 deletions(-)
---
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 12ecb02..e3676e6 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -173,7 +173,6 @@ static const gchar *ui =
 "    <menu action='view-menu'/>"
 "    <menu action='insert-menu'>"
 "      <menuitem action='attach'/>"
-"      <placeholder name='recent-placeholder'/>"
 "    </menu>"
 "    <menu action='options-menu'/>"
 "    <menu action='help-menu'>"
@@ -1326,40 +1325,6 @@ static GtkToggleActionEntry coordinated_toggle_entries[] = {
 };
 
 static void
-comp_editor_setup_recent_menu (CompEditor *editor)
-{
-	EAttachmentView *view;
-	GtkUIManager *ui_manager;
-	GtkAction *action;
-	GtkActionGroup *action_group;
-	const gchar *action_name;
-	const gchar *path;
-	guint merge_id;
-
-	ui_manager = editor->priv->ui_manager;
-	view = E_ATTACHMENT_VIEW (editor->priv->attachment_view);
-	action_group = comp_editor_get_action_group (editor, "individual");
-	merge_id = gtk_ui_manager_new_merge_id (ui_manager);
-	path = "/main-menu/insert-menu/recent-placeholder";
-	action_name = "recent-menu";
-
-	action = e_attachment_view_recent_action_new (
-		view, action_name, _("Recent _Documents"));
-
-	if (action != NULL) {
-		gtk_action_group_add_action (action_group, action);
-		g_object_unref (action);
-
-		gtk_ui_manager_add_ui (
-			ui_manager, merge_id, path,
-			action_name, action_name,
-			GTK_UI_MANAGER_AUTO, FALSE);
-	}
-
-	gtk_ui_manager_ensure_update (ui_manager);
-}
-
-static void
 comp_editor_set_shell (CompEditor *editor,
                        EShell *shell)
 {
@@ -2152,8 +2117,6 @@ comp_editor_init (CompEditor *editor)
 	priv->notebook = GTK_NOTEBOOK (widget);
 	gtk_widget_show (widget);
 
-	comp_editor_setup_recent_menu (editor);
-
 	/* Drag-and-Drop Support */
 
 	view = E_ATTACHMENT_VIEW (priv->attachment_view);
diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c
index b35c84d..3441c6b 100644
--- a/composer/e-composer-private.c
+++ b/composer/e-composer-private.c
@@ -58,38 +58,6 @@ composer_setup_charset_menu (EMsgComposer *composer)
 }
 
 static void
-composer_setup_recent_menu (EMsgComposer *composer)
-{
-	EAttachmentView *view;
-	GtkUIManager *ui_manager;
-	GtkAction *action;
-	const gchar *action_name;
-	const gchar *path;
-	guint merge_id;
-
-	view = e_msg_composer_get_attachment_view (composer);
-	ui_manager = gtkhtml_editor_get_ui_manager (GTKHTML_EDITOR (composer));
-	path = "/main-menu/insert-menu/insert-menu-top/recent-placeholder";
-	merge_id = gtk_ui_manager_new_merge_id (ui_manager);
-	action_name = "recent-menu";
-
-	action = e_attachment_view_recent_action_new (
-		view, action_name, _("Recent _Documents"));
-
-	if (action != NULL) {
-		gtk_action_group_add_action (
-			composer->priv->composer_actions, action);
-
-		gtk_ui_manager_add_ui (
-			ui_manager, merge_id, path,
-			action_name, action_name,
-			GTK_UI_MANAGER_AUTO, FALSE);
-	}
-
-	gtk_ui_manager_ensure_update (ui_manager);
-}
-
-static void
 msg_composer_url_requested_cb (GtkHTML *html,
                                const gchar *uri,
                                GtkHTMLStream *stream,
@@ -434,8 +402,6 @@ e_composer_private_constructed (EMsgComposer *composer)
 	/* XXX What is this for? */
 	g_object_set_data (G_OBJECT (composer), "vbox", editor->vbox);
 
-	composer_setup_recent_menu (composer);
-
 	/* Bind headers to their corresponding actions. */
 
 	for (ii = 0; ii < E_COMPOSER_NUM_HEADERS; ii++) {
diff --git a/composer/evolution-composer.ui b/composer/evolution-composer.ui
index 91fce38..a12865e 100644
--- a/composer/evolution-composer.ui
+++ b/composer/evolution-composer.ui
@@ -36,7 +36,6 @@
     <menu action='insert-menu'>
       <placeholder name='insert-menu-top'>
         <menuitem action='attach'/>
-        <placeholder name='recent-placeholder'/>
         <separator/>
         <placeholder name='send-options'/>
         <separator/>
diff --git a/widgets/misc/e-attachment-view.c b/widgets/misc/e-attachment-view.c
index b066d29..e8f9af8 100644
--- a/widgets/misc/e-attachment-view.c
+++ b/widgets/misc/e-attachment-view.c
@@ -244,31 +244,6 @@ action_properties_cb (GtkAction *action,
 }
 
 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 0f5bcf1..87274d0 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,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]