[libgda] Misc corrections
- From: Vivien Malerba <vivien src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libgda] Misc corrections
- Date: Mon, 5 Oct 2009 18:46:49 +0000 (UTC)
commit efe52c1661d727cb1ad7d74f22a8818a58682842
Author: Vivien Malerba <malerba gnome-db org>
Date: Mon Oct 5 20:43:17 2009 +0200
Misc corrections
libgda-ui/gdaui-basic-form.c | 17 ++++++++++++-----
tools/browser/common/objects-cloud.c | 4 ++--
tools/browser/query-exec/gda-sql.lang | 2 +-
tools/browser/query-exec/query-console.c | 3 ++-
tools/browser/support.c | 2 +-
tools/browser/support.h | 4 ++--
6 files changed, 20 insertions(+), 12 deletions(-)
---
diff --git a/libgda-ui/gdaui-basic-form.c b/libgda-ui/gdaui-basic-form.c
index 68c8993..1eb196d 100644
--- a/libgda-ui/gdaui-basic-form.c
+++ b/libgda-ui/gdaui-basic-form.c
@@ -1878,6 +1878,7 @@ entry_contents_modified (GdauiDataEntry *entry, GdauiBasicForm *form)
param = g_object_get_data (G_OBJECT (entry), "param");
if (param) { /* single parameter */
GValue *value;
+ GError *error = NULL;
form->priv->forward_param_updates = FALSE;
@@ -1886,7 +1887,7 @@ entry_contents_modified (GdauiDataEntry *entry, GdauiBasicForm *form)
if ((!value || gda_value_is_null (value)) &&
(attr & GDA_VALUE_ATTR_IS_DEFAULT))
gda_holder_set_value_to_default (param);
- else if (gda_holder_set_value (param, value, NULL)) {
+ else if (gda_holder_set_value (param, value, &error)) {
#ifdef debug_signal
g_print (">> 'PARAM_CHANGED' from %s\n", __FUNCTION__);
#endif
@@ -1895,8 +1896,11 @@ entry_contents_modified (GdauiDataEntry *entry, GdauiBasicForm *form)
g_print ("<< 'PARAM_CHANGED' from %s\n", __FUNCTION__);
#endif
}
- else
- TO_IMPLEMENT;
+ else {
+ g_warning (_("Parameter did not accept form's change: %s"),
+ error && error->message ? error->message : _("No detail"));
+ g_clear_error (&error);
+ }
gda_value_free (value);
form->priv->forward_param_updates = TRUE;
}
@@ -2508,7 +2512,7 @@ gdaui_basic_form_get_label_widget (GdauiBasicForm *form, GdaHolder *param)
*/
GtkWidget *
gdaui_basic_form_new_in_dialog (GdaSet *paramlist, GtkWindow *parent,
- const gchar *title, const gchar *header)
+ const gchar *title, const gchar *header)
{
GtkWidget *form;
GtkWidget *dlg;
@@ -2529,10 +2533,13 @@ gdaui_basic_form_new_in_dialog (GdaSet *paramlist, GtkWindow *parent,
NULL);
if (header && *header) {
GtkWidget *label;
+ gchar *str;
label = gtk_label_new (NULL);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
- gtk_label_set_markup (GTK_LABEL (label), header);
+ str = g_markup_printf_escaped ("<b>%s:</b>", header);
+ gtk_label_set_markup (GTK_LABEL (label), str);
+ g_free (str);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), label, FALSE, FALSE, 5);
gtk_widget_show (label);
}
diff --git a/tools/browser/common/objects-cloud.c b/tools/browser/common/objects-cloud.c
index 1829b09..4b6b578 100644
--- a/tools/browser/common/objects-cloud.c
+++ b/tools/browser/common/objects-cloud.c
@@ -177,8 +177,8 @@ update_display (ObjectsCloud *cloud)
mstruct = cloud->priv->mstruct;
if (!mstruct) {
/* nothing to display */
- g_object_unref (sd->mark);
- g_free (sd);
+ g_object_unref (default_sd->mark);
+ g_free (default_sd);
return;
}
dbo_list = g_slist_reverse (gda_meta_struct_get_all_db_objects (mstruct));
diff --git a/tools/browser/query-exec/gda-sql.lang b/tools/browser/query-exec/gda-sql.lang
index d8d1e9c..c52788b 100644
--- a/tools/browser/query-exec/gda-sql.lang
+++ b/tools/browser/query-exec/gda-sql.lang
@@ -102,7 +102,7 @@
</context>
<context id="shortvariable" style-ref="variable">
- <match>##[0-9a-zA-Z\+\- ]+(::[0-9a-zA-Z]+(::NULL)?)?</match>
+ <match>##[0-9a-zA-Z\+\-_ ]+(::[0-9a-zA-Z]+(::NULL)?)?</match>
</context>
<context id="longvariable" style-ref="variable">
diff --git a/tools/browser/query-exec/query-console.c b/tools/browser/query-exec/query-console.c
index f161821..f4c9ffd 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))
+ if (tconsole->priv->params && 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/support.c b/tools/browser/support.c
index 94030de..7e916af 100644
--- a/tools/browser/support.c
+++ b/tools/browser/support.c
@@ -177,7 +177,7 @@ browser_show_notice (GtkWindow *parent, const gchar *context, const gchar *forma
if (context) {
if (!hidden_contexts)
hidden_contexts = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
- hide = g_hash_table_lookup (hidden_contexts, context);
+ hide = GPOINTER_TO_INT (g_hash_table_lookup (hidden_contexts, context));
}
if (hide) {
diff --git a/tools/browser/support.h b/tools/browser/support.h
index 1efb212..aa13d91 100644
--- a/tools/browser/support.h
+++ b/tools/browser/support.h
@@ -19,8 +19,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifndef __SUPPORT_H_
-#define __SUPPORT_H_
+#ifndef __SUPPORT_H__
+#define __SUPPORT_H__
#include <libgda/libgda.h>
#include <gtk/gtk.h>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]