gnumeric r16907 - in trunk: . src/dialogs



Author: guelzow
Date: Mon Oct 20 18:34:04 2008
New Revision: 16907
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16907&view=rev

Log:
2008-10-20  Andreas J. Guelzow <aguelzow pyrshep ca>

	* dialog-sheet-order.c (cb_selection_changed): only enable
	  delete button if there are at least 2 sheets [#557083]
	(cb_duplicate_clicked): call cb_selection_changed
	(cb_append_clicked): call cb_selection_changed
	(cb_add_clicked): call cb_selection_changed



Modified:
   trunk/NEWS
   trunk/src/dialogs/ChangeLog
   trunk/src/dialogs/dialog-sheet-order.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Mon Oct 20 18:34:04 2008
@@ -2,7 +2,8 @@
 
 Andreas:
 	* Change sheet manage dialog into an instant-apply dialog
-	* Implemented sheet duplication in manage sheet dialog [#128160]	
+	* Implemented sheet duplication in manage sheet dialog [#128160]
+	* Do not allow the last sheet to be deleted [#557083]	
 
 Jody:
 	* Display top-left when selecting a rel ref to a merged region.

Modified: trunk/src/dialogs/dialog-sheet-order.c
==============================================================================
--- trunk/src/dialogs/dialog-sheet-order.c	(original)
+++ trunk/src/dialogs/dialog-sheet-order.c	Mon Oct 20 18:34:04 2008
@@ -268,7 +268,9 @@
 
 	gtk_widget_set_sensitive (state->ccombo_back, TRUE);
 	gtk_widget_set_sensitive (state->ccombo_fore, TRUE);
-	gtk_widget_set_sensitive (state->delete_btn, TRUE);
+	gtk_widget_set_sensitive 
+	  (state->delete_btn, 
+	   gtk_tree_model_iter_n_children(GTK_TREE_MODEL (state->model), NULL)>1);
 	gtk_widget_set_sensitive (state->add_btn, TRUE);
 	gtk_widget_set_sensitive (state->duplicate_btn, TRUE);
 
@@ -702,6 +704,7 @@
 
 	set_sheet_info_at_iter (state, &iter, sheet);
 	
+	cb_selection_changed (NULL, state);
 }
 
 static void
@@ -730,6 +733,8 @@
 	g_signal_handler_unblock (state->model, state->model_row_insertion_listener);
 	
 	set_sheet_info_at_iter (state, &iter, sheet);
+
+	cb_selection_changed (NULL, state);
 }
 
 static void
@@ -769,6 +774,8 @@
 
 	set_sheet_info_at_iter (state, &iter, new_sheet);
 	g_object_unref (new_sheet);	
+
+	cb_selection_changed (NULL, state);
 }
 
 static void



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