After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 609958 - add "Edit Image" toolbar button
add "Edit Image" toolbar button
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: image viewer
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Allison Karlitskaya (desrt)
EOG Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-02-15 01:47 UTC by Allison Karlitskaya (desrt)
Modified: 2010-10-06 19:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Bug 609958 - add "Edit Image" toolbar button (6.20 KB, patch)
2010-02-15 01:51 UTC, Allison Karlitskaya (desrt)
needs-work Details | Review
Example of how a distro might vendor-patch this (893 bytes, patch)
2010-02-15 02:00 UTC, Allison Karlitskaya (desrt)
none Details | Review
new patch (8.16 KB, patch)
2010-02-21 18:54 UTC, Allison Karlitskaya (desrt)
accepted-commit_after_freeze Details | Review

Description Allison Karlitskaya (desrt) 2010-02-15 01:47:40 UTC
eog is the best and fastest image viewer available on the GNOME desktop at present, but it lacks almost any editing functionality.

I think that keeping eog as the default viewer for images is probably the best idea for any distribution, but ideally it would be easier for users to edit their images from inside of eog.

To this end, I think there should be the possibility of an "Edit Image" toolbar button.  A key in GConf would specify the user's preferred image editor and the toolbar button would be available only if this editor was specified.

The idea is that a distribution can patch the GConf schema to default to using GIMP or F-Spot as the editor and then patch the default toolbar layout to add the "Edit Image" button in a prominent location.
Comment 1 Allison Karlitskaya (desrt) 2010-02-15 01:51:27 UTC
I should mention that I originally tried to make this a plugin but failed for several reasons:

1) Due to the nature of EggToolbarsModel, once an action has been added it had better always be there.  This makes unloading the plugin essentially impossible.

2) The code needs to be called relatively early in the window construction process in order for the tool item to end up in the toolbar.  The plugin engine runs too late for this.

3) (trivial) The EggToolbar stuff isn't accessible from plugins.

4) The plugin requires GConf schema support, and also required a change to configure.in to use gio-unix (for GDesktopAppInfo).
Comment 2 Allison Karlitskaya (desrt) 2010-02-15 01:51:56 UTC
Created attachment 153809 [details] [review]
Bug 609958 - add "Edit Image" toolbar button

Add a conditionally-enabled "Edit Image" toolbar button.  The toolbar is
only enabled if a specific image editor is specified in GConf.
Comment 3 Allison Karlitskaya (desrt) 2010-02-15 02:00:31 UTC
Created attachment 153810 [details] [review]
Example of how a distro might vendor-patch this

A quick demo of what a distribution might do to use GIMP as their editor.
Comment 4 Allison Karlitskaya (desrt) 2010-02-15 03:45:14 UTC
Review of attachment 153809 [details] [review]:

::: src/eog-window.c
@@ +4267,3 @@
+		}
+
+		g_free (editor);

oops.  Should have set initialised = TRUE here.
Comment 5 Allison Karlitskaya (desrt) 2010-02-15 06:22:58 UTC
Review of attachment 153809 [details] [review]:

::: src/eog-window.c
@@ +4326,3 @@
+	                           g_app_info_get_name (app_info));
+	action = gtk_action_new ("OpenEditor", _("Edit Image"), tooltip, NULL);
+	gtk_action_set_gicon (action, g_app_info_get_icon (app_info));

girlfriend-testing suggests the addition of this line:
        gtk_action_set_is_important (action, TRUE);
Comment 6 Felix Riemann 2010-02-19 20:36:41 UTC
Review of attachment 153809 [details] [review]:

Isn't this mostly the same as the present Open with menu except that it's limited to editing?

Also it assumes that the editor is also capable of editing SVG images.

::: src/eog-window.c
@@ +4255,3 @@
+	 */
+	static GDesktopAppInfo *app_info = NULL;
+	static gboolean initialised;

Should be initialized (FALSE), too.
Comment 7 Allison Karlitskaya (desrt) 2010-02-21 15:46:57 UTC
Yes.  But noboy knows about the "open with" menu.

About SVG: also assumes that the given editor is capable of opening URIs.

I'll draw up another version of the patch that fixes the two issues I mentioned and adds a check that the .desktop file supports the given mime type and file location.

Static variables always have their values initially set to all-zeros.
Comment 8 Allison Karlitskaya (desrt) 2010-02-21 18:54:31 UTC
Created attachment 154335 [details] [review]
new patch

Here's the updated patch.

I asked in #nautilus and apparently the correct thing to do in the face of remote files and applications that don't support URIs is to do it anyway.  This is the entire point of the FUSE-mount stuff -- network transparency for all applications.
Comment 9 Felix Riemann 2010-02-26 10:41:54 UTC
Review of attachment 154335 [details] [review]:

Okay, I guess we could give it a go.
But let's wait until after 2.30 as I've already been told off for including stuff after feature freeze.
Comment 10 Claudio Saavedra 2010-04-02 13:54:26 UTC
There were three different bugs reported for Ubuntu Eye of GNOME with this patch in, in our bugzilla. These issues, in my opinion, should be considered before merging this patch.

The bugs are: bug 614634, bug 614635, and bug 614637.
Comment 11 Yann 2010-04-03 13:27:51 UTC
Dear all,
I agree with Claudio.
Before integrating this patch, we should especially consider Bug 614637 which would the affect the ergonomy of Gnome.

I suggest Gnome should first implement the idea of Fabricio in Bug 534348 (EOG suggests to reload a modified file, in a simple way like Gedit does). 
This would be useful even if the patch is not integrated. And if the patch is integrated, this would prevent us from having bug 614635 and bug 614637, so the only remaining issue would be the bug 614634 (which is minor IMHO).
Comment 12 André Klapper 2010-05-18 21:03:10 UTC
(In reply to comment #9)
> Okay, I guess we could give it a go.
> But let's wait until after 2.30

EOG has been branched for gnome-2-30 so I assume this can be committed now.
Comment 13 Felix Riemann 2010-10-06 19:26:52 UTC
Committed it. Converted to GSettings while merging it.

commit b5e6b7d31181ab87f788921f751a6550bddb5bcf
Author: Ryan Lortie <>
Date:   Sun Feb 14 20:48:13 2010 -0500

    Bug 609958 - add "Edit Image" toolbar button
    
    Add a conditionally-enabled "Edit Image" toolbar button.  The toolbar is
    only enabled if a specific image editor is specified in GSettings.