[gnumeric] Fix multiple error message boxes in graph guru



commit 2a2d1cd2af7b9fea6fff43ea32fd4df60c71b19d
Author: Jean Brefort <jean brefort normalesup org>
Date:   Thu Nov 26 21:26:53 2009 +0100

    Fix multiple error message boxes in graph guru

 ChangeLog         |    6 ++++++
 NEWS              |    1 +
 src/wbc-gtk.c     |   24 +++++++++++++++++++++++-
 tools/ChangeLog   |    4 ++++
 tools/win32/build |    6 +++++-
 5 files changed, 39 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 585e3b7..fcafa47 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-26  Jean Brefort  <jean brefort normalesup org>
+
+	* src/wbc-gtk.c (cb_graph_dim_editor_update), (cb_update_idle),
+	(cb_graph_dim_entry_focus_out_event), (cb_graph_dim_entry_changed),
+	(wbcg_data_allocator_editor): avoid piles of error message boxes. [#152517]
+
 2009-11-25  Morten Welinder  <terra gnome org>
 
 	* src/commands.c (cmd_scenario_add_redo, cmd_scenario_add_undo):
diff --git a/NEWS b/NEWS
index 6783eb0..b7473fc 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ Andreas:
 
 Jean:
 	* Fix cursor and cell edition on dark backgrounds. [#600656]
+	* Fix multiple error message boxes in graph guru. [#152517]
 
 Jody:
 	* turnkey win32 build on 32bit host.
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index aa9e0e1..7df68ab 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -4662,6 +4662,7 @@ typedef struct {
 	int dim_i;
 	gboolean suppress_update;
 	GogDataType data_type;
+	gboolean changed;
 
 	gulong dataset_changed_handler;
 	gulong entry_update_handler;
@@ -4675,6 +4676,7 @@ cb_graph_dim_editor_update (GnmExprEntry *gee,
 	GOData *data = NULL;
 	Sheet *sheet;
 	SheetControlGUI *scg;
+	editor->changed = FALSE;
 
 	/* Ignore changes while we are insensitive. useful for displaying
 	 * values, without storing them as Data.  Also ignore updates if the
@@ -4709,6 +4711,8 @@ cb_graph_dim_editor_update (GnmExprEntry *gee,
 				wb_control_validation_msg (WORKBOOK_CONTROL (scg_wbcg (scg)),
 					VALIDATION_STYLE_INFO, NULL, perr.err->message);
 				parse_error_free (&perr);
+				gtk_editable_select_region (GTK_EDITABLE (gnm_expr_entry_get_entry (editor->entry)), 0, G_MAXINT);
+				editor->changed = TRUE;
 				return;
 			}
 		}
@@ -4732,16 +4736,31 @@ cb_graph_dim_editor_update (GnmExprEntry *gee,
 }
 
 static gboolean
+cb_update_idle (GraphDimEditor *editor)
+{
+	cb_graph_dim_editor_update (editor->entry, FALSE, editor);
+	return FALSE;
+}
+
+static gboolean
 cb_graph_dim_entry_focus_out_event (G_GNUC_UNUSED GtkEntry	*ignored,
 				    G_GNUC_UNUSED GdkEventFocus	*event,
 				    GraphDimEditor		*editor)
 {
-	cb_graph_dim_editor_update (editor->entry, FALSE, editor);
+	if (!editor->changed)
+		return FALSE;
+	g_idle_add ((GSourceFunc) cb_update_idle, editor);
 
 	return FALSE;
 }
 
 static void
+cb_graph_dim_entry_changed (GraphDimEditor *editor)
+{
+	editor->changed = TRUE;
+}
+
+static void
 set_entry_contents (GnmExprEntry *entry, GOData *val)
 {
 	SheetControlGUI *scg = gnm_expr_entry_get_scg (entry);
@@ -4819,6 +4838,9 @@ wbcg_data_allocator_editor (GogDataAllocator *dalloc,
 	g_signal_connect (G_OBJECT (gnm_expr_entry_get_entry (editor->entry)),
 		"focus-out-event",
 		G_CALLBACK (cb_graph_dim_entry_focus_out_event), editor);
+	g_signal_connect_swapped (G_OBJECT (gnm_expr_entry_get_entry (editor->entry)),
+		"changed",
+		G_CALLBACK (cb_graph_dim_entry_changed), editor);
 	editor->dataset_changed_handler = g_signal_connect (G_OBJECT (editor->dataset),
 		"changed", G_CALLBACK (cb_dataset_changed), editor);
 	g_object_set_data_full (G_OBJECT (editor->entry),
diff --git a/tools/ChangeLog b/tools/ChangeLog
index 310533a..0f1eb37 100644
--- a/tools/ChangeLog
+++ b/tools/ChangeLog
@@ -1,3 +1,7 @@
+2009-11-26  Jean Brefort  <jean brefort normalesup org>
+
+	* win32/build: make without shell build work again.
+
 2009-11-01  Morten Welinder <terra gnome org>
 
 	* Release 1.9.15
diff --git a/tools/win32/build b/tools/win32/build
index 97a7499..6e56769 100755
--- a/tools/win32/build
+++ b/tools/win32/build
@@ -59,7 +59,11 @@ build_ls_s() {
     build_ls_s "${WINEDIR}/Python${py_ver}/libs/python${py_ver}.lib"	"lib/libpython${py_ver}.dll.a"
 
 # prep jhbuild files
-    ${HOME}/bin/jhbuild -f "${srcdir}/jhbuildrc.py" "${is_shell}"
+    if [ ! "x${is_shell}" = "x" ]; then
+ 	${HOME}/bin/jhbuild -f "${srcdir}/jhbuildrc.py" "${is_shell}"
+    else
+	${HOME}/bin/jhbuild -f "${srcdir}/jhbuildrc.py"
+fi
 
 ################################################################
 # TODO



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