[eog] Don't allow hiding the toolbar while editing it with the editor



commit 0a16d74a768987241879913f873a68709f3587b2
Author: Felix Riemann <friemann gnome org>
Date:   Tue Apr 26 22:39:38 2011 +0200

    Don't allow hiding the toolbar while editing it with the editor
    
    https://bugzilla.gnome.org/show_bug.cgi?id=648440

 src/eog-window.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/eog-window.c b/src/eog-window.c
index a948786..911968d 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -2449,6 +2449,8 @@ eog_window_cmd_edit_toolbar_cb (GtkDialog *dialog, gint response, gpointer data)
 
 		eog_application_save_toolbars_model (EOG_APP);
 
+		// Destroying the dialog will also make the previously
+		// disabled action sensitive again through the GBindings
         	gtk_widget_destroy (GTK_WIDGET (dialog));
 	}
 }
@@ -2459,6 +2461,7 @@ eog_window_cmd_edit_toolbar (GtkAction *action, gpointer *user_data)
 	EogWindow *window;
 	GtkWidget *dialog;
 	GtkWidget *editor;
+	GtkAction *tb_action;
 
 	g_return_if_fail (EOG_IS_WINDOW (user_data));
 
@@ -2506,6 +2509,17 @@ eog_window_cmd_edit_toolbar (GtkAction *action, gpointer *user_data)
 			  window);
 
 	gtk_widget_show_all (dialog);
+
+	tb_action = gtk_action_group_get_action (window->priv->actions_window,
+						"ViewToolbar");
+	/* Bind sensitivity of ViewToolbar action to the dialog's visibility.
+	 * This will make it sensitive again once the dialog goes away.
+	 */
+	if(tb_action)
+		g_object_bind_property (dialog, "visible",
+					tb_action, "sensitive", 
+					G_BINDING_SYNC_CREATE |
+					G_BINDING_INVERT_BOOLEAN);
 }
 
 static void



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