aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-07-28 00:17:20 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-07-28 09:24:02 +0800
commit83134a75c34502e784161ee21b803c2082d1a446 (patch)
tree1cec752355546f7f2d5954e22b5ed29c1caaff6f /e-util
parent826372c35155cb47f940905e27b304e9ef63441d (diff)
downloadgsoc2013-evolution-83134a75c34502e784161ee21b803c2082d1a446.tar
gsoc2013-evolution-83134a75c34502e784161ee21b803c2082d1a446.tar.gz
gsoc2013-evolution-83134a75c34502e784161ee21b803c2082d1a446.tar.bz2
gsoc2013-evolution-83134a75c34502e784161ee21b803c2082d1a446.tar.lz
gsoc2013-evolution-83134a75c34502e784161ee21b803c2082d1a446.tar.xz
gsoc2013-evolution-83134a75c34502e784161ee21b803c2082d1a446.tar.zst
gsoc2013-evolution-83134a75c34502e784161ee21b803c2082d1a446.zip
EWebView: Add an "image-save" action.
There's now enough hooks in EWebView that it can take over image saving from EMailDisplay / EMailReader, with the added perk that a "Save Image" pop-up menu item now appears for images in ALL preview panes.
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-web-view.c17
-rw-r--r--e-util/widgets.error.xml5
2 files changed, 21 insertions, 1 deletions
diff --git a/e-util/e-web-view.c b/e-util/e-web-view.c
index a762c45513..bc0b2648ce 100644
--- a/e-util/e-web-view.c
+++ b/e-util/e-web-view.c
@@ -125,6 +125,7 @@ static const gchar *ui =
" <menuitem action='uri-copy'/>"
" <menuitem action='mailto-copy'/>"
" <menuitem action='image-copy'/>"
+" <menuitem action='image-save'/>"
" </placeholder>"
" <placeholder name='custom-actions-3'/>"
" <separator/>"
@@ -270,6 +271,13 @@ action_image_copy_cb (GtkAction *action,
e_web_view_cursor_image_copy (web_view);
}
+static void
+action_image_save_cb (GtkAction *action,
+ EWebView *web_view)
+{
+ e_web_view_cursor_image_save (web_view);
+}
+
static GtkActionEntry uri_entries[] = {
{ "uri-copy",
@@ -314,7 +322,14 @@ static GtkActionEntry image_entries[] = {
N_("_Copy Image"),
NULL,
N_("Copy the image to the clipboard"),
- G_CALLBACK (action_image_copy_cb) }
+ G_CALLBACK (action_image_copy_cb) },
+
+ { "image-save",
+ GTK_STOCK_SAVE,
+ N_("Save _Image..."),
+ NULL,
+ N_("Save the image to a file"),
+ G_CALLBACK (action_image_save_cb) }
};
static GtkActionEntry selection_entries[] = {
diff --git a/e-util/widgets.error.xml b/e-util/widgets.error.xml
index 60dc78080f..74fbd9f9a1 100644
--- a/e-util/widgets.error.xml
+++ b/e-util/widgets.error.xml
@@ -19,6 +19,11 @@
<secondary xml:space="preserve">{0}</secondary>
</error>
+ <error id="no-image-save" type="warning">
+ <_primary>Unable to save image.</_primary>
+ <secondary xml:space="preserve">{0}</secondary>
+ </error>
+
<error id="no-load-signature" type="error">
<_primary>Could not load signature.</_primary>
<secondary xml:space="preserve">{0}</secondary>