libgnomedb r1721 - in trunk: . control-center doc/C/tmpl extra extra/demos libgnomedb libgnomedb-goo libgnomedb-graph testing



Author: vivien
Date: Mon Apr 28 16:49:12 2008
New Revision: 1721
URL: http://svn.gnome.org/viewvc/libgnomedb?rev=1721&view=rev

Log:
2008-04-28 Vivien Malerba <malerba gnome-db org>

	* testing/Makefile.am:
	* extra/demos/graph.c:
	* extra/demos/Makefile.am
	* libgnomedb-graph-4.0.pc.in:
	* configure.in:
	* Makefile.am:
	* libgnomedb-graph: renamed from libgnomedb-goo
	* libgnomedb/gnome-db-stock.c: better string for connection opening
	* libgnomedb/gnome-db-login.[ch]: signal DSN changes
	* libgnomedb/gnome-db-login-dialog.c: correctly behave when DSN does not need
	authentication, fixes bug #112822
	* control-center/dsn-properties-dialog.c: don't display a login dialog when none is needed
	* libgnomedb/gnome-db-login-dialog.[ch]: added the the parent GTkWindow as argument to
	gnome_db_login_dialog_new()


Added:
   trunk/libgnomedb-graph/
      - copied from r1719, /trunk/libgnomedb-goo/
   trunk/libgnomedb-graph-4.0.pc.in
   trunk/libgnomedb-graph/Makefile.am
      - copied, changed from r1720, /trunk/libgnomedb-goo/Makefile.am
   trunk/libgnomedb-graph/gnome-db-goo-column.c
      - copied unchanged from r1720, /trunk/libgnomedb-goo/gnome-db-goo-column.c
   trunk/libgnomedb-graph/gnome-db-goo-column.h
      - copied unchanged from r1720, /trunk/libgnomedb-goo/gnome-db-goo-column.h
   trunk/libgnomedb-graph/gnome-db-goo-db-relations.c
      - copied unchanged from r1720, /trunk/libgnomedb-goo/gnome-db-goo-db-relations.c
   trunk/libgnomedb-graph/gnome-db-goo-db-relations.h
      - copied unchanged from r1720, /trunk/libgnomedb-goo/gnome-db-goo-db-relations.h
   trunk/libgnomedb-graph/gnome-db-goo-decl.h
      - copied unchanged from r1720, /trunk/libgnomedb-goo/gnome-db-goo-decl.h
   trunk/libgnomedb-graph/gnome-db-goo-fkey.c
      - copied unchanged from r1720, /trunk/libgnomedb-goo/gnome-db-goo-fkey.c
   trunk/libgnomedb-graph/gnome-db-goo-fkey.h
      - copied unchanged from r1720, /trunk/libgnomedb-goo/gnome-db-goo-fkey.h
   trunk/libgnomedb-graph/gnome-db-goo-item.c
      - copied unchanged from r1720, /trunk/libgnomedb-goo/gnome-db-goo-item.c
   trunk/libgnomedb-graph/gnome-db-goo-item.h
      - copied, changed from r1720, /trunk/libgnomedb-goo/gnome-db-goo-item.h
   trunk/libgnomedb-graph/gnome-db-goo-table.c
      - copied unchanged from r1720, /trunk/libgnomedb-goo/gnome-db-goo-table.c
   trunk/libgnomedb-graph/gnome-db-goo-table.h
      - copied, changed from r1720, /trunk/libgnomedb-goo/gnome-db-goo-table.h
   trunk/libgnomedb-graph/gnome-db-goo-text.c
      - copied unchanged from r1720, /trunk/libgnomedb-goo/gnome-db-goo-text.c
   trunk/libgnomedb-graph/gnome-db-goo-tip.c
      - copied unchanged from r1720, /trunk/libgnomedb-goo/gnome-db-goo-tip.c
   trunk/libgnomedb-graph/gnome-db-goo-utility.c
      - copied unchanged from r1720, /trunk/libgnomedb-goo/gnome-db-goo-utility.c
   trunk/libgnomedb-graph/gnome-db-goo-utility.h
      - copied unchanged from r1720, /trunk/libgnomedb-goo/gnome-db-goo-utility.h
   trunk/libgnomedb-graph/gnome-db-goo.c
      - copied unchanged from r1720, /trunk/libgnomedb-goo/gnome-db-goo.c
   trunk/libgnomedb-graph/gnome-db-goo.h
      - copied, changed from r1720, /trunk/libgnomedb-goo/gnome-db-goo.h
   trunk/libgnomedb-graph/gnome-db-graph-item.c
      - copied unchanged from r1720, /trunk/libgnomedb-goo/gnome-db-graph-item.c
   trunk/libgnomedb-graph/gnome-db-graph-item.h
      - copied, changed from r1720, /trunk/libgnomedb-goo/gnome-db-graph-item.h
   trunk/libgnomedb-graph/gnome-db-graph.c
      - copied, changed from r1720, /trunk/libgnomedb-goo/gnome-db-graph.c
   trunk/libgnomedb-graph/gnome-db-graph.h
      - copied, changed from r1720, /trunk/libgnomedb-goo/gnome-db-graph.h
   trunk/libgnomedb-graph/goo-canvas-test.c
      - copied unchanged from r1720, /trunk/libgnomedb-goo/goo-canvas-test.c
   trunk/libgnomedb-graph/libgnomedb-goo.h
      - copied, changed from r1720, /trunk/libgnomedb-goo/libgnomedb-goo.h
Removed:
   trunk/libgnomedb-goo/
   trunk/libgnomedb-goo-4.0.pc.in
   trunk/libgnomedb-graph/gnome-db-goo-entity.c
   trunk/libgnomedb-graph/gnome-db-goo-entity.h
   trunk/libgnomedb-graph/gnome-db-goo-field.c
   trunk/libgnomedb-graph/gnome-db-goo-field.h
   trunk/libgnomedb-graph/gnome-db-goo-fkconstraint.c
   trunk/libgnomedb-graph/gnome-db-goo-fkconstraint.h
   trunk/libgnomedb-graph/gnome-db-goo-join.c
   trunk/libgnomedb-graph/gnome-db-goo-join.h
   trunk/libgnomedb-graph/gnome-db-goo-query-struct.c
   trunk/libgnomedb-graph/gnome-db-goo-query-struct.h
Modified:
   trunk/ChangeLog
   trunk/Makefile.am
   trunk/configure.in
   trunk/control-center/dsn-properties-dialog.c
   trunk/doc/C/tmpl/gnome-db-login-dialog.sgml
   trunk/doc/C/tmpl/gnome-db-login.sgml
   trunk/extra/demos/Makefile.am
   trunk/extra/demos/graph.c
   trunk/extra/gnome-db-browser.c
   trunk/libgnomedb/gnome-db-data-store.c
   trunk/libgnomedb/gnome-db-login-dialog.c
   trunk/libgnomedb/gnome-db-login-dialog.h
   trunk/libgnomedb/gnome-db-login.c
   trunk/libgnomedb/gnome-db-login.h
   trunk/libgnomedb/gnome-db-raw-grid.c
   trunk/libgnomedb/gnome-db-stock.c
   trunk/testing/Makefile.am
   trunk/testing/test-dyn-widgets.c

Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am	(original)
+++ trunk/Makefile.am	Mon Apr 28 16:49:12 2008
@@ -13,8 +13,8 @@
 endif
 
 if HAVE_GOOCANVAS
-GRAPHLIB_DIRECTORY= libgnomedb-goo
-GRAPHLIB_PC= libgnomedb-goo-4.0.pc
+GRAPHLIB_DIRECTORY= libgnomedb-graph
+GRAPHLIB_PC= libgnomedb-graph-4.0.pc
 else
 GRAPHLIB_DIRECTORY=
 GRAPHLIB_PC=

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Mon Apr 28 16:49:12 2008
@@ -403,7 +403,7 @@
 libgnomedb.spec
 libgnomedb-4.0.pc
 libgnomedb-extra-4.0.pc
-libgnomedb-goo-4.0.pc
+libgnomedb-graph-4.0.pc
 control-center/Makefile
 data/Makefile
 data/libgnomedb.keys
@@ -421,7 +421,7 @@
 libgnomedb/plugins/Makefile
 libgnomedb-extra/Makefile
 libgnomedb-extra/data/Makefile
-libgnomedb-goo/Makefile
+libgnomedb-graph/Makefile
 po/Makefile.in
 testing/Makefile
 extra/Makefile

Modified: trunk/control-center/dsn-properties-dialog.c
==============================================================================
--- trunk/control-center/dsn-properties-dialog.c	(original)
+++ trunk/control-center/dsn-properties-dialog.c	Mon Apr 28 16:49:12 2008
@@ -82,7 +82,7 @@
 	GdaConnection *cnc = NULL;
 
 	title = g_strdup_printf (_("Login for %s"), dsn);
-	dialog = gnome_db_login_dialog_new (title);
+	dialog = gnome_db_login_dialog_new (title, NULL);
 	GnomeDbLogin* login = gnome_db_login_dialog_get_login_widget (GNOME_DB_LOGIN_DIALOG (dialog));
 	gnome_db_login_set_dsn (login, dsn);
 
@@ -195,27 +195,32 @@
 			break;
 		case TEST_BUTTON:
 		{
-			GtkWidget *dialog;
+			GtkWidget *dialog = NULL;
+			GnomeDbLogin* login = NULL;
 			gchar *title;
 			GdaConnection *cnc = NULL;
+			gboolean auth_needed = gda_config_dsn_needs_authentication (dsn);
 
-			title = g_strdup_printf (_("Login for %s"), dsn);
-			dialog = gnome_db_login_dialog_new (title);
-			g_free (title);
-			GnomeDbLogin* login = gnome_db_login_dialog_get_login_widget (GNOME_DB_LOGIN_DIALOG (dialog));
-			gnome_db_login_set_dsn (login, dsn);
-			gnome_db_login_set_show_dsn_selector (login, FALSE);
+			if (auth_needed) {
+				title = g_strdup_printf (_("Login for %s"), dsn);
+				dialog = gnome_db_login_dialog_new (title, parent);
+				g_free (title);
+				login = gnome_db_login_dialog_get_login_widget (GNOME_DB_LOGIN_DIALOG (dialog));
+				gnome_db_login_set_dsn (login, dsn);
+				gnome_db_login_set_show_dsn_selector (login, FALSE);
+			}
 
-			if (gnome_db_login_dialog_run (GNOME_DB_LOGIN_DIALOG (dialog))) {
+			if (!auth_needed || gnome_db_login_dialog_run (GNOME_DB_LOGIN_DIALOG (dialog))) {
 				GtkWidget *msgdialog;
 				GError *error = NULL;
 
-				cnc = gda_connection_open_from_dsn (gnome_db_login_get_dsn (login),
-								    gnome_db_login_get_auth (login),
+				cnc = gda_connection_open_from_dsn (login ? gnome_db_login_get_dsn (login) : dsn,
+								    login ? gnome_db_login_get_auth (login) : NULL,
 								    GDA_CONNECTION_OPTIONS_NONE, &error);
 				if (cnc) {
 					str = g_strdup_printf ("<b>%s</b>", _("Connection successfully opened!"));
-					msgdialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (dialog), GTK_DIALOG_MODAL,
+					msgdialog = gtk_message_dialog_new_with_markup (dialog ? GTK_WINDOW (dialog) : parent, 
+											GTK_DIALOG_MODAL,
 											GTK_MESSAGE_INFO, GTK_BUTTONS_OK, str);
 					g_free (str);
 					gda_connection_close (cnc);
@@ -228,7 +233,8 @@
 					}
 					else
 						str = g_strdup_printf ("<b>%s</b>", _("Could not open connection"));
-					msgdialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (dialog), GTK_DIALOG_MODAL,
+					msgdialog = gtk_message_dialog_new_with_markup (dialog ? GTK_WINDOW (dialog) : parent, 
+											GTK_DIALOG_MODAL,
 											GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, str);
 					g_free (str);
 				}
@@ -236,7 +242,8 @@
 				gtk_dialog_run (GTK_DIALOG (msgdialog));
 				gtk_widget_destroy (msgdialog);
 			}
-			gtk_widget_destroy (dialog);
+			if (dialog)
+				gtk_widget_destroy (dialog);
 		}
 		break;
 		case BROWSE_BUTTON:

Modified: trunk/doc/C/tmpl/gnome-db-login-dialog.sgml
==============================================================================
--- trunk/doc/C/tmpl/gnome-db-login-dialog.sgml	(original)
+++ trunk/doc/C/tmpl/gnome-db-login-dialog.sgml	Mon Apr 28 16:49:12 2008
@@ -57,6 +57,7 @@
 </para>
 
 @title: 
+ parent: 
 @Returns: 
 
 

Modified: trunk/doc/C/tmpl/gnome-db-login.sgml
==============================================================================
--- trunk/doc/C/tmpl/gnome-db-login.sgml	(original)
+++ trunk/doc/C/tmpl/gnome-db-login.sgml	Mon Apr 28 16:49:12 2008
@@ -23,6 +23,13 @@
 </para>
 
 
+<!-- ##### SIGNAL GnomeDbLogin::dsn-changed ##### -->
+<para>
+
+</para>
+
+ dblogin: the object which received the signal.
+
 <!-- ##### ARG GnomeDbLogin:dsn ##### -->
 <para>
 
@@ -54,6 +61,7 @@
 </para>
 
 @parent_class: 
+ dsn_changed: 
 
 <!-- ##### STRUCT GnomeDbLoginPrivate ##### -->
 <para>

Modified: trunk/extra/demos/Makefile.am
==============================================================================
--- trunk/extra/demos/Makefile.am	(original)
+++ trunk/extra/demos/Makefile.am	Mon Apr 28 16:49:12 2008
@@ -3,7 +3,7 @@
 democodedir=$(datadir)/gnome-db-4.0/demo
 
 if HAVE_GOOCANVAS
-graphlib= $(top_builddir)/libgnomedb-goo/libgnomedb_goo-4.0.la
+graphlib= $(top_builddir)/libgnomedb-graph/libgnomedb_graph-4.0.la
 canvassources= graph.c
 else
 graphlib=

Modified: trunk/extra/demos/graph.c
==============================================================================
--- trunk/extra/demos/graph.c	(original)
+++ trunk/extra/demos/graph.c	Mon Apr 28 16:49:12 2008
@@ -9,7 +9,7 @@
  */
 
 #include <libgnomedb/libgnomedb.h>
-#include <libgnomedb-goo/libgnomedb-goo.h>
+#include <libgnomedb-graph/libgnomedb-goo.h>
 
 extern GdaConnection *demo_cnc;
 static GtkWidget *window = NULL;

Modified: trunk/extra/gnome-db-browser.c
==============================================================================
--- trunk/extra/gnome-db-browser.c	(original)
+++ trunk/extra/gnome-db-browser.c	Mon Apr 28 16:49:12 2008
@@ -127,7 +127,7 @@
 	if (gda_config_dsn_needs_authentication (config->dsn) && (!config->auth || ask)) {
 		GtkWidget *dlg;
 		GnomeDbLogin *login;
-		dlg = gnome_db_login_dialog_new (_("Authentication"));
+		dlg = gnome_db_login_dialog_new (_("Authentication"), NULL);
 		login = gnome_db_login_dialog_get_login_widget (GNOME_DB_LOGIN_DIALOG (dlg));
 		gnome_db_login_set_dsn (login, config->dsn);
 		gnome_db_login_set_auth (login, config->auth);

Added: trunk/libgnomedb-graph-4.0.pc.in
==============================================================================
--- (empty file)
+++ trunk/libgnomedb-graph-4.0.pc.in	Mon Apr 28 16:49:12 2008
@@ -0,0 +1,13 @@
+prefix= prefix@
+exec_prefix= exec_prefix@
+libdir= libdir@
+includedir= includedir@
+idldir= datadir@/idl
+
+Name: libgnomedb-graph- GNOMEDB_ABI_MAJOR_VERSION@  GNOMEDB_ABI_MINOR_VERSION@
+Description: Graphs library associated with libgnomedb, using the GooCanvas library
+Requires: libgnomedb- GNOMEDB_ABI_MAJOR_VERSION@  GNOMEDB_ABI_MINOR_VERSION@
+Version: @VERSION@
+Libs: -L${libdir} -lgnomedb_graph- GNOMEDB_ABI_MAJOR_VERSION@  GNOMEDB_ABI_MINOR_VERSION@
+Cflags: -I${includedir}/libgnomedb- GNOMEDB_ABI_MAJOR_VERSION@  GNOMEDB_ABI_MINOR_VERSION@
+

Copied: trunk/libgnomedb-graph/Makefile.am (from r1720, /trunk/libgnomedb-goo/Makefile.am)
==============================================================================
--- /trunk/libgnomedb-goo/Makefile.am	(original)
+++ trunk/libgnomedb-graph/Makefile.am	Mon Apr 28 16:49:12 2008
@@ -1,5 +1,5 @@
-lib_LTLIBRARIES = libgnomedb_goo-4.0.la
-noinst_PROGRAMS = goo-canvas-test
+lib_LTLIBRARIES = libgnomedb_graph-4.0.la
+noinst_PROGRAMS = graph-canvas-test
 
 SUBDIRS = 
 
@@ -17,7 +17,7 @@
         -DLIBDIR=\""$(libdir)"\"
 
 global_header = libgnomedb-goo.h
-libgnomedb_goo_headers = \
+libgnomedb_graph_headers = \
 	$(global_header) \
 	gnome-db-goo.h \
 	gnome-db-goo-cursor.h \
@@ -33,12 +33,12 @@
 	gnome-db-graph.h \
 	gnome-db-graph-item.h
 
-libgnomedb_gooincludedir=$(includedir)/libgnomedb-$(GNOMEDB_ABI_MAJOR_VERSION).$(GNOMEDB_ABI_MINOR_VERSION)/libgnomedb-goo
-libgnomedb_gooinclude_HEADERS=$(libgnomedb_goo_headers)
+libgnomedb_graphincludedir=$(includedir)/libgnomedb-$(GNOMEDB_ABI_MAJOR_VERSION).$(GNOMEDB_ABI_MINOR_VERSION)/libgnomedb-graph
+libgnomedb_graphinclude_HEADERS=$(libgnomedb_graph_headers)
 
-libgnomedb_goo_4_0_la_SOURCES = \
+libgnomedb_graph_4_0_la_SOURCES = \
 	$(global_header) \
-	$(libgnomedb_goo_headers) \
+	$(libgnomedb_graph_headers) \
 	gnome-db-goo.c \
 	gnome-db-goo-cursor.c \
 	gnome-db-goo-db-relations.c \
@@ -53,8 +53,8 @@
 	gnome-db-graph.c \
 	gnome-db-graph-item.c
 
-libgnomedb_goo_4_0_la_LDFLAGS = -version-info $(GNOMEDB_CURRENT):$(GNOMEDB_REVISION):$(GNOMEDB_AGE) $(NO_UNDEFINED)
-libgnomedb_goo_4_0_la_LIBADD = ../libgnomedb/libgnomedb-4.0.la $(LIBGNOMEDB_LIBS) $(GOOCANVAS_LIBS) $(GRAPHVIZ_LIBS)
+libgnomedb_graph_4_0_la_LDFLAGS = -version-info $(GNOMEDB_CURRENT):$(GNOMEDB_REVISION):$(GNOMEDB_AGE) $(NO_UNDEFINED)
+libgnomedb_graph_4_0_la_LIBADD = ../libgnomedb/libgnomedb-4.0.la $(LIBGNOMEDB_LIBS) $(GOOCANVAS_LIBS) $(GRAPHVIZ_LIBS)
 
-goo_canvas_test_SOURCES = goo-canvas-test.c
-goo_canvas_test_LDADD = libgnomedb_goo-4.0.la
+graph_canvas_test_SOURCES = goo-canvas-test.c
+graph_canvas_test_LDADD = libgnomedb_graph-4.0.la

Copied: trunk/libgnomedb-graph/gnome-db-goo-item.h (from r1720, /trunk/libgnomedb-goo/gnome-db-goo-item.h)
==============================================================================
--- /trunk/libgnomedb-goo/gnome-db-goo-item.h	(original)
+++ trunk/libgnomedb-graph/gnome-db-goo-item.h	Mon Apr 28 16:49:12 2008
@@ -22,7 +22,7 @@
 #define __GNOME_DB_GOO_ITEM__
 
 #include <goocanvas.h>
-#include <libgnomedb-goo/gnome-db-goo-decl.h>
+#include <libgnomedb-graph/gnome-db-goo-decl.h>
 
 G_BEGIN_DECLS
 

Copied: trunk/libgnomedb-graph/gnome-db-goo-table.h (from r1720, /trunk/libgnomedb-goo/gnome-db-goo-table.h)
==============================================================================
--- /trunk/libgnomedb-goo/gnome-db-goo-table.h	(original)
+++ trunk/libgnomedb-graph/gnome-db-goo-table.h	Mon Apr 28 16:49:12 2008
@@ -22,7 +22,7 @@
 #define __GNOME_DB_GOO_TABLE__
 
 #include "gnome-db-goo-item.h"
-#include <libgnomedb-goo/gnome-db-goo-decl.h>
+#include <libgnomedb-graph/gnome-db-goo-decl.h>
 #include <libgda/gda-meta-struct.h>
 
 G_BEGIN_DECLS

Copied: trunk/libgnomedb-graph/gnome-db-goo.h (from r1720, /trunk/libgnomedb-goo/gnome-db-goo.h)
==============================================================================
--- /trunk/libgnomedb-goo/gnome-db-goo.h	(original)
+++ trunk/libgnomedb-graph/gnome-db-goo.h	Mon Apr 28 16:49:12 2008
@@ -23,7 +23,7 @@
 
 #include <goocanvas.h>
 #include <libgda/gda-decl.h>
-#include <libgnomedb-goo/gnome-db-goo-decl.h>
+#include <libgnomedb-graph/gnome-db-goo-decl.h>
 
 G_BEGIN_DECLS
 

Copied: trunk/libgnomedb-graph/gnome-db-graph-item.h (from r1720, /trunk/libgnomedb-goo/gnome-db-graph-item.h)
==============================================================================
--- /trunk/libgnomedb-goo/gnome-db-graph-item.h	(original)
+++ trunk/libgnomedb-graph/gnome-db-graph-item.h	Mon Apr 28 16:49:12 2008
@@ -23,7 +23,7 @@
 #define __GNOME_DB_GRAPH_ITEM_H_
 
 #include <glib-object.h>
-#include <libgnomedb-goo/gnome-db-goo-decl.h>
+#include <libgnomedb-graph/gnome-db-goo-decl.h>
 
 G_BEGIN_DECLS
 

Copied: trunk/libgnomedb-graph/gnome-db-graph.c (from r1720, /trunk/libgnomedb-goo/gnome-db-graph.c)
==============================================================================
--- /trunk/libgnomedb-goo/gnome-db-graph.c	(original)
+++ trunk/libgnomedb-graph/gnome-db-graph.c	Mon Apr 28 16:49:12 2008
@@ -110,11 +110,11 @@
 
 
 static void
-gnome_db_graph_class_init (GnomeDbGraphClass * class)
+gnome_db_graph_class_init (GnomeDbGraphClass *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);
 	
 	gnome_db_graph_signals[ITEM_ADDED] =
 		g_signal_new ("item_added",
@@ -141,9 +141,9 @@
 			      g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE,
 			      1, GNOME_DB_TYPE_GRAPH_ITEM);
 	
-	class->item_added = NULL;
-	class->item_dropped = NULL;
-	class->item_moved = NULL;
+	klass->item_added = NULL;
+	klass->item_dropped = NULL;
+	klass->item_moved = NULL;
 
 	object_class->dispose = gnome_db_graph_dispose;
 	object_class->finalize = gnome_db_graph_finalize;

Copied: trunk/libgnomedb-graph/gnome-db-graph.h (from r1720, /trunk/libgnomedb-goo/gnome-db-graph.h)
==============================================================================
--- /trunk/libgnomedb-goo/gnome-db-graph.h	(original)
+++ trunk/libgnomedb-graph/gnome-db-graph.h	Mon Apr 28 16:49:12 2008
@@ -23,7 +23,7 @@
 #define __GNOME_DB_GRAPH_H_
 
 #include <glib-object.h>
-#include <libgnomedb-goo/gnome-db-goo-decl.h>
+#include <libgnomedb-graph/gnome-db-goo-decl.h>
 #include <libgda/libgda.h>
 
 G_BEGIN_DECLS

Copied: trunk/libgnomedb-graph/libgnomedb-goo.h (from r1720, /trunk/libgnomedb-goo/libgnomedb-goo.h)
==============================================================================
--- /trunk/libgnomedb-goo/libgnomedb-goo.h	(original)
+++ trunk/libgnomedb-graph/libgnomedb-goo.h	Mon Apr 28 16:49:12 2008
@@ -23,14 +23,14 @@
 #ifndef __LIBGNOME_DB_GRAPH_H_
 #define __LIBGNOME_DB_GRAPH_H_
 
-#include <libgnomedb-goo/gnome-db-goo-cursor.h>
-#include <libgnomedb-goo/gnome-db-goo-db-relations.h>
-#include <libgnomedb-goo/gnome-db-goo-table.h>
-#include <libgnomedb-goo/gnome-db-goo-column.h>
-#include <libgnomedb-goo/gnome-db-goo-fkey.h>
-#include <libgnomedb-goo/gnome-db-goo-item.h>
-#include <libgnomedb-goo/gnome-db-goo-text.h>
-#include <libgnomedb-goo/gnome-db-goo-tip.h>
-#include <libgnomedb-goo/gnome-db-goo.h>
+#include <libgnomedb-graph/gnome-db-goo-cursor.h>
+#include <libgnomedb-graph/gnome-db-goo-db-relations.h>
+#include <libgnomedb-graph/gnome-db-goo-table.h>
+#include <libgnomedb-graph/gnome-db-goo-column.h>
+#include <libgnomedb-graph/gnome-db-goo-fkey.h>
+#include <libgnomedb-graph/gnome-db-goo-item.h>
+#include <libgnomedb-graph/gnome-db-goo-text.h>
+#include <libgnomedb-graph/gnome-db-goo-tip.h>
+#include <libgnomedb-graph/gnome-db-goo.h>
 
 #endif

Modified: trunk/libgnomedb/gnome-db-data-store.c
==============================================================================
--- trunk/libgnomedb/gnome-db-data-store.c	(original)
+++ trunk/libgnomedb/gnome-db-data-store.c	Mon Apr 28 16:49:12 2008
@@ -160,6 +160,8 @@
 	GtkTreePath *path;
 	GtkTreeIter iter;
 
+	g_print ("I %d\n", row);
+	gda_data_model_dump (((GnomeDbDataStore*) store)->priv->proxy, stdout);
 	((GnomeDbDataStore*) store)->priv->nrows ++;
 	((GnomeDbDataStore*) store)->priv->stamp = g_random_int ();
 	path = gtk_tree_path_new ();
@@ -175,6 +177,8 @@
 	GtkTreePath *path;
 	GtkTreeIter iter;
 
+	g_print ("U %d\n", row);
+	gda_data_model_dump (((GnomeDbDataStore*) store)->priv->proxy, stdout);
 	((GnomeDbDataStore*) store)->priv->stamp = g_random_int ();
 	path = gtk_tree_path_new ();
         gtk_tree_path_append_index (path, row);
@@ -188,6 +192,8 @@
 {
 	GtkTreePath *path;
 
+	g_print ("R %d\n", row);
+	gda_data_model_dump (((GnomeDbDataStore*) store)->priv->proxy, stdout);
 	((GnomeDbDataStore*) store)->priv->nrows --;
 	((GnomeDbDataStore*) store)->priv->stamp = g_random_int ();
 	path = gtk_tree_path_new ();
@@ -201,6 +207,7 @@
 {
 	gint i, nrows;
 
+	g_print ("RESET\n");
 	while (((GnomeDbDataStore*) store)->priv->nrows > 0) 
 		row_removed_cb (proxy, ((GnomeDbDataStore*) store)->priv->nrows - 1, store);
 
@@ -316,7 +323,6 @@
 		case PROP_ADD_NULL_ENTRY: {
 			gboolean prop;
 			
-			g_return_if_fail (store->priv->proxy);
 			g_object_get (store->priv->proxy, "prepend_null_entry", &prop, NULL);
 			g_value_set_boolean (value, prop);
 			break;

Modified: trunk/libgnomedb/gnome-db-login-dialog.c
==============================================================================
--- trunk/libgnomedb/gnome-db-login-dialog.c	(original)
+++ trunk/libgnomedb/gnome-db-login-dialog.c	Mon Apr 28 16:49:12 2008
@@ -27,6 +27,7 @@
 #include <gtk/gtktable.h>
 #include <gtk/gtkhbox.h>
 #include <gtk/gtkwindow.h>
+#include <libgda/gda-config.h>
 #include <libgnomedb/gnome-db-login.h>
 #include <libgnomedb/gnome-db-login-dialog.h>
 #include <libgnomedb/gnome-db-stock.h>
@@ -38,6 +39,7 @@
 
 
 struct _GnomeDbLoginDialogPrivate {
+	GtkWidget *notice;
 	GtkWidget *login;
 };
 
@@ -79,20 +81,39 @@
 	object_class->finalize = gnome_db_login_dialog_finalize;
 
 	/* add class properties */
-	g_object_class_install_property (
-		object_class, PROP_DSN,
-		g_param_spec_string ("dsn", NULL, NULL, NULL, G_PARAM_READABLE));
-	g_object_class_install_property (
-		object_class, PROP_USERNAME,
-		g_param_spec_string ("username", NULL, NULL, NULL, G_PARAM_READABLE));
-	g_object_class_install_property (
-		object_class, PROP_PASSWORD,
-		g_param_spec_string ("password", NULL, NULL, NULL, G_PARAM_READABLE));
+	g_object_class_install_property (object_class, PROP_DSN,
+					 g_param_spec_string ("dsn", NULL, NULL, NULL, G_PARAM_READABLE));
+	g_object_class_install_property (object_class, PROP_USERNAME,
+					 g_param_spec_string ("username", NULL, NULL, NULL, G_PARAM_READABLE));
+	g_object_class_install_property (object_class, PROP_PASSWORD,
+					 g_param_spec_string ("password", NULL, NULL, NULL, G_PARAM_READABLE));
 
 	gnome_db_stock_init ();
 }
 
 static void
+login_dsn_changed_cb (GnomeDbLogin *login, GnomeDbLoginDialog *dialog)
+{
+	gchar *str;
+	if (gda_config_dsn_needs_authentication (gnome_db_login_get_dsn (login))) {
+		str = g_strdup_printf ("<b>%s:</b>\n%s", _("Connection opening"),
+				       _("Fill in the following authentication arguments below\n"
+					 "to open a connection"));
+		gtk_label_set_markup (GTK_LABEL (dialog->priv->notice), str);
+		g_free (str);
+		gtk_widget_show (dialog->priv->login);
+	}
+	else {
+		str = g_strdup_printf ("<b>%s:</b>\n%s", _("Connection opening"),
+				       _("No authentication required,\n"
+					 "confirm connection opening"));
+		gtk_label_set_markup (GTK_LABEL (dialog->priv->notice), str);
+		g_free (str);
+		gtk_widget_hide (dialog->priv->login);
+	}
+}
+
+static void
 gnome_db_login_dialog_init (GnomeDbLoginDialog *dialog, GnomeDbLoginDialogClass *klass)
 {
 	GtkWidget *hbox, *vbox, *image, *label;
@@ -134,15 +155,12 @@
 	gtk_widget_show (vbox);
 	gtk_notebook_append_page (GTK_NOTEBOOK (nb), vbox, NULL);
 	gtk_widget_show (vbox);
-	
-	str = g_strdup_printf ("<b>%s:</b>\n%s", _("Connection opening"),
-			       _("Enter the arguments below to open a connection\n"
-				 "to a data source"));
+
 	label = gtk_label_new ("");
-	gtk_label_set_markup (GTK_LABEL (label), str);
-	g_free (str);
+	dialog->priv->notice = label;
+
 	gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
-        gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+	gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
 	gtk_label_set_selectable (GTK_LABEL (label), FALSE);
 	gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
 	gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
@@ -152,6 +170,8 @@
 	gnome_db_login_set_enable_create_button (GNOME_DB_LOGIN (dialog->priv->login), TRUE);
 	gtk_widget_show (dialog->priv->login);
 	gtk_box_pack_start (GTK_BOX (vbox), dialog->priv->login, TRUE, TRUE, 0);
+	g_signal_connect (G_OBJECT (dialog->priv->login), "dsn-changed",
+			  G_CALLBACK (login_dsn_changed_cb), dialog);
 
 	str = gnome_db_gbr_get_icon_path ("gnome-db.png");
 	icon = gdk_pixbuf_new_from_file (str, NULL);
@@ -250,18 +270,19 @@
 
 /**
  * gnome_db_login_dialog_new
- * @title:
- *
+ * @title: title of the dialog, or %NULL
+ * @parent: transient parent of the dialog, or %NULL
  *
+ * Creates a new login dialog widget.
  *
- * Returns:
+ * Returns: the new widget
  */
 GtkWidget *
-gnome_db_login_dialog_new (const gchar *title)
+gnome_db_login_dialog_new (const gchar *title, GtkWindow *parent)
 {
 	GnomeDbLoginDialog *dialog;
 
-	dialog = g_object_new (GNOME_DB_TYPE_LOGIN_DIALOG, "title", title, NULL);
+	dialog = g_object_new (GNOME_DB_TYPE_LOGIN_DIALOG, "transient-for", parent, "title", title, NULL);
 
 	return GTK_WIDGET (dialog);
 }
@@ -324,7 +345,8 @@
  *
  * Returns:
  */
-const gchar *gnome_db_login_dialog_get_username (GnomeDbLoginDialog *dialog)
+const gchar *
+gnome_db_login_dialog_get_username (GnomeDbLoginDialog *dialog)
 {
 	g_return_val_if_fail (GNOME_DB_IS_LOGIN_DIALOG (dialog), NULL);
 	return gnome_db_login_get_username (GNOME_DB_LOGIN (dialog->priv->login));
@@ -338,7 +360,8 @@
  *
  * Returns:
  */
-const gchar *gnome_db_login_dialog_get_password (GnomeDbLoginDialog *dialog)
+const gchar *
+gnome_db_login_dialog_get_password (GnomeDbLoginDialog *dialog)
 {
 	g_return_val_if_fail (GNOME_DB_IS_LOGIN_DIALOG (dialog), NULL);
 	return gnome_db_login_get_password (GNOME_DB_LOGIN (dialog->priv->login));

Modified: trunk/libgnomedb/gnome-db-login-dialog.h
==============================================================================
--- trunk/libgnomedb/gnome-db-login-dialog.h	(original)
+++ trunk/libgnomedb/gnome-db-login-dialog.h	Mon Apr 28 16:49:12 2008
@@ -49,11 +49,11 @@
 };
 
 GType        gnome_db_login_dialog_get_type         (void) G_GNUC_CONST;
-GtkWidget   *gnome_db_login_dialog_new              (const gchar *title);
+GtkWidget   *gnome_db_login_dialog_new              (const gchar *title, GtkWindow *parent);
 gboolean     gnome_db_login_dialog_run              (GnomeDbLoginDialog *dialog);
+
 const gchar *gnome_db_login_dialog_get_dsn          (GnomeDbLoginDialog *dialog);
 const gchar *gnome_db_login_dialog_get_auth         (GnomeDbLoginDialog *dialog);
-
 const gchar *gnome_db_login_dialog_get_username     (GnomeDbLoginDialog *dialog);
 const gchar *gnome_db_login_dialog_get_password     (GnomeDbLoginDialog *dialog);
 

Modified: trunk/libgnomedb/gnome-db-login.c
==============================================================================
--- trunk/libgnomedb/gnome-db-login.c	(original)
+++ trunk/libgnomedb/gnome-db-login.c	Mon Apr 28 16:49:12 2008
@@ -70,6 +70,16 @@
 
 static GObjectClass *parent_class = NULL;
 
+/* signals */
+enum
+{
+        DSN_CHANGED,
+        LAST_SIGNAL
+};
+
+static gint gnome_db_login_signals[LAST_SIGNAL] = { 0 };
+
+
 #ifdef HAVE_GTKTWOTEN
 static void
 assistant_finished_cb (GnomeDbDsnAssistant *assistant, gboolean error, GnomeDbLogin *login);
@@ -80,10 +90,6 @@
 dsn_entry_changed_cb (GnomeDbDataSourceSelector *sel, GnomeDbLogin *login);
 
 /*
- * Private functions
- */
-
-/*
  * GnomeDbLogin class implementation
  */
 
@@ -94,6 +100,17 @@
 
 	parent_class = g_type_class_peek_parent (klass);
 
+	gnome_db_login_signals[DSN_CHANGED] =
+                g_signal_new ("dsn-changed",
+                              G_TYPE_FROM_CLASS (object_class),
+                              G_SIGNAL_RUN_FIRST,
+                              G_STRUCT_OFFSET (GnomeDbLoginClass, dsn_changed),
+                              NULL, NULL,
+                              g_cclosure_marshal_VOID__VOID, G_TYPE_NONE,
+                              0);
+
+	klass->dsn_changed = NULL;
+
 	object_class->set_property = gnome_db_login_set_property;
 	object_class->get_property = gnome_db_login_get_property;
 	object_class->finalize = gnome_db_login_finalize;
@@ -417,12 +434,15 @@
 				g_object_unref (set);
 				gtk_container_add (GTK_CONTAINER (login->priv->auth_container),
 						   login->priv->auth_widget);
-				gtk_widget_show (login->priv->auth_container);
 				gtk_widget_show (login->priv->auth_widget);
 			}
 		}
-		else
-			gtk_widget_hide (login->priv->auth_container);
+		else {
+			login->priv->auth_widget = gtk_label_new (_("No authentication necessary."));
+			gtk_container_add (GTK_CONTAINER (login->priv->auth_container), login->priv->auth_widget);
+			gtk_widget_show (login->priv->auth_widget);
+		}
+		g_signal_emit (login, gnome_db_login_signals[DSN_CHANGED], 0);
 	}
 }
 

Modified: trunk/libgnomedb/gnome-db-login.h
==============================================================================
--- trunk/libgnomedb/gnome-db-login.h	(original)
+++ trunk/libgnomedb/gnome-db-login.h	Mon Apr 28 16:49:12 2008
@@ -45,6 +45,9 @@
 
 struct _GnomeDbLoginClass {
 	GtkVBoxClass         parent_class;
+
+	/* signals */
+	void               (*dsn_changed) (GnomeDbLogin *login);
 };
 
 GType        gnome_db_login_get_type                 (void) G_GNUC_CONST;

Modified: trunk/libgnomedb/gnome-db-raw-grid.c
==============================================================================
--- trunk/libgnomedb/gnome-db-raw-grid.c	(original)
+++ trunk/libgnomedb/gnome-db-raw-grid.c	Mon Apr 28 16:49:12 2008
@@ -925,11 +925,6 @@
 		/* the reason for not having any value is that the GnomeDbDataCellRendererCombo had no selected item */
 		return;
 	
-#ifdef debug_NO
-	DEBUG_HEADER;
-	gda_object_dump (grid->priv->proxy, 0);
-#endif
-
 	if (set_iter_from_path (grid, path, &iter)) {
 		GSList *list, *params;
 		gint col, proxy_row;
@@ -959,11 +954,6 @@
 		}
 #endif
 	}
-
-#ifdef debug_NO
-	DEBUG_HEADER;
-	gda_object_dump (grid->priv->proxy, 0);
-#endif
 }
 
 static gboolean
@@ -1099,11 +1089,6 @@
 		gnome_db_data_store_set_value (grid->priv->store, &iter, offset + col, attribute);
 	}
 	gda_value_free (attribute);
-
-#ifdef debug_no
-	DEBUG_HEADER;
-	gda_object_dump (grid->priv->proxy, 0);
-#endif
 }
 
 static void

Modified: trunk/libgnomedb/gnome-db-stock.c
==============================================================================
--- trunk/libgnomedb/gnome-db-stock.c	(original)
+++ trunk/libgnomedb/gnome-db-stock.c	Mon Apr 28 16:49:12 2008
@@ -31,10 +31,10 @@
 static GtkStockItem builtin_icons [] = {
 	{ GNOME_DB_STOCK_AGGREGATES, N_("Aggregates"), 0, 0, GETTEXT_PACKAGE },
 	{ GNOME_DB_STOCK_COMMIT, N_("Commit"), 0, 0, GETTEXT_PACKAGE },
-	{ GNOME_DB_STOCK_CONNECT, N_("Connect"), 0, 0, GETTEXT_PACKAGE },
+	{ GNOME_DB_STOCK_CONNECT, N_("Open connection"), 0, 0, GETTEXT_PACKAGE },
 	{ GNOME_DB_STOCK_DATABASE, N_("Database"), 0, 0, GETTEXT_PACKAGE },
 	{ GNOME_DB_STOCK_DESIGNER, N_("Designer"), 0, 0, GETTEXT_PACKAGE },
-	{ GNOME_DB_STOCK_DISCONNECT, N_("Disconnect"), 0, 0, GETTEXT_PACKAGE },
+	{ GNOME_DB_STOCK_DISCONNECT, N_("Close connection"), 0, 0, GETTEXT_PACKAGE },
 	{ GNOME_DB_STOCK_NO_TRANSACTION, N_("NoTransaction"), 0, 0, GETTEXT_PACKAGE },
 	{ GNOME_DB_STOCK_PROCEDURES, N_("Procedures"), 0, 0, GETTEXT_PACKAGE },
 	{ GNOME_DB_STOCK_QUERY, N_("Query"), 0, 0, GETTEXT_PACKAGE },

Modified: trunk/testing/Makefile.am
==============================================================================
--- trunk/testing/Makefile.am	(original)
+++ trunk/testing/Makefile.am	Mon Apr 28 16:49:12 2008
@@ -1,7 +1,7 @@
 noinst_PROGRAMS = test-dyn-widgets test-handlers
 
 if HAVE_GOOCANVAS
-graphlib= $(top_builddir)/libgnomedb-goo/libgnomedb_goo-4.0.la
+graphlib= $(top_builddir)/libgnomedb-graph/libgnomedb_graph-4.0.la
 else
 graphlib=
 endif

Modified: trunk/testing/test-dyn-widgets.c
==============================================================================
--- trunk/testing/test-dyn-widgets.c	(original)
+++ trunk/testing/test-dyn-widgets.c	Mon Apr 28 16:49:12 2008
@@ -529,7 +529,7 @@
 {
 	GtkWidget *props;
                                                                                                                     
-        props = gnome_db_login_dialog_new (_("Connection's configuration"));
+        props = gnome_db_login_dialog_new (_("Connection's configuration"), NULL);
         if (gnome_db_login_dialog_run (GNOME_DB_LOGIN_DIALOG (props))) {
 		gda_connection_set_dsn (config->cnc, gnome_db_login_dialog_get_dsn (GNOME_DB_LOGIN_DIALOG (props)));
 		g_object_set (G_OBJECT (config->cnc),



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