[libgda] Misc. corrections & improvements



commit 9e9461d560be49bf57dcc82f379efc9a6f207473
Author: Vivien Malerba <malerba gnome-db org>
Date:   Sun Nov 29 20:14:53 2015 +0100

    Misc. corrections & improvements

 libgda-ui/data-entries/gdaui-entry-shell.c      |   16 ++++++++--------
 libgda-ui/gdaui-basic-form.c                    |   12 ++++++------
 libgda-ui/gdaui-server-operation.c              |    3 +--
 libgda-ui/internal/gdaui-provider-spec-editor.c |    1 -
 providers/sqlite/sqlite_specs_dsn.xml.in        |   12 +++++++++---
 tools/browser/browser-connections-list.c        |    1 -
 tools/browser/data-manager/data-console.c       |    2 --
 tools/browser/query-exec/query-console-page.c   |    3 ---
 tools/browser/schema-browser/table-info.c       |    1 -
 tools/tools-main.c                              |    2 +-
 10 files changed, 25 insertions(+), 28 deletions(-)
---
diff --git a/libgda-ui/data-entries/gdaui-entry-shell.c b/libgda-ui/data-entries/gdaui-entry-shell.c
index 2ac2b00..0282492 100644
--- a/libgda-ui/data-entries/gdaui-entry-shell.c
+++ b/libgda-ui/data-entries/gdaui-entry-shell.c
@@ -74,10 +74,10 @@ typedef enum {
 
 static const gchar *raw_messages[] = {
        "",
-       N_("NULL value"),
-       N_("Default value"),
-       N_("Default value (NULL)"),
-       N_("Invalid value"),
+       N_("Unspecified"),
+       N_("Default"),
+       N_("Default (unspecified)"),
+       N_("Invalid"),
 };
 
 static gchar **messages = NULL;
@@ -283,28 +283,28 @@ actions_button_clicked_cb (G_GNUC_UNUSED GtkButton *button, GdauiEntryShell *she
 
        GtkWidget *action_button;
        if (!strcmp (gtk_stack_get_visible_child_name (GTK_STACK (shell->priv->stack)), PAGE_LABEL)) {
-               action_button = gtk_button_new_with_label (_("Edit value"));
+               action_button = gtk_button_new_with_label (_("Edit"));
                g_signal_connect (action_button, "clicked",
                                  G_CALLBACK (action_edit_value_cb), shell);
                gtk_box_pack_start (GTK_BOX (box), action_button, FALSE, FALSE, 0);
        }
 
        if ((attr & GDA_VALUE_ATTR_CAN_BE_NULL) && !(attr & GDA_VALUE_ATTR_IS_NULL)) {
-               action_button = gtk_button_new_with_label (_("Set value to NULL"));
+               action_button = gtk_button_new_with_label (_("Define as unspecified"));
                g_signal_connect (action_button, "clicked",
                                  G_CALLBACK (action_set_value_to_null_cb), shell);
                gtk_box_pack_start (GTK_BOX (box), action_button, FALSE, FALSE, 0);
        }
 
        if ((attr & GDA_VALUE_ATTR_CAN_BE_DEFAULT) && !(attr & GDA_VALUE_ATTR_IS_DEFAULT)) {
-               action_button = gtk_button_new_with_label (_("Set value to default"));
+               action_button = gtk_button_new_with_label (_("Define as default"));
                g_signal_connect (action_button, "clicked",
                                  G_CALLBACK (action_set_value_to_default_cb), shell);
                gtk_box_pack_start (GTK_BOX (box), action_button, FALSE, FALSE, 0);
        }
 
        if ((attr & GDA_VALUE_ATTR_HAS_VALUE_ORIG) && ! (attr & GDA_VALUE_ATTR_IS_UNCHANGED)) {
-               action_button = gtk_button_new_with_label (_("Reset value"));
+               action_button = gtk_button_new_with_label (_("Reset"));
                g_signal_connect (action_button, "clicked",
                                  G_CALLBACK (action_reset_value_cb), shell);
                        gtk_box_pack_start (GTK_BOX (box), action_button, FALSE, FALSE, 0);
diff --git a/libgda-ui/gdaui-basic-form.c b/libgda-ui/gdaui-basic-form.c
index 67774a7..0c2bb30 100644
--- a/libgda-ui/gdaui-basic-form.c
+++ b/libgda-ui/gdaui-basic-form.c
@@ -1424,14 +1424,14 @@ mark_not_null_entry_labels (GdauiBasicForm *form, gboolean show_mark)
 
        for (list = form->priv->s_entries; list; list = list->next) {
                SingleEntry *sentry = (SingleEntry*) list->data;
-               gchar *str;
-
-               str = _gdaui_utility_markup_title (sentry->label_title, !show_mark || !sentry->not_null);
-               if (show_mark && sentry->not_null)
+               if (show_mark && sentry->not_null) {
+                       gchar *str;
+                       str = _gdaui_utility_markup_title (sentry->label_title, !show_mark || 
!sentry->not_null);
                        gtk_label_set_markup (GTK_LABEL (sentry->label), str);
+                       g_free (str);
+               }
                else
-                       gtk_label_set_text (GTK_LABEL (sentry->label), str);
-               g_free (str);
+                       gtk_label_set_text (GTK_LABEL (sentry->label), sentry->label_title);
        }
 }
 
diff --git a/libgda-ui/gdaui-server-operation.c b/libgda-ui/gdaui-server-operation.c
index 478474e..1696b1b 100644
--- a/libgda-ui/gdaui-server-operation.c
+++ b/libgda-ui/gdaui-server-operation.c
@@ -416,7 +416,6 @@ fill_create_widget (GdauiServerOperation *form, const gchar *path, gchar **secti
                plist = info_node->plist;
                plwid = gdaui_basic_form_new (plist);
                gdaui_basic_form_set_unknown_color (GDAUI_BASIC_FORM (plwid), 0., 0., 0., 0.);
-               g_object_set ((GObject*) plwid, "show-actions", FALSE, NULL);
 
                if (section_str) {
                        const gchar *name;
@@ -539,7 +538,7 @@ fill_create_widget (GdauiServerOperation *form, const gchar *path, gchar **secti
                g_slist_free (list);
                plwid = gdaui_basic_form_new (plist);
                gdaui_basic_form_set_unknown_color (GDAUI_BASIC_FORM (plwid), 0., 0., 0., 0.);
-               g_object_set ((GObject*) plwid, "show-actions", FALSE, NULL);
+
                /* we don't need plist anymore */
                g_object_unref (plist);
 
diff --git a/libgda-ui/internal/gdaui-provider-spec-editor.c b/libgda-ui/internal/gdaui-provider-spec-editor.c
index 0c2f582..1990368 100644
--- a/libgda-ui/internal/gdaui-provider-spec-editor.c
+++ b/libgda-ui/internal/gdaui-provider-spec-editor.c
@@ -208,7 +208,6 @@ adapt_form_widget (GdauiProviderSpecEditor *spec)
                spec->priv->type = PROVIDER_FORM;
                
                wid = gdaui_basic_form_new (dset);
-               g_object_set ((GObject*) wid, "show-actions", FALSE, NULL);
                g_object_unref (dset);
                
                spec->priv->form = wid;
diff --git a/providers/sqlite/sqlite_specs_dsn.xml.in b/providers/sqlite/sqlite_specs_dsn.xml.in
index 507bb01..7306538 100644
--- a/providers/sqlite/sqlite_specs_dsn.xml.in
+++ b/providers/sqlite/sqlite_specs_dsn.xml.in
@@ -2,7 +2,9 @@
 <data-set-spec>
   <parameters>
     <parameter id="DB_NAME" _name="Database name" _descr="The name of a database to use (without the .db)" 
gdatype="gchararray" nullok="FALSE"/>
-    <parameter id="APPEND_DB_EXTENSION" _name="Append '.db'" _descr="Defines if the '.db' extension need to 
be appended to the DB_NAME argument" gdatype="gboolean" nullok="TRUE"/>
+    <parameter id="APPEND_DB_EXTENSION" _name="Append '.db'" _descr="Defines if the '.db' extension need to 
be appended to the DB_NAME argument" gdatype="gboolean" nullok="TRUE">
+      <gda_value>FALSE</gda_value>
+    </parameter>
     <parameter id="DB_DIR" _name="Directory" _descr="Directory where the database file is stored" 
gdatype="gchararray" nullok="FALSE" plugin="filesel:MODE=PICKFOLDER"/>
     <parameter id="EXTRA_FUNCTIONS" _name="Extra functions" _descr="Enable usage of extra functions 
(gda_upper, ...)" gdatype="gboolean" nullok="TRUE">
       <gda_value>TRUE</gda_value>
@@ -13,7 +15,11 @@
     <parameter id="EXTRA_COLLATIONS" _name="Localized comparisons" _descr="Enable usage of extra collation 
methods (LOCALE and DCASE)" gdatype="gboolean" nullok="TRUE">
       <gda_value>TRUE</gda_value>
     </parameter>
-    <parameter id="FK" _name="With foreign keys" _descr="Enforce foreign keys" gdatype="gboolean" 
nullok="TRUE"/>
-    <parameter id="EXTENSIONS" _name="Allow extensions" _descr="Allow SQLite to load extensions using the 
load_extension() function" gdatype="gboolean" nullok="TRUE"/>
+    <parameter id="FK" _name="With foreign keys" _descr="Enforce foreign keys" gdatype="gboolean" 
nullok="TRUE">
+      <gda_value>TRUE</gda_value>
+    </parameter>
+    <parameter id="EXTENSIONS" _name="Allow extensions" _descr="Allow SQLite to load extensions using the 
load_extension() function" gdatype="gboolean" nullok="TRUE">
+      <gda_value>TRUE</gda_value>
+    </parameter>
   </parameters>
 </data-set-spec>
diff --git a/tools/browser/browser-connections-list.c b/tools/browser/browser-connections-list.c
index 4967561..d06491c 100644
--- a/tools/browser/browser-connections-list.c
+++ b/tools/browser/browser-connections-list.c
@@ -226,7 +226,6 @@ selection_changed_cb (GtkTreeSelection *select, BrowserConnectionsList *clist)
                /* create form */
                GtkWidget *wid;
                wid = gdaui_basic_form_new (dset);
-               g_object_set ((GObject*) wid, "show-actions", FALSE, NULL);
                gdaui_basic_form_entry_set_editable (GDAUI_BASIC_FORM (wid), NULL, FALSE);
                gtk_grid_attach (clist->priv->layout_grid, wid, 1, 2, 1, 1);
                gtk_widget_show (wid);
diff --git a/tools/browser/data-manager/data-console.c b/tools/browser/data-manager/data-console.c
index d8ccc23..4f1c9e2 100644
--- a/tools/browser/data-manager/data-console.c
+++ b/tools/browser/data-manager/data-console.c
@@ -681,8 +681,6 @@ data_source_mgr_changed_cb (DataSourceManager *mgr, DataConsole *dconsole)
        params = data_source_manager_get_params (mgr);
        if (params) {
                dconsole->priv->params_form = gdaui_basic_form_new (params);
-               g_object_set ((GObject*) dconsole->priv->params_form,
-                             "show-actions", TRUE, NULL);
                g_signal_connect (dconsole->priv->params_form, "activated",
                                  G_CALLBACK (param_activated_cb), dconsole);
        }
diff --git a/tools/browser/query-exec/query-console-page.c b/tools/browser/query-exec/query-console-page.c
index 6757896..66f0660 100644
--- a/tools/browser/query-exec/query-console-page.c
+++ b/tools/browser/query-exec/query-console-page.c
@@ -529,8 +529,6 @@ compute_params (QueryConsolePage *tconsole)
                                                                          tconsole->priv->params);
                                show_variables = TRUE;
                                tconsole->priv->params_form = gdaui_basic_form_new (tconsole->priv->params);
-                               g_object_set ((GObject*) tconsole->priv->params_form,
-                                             "show-actions", TRUE, NULL);
                                g_signal_connect (tconsole->priv->params_form, "activated",
                                                  G_CALLBACK (params_form_activated_cb), tconsole);
                        }
@@ -903,7 +901,6 @@ sql_execute_clicked_cb (G_GNUC_UNUSED GtkToolButton *button, QueryConsolePage *t
 
                        cont = g_object_get_data (G_OBJECT (tconsole->priv->params_popup), "cont");
                        form = gdaui_basic_form_new (tconsole->priv->params);
-                       g_object_set ((GObject*) form, "show-actions", TRUE, NULL);
                        g_signal_connect (form, "holder-changed",
                                          G_CALLBACK (params_form_changed_cb), tconsole);
                        g_signal_connect (form, "activated",
diff --git a/tools/browser/schema-browser/table-info.c b/tools/browser/schema-browser/table-info.c
index be5c19d..b340844 100644
--- a/tools/browser/schema-browser/table-info.c
+++ b/tools/browser/schema-browser/table-info.c
@@ -959,7 +959,6 @@ action_insert_cb (G_GNUC_UNUSED GSimpleAction *action, G_GNUC_UNUSED GVariant *s
                            label, FALSE, FALSE, 0);
        
        form = gdaui_basic_form_new (params);
-       g_object_set ((GObject*) form, "show-actions", TRUE, NULL);
        g_signal_connect (form, "holder-changed",
                          G_CALLBACK (insert_form_params_changed_cb), popup);
        gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (popup))),
diff --git a/tools/tools-main.c b/tools/tools-main.c
index d403300..58a86d4 100644
--- a/tools/tools-main.c
+++ b/tools/tools-main.c
@@ -571,7 +571,7 @@ command_line (GApplication *application, GApplicationCommandLine *cmdline)
                /* hack */
                TConnection *tcnc = T_CONNECTION (t_app_get_all_connections ()->data);
                gchar *tmp;
-               tmp = g_strdup_printf ("%s_AAA_B", t_connection_get_name (tcnc));
+               tmp = g_strdup_printf ("%s", t_connection_get_name (tcnc));
                t_connection_set_name (tcnc, tmp);
                g_free (tmp);
        }


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