[libgda] Better entry label in GdauiBasicForm
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] Better entry label in GdauiBasicForm
- Date: Wed, 28 Jul 2010 15:47:29 +0000 (UTC)
commit 4eefec425655e8d259f6ac3e249ff65734c6a42f
Author: Vivien Malerba <malerba gnome-db org>
Date: Mon Jul 26 22:15:56 2010 +0200
Better entry label in GdauiBasicForm
for multiple entries linked by the same data model
libgda-ui/gdaui-basic-form.c | 34 +++++++++++++++++++++-------------
1 files changed, 21 insertions(+), 13 deletions(-)
---
diff --git a/libgda-ui/gdaui-basic-form.c b/libgda-ui/gdaui-basic-form.c
index 1f71243..bbe2120 100644
--- a/libgda-ui/gdaui-basic-form.c
+++ b/libgda-ui/gdaui-basic-form.c
@@ -841,22 +841,30 @@ create_entry_widget (SingleEntry *sentry)
gchar *title = NULL;
gchar *str;
GSList *params;
-
- for (params = sentry->group->group->nodes; params; params = params->next) {
- g_object_get (G_OBJECT (GDA_SET_NODE (params->data)->holder),
- "name", &title, NULL);
- if (title)
- break;
- }
-
- if (!title) {
- str = g_object_get_data (G_OBJECT (group->group->nodes_source->data_model),
- "name");
- if (str)
- title = g_strdup (str);
+
+ str = g_object_get_data (G_OBJECT (group->group->nodes_source->data_model), "name");
+ if (str)
+ title = g_strdup (str);
+ else {
+ GString *tstring = NULL;
+ for (params = sentry->group->group->nodes; params; params = params->next) {
+ g_object_get (G_OBJECT (GDA_SET_NODE (params->data)->holder),
+ "name", &title, NULL);
+ if (title) {
+ if (tstring)
+ g_string_append (tstring, ",\n");
+ else
+ tstring = g_string_new ("");
+ g_string_append (tstring, title);
+ }
+ }
+ if (tstring)
+ title = g_string_free (tstring, FALSE);
}
+
if (!title)
title = g_strdup (_("Value"));
+
str = g_strdup_printf ("%s:", title);
sentry->label = gtk_label_new (str);
g_free (str);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]