[libgda] UI data entry plugins: distinguish between integers and not
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] UI data entry plugins: distinguish between integers and not
- Date: Sat, 20 Sep 2014 14:41:15 +0000 (UTC)
commit 87bd9d5b5927586e912adfb0bfefe3d6a0663be4
Author: Vivien Malerba <malerba gnome-db org>
Date: Sat Sep 20 15:43:00 2014 +0200
UI data entry plugins: distinguish between integers and not
libgda-ui/data-entries/.gitignore | 1 +
libgda-ui/data-entries/Makefile.am | 1 +
libgda-ui/data-entries/gdaui-entry-integer.xml.in | 17 ++++++++
libgda-ui/gdaui-init.c | 44 ++++++++++++++------
4 files changed, 50 insertions(+), 13 deletions(-)
---
diff --git a/libgda-ui/data-entries/.gitignore b/libgda-ui/data-entries/.gitignore
index a0680bc..1c2cc64 100644
--- a/libgda-ui/data-entries/.gitignore
+++ b/libgda-ui/data-entries/.gitignore
@@ -1,2 +1,3 @@
gdaui-entry-number.xml
+gdaui-entry-integer.xml
gdaui-entry-string.xml
diff --git a/libgda-ui/data-entries/Makefile.am b/libgda-ui/data-entries/Makefile.am
index a8c5f54..20cd682 100644
--- a/libgda-ui/data-entries/Makefile.am
+++ b/libgda-ui/data-entries/Makefile.am
@@ -73,6 +73,7 @@ libgda_ui_data_entries_la_SOURCES = \
xmldir = $(datadir)/libgda-6.0/ui
xml_in_files = \
gdaui-entry-string.xml.in \
+ gdaui-entry-integer.xml.in \
gdaui-entry-number.xml.in
@INTLTOOL_XML_RULE@
diff --git a/libgda-ui/data-entries/gdaui-entry-integer.xml.in
b/libgda-ui/data-entries/gdaui-entry-integer.xml.in
new file mode 100644
index 0000000..f46ff21
--- /dev/null
+++ b/libgda-ui/data-entries/gdaui-entry-integer.xml.in
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<data-set-spec>
+ <parameters>
+ <parameter id="THOUSAND_SEP" _name="Use 1000s separators" _descr="Use thousands separator as specified
by current locale" gdatype="gboolean">
+ <gda_value>FALSE</gda_value>
+ </parameter>
+ <parameter id="CURRENCY" _name="Currency symbol" _descr="A currency symbol" source="currencies:0"
gdatype="gchararray"/>
+ </parameters>
+ <sources>
+ <gda_array name="currencies">
+ <gda_array_field name="cur" gdatype="gchararray"/>
+ <gda_array_field name="cur2" gdatype="gchararray"/>
+ <gda_array_field name="text" gdatype="gchararray"/>
+ <gda_array_data/>
+ </gda_array>
+ </sources>
+</data-set-spec>
diff --git a/libgda-ui/gdaui-init.c b/libgda-ui/gdaui-init.c
index 1c720c7..df32803 100644
--- a/libgda-ui/gdaui-init.c
+++ b/libgda-ui/gdaui-init.c
@@ -411,28 +411,25 @@ init_plugins_hash (void)
g_free (file);
plugin = g_new0 (GdauiPlugin, 1);
- plugin->plugin_name = "number";
- plugin->plugin_descr = "Numeric entry";
+ plugin->plugin_name = "integer";
+ plugin->plugin_descr = "Numeric integer entry";
plugin->plugin_file = NULL;
- plugin->nb_g_types = 12;
+ plugin->nb_g_types = 10;
plugin->valid_g_types = g_new (GType, plugin->nb_g_types);
plugin->valid_g_types [0] = G_TYPE_INT64;
plugin->valid_g_types [1] = G_TYPE_UINT64;
- plugin->valid_g_types [2] = G_TYPE_DOUBLE;
plugin->valid_g_types [3] = G_TYPE_INT;
- plugin->valid_g_types [4] = GDA_TYPE_NUMERIC;
- plugin->valid_g_types [5] = G_TYPE_FLOAT;
- plugin->valid_g_types [6] = GDA_TYPE_SHORT;
- plugin->valid_g_types [7] = GDA_TYPE_USHORT;
- plugin->valid_g_types [8] = G_TYPE_CHAR;
- plugin->valid_g_types [9] = G_TYPE_UCHAR;
- plugin->valid_g_types [10] = G_TYPE_ULONG;
- plugin->valid_g_types [11] = G_TYPE_UINT;
+ plugin->valid_g_types [4] = GDA_TYPE_SHORT;
+ plugin->valid_g_types [5] = GDA_TYPE_USHORT;
+ plugin->valid_g_types [6] = G_TYPE_CHAR;
+ plugin->valid_g_types [7] = G_TYPE_UCHAR;
+ plugin->valid_g_types [8] = G_TYPE_ULONG;
+ plugin->valid_g_types [9] = G_TYPE_UINT;
plugin->options_xml_spec = NULL;
plugin->entry_create_func = entry_number_create_func;
plugin->cell_create_func = cell_textual_create_func;
g_hash_table_insert (hash, plugin->plugin_name, plugin);
- file = gda_gbr_get_file_path (GDA_DATA_DIR, LIBGDA_ABI_NAME, "ui", "gdaui-entry-number.xml", NULL);
+ file = gda_gbr_get_file_path (GDA_DATA_DIR, LIBGDA_ABI_NAME, "ui", "gdaui-entry-integer.xml", NULL);
xmlChar *xml_spec = get_spec_with_isocodes (file);
if (xml_spec) {
plugin->options_xml_spec = g_strdup ((gchar*) xml_spec);
@@ -441,6 +438,27 @@ init_plugins_hash (void)
g_free (file);
plugin = g_new0 (GdauiPlugin, 1);
+ plugin->plugin_name = "number";
+ plugin->plugin_descr = "Numeric entry";
+ plugin->plugin_file = NULL;
+ plugin->nb_g_types = 3;
+ plugin->valid_g_types = g_new (GType, plugin->nb_g_types);
+ plugin->valid_g_types [0] = GDA_TYPE_NUMERIC;
+ plugin->valid_g_types [1] = G_TYPE_FLOAT;
+ plugin->valid_g_types [1] = G_TYPE_DOUBLE;
+ plugin->options_xml_spec = NULL;
+ plugin->entry_create_func = entry_number_create_func;
+ plugin->cell_create_func = cell_textual_create_func;
+ g_hash_table_insert (hash, plugin->plugin_name, plugin);
+ file = gda_gbr_get_file_path (GDA_DATA_DIR, LIBGDA_ABI_NAME, "ui", "gdaui-entry-number.xml", NULL);
+ xml_spec = get_spec_with_isocodes (file);
+ if (xml_spec) {
+ plugin->options_xml_spec = g_strdup ((gchar*) xml_spec);
+ xmlFree (xml_spec);
+ }
+ g_free (file);
+
+ plugin = g_new0 (GdauiPlugin, 1);
plugin->plugin_name = "textual";
plugin->plugin_descr = "Textual entry";
plugin->plugin_file = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]