[gedit] Manage better the sensitivity



commit 2d7c20a4a92c30ab5cc41d4800dabc98248512e4
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Tue Jun 22 23:29:48 2010 +0200

    Manage better the sensitivity

 gedit/gedit-window.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index 583eb9c..f238188 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -3627,14 +3627,17 @@ on_tab_removed (GeditMultiNotebook *multi,
 
 	if (!window->priv->dispose_has_run)
 	{
-		if (!window->priv->removing_tabs || num_tabs == 0)
+		if ((!window->priv->removing_tabs &&
+		    gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook)) > 0) ||
+		    num_tabs == 0)
 		{
 			update_documents_list_menu (window);
 			update_next_prev_doc_sensitivity_per_window (window);
+			update_sensitivity_according_to_open_tabs (window,
+								   num_notebooks,
+								   num_tabs);
 		}
 
-		update_sensitivity_according_to_open_tabs (window, num_notebooks, num_tabs);
-
 		if (num_tabs == 0)
 		{
 			gedit_plugins_engine_update_plugins_ui (gedit_plugins_engine_get_default (),
@@ -3716,6 +3719,9 @@ on_notebook_changed (GeditMultiNotebook *multi,
 		     GeditWindow        *window)
 {
 	update_documents_list_menu (window);
+	update_sensitivity_according_to_open_tabs (window,
+						   gedit_multi_notebook_get_n_notebooks (multi),
+						   gedit_multi_notebook_get_n_tabs (multi));
 }
 
 static void



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