[libgda] Misc. corrections & improvements



commit 63098da66980a62b336f8696a2622a766c6c7441
Author: Vivien Malerba <malerba gnome-db org>
Date:   Sun Mar 22 19:06:07 2015 +0100

    Misc. corrections & improvements

 libgda-ui/data-entries/plugins/libmain.c |    1 +
 libgda-ui/demos/tree.c                   |    4 +-
 libgda-ui/gdaui-data-proxy-info.c        |   11 +--------
 libgda-ui/gdaui-server-operation.c       |   32 ++++++++++++++++++++++++-----
 4 files changed, 31 insertions(+), 17 deletions(-)
---
diff --git a/libgda-ui/data-entries/plugins/libmain.c b/libgda-ui/data-entries/plugins/libmain.c
index a30c2db..c134e3c 100644
--- a/libgda-ui/data-entries/plugins/libmain.c
+++ b/libgda-ui/data-entries/plugins/libmain.c
@@ -48,6 +48,7 @@
   #include <gtksourceview/gtksourcebuffer.h>
   #include <gtksourceview/gtksourcestyleschememanager.h>
   #include <gtksourceview/gtksourcestylescheme.h>
+  #include <gtksourceview/gtksource.h>
 #endif
 
 static GdauiDataEntry *plugin_entry_filesel_create_func (GdaDataHandler *handler, GType type, const gchar 
*options);
diff --git a/libgda-ui/demos/tree.c b/libgda-ui/demos/tree.c
index a62ef54..e5dbeb5 100644
--- a/libgda-ui/demos/tree.c
+++ b/libgda-ui/demos/tree.c
@@ -61,7 +61,7 @@ timout_cb (GdaTreeNode *node)
        cvalue = gda_tree_node_get_node_attribute (node, "scale");
        g_assert (cvalue && (G_VALUE_TYPE (cvalue) == G_TYPE_DOUBLE));
        sc = g_value_get_double (cvalue);
-       sc += 0.05;
+       sc += 0.005;
        if (sc > 1.2)
                sc = .8;
        g_value_set_double ((scale = gda_value_new (G_TYPE_DOUBLE)), sc);
@@ -89,7 +89,7 @@ node_func (GdaTreeManager *manager, GdaTreeNode *node, const GSList *children_no
                g_value_set_double ((scale = gda_value_new (G_TYPE_DOUBLE)), 1.);
                gda_tree_node_set_node_attribute (snode, "scale", scale, NULL);
                gda_value_free (scale);
-               g_timeout_add (200, (GSourceFunc) timout_cb, g_object_ref (snode));
+               g_timeout_add (50, (GSourceFunc) timout_cb, g_object_ref (snode));
 
                g_value_set_boolean ((scale = gda_value_new (G_TYPE_BOOLEAN)), TRUE);
                gda_tree_node_set_node_attribute (snode, "scale-set", scale, NULL);
diff --git a/libgda-ui/gdaui-data-proxy-info.c b/libgda-ui/gdaui-data-proxy-info.c
index d355b6c..11fb90c 100644
--- a/libgda-ui/gdaui-data-proxy-info.c
+++ b/libgda-ui/gdaui-data-proxy-info.c
@@ -867,7 +867,7 @@ idle_modif_buttons_update (GdauiDataProxyInfo *info)
                        gtk_widget_set_sensitive (info->priv->action_items [ACTION_COMMIT], changed ? TRUE : 
FALSE);
                        if (mode == GDAUI_DATA_PROXY_WRITE_ON_VALUE_CHANGE)
                                gtk_widget_hide (action_items [ACTION_COMMIT]);
-                       else
+                       else if (! gtk_widget_get_no_show_all (action_items [ACTION_COMMIT]))
                                gtk_widget_show (action_items [ACTION_COMMIT]);
                }
 
@@ -875,7 +875,7 @@ idle_modif_buttons_update (GdauiDataProxyInfo *info)
                        gtk_widget_set_sensitive (info->priv->action_items [ACTION_RESET], changed ? TRUE : 
FALSE);
                        if (mode == GDAUI_DATA_PROXY_WRITE_ON_VALUE_CHANGE)
                                gtk_widget_hide (action_items [ACTION_RESET]);
-                       else
+                       else if (! gtk_widget_get_no_show_all (action_items [ACTION_RESET]))
                                gtk_widget_show (action_items [ACTION_RESET]);
                }
 
@@ -906,13 +906,6 @@ idle_modif_buttons_update (GdauiDataProxyInfo *info)
                                                             _("Delete the selected entry"));
                        }
                        gtk_widget_set_sensitive (info->priv->action_items [ACTION_DELETE], wrows);
-
-                       if ((mode == GDAUI_DATA_PROXY_WRITE_ON_ROW_CHANGE) ||
-                           (mode == GDAUI_DATA_PROXY_WRITE_ON_VALUE_CHANGE) ||
-                           (mode == GDAUI_DATA_PROXY_WRITE_ON_VALUE_ACTIVATED))
-                               gtk_widget_hide (action_items [ACTION_DELETE]);
-                       else
-                               gtk_widget_show (action_items [ACTION_DELETE]);
                }
        }
 
diff --git a/libgda-ui/gdaui-server-operation.c b/libgda-ui/gdaui-server-operation.c
index 46caa6b..8b88839 100644
--- a/libgda-ui/gdaui-server-operation.c
+++ b/libgda-ui/gdaui-server-operation.c
@@ -32,7 +32,6 @@
 #include "gdaui-data-selector.h"
 #include "gdaui-data-proxy-info.h"
 #include <libgda/gda-debug-macros.h>
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 
 static void gdaui_server_operation_class_init (GdauiServerOperationClass *class);
 static void gdaui_server_operation_init (GdauiServerOperation *wid);
@@ -375,7 +374,7 @@ sequence_grid_attach_widget (GdauiServerOperation *form, GtkWidget *grid, GtkWid
        gtk_widget_show (wid);
 
        /* "-" button */
-       image = gtk_image_new_from_icon_name ("list-remove", GTK_ICON_SIZE_MENU);
+       image = gtk_image_new_from_icon_name ("list-remove-symbolic", GTK_ICON_SIZE_MENU);
        wid = gtk_button_new ();
        gtk_button_set_image (GTK_BUTTON (wid), image);
        gtk_grid_attach (GTK_GRID (grid), wid, 1, index, 1, 1);
@@ -470,6 +469,24 @@ fill_create_widget (GdauiServerOperation *form, const gchar *path, gchar **secti
                winfo = gdaui_data_proxy_info_new (GDAUI_DATA_PROXY (grid),
                                                   GDAUI_DATA_PROXY_INFO_ROW_MODIFY_BUTTONS);
 
+               GtkToolItem *item;
+               item = gdaui_data_proxy_info_get_item (GDAUI_DATA_PROXY_INFO (winfo), GDAUI_ACTION_NEW_DATA);
+               if (item)
+                       gtk_widget_set_tooltip_text (GTK_WIDGET (item), _("Add a new field"));
+               item = gdaui_data_proxy_info_get_item (GDAUI_DATA_PROXY_INFO (winfo), 
GDAUI_ACTION_DELETE_SELECTED_DATA);
+               if (item)
+                       gtk_widget_set_tooltip_text (GTK_WIDGET (item), _("Remove selected field"));
+               item = gdaui_data_proxy_info_get_item (GDAUI_DATA_PROXY_INFO (winfo), 
GDAUI_ACTION_WRITE_MODIFIED_DATA);
+               if (item) {
+                       gtk_widget_hide (GTK_WIDGET (item));
+                       gtk_widget_set_no_show_all (GTK_WIDGET (item), TRUE);
+               }
+               item = gdaui_data_proxy_info_get_item (GDAUI_DATA_PROXY_INFO (winfo), 
GDAUI_ACTION_RESET_DATA);
+               if (item) {
+                       gtk_widget_hide (GTK_WIDGET (item));
+                       gtk_widget_set_no_show_all (GTK_WIDGET (item), TRUE);
+               }
+
                box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
                gtk_box_pack_start (GTK_BOX (box), plwid, TRUE, TRUE, 0);
                gtk_widget_show (plwid);
@@ -594,7 +611,7 @@ fill_create_widget (GdauiServerOperation *form, const gchar *path, gchar **secti
                        gtk_grid_attach (GTK_GRID (grid), wid, 0, size, 1, 1);
                        gtk_widget_show (wid);
 
-                       image = gtk_image_new_from_icon_name ("list-add", GTK_ICON_SIZE_MENU);
+                       image = gtk_image_new_from_icon_name ("list-add-symbolic", GTK_ICON_SIZE_MENU);
                        wid = gtk_button_new ();
                        gtk_button_set_image (GTK_BUTTON (wid), image);
                        gtk_grid_attach (GTK_GRID (grid), wid, 1, size, 1, 1);
@@ -1199,12 +1216,15 @@ create_table_fields_array_create_widget (GdauiServerOperation *form, const gchar
        if (item)
                gtk_widget_set_tooltip_text (GTK_WIDGET (item), _("Remove selected field"));
        item = gdaui_data_proxy_info_get_item (GDAUI_DATA_PROXY_INFO (winfo), 
GDAUI_ACTION_WRITE_MODIFIED_DATA);
-       if (item)
+       if (item) {
                gtk_widget_hide (GTK_WIDGET (item));
+               g_object_set ((GObject*) item, "no-show-all", TRUE, NULL);
+       }
        item = gdaui_data_proxy_info_get_item (GDAUI_DATA_PROXY_INFO (winfo), GDAUI_ACTION_RESET_DATA);
-       if (item)
+       if (item) {
                gtk_widget_hide (GTK_WIDGET (item));
-       g_print ("==================================================================\n");
+               g_object_set ((GObject*) item, "no-show-all", TRUE, NULL);
+       }
 
        return hlayout;
 }


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