[libgda] Misc corrections



commit 8419c1906551a808ff0ff6c66dc2111fce117e68
Author: Vivien Malerba <malerba gnome-db org>
Date:   Fri Oct 2 20:54:42 2009 +0200

    Misc corrections

 libgda-ui/internal/utility.c             |   33 +++++++++++++----------------
 libgda/gda-sql-builder.c                 |    3 ++
 tools/browser/query-exec/query-console.c |    3 +-
 tools/browser/query-exec/query-editor.h  |    2 +-
 4 files changed, 21 insertions(+), 20 deletions(-)
---
diff --git a/libgda-ui/internal/utility.c b/libgda-ui/internal/utility.c
index 101c906..5334aad 100644
--- a/libgda-ui/internal/utility.c
+++ b/libgda-ui/internal/utility.c
@@ -387,35 +387,32 @@ static GtkWidget *
 create_data_error_dialog (GdauiDataWidget *form, gboolean with_question, gboolean can_discard, GError *filled_error)
 {
 	GtkWidget *dlg;
-	gchar *msg;
+	const gchar *msg1 = NULL, *msg2 = NULL;
 
 	if (can_discard) {
+		msg1 = _("Current modified data is invalid");
 		if (with_question)
-			msg = g_strdup_printf ("<b>%s:</b>\n\n%s",
-					       _("Current modified data is invalid"),
-					       _("You may now choose to correct it, or to discard\n"
-						 "the modifications.\n\n"
-						 "What do you wan to do?"));
+			msg2 =_("You may now choose to correct it, or to discard\n"
+				"the modifications.\n\n"
+				"What do you wan to do?");
 		else
-			msg = g_strdup_printf ("<b>%s:</b>\n\n%s",
-					       _("Current modified data is invalid"),
-					       _("please correct it and try again, or discard\n"
-						 "the modifications."));
+			msg2 = _("please correct it and try again, or discard\n"
+				 "the modifications.");
 	}
 	else {
 		if (with_question)
 			g_warning ("Incoherence problem...\n");
-		else
-			msg = g_strdup_printf ("<b>%s:</b>\n\n%s",
-					       _("Part of the current modified data was invalid"),
-					       _("As no transaction was used, only a part of the valid data\n"
-						 "has been written, and the remaining modification have been discarded."));
+		else {
+			msg1 = _("Part of the current modified data was invalid");
+			msg2 = _("As no transaction was used, only a part of the valid data\n"
+				 "has been written, and the remaining modification have been discarded.");
+		}
 	}
-	dlg = gtk_message_dialog_new_with_markup ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (form)), GTK_DIALOG_MODAL,
+	dlg = gtk_message_dialog_new_with_markup ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (form)),
+						  GTK_DIALOG_MODAL,
 						  GTK_MESSAGE_ERROR, 
 						  with_question ? GTK_BUTTONS_NONE : GTK_BUTTONS_CLOSE,
-						  "%s", msg);
-	g_free (msg);
+						  "<b>%s:</b>\n\n%s", msg1, msg2);
 
 	if (filled_error && filled_error->message) {
 		GtkWidget *exp, *sw, *view;
diff --git a/libgda/gda-sql-builder.c b/libgda/gda-sql-builder.c
index ce6d0fa..dcf7c1f 100644
--- a/libgda/gda-sql-builder.c
+++ b/libgda/gda-sql-builder.c
@@ -926,6 +926,9 @@ gda_sql_builder_select_add_target (GdaSqlBuilder *builder, guint id, guint table
 	((GdaSqlSelectTarget*) btarget)->expr = (GdaSqlExpr*) use_part (p, GDA_SQL_ANY_PART (btarget));
 	if (alias) 
 		((GdaSqlSelectTarget*) btarget)->as = g_strdup (alias);
+	if (g_value_get_string (((GdaSqlSelectTarget*) btarget)->expr->value))
+		((GdaSqlSelectTarget*) btarget)->table_name = 
+			g_value_dup_string (((GdaSqlSelectTarget*) btarget)->expr->value);
 
 	/* add target to sel->from. NOTE: @btarget is NOT added to the "repository" or GdaSqlAnyPart parts
 	* like others */
diff --git a/tools/browser/query-exec/query-console.c b/tools/browser/query-exec/query-console.c
index b7a9a82..f161821 100644
--- a/tools/browser/query-exec/query-console.c
+++ b/tools/browser/query-exec/query-console.c
@@ -649,7 +649,8 @@ compute_params (QueryConsole *tconsole)
 				}
 			}
 		}
-
+		if (show_variables && gda_set_is_valid (tconsole->priv->params, NULL))
+			show_variables = FALSE;
 		if (show_variables && !gtk_toggle_button_get_active (tconsole->priv->params_toggle))
 			gtk_toggle_button_set_active (tconsole->priv->params_toggle, TRUE);
 	}
diff --git a/tools/browser/query-exec/query-editor.h b/tools/browser/query-exec/query-editor.h
index 3aa207e..1fccfff 100644
--- a/tools/browser/query-exec/query-editor.h
+++ b/tools/browser/query-exec/query-editor.h
@@ -41,7 +41,7 @@ G_BEGIN_DECLS
 			       "   <small><b>CTRL - l</b></small> to clear the editor\n" \
 			       "   <small><b>CTRL - ENTER</b></small> to execute SQL\n" \
 			       "   <small><b>CTRL - Up</b></small> to move to previous executed SQL in history\n" \
-			       "   <small><b>CTRL - Down</b></small> to move to next executed SQL in history" \
+			       "   <small><b>CTRL - Down</b></small> to move to next executed SQL in history\n" \
 			       "   <small><b>CTRL - SPACE</b></small> to obtain a completion list")
 
 typedef struct _QueryEditor        QueryEditor;



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