diff options
author | Suman Manjunath <msuman@src.gnome.org> | 2008-04-12 02:52:39 +0800 |
---|---|---|
committer | Suman Manjunath <msuman@src.gnome.org> | 2008-04-12 02:52:39 +0800 |
commit | 8873c47ed16aa9babd88312672a72ea56dcca471 (patch) | |
tree | c5d5de26da2ada6c5bcb2633cc3b2ac9b563e7a4 /composer | |
parent | fe0495c2bdae62a38f23f7c3d86eb4db3c741157 (diff) | |
download | gsoc2013-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')
-rw-r--r-- | composer/ChangeLog | 12 | ||||
-rw-r--r-- | composer/e-composer-actions.c | 4 | ||||
-rw-r--r-- | composer/e-composer-private.c | 38 | ||||
-rw-r--r-- | composer/evolution-composer.ui | 1 |
4 files changed, 51 insertions, 4 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index 5fccf25965..2a3d303a97 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,15 @@ +2008-04-11 Suman Manjunath <msuman@novell.com> + + ** Fix for bug #517134 + + * e-composer-actions.c: (action_attach_cb): Save some CPU cycles. + * e-composer-private.c: (composer_setup_charset_menu), + (composer_setup_recent_menu), (e_composer_private_init): Extend the + 'Insert' menu to show a "Recent Documents" submenu (to quickly add + them as attachments). + * evolution-composer.ui: Added a placeholder to dock the "Recent + Documents" menu. + 2008-04-08 Matthew Barnes <mbarnes@redhat.com> ** Fixes bug #523413 diff --git a/composer/e-composer-actions.c b/composer/e-composer-actions.c index ecf7e84346..33a865c5e6 100644 --- a/composer/e-composer-actions.c +++ b/composer/e-composer-actions.c @@ -36,6 +36,7 @@ action_attach_cb (GtkAction *action, GtkWidget *dialog; GtkWidget *option; GSList *uris, *iter; + const gchar *disposition; gboolean active; gint response; @@ -72,16 +73,15 @@ action_attach_cb (GtkAction *action, uris = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (dialog)); active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (option)); + disposition = active ? "inline" : "attachment"; for (iter = uris; iter != NULL; iter = iter->next) { - const gchar *disposition; CamelURL *url; url = camel_url_new (iter->data, NULL); if (url == NULL) continue; - disposition = active ? "inline" : "attachment"; if (!g_ascii_strcasecmp (url->protocol, "file")) e_attachment_bar_attach (bar, url->path, disposition); else 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 diff --git a/composer/evolution-composer.ui b/composer/evolution-composer.ui index ab907e1ca9..feb9cdfa9b 100644 --- a/composer/evolution-composer.ui +++ b/composer/evolution-composer.ui @@ -34,6 +34,7 @@ <menu action='insert-menu'> <placeholder name='insert-menu-top'> <menuitem action='attach'/> + <placeholder name='recent-placeholder'/> <separator/> <menuitem action='send-options'/> <separator/> |