--- abiword-2.4.0~/abiword-plugins/tools/gda/unix/AbiGDA.cpp 2005-01-12 19:54:57 +0200 +++ abiword-2.4.0/abiword-plugins/tools/gda/unix/AbiGDA.cpp 2005-11-23 20:18:50 +0200 @@ -51,9 +51,9 @@ #include #include +#include #include #include -#include static GdaClient * connection_pool = NULL; @@ -63,6 +63,9 @@ #define X_ReturnNoMemIfError(exp) UT_return_val_if_fail(exp,UT_IE_NOMEMORY) #define X_CheckError(v) UT_return_if_fail(v != UT_OK) +GtkWidget * gnome_db_new_table_widget (gint rows, gint cols, gboolean homogenous); +GtkWidget * gnome_db_new_label_widget (const gchar *text); + /** * This class' purpose is to take (or generate) a GdaDataModel * and turn it into an AbiWord table. If we generate a DataModel @@ -283,13 +286,18 @@ sql = editable_txt; g_free (editable_txt); - cnc = gda_client_open_connection (connection_pool, dsn_name.utf8_str(), user_name.utf8_str(), password.utf8_str(), GDA_CONNECTION_OPTIONS_READ_ONLY); + cnc = gda_client_open_connection (connection_pool, + dsn_name.utf8_str(), + user_name.utf8_str(), + password.utf8_str(), + GDA_CONNECTION_OPTIONS_READ_ONLY, + 0); if (!GDA_IS_CONNECTION (cnc)) return false; /* execute command */ cmd = gda_command_new (sql.utf8_str(), GDA_COMMAND_TYPE_SQL, (GdaCommandOptions)0); - recset = gda_connection_execute_single_command (cnc, cmd, NULL); + recset = gda_connection_execute_single_command (cnc, cmd, NULL,0); gda_command_free (cmd); if (recset == NULL || !GDA_IS_DATA_MODEL (recset)) @@ -358,6 +366,30 @@ return ret; } +GtkWidget * +gnome_db_new_table_widget (gint rows, gint cols, gboolean homogenous) +{ + GtkWidget *table; + table = gtk_table_new (rows, cols, homogenous); + gtk_table_set_row_spacings (GTK_TABLE (table), 6); + gtk_table_set_col_spacings (GTK_TABLE (table), 6); + gtk_widget_show (table); + return table; +} + +GtkWidget * +gnome_db_new_label_widget (const gchar *text) +{ + GtkWidget *label; + + label = gtk_label_new_with_mnemonic (text); + gtk_label_set_selectable (GTK_LABEL (label), TRUE); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_widget_show (label); + + return label; +} + // // GDA_viewDataSources // -------------------