[eog] Set sensitivity for Save and Undo on image load



commit 011d68548f93cfe2fcf20c51075d4d5f71389472
Author: Felix Riemann <friemann gnome org>
Date:   Mon Oct 12 16:23:00 2009 +0200

    Set sensitivity for Save and Undo on image load
    
    They were disabled before which made it impossible to do changes to an
    image, switch to another, switch back and try to save/undo the changes.
    Respect lockdown settings for Save.

 src/eog-window.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/eog-window.c b/src/eog-window.c
index 417c779..7741a46 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -1533,10 +1533,10 @@ eog_job_load_cb (EogJobLoad *job, gpointer data)
 	action_save = gtk_action_group_get_action (priv->actions_image, "FileSave");
 	action_undo = gtk_action_group_get_action (priv->actions_image, "EditUndo");
 
-	/* We set these to be unsensitive on image load, we activate it
-	 * only when the image is changed. */
-	gtk_action_set_sensitive (action_save, FALSE);
-	gtk_action_set_sensitive (action_undo, FALSE);
+	/* Set Save and Undo sensitive according to image state.
+	 * Respect lockdown in case of Save.*/
+	gtk_action_set_sensitive (action_save, (!priv->save_disabled && eog_image_is_modified (job->image)));
+	gtk_action_set_sensitive (action_undo, eog_image_is_modified (job->image));
 
 	g_object_unref (job->image);
 }



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