[gnumeric] GUI: Fix problem with unhiding sheets.



commit 606c03bc2f73003eeaa81d444a59932ac810b580
Author: Morten Welinder <terra gnome org>
Date:   Sun Jun 13 17:02:02 2010 -0400

    GUI: Fix problem with unhiding sheets.

 ChangeLog               |   17 ++++++++----
 NEWS                    |    1 +
 src/sheet-control-gui.c |   66 ++++++++++++++++++++++------------------------
 src/wbc-gtk.c           |    9 ++++--
 4 files changed, 50 insertions(+), 43 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b35a6a1..2d84822 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-06-13  Morten Welinder  <terra gnome org>
+
+	* src/wbc-gtk.c (cb_sheet_visibility_change): Set visibility of
+	both label and page.  Fixes #621463.
+
 2010-06-11 Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* src/expr.c (gnm_insert_unique_value_cmp): new
@@ -13,14 +18,14 @@
 2010-06-11 Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* src/gnm-pane-impl.h: make cursor.expr_range into a GSList
-	* src/gnm-pane.h (gnm_pane_expr_cursor_bound_set): add main_colour arg 
-	* src/gnm-pane.c (gnm_pane_expr_cursor_bound_set): add main_colour 
+	* src/gnm-pane.h (gnm_pane_expr_cursor_bound_set): add main_colour arg
+	* src/gnm-pane.c (gnm_pane_expr_cursor_bound_set): add main_colour
 	  arg and don't delete existing cursors
 
 2010-06-10 Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* src/func-builtin.c (help_if): remove inconsistent period
-	
+
 2010-06-10  Morten Welinder  <terra gnome org>
 
 	* src/sheet.c (gnm_sheet_set_property): Mark sheet dirty in more
@@ -34,7 +39,7 @@
 	* src/dead-kittens.h: New file for kittens killed by gtk.
 
 2010-06-09 Andreas J. Guelzow <aguelzow pyrshep ca>
-	
+
 	* component/Gnumeric-embed.xml.in: add Function Help
 	* src/GNOME_Gnumeric-gtk.xml.in: ditto
 	* src/HILDON_Gnumeric-gtk.xml.in: ditto
@@ -64,10 +69,10 @@
 	(cb_expr_name_check_for_name): new
 	(cb_expr_name_check_for_name_eq): new
 	(expr_name_check_for_name): new
-	
+
 2010-06-04 Andreas J. Guelzow <aguelzow pyrshep ca>
 
-	* src/commands.c (cmd_define_name): be clearer with the error 
+	* src/commands.c (cmd_define_name): be clearer with the error
 	  messages.
 	(cmd_rescope_name_redo): watch out for returned error strings
 
diff --git a/NEWS b/NEWS
index 0088596..ca569d0 100644
--- a/NEWS
+++ b/NEWS
@@ -35,6 +35,7 @@ Morten:
 	* GEOMDIST: avoid overflow in extreme cases.
 	* SFTEST: improve extreme-case precision.
 	* Fix RANDLEVY.
+	* Fix hidden-sheet problem.  [#621463]
 
 --------------------------------------------------------------------------
 Gnumeric 1.10.5
diff --git a/src/sheet-control-gui.c b/src/sheet-control-gui.c
index 6caf24a..6a76acf 100644
--- a/src/sheet-control-gui.c
+++ b/src/sheet-control-gui.c
@@ -74,11 +74,9 @@
 
 #include <string.h>
 
-#define DEBUG_DND
-
 static GObjectClass *scg_parent_class;
 
-static void scg_unant        (SheetControl *sc);
+static void scg_unant (SheetControl *sc);
 static void set_resize_pane_pos (SheetControlGUI *scg, GtkPaned *p);
 static void cb_resize_pane_motion (GtkPaned *p, GParamSpec *pspec, SheetControlGUI *scg);
 
@@ -1236,7 +1234,7 @@ resize_pane_pos (SheetControlGUI *scg, GtkPaned *p,
 static void
 scg_gtk_paned_set_position (SheetControlGUI *scg, GtkPaned *p, int pane_pos)
 {
-	if (p == scg->vpane) 
+	if (p == scg->vpane)
 		scg->vpos = pane_pos;
 	else
 		scg->hpos = pane_pos;
@@ -1359,7 +1357,7 @@ cb_resize_pane_motion (GtkPaned *p,
 }
 
 static void
-cb_check_resize (GtkPaned *p, GtkAllocation *allocation, 
+cb_check_resize (GtkPaned *p, GtkAllocation *allocation,
 		 SheetControlGUI *scg)
 {
 	gboolean const vert = (p == scg->vpane);
@@ -2232,7 +2230,7 @@ scg_object_unselect (SheetControlGUI *scg, SheetObject *so)
 	wb_control_update_action_sensitivity (scg_wbc (scg));
 }
 
-void 
+void
 scg_object_select_next	(SheetControlGUI *scg, gboolean reverse)
 {
 	Sheet *sheet = scg_sheet (scg);
@@ -2240,14 +2238,14 @@ scg_object_select_next	(SheetControlGUI *scg, gboolean reverse)
 
 	g_return_if_fail (ptr != NULL);
 
-	if ((scg->selected_objects == NULL) || 
+	if ((scg->selected_objects == NULL) ||
 	    (g_hash_table_size (scg->selected_objects) == 0)) {
 		scg_object_select (scg, ptr->data);
 		return;
 	} else {
 		GSList *prev = NULL;
 		for (; ptr != NULL ; prev = ptr, ptr = ptr->next)
-			if (NULL != g_hash_table_lookup 
+			if (NULL != g_hash_table_lookup
 			    (scg->selected_objects, ptr->data)) {
 				SheetObject *target;
 				if (reverse) {
@@ -3570,7 +3568,6 @@ scg_drag_receive_same_process (SheetControlGUI *scg, GtkWidget *source_widget,
 	}
 }
 
-#ifdef DEBUG_DND
 /*  Keep in sync with gtk_selection_data_targets_include_text() */
 static gboolean
 is_text_target (gchar *target_type)
@@ -3591,7 +3588,6 @@ is_text_target (gchar *target_type)
 	g_free (text_plain_locale);
 	return ret;
 }
-#endif
 
 void
 scg_drag_data_received (SheetControlGUI *scg, GtkWidget *source_widget,
@@ -3610,31 +3606,33 @@ scg_drag_data_received (SheetControlGUI *scg, GtkWidget *source_widget,
 		scg_drag_receive_same_process (scg, source_widget, x, y);
 	} else if (!strcmp (target_type, "application/x-gnumeric")) {
 		scg_drag_receive_cellregion (scg, x, y, sel_data, sel_len);
-#ifdef DEBUG_DND
-	} else if (!strcmp (target_type, "x-special/gnome-copied-files")) {
-		char *cdata = g_strndup (sel_data, sel_len);
-		g_print ("data length: %d, data: %s\n",
-			 (int)sel_len, cdata);
-		g_free (cdata);
-	} else if (!strcmp (target_type, "_NETSCAPE_URL")) {
-		char *cdata = g_strndup (sel_data, sel_len);
-		g_print ("data length: %d, data: %s\n",
-			 (int)sel_len, cdata);
-		g_free (cdata);
-	} else if (is_text_target (target_type)) {
-		char *cdata = g_strndup (sel_data, sel_len);
-		g_print ("data length: %d, data: %s\n",
-			 (int)sel_len, cdata);
-		g_free (cdata);
-	} else if (!strcmp (target_type, "text/html")) {
-		char *cdata = g_strndup (sel_data, sel_len);
-		/* For mozilla, need to convert the encoding */
-		g_print ("data length: %d, data: %s\n", (int)sel_len, cdata);
-		g_free (cdata);
-#endif
 	} else
 		g_warning ("Unknown target type '%s'!", target_type);
 
+	if (gnm_debug_flag ("dnd")) {
+		if (!strcmp (target_type, "x-special/gnome-copied-files")) {
+			char *cdata = g_strndup (sel_data, sel_len);
+			g_print ("data length: %d, data: %s\n",
+				 (int)sel_len, cdata);
+			g_free (cdata);
+		} else if (!strcmp (target_type, "_NETSCAPE_URL")) {
+			char *cdata = g_strndup (sel_data, sel_len);
+			g_print ("data length: %d, data: %s\n",
+				 (int)sel_len, cdata);
+			g_free (cdata);
+		} else if (is_text_target (target_type)) {
+			char *cdata = g_strndup (sel_data, sel_len);
+			g_print ("data length: %d, data: %s\n",
+				 (int)sel_len, cdata);
+			g_free (cdata);
+		} else if (!strcmp (target_type, "text/html")) {
+			char *cdata = g_strndup (sel_data, sel_len);
+			/* For mozilla, need to convert the encoding */
+			g_print ("data length: %d, data: %s\n", (int)sel_len, cdata);
+			g_free (cdata);
+		}
+	}
+
 	g_free (target_type);
 }
 
@@ -3799,12 +3797,12 @@ scg_delete_sheet_if_possible (SheetControlGUI *scg)
 	}
 }
 
-void 
+void
 scg_reload_item_edits (SheetControlGUI *scg)
 {
 	SCG_FOREACH_PANE (scg, pane, {
 			if (pane->editor != NULL)
-				goc_item_bounds_changed 
+				goc_item_bounds_changed
 					(GOC_ITEM (pane->editor));
 	});
 }
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index c9a7a96..4b6eaef 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -1189,11 +1189,14 @@ cb_sheet_visibility_change (Sheet *sheet,
 			    G_GNUC_UNUSED GParamSpec *pspec,
 			    SheetControlGUI *scg)
 {
+	gboolean viz;
+
 	g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
 
-	g_object_set (GTK_WIDGET (scg->label),
-		      "visible", sheet_is_visible (sheet),
-		      NULL);
+	viz = sheet_is_visible (sheet);
+	gtk_widget_set_visible (GTK_WIDGET (scg->table), viz);
+	gtk_widget_set_visible (GTK_WIDGET (scg->label), viz);
+
 	wbcg_menu_state_sheet_count (scg->wbcg);
 }
 



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