[libgda] Minor combo UI entry corrections



commit 7c3460ba0faabc61d87a5f93df22ccfb5fa8ceaf
Author: Vivien Malerba <malerba gnome-db org>
Date:   Wed Jul 28 19:25:21 2010 +0200

    Minor combo UI entry corrections

 libgda-ui/data-entries/gdaui-entry-combo.c |    3 +++
 libgda-ui/gdaui-basic-form.c               |   11 +++++------
 2 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/libgda-ui/data-entries/gdaui-entry-combo.c b/libgda-ui/data-entries/gdaui-entry-combo.c
index f8845aa..7689ff2 100644
--- a/libgda-ui/data-entries/gdaui-entry-combo.c
+++ b/libgda-ui/data-entries/gdaui-entry-combo.c
@@ -254,6 +254,7 @@ uiset_source_model_changed_cb (GdauiSet *paramlist, GdauiSetSource *source, Gdau
 				       combo->priv->source->shown_cols_index);
 		_gdaui_combo_set_selected_ext (GDAUI_COMBO (combo->priv->combo_entry), values, NULL);
 		g_slist_free (values);
+		gdaui_combo_add_null (GDAUI_COMBO (combo->priv->combo_entry), combo->priv->null_possible);
 	}
 }
 
@@ -316,6 +317,8 @@ void _gdaui_entry_combo_construct (GdauiEntryCombo* combo, GdauiSet *paramlist,
 	_gdaui_combo_set_selected_ext (GDAUI_COMBO (entry), values, NULL);
 	g_slist_free (values);
 	gdaui_combo_add_null (GDAUI_COMBO (entry), combo->priv->null_possible);
+
+	combo->priv->data_valid = combo->priv->null_possible ? TRUE : FALSE;
 }
 
 static void
diff --git a/libgda-ui/gdaui-basic-form.c b/libgda-ui/gdaui-basic-form.c
index 9867569..2c509db 100644
--- a/libgda-ui/gdaui-basic-form.c
+++ b/libgda-ui/gdaui-basic-form.c
@@ -821,7 +821,7 @@ create_entry_widget (SingleEntry *sentry)
 	else {
 		/* several parameters depending on the values of a GdaDataModel object */
 		GSList *plist;
-		gboolean nnul = TRUE;
+		gboolean nullok = TRUE;
 			
 		entry = gdaui_entry_combo_new (sentry->form->priv->set_info, group->source);
 
@@ -831,8 +831,8 @@ create_entry_widget (SingleEntry *sentry)
 			GdaHolder *param;
 
 			param = GDA_SET_NODE (plist->data)->holder;
-			if (!gda_holder_get_not_null (param))
-				nnul = FALSE;
+			if (gda_holder_get_not_null (param))
+				nullok = FALSE;
 
 			SignalData sd;
 			sd.holder = g_object_ref (param);
@@ -842,12 +842,11 @@ create_entry_widget (SingleEntry *sentry)
 			g_array_append_val (sentry->group_signals, sd);
 		}
 		gdaui_data_entry_set_attributes (GDAUI_DATA_ENTRY (entry),
-						 nnul ? 0 : GDA_VALUE_ATTR_CAN_BE_NULL,
+						 nullok ? GDA_VALUE_ATTR_CAN_BE_NULL : 0,
 						 GDA_VALUE_ATTR_CAN_BE_NULL);
-		sentry->not_null = nnul;
+		sentry->not_null = !nullok;
 
 		/* label */
-		/* FIXME: find a better label and tooltip and improve data entry attributes */
 		gchar *title = NULL;
 		gchar *str;
 		GSList *params;



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