aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-composer-private.c
diff options
context:
space:
mode:
authorSuman Manjunath <msuman@src.gnome.org>2008-04-12 02:52:39 +0800
committerSuman Manjunath <msuman@src.gnome.org>2008-04-12 02:52:39 +0800
commit8873c47ed16aa9babd88312672a72ea56dcca471 (patch)
treec5d5de26da2ada6c5bcb2633cc3b2ac9b563e7a4 /composer/e-composer-private.c
parentfe0495c2bdae62a38f23f7c3d86eb4db3c741157 (diff)
downloadgsoc2013-evolution-8873c47ed16aa9babd88312672a72ea56dcca471.tar.gz
gsoc2013-evolution-8873c47ed16aa9babd88312672a72ea56dcca471.tar.zst
gsoc2013-evolution-8873c47ed16aa9babd88312672a72ea56dcca471.zip
Fix for bug #517134 : Extend the 'Insert' menu (in editors) to show a "Recent Documents" submenu (to quickly add them as attachments).
M configure.in M ChangeLog M composer/evolution-composer.ui M composer/ChangeLog M composer/e-composer-actions.c M composer/e-composer-private.c M widgets/misc/ChangeLog M widgets/misc/e-attachment-bar.c M widgets/misc/e-attachment-bar.h M calendar/gui/dialogs/comp-editor.c M calendar/ChangeLog M ui/ChangeLog M ui/evolution-editor.xml svn path=/trunk/; revision=35354
Diffstat (limited to 'composer/e-composer-private.c')
-rw-r--r--composer/e-composer-private.c38
1 files changed, 36 insertions, 2 deletions
diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c
index f5e3e08c68..55c1a824e9 100644
--- a/composer/e-composer-private.c
+++ b/composer/e-composer-private.c
@@ -43,6 +43,38 @@ composer_setup_charset_menu (EMsgComposer *composer)
list = g_list_delete_link (list, list);
}
+
+ gtk_ui_manager_ensure_update (manager);
+}
+
+static void
+composer_setup_recent_menu (EMsgComposer *composer)
+{
+ GtkUIManager *manager;
+ GtkAction *action = NULL;
+ const gchar *path, *action_name;
+ guint merge_id;
+
+ manager = gtkhtml_editor_get_ui_manager (GTKHTML_EDITOR (composer));
+ action_name = "recent-menu";
+ path = "/main-menu/insert-menu/insert-menu-top/recent-placeholder";
+ merge_id = gtk_ui_manager_new_merge_id (manager);
+
+ action = e_attachment_bar_recent_action_new (
+ e_msg_composer_get_attachment_bar (composer),
+ action_name, _("Recent _Documents"));
+
+ if (action != NULL) {
+ gtk_action_group_add_action (composer->priv->composer_actions, action);
+
+ gtk_ui_manager_add_ui (
+ manager, merge_id, path,
+ action_name,
+ action_name,
+ GTK_UI_MANAGER_AUTO, FALSE);
+ }
+
+ gtk_ui_manager_ensure_update (manager);
}
void
@@ -86,10 +118,10 @@ e_composer_private_init (EMsgComposer *composer)
filename = e_composer_find_data_file ("evolution-composer.ui");
gtk_ui_manager_add_ui_from_file (manager, filename, &error);
- composer_setup_charset_menu (composer);
- gtk_ui_manager_ensure_update (manager);
g_free (filename);
+ composer_setup_charset_menu (composer);
+
if (error != NULL) {
/* Henceforth, bad things start happening. */
g_critical ("%s", error->message);
@@ -158,6 +190,8 @@ e_composer_private_init (EMsgComposer *composer)
gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 6);
priv->attachment_expander_num = g_object_ref (widget);
gtk_widget_show (widget);
+
+ composer_setup_recent_menu (composer);
}
void