[libgda] UI: misc data entry corrections
- From: Vivien Malerba <vivien src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libgda] UI: misc data entry corrections
- Date: Tue, 29 Sep 2009 19:27:57 +0000 (UTC)
commit 29720cdf9371b003d289083a9700720fd2ae5182
Author: Vivien Malerba <malerba gnome-db org>
Date: Tue Sep 29 20:36:55 2009 +0200
UI: misc data entry corrections
libgda-ui/data-entries/gdaui-entry-wrapper.c | 32 +++++++++++++-------------
libgda-ui/data-entries/gdaui-entry.c | 11 ++++++--
libgda-ui/gdaui-basic-form.c | 3 +-
libgda-ui/gdaui-init.c | 3 +-
4 files changed, 28 insertions(+), 21 deletions(-)
---
diff --git a/libgda-ui/data-entries/gdaui-entry-wrapper.c b/libgda-ui/data-entries/gdaui-entry-wrapper.c
index 17ed108..1dcbc3a 100644
--- a/libgda-ui/data-entries/gdaui-entry-wrapper.c
+++ b/libgda-ui/data-entries/gdaui-entry-wrapper.c
@@ -22,7 +22,7 @@
#include <libgda/gda-data-handler.h>
#include <libgda/gda-enums.h>
-static void gdaui_entry_wrapper_class_init (GdauiEntryWrapperClass *class);
+static void gdaui_entry_wrapper_class_init (GdauiEntryWrapperClass *klass);
static void gdaui_entry_wrapper_init (GdauiEntryWrapper *wid);
static void gdaui_entry_wrapper_dispose (GObject *object);
@@ -67,7 +67,7 @@ enum
struct _GdauiEntryWrapperPriv {
gboolean impl_is_correct;
GtkWidget *entry;
- GdauiEntryWrapperClass *real_class;
+ GdauiEntryWrapperClass *real_class;
guint signals_blocked;
GType type;
@@ -139,16 +139,16 @@ gdaui_entry_wrapper_data_entry_init (GdauiDataEntryIface *iface)
static void
-gdaui_entry_wrapper_class_init (GdauiEntryWrapperClass *class)
+gdaui_entry_wrapper_class_init (GdauiEntryWrapperClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (class);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (class);
+ parent_class = g_type_class_peek_parent (klass);
/* virtual functions */
- class->create_entry = NULL;
- class->real_set_value = NULL;
- class->real_get_value = NULL;
+ klass->create_entry = NULL;
+ klass->real_set_value = NULL;
+ klass->real_get_value = NULL;
/* Properties */
object_class->set_property = gdaui_entry_wrapper_set_property;
@@ -165,38 +165,38 @@ check_correct_init (GdauiEntryWrapper *mgwrap)
{
if (!mgwrap->priv->impl_is_correct) {
GtkWidget *entry = NULL;
- GdauiEntryWrapperClass *class;
+ GdauiEntryWrapperClass *klass;
gboolean class_impl_error = FALSE;;
- class = GDAUI_ENTRY_WRAPPER_CLASS (G_OBJECT_GET_CLASS (mgwrap));
- if (! class->create_entry) {
+ klass = GDAUI_ENTRY_WRAPPER_CLASS (G_OBJECT_GET_CLASS (mgwrap));
+ if (! klass->create_entry) {
g_warning ("create_entry () virtual function not implemented for object class %s\n",
G_OBJECT_TYPE_NAME (mgwrap));
class_impl_error = TRUE;
}
- if (! class->real_set_value) {
+ if (! klass->real_set_value) {
g_warning ("real_set_value () virtual function not implemented for object class %s\n",
G_OBJECT_TYPE_NAME (mgwrap));
class_impl_error = TRUE;
}
- if (! class->real_get_value) {
+ if (! klass->real_get_value) {
g_warning ("real_get_value () virtual function not implemented for object class %s\n",
G_OBJECT_TYPE_NAME (mgwrap));
class_impl_error = TRUE;
}
- if (! class->connect_signals) {
+ if (! klass->connect_signals) {
g_warning ("connect_signals () virtual function not implemented for object class %s\n",
G_OBJECT_TYPE_NAME (mgwrap));
class_impl_error = TRUE;
}
- if (! class->expand_in_layout) {
+ if (! klass->expand_in_layout) {
g_warning ("expand_in_layout () virtual function not implemented for object class %s\n",
G_OBJECT_TYPE_NAME (mgwrap));
class_impl_error = TRUE;
}
if (!class_impl_error) {
- mgwrap->priv->real_class = class;
+ mgwrap->priv->real_class = klass;
mgwrap->priv->impl_is_correct = TRUE;
entry = (*mgwrap->priv->real_class->create_entry) (mgwrap);
diff --git a/libgda-ui/data-entries/gdaui-entry.c b/libgda-ui/data-entries/gdaui-entry.c
index 5cc8662..a333cd3 100644
--- a/libgda-ui/data-entries/gdaui-entry.c
+++ b/libgda-ui/data-entries/gdaui-entry.c
@@ -622,6 +622,9 @@ insert_text_cb (GtkEditable *editable, const gchar *text, gint text_length, gint
if (*itext)
gtk_editable_insert_text (editable, itext, nallowed, position);
g_free (itext);
+
+ signal_handlers_unblock (entry);
+ g_signal_emit_by_name (entry, "changed");
}
else if (GDAUI_ENTRY_GET_CLASS (editable)->assume_insert) {
g_signal_stop_emission_by_name (editable, "insert-text");
@@ -630,8 +633,10 @@ insert_text_cb (GtkEditable *editable, const gchar *text, gint text_length, gint
GDAUI_ENTRY_GET_CLASS (editable)->assume_insert (entry, text, text_length,
&pos, entry->priv->prefix_clen);
*position = pos + entry->priv->prefix_clen;
- }
- signal_handlers_unblock (entry);
- g_signal_emit_by_name (entry, "changed");
+ signal_handlers_unblock (entry);
+ g_signal_emit_by_name (entry, "changed");
+ }
+ else
+ signal_handlers_unblock (entry);
}
diff --git a/libgda-ui/gdaui-basic-form.c b/libgda-ui/gdaui-basic-form.c
index 4f864b5..fee8e88 100644
--- a/libgda-ui/gdaui-basic-form.c
+++ b/libgda-ui/gdaui-basic-form.c
@@ -1877,7 +1877,7 @@ entry_contents_modified (GdauiDataEntry *entry, GdauiBasicForm *form)
if (param) { /* single parameter */
GValue *value;
- form->priv->forward_param_updates = TRUE;
+ form->priv->forward_param_updates = FALSE;
/* parameter's value */
value = gdaui_data_entry_get_value (entry);
@@ -1896,6 +1896,7 @@ entry_contents_modified (GdauiDataEntry *entry, GdauiBasicForm *form)
else
TO_IMPLEMENT;
gda_value_free (value);
+ form->priv->forward_param_updates = TRUE;
}
else { /* multiple parameters */
GSList *params;
diff --git a/libgda-ui/gdaui-init.c b/libgda-ui/gdaui-init.c
index c5ccd32..7b92503 100644
--- a/libgda-ui/gdaui-init.c
+++ b/libgda-ui/gdaui-init.c
@@ -126,6 +126,8 @@ gdaui_new_data_entry (GType type, const gchar *plugin_name)
if (!entry) {
if (type == GDA_TYPE_NULL)
entry = (GdauiDataEntry *) gdaui_entry_none_new (GDA_TYPE_NULL);
+ else if (type == G_TYPE_STRING)
+ entry = (GdauiDataEntry *) gdaui_entry_string_new (dh, type, spec_options);
else if ((type == G_TYPE_INT64) ||
(type == G_TYPE_UINT64) ||
(type == G_TYPE_DOUBLE) ||
@@ -134,7 +136,6 @@ gdaui_new_data_entry (GType type, const gchar *plugin_name)
(type == G_TYPE_FLOAT) ||
(type == GDA_TYPE_SHORT) ||
(type == GDA_TYPE_USHORT) ||
- (type == G_TYPE_STRING) ||
(type == G_TYPE_CHAR) ||
(type == G_TYPE_UCHAR) ||
(type == G_TYPE_ULONG) ||
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]