forked from GNOME/libgda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
newcode.patch
335 lines (313 loc) · 11.7 KB
/
newcode.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
diff --git a/libgda-ui/demos/linked_grid_form.c b/libgda-ui/demos/linked_grid_form.c
index 9341d9d..f5df34c 100644
--- a/libgda-ui/demos/linked_grid_form.c
+++ b/libgda-ui/demos/linked_grid_form.c
@@ -154,11 +154,11 @@ do_linked_grid_form (GtkWidget *do_widget)
"<small>Effective only at the next selected row change</small>");
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_misc_set_alignment (GTK_MISC (label), 0., -1);
- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
cb = gtk_check_button_new_with_label ("Keep selected rows synchroniezd");
- gtk_box_pack_start (GTK_BOX (vbox), cb, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), cb, FALSE, FALSE, 0);
gtk_widget_show (cb);
g_signal_connect (G_OBJECT (cb), "toggled",
G_CALLBACK (sync_selections_cb), data);
diff --git a/libgda-ui/gdaui-init.c b/libgda-ui/gdaui-init.c
index 3a4a049..3f57c4b 100644
--- a/libgda-ui/gdaui-init.c
+++ b/libgda-ui/gdaui-init.c
@@ -906,7 +906,6 @@ gdaui_get_icon_for_db_engine (const gchar *engine)
g_hash_table_remove (icons_hash, key);
break;
}
- g_print ("Inserted '%s'\n", key);
g_hash_table_insert (icons_hash, g_strdup (key), g_object_ref (pix));
}
g_free (key);
diff --git a/libgda-ui/libgdaui-6.0.vapi b/libgda-ui/libgdaui-6.0.vapi
index b8b2717..86ae8a7 100644
--- a/libgda-ui/libgdaui-6.0.vapi
+++ b/libgda-ui/libgdaui-6.0.vapi
@@ -1,4 +1,4 @@
-/* libgdaui-6.0.vapi generated by vapigen-0.22, do not modify. */
+/* libgdaui-6.0.vapi generated by vapigen-0.26, do not modify. */
[CCode (cprefix = "Gdaui", gir_namespace = "Gdaui", gir_version = "6.0", lower_case_cprefix = "gdaui_")]
namespace Gdaui {
@@ -534,9 +534,11 @@ namespace Gdaui {
[CCode (cheader_filename = "libgda-ui/libgda-ui.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "gdaui_set_source_get_type ()")]
[Compact]
public class SetSource {
- public int ref_cols_index;
+ [CCode (array_length = false, array_null_terminated = true)]
+ public weak int[] ref_cols_index;
public int ref_n_cols;
- public int shown_cols_index;
+ [CCode (array_length = false, array_null_terminated = true)]
+ public weak int[] shown_cols_index;
public int shown_n_cols;
public weak Gda.SetSource source;
[CCode (has_construct_function = false)]
diff --git a/libgda/gda-config.c b/libgda/gda-config.c
index 049fefc..d6a3ead 100644
--- a/libgda/gda-config.c
+++ b/libgda/gda-config.c
@@ -716,6 +716,7 @@ gda_config_constructor (GType type,
gboolean setup_ok = TRUE;
confdir = g_build_path (G_DIR_SEPARATOR_S, g_get_user_data_dir (), "libgda", NULL);
conffile = g_build_filename (confdir, "config", NULL);
+ g_print ("Confdir = %s\n", confdir);
if (!g_file_test (confdir, G_FILE_TEST_EXISTS)) {
gchar *old_path;
@@ -808,6 +809,7 @@ gda_config_constructor (GType type,
LIBGDA_ABI_NAME, "config", NULL);
unique_instance->priv->system_config_allowed = FALSE;
if (unique_instance->priv->system_file) {
+ g_print ("System dir is %s\n", unique_instance->priv->system_file);
#ifdef G_OS_WIN32
FILE *file;
diff --git a/libgda/gda-config.h b/libgda/gda-config.h
index 11879ff..03477a4 100644
--- a/libgda/gda-config.h
+++ b/libgda/gda-config.h
@@ -61,6 +61,8 @@ typedef enum {
* @cnc_string: the connection string, a semi-colon separated <key>=<value> list where <key> and <value> are RFC 1738 encoded
* @auth_string: the authentication string, a semi-colon separated <key>=<value> list where <key> and <value> are RFC 1738 encoded. Can be %NULL.
* @is_system: %TRUE if the DSN is a system wide defined data source
+ * @sql_dialect: name of the SQL dialect useable (for example "PostgreSQL") or %NULL if no SQL can be used
+ * @sql_dialect_help: additional help about the SQL dialect, if available, or %NULL
*
* This structure defines the properties of a named data source (DSN).
*/
@@ -71,6 +73,8 @@ struct _GdaDsnInfo {
gchar *cnc_string;
gchar *auth_string;
gboolean is_system;
+ gchar *sql_dialect;
+ gchar *sql_dialect_help;
/*< private >*/
/* Padding for future expansion */
diff --git a/libgda/thread-wrapper/test-worker.c b/libgda/thread-wrapper/test-worker.c
index 89f9b6b..0a8b367 100644
--- a/libgda/thread-wrapper/test-worker.c
+++ b/libgda/thread-wrapper/test-worker.c
@@ -851,6 +851,14 @@ test13_time_func (GdaWorker *worker)
return G_SOURCE_REMOVE;
}
+gboolean
+test13_timerun_func (guint *counter)
+{
+ *counter += 1;
+ g_print (".%u\n", *counter);
+ return G_SOURCE_CONTINUE;
+}
+
int
test13 (void)
{
@@ -860,8 +868,10 @@ test13 (void)
worker = gda_worker_new ();
GError *error = NULL;
+ guint counter = 0;
g_timeout_add (200, (GSourceFunc) test13_time_func, gda_worker_ref (worker));
+ g_timeout_add (10, (GSourceFunc) test13_timerun_func, &counter);
g_print ("Sumbitting job for test13_func()\n");
gpointer result;
diff --git a/providers/bdb/libmain.c b/providers/bdb/libmain.c
index b0f3d0a..bec1a2d 100644
--- a/providers/bdb/libmain.c
+++ b/providers/bdb/libmain.c
@@ -73,7 +73,8 @@ plugin_get_name (void)
const gchar *
plugin_get_description (void)
{
- return _("Provider for Berkeley databases");
+ /* http://fr.wikipedia.org/wiki/Berkeley_DB */
+ return _("Provider for Berkeley DB databases");
}
gchar *
diff --git a/providers/mdb/libmain.c b/providers/mdb/libmain.c
index 3b5a19a..7dd535b 100644
--- a/providers/mdb/libmain.c
+++ b/providers/mdb/libmain.c
@@ -70,7 +70,7 @@ plugin_get_name (void)
const gchar *
plugin_get_description (void)
{
- return _("Provider for Microsoft Access files");
+ return _("Provider for Microsoft Access® files");
}
gchar *
diff --git a/providers/mysql/libmain.c b/providers/mysql/libmain.c
index 52fdf94..677568e 100644
--- a/providers/mysql/libmain.c
+++ b/providers/mysql/libmain.c
@@ -4,7 +4,7 @@
* Copyright (C) 2003 Gonzalo Paniagua Javier <[email protected]>
* Copyright (C) 2005 Bas Driessen <[email protected]>
* Copyright (C) 2005 Stanislav Brabec <[email protected]>
- * Copyright (C) 2005 - 2011 Vivien Malerba <[email protected]>
+ * Copyright (C) 2005 - 2014 Vivien Malerba <[email protected]>
* Copyright (C) 2011 Murray Cumming <[email protected]>
*
* This library is free software; you can redistribute it and/or
@@ -72,7 +72,7 @@ plugin_get_name (void)
const gchar *
plugin_get_description (void)
{
- return _("Provider for MySQL databases");
+ return _("Provider for MySQL and MariaDB databases");
}
gchar *
diff --git a/providers/sqlcipher/libmain.c b/providers/sqlcipher/libmain.c
index 4948bf4..c31e638 100644
--- a/providers/sqlcipher/libmain.c
+++ b/providers/sqlcipher/libmain.c
@@ -4,7 +4,7 @@
* Copyright (C) 2002 Carlos Perelló Marín <[email protected]>
* Copyright (C) 2005 Bas Driessen <[email protected]>
* Copyright (C) 2005 Stanislav Brabec <[email protected]>
- * Copyright (C) 2005 - 2011 Vivien Malerba <[email protected]>
+ * Copyright (C) 2005 - 2014 Vivien Malerba <[email protected]>
* Copyright (C) 2010 David King <[email protected]>
*
* This library is free software; you can redistribute it and/or
@@ -73,7 +73,7 @@ plugin_get_name (void)
const gchar *
plugin_get_description (void)
{
- return _("Provider for SQLCipher");
+ return _("Provider for SQLCipher, encrypted SQLite based database");
}
gchar *
diff --git a/providers/web/libmain.c b/providers/web/libmain.c
index 9ca0294..42938f3 100644
--- a/providers/web/libmain.c
+++ b/providers/web/libmain.c
@@ -72,7 +72,7 @@ plugin_get_name (void)
const gchar *
plugin_get_description (void)
{
- return _("Provider for web server proxies");
+ return _("Provider to access databases through a specially configured web proxy");
}
gchar *
diff --git a/tools/browser/query-exec/query-console-page.c b/tools/browser/query-exec/query-console-page.c
index fddbc9b..9a4c1d2 100644
--- a/tools/browser/query-exec/query-console-page.c
+++ b/tools/browser/query-exec/query-console-page.c
@@ -29,6 +29,8 @@
#include "../browser-page.h"
#include "query-editor.h"
#include "query-result.h"
+#include <t-context.h>
+#include <t-app.h>
#include <libgda-ui/internal/popup-container.h>
#include <libgda/sql-parser/gda-sql-parser.h>
#include <libgda-ui/libgda-ui.h>
@@ -39,6 +41,7 @@
struct _QueryConsolePagePrivate {
TConnection *tcnc;
GdaSqlParser *parser;
+ TContext *tconsole;
GtkActionGroup *agroup;
@@ -129,6 +132,7 @@ query_console_page_init (QueryConsolePage *tconsole, G_GNUC_UNUSED QueryConsoleP
tconsole->priv->params_popup = NULL;
tconsole->priv->agroup = NULL;
tconsole->priv->fav_id = -1;
+ tconsole->priv->tconsole = NULL;
gtk_orientable_set_orientation (GTK_ORIENTABLE (tconsole), GTK_ORIENTATION_VERTICAL);
}
@@ -147,6 +151,8 @@ query_console_page_dispose (GObject *object)
G_CALLBACK (connection_busy_cb), tconsole);
g_object_unref (tconsole->priv->tcnc);
}
+ if (tconsole->priv->tconsole)
+ g_object_unref (tconsole->priv->tconsole);
if (tconsole->priv->parser)
g_object_unref (tconsole->priv->parser);
if (tconsole->priv->params)
@@ -227,7 +233,14 @@ query_console_page_new (TConnection *tcnc)
tconsole = QUERY_CONSOLE_PAGE (g_object_new (QUERY_CONSOLE_PAGE_TYPE, NULL));
tconsole->priv->tcnc = g_object_ref (tcnc);
-
+
+ /* TContext */
+ tconsole->priv->tconsole = g_object_new (T_TYPE_CONTEXT, NULL);
+ t_context_set_connection (tconsole->priv->tconsole, tcnc);
+ TApp *app;
+ app = t_app_get();
+ t_context_set_command_group (tconsole->priv->tconsole, app->term_commands);
+
/* header */
GtkWidget *label;
gchar *str;
@@ -939,6 +952,47 @@ actually_execute (QueryConsolePage *tconsole, const gchar *sql, GdaSet *params,
}
tconsole->priv->currently_executing = TRUE;
+ ToolCommandResult *result;
+ result = t_context_command_execute (tconsole->priv->tconsole, sql, GDA_STATEMENT_MODEL_RANDOM_ACCESS, &error);
+ if (!result) {
+ ui_show_error (GTK_WINDOW (gtk_widget_get_toplevel ((GtkWidget*) tconsole)),
+ _("Error while parsing code: %s"),
+ error && error->message ? error->message : _("No detail"));
+ g_clear_error (&error);
+ return;
+ }
+
+ if (add_editor_history) {
+ if (! base_tool_command_is_internal (sql)) {
+ /* mark the current SQL to be kept by the editor as an internal history */
+ query_editor_keep_current_state (tconsole->priv->editor);
+ }
+ }
+
+ switch (result->type) {
+ case BASE_TOOL_COMMAND_RESULT_TXT_STDOUT:
+ TO_IMPLEMENT;
+ break;
+ case BASE_TOOL_COMMAND_RESULT_EMPTY:
+ break;
+ case BASE_TOOL_COMMAND_RESULT_MULTIPLE:
+ TO_IMPLEMENT;
+ break;
+ case BASE_TOOL_COMMAND_RESULT_EXIT:
+ TO_IMPLEMENT;
+ break;
+ case BASE_TOOL_COMMAND_RESULT_DATA_MODEL:
+ TO_IMPLEMENT;
+ break;
+ default:
+ TO_IMPLEMENT;
+ break;
+ }
+
+ base_tool_command_result_free (result);
+ tconsole->priv->currently_executing = FALSE;
+
+#ifdef OLDCODE
if (!tconsole->priv->parser)
tconsole->priv->parser = t_connection_create_parser (tconsole->priv->tcnc);
@@ -1025,6 +1079,7 @@ actually_execute (QueryConsolePage *tconsole, const gchar *sql, GdaSet *params,
}
g_object_unref (batch);
tconsole->priv->currently_executing = FALSE;
+#endif
}
static void
diff --git a/tools/browser/query-exec/query-editor.h b/tools/browser/query-exec/query-editor.h
index 091cdb2..93e06ab 100644
--- a/tools/browser/query-exec/query-editor.h
+++ b/tools/browser/query-exec/query-editor.h
@@ -75,7 +75,9 @@ QueryEditorHistoryBatch *query_editor_history_batch_new (GTimeVal run_time, GdaS
QueryEditorHistoryBatch *query_editor_history_batch_ref (QueryEditorHistoryBatch *qib);
void query_editor_history_batch_unref (QueryEditorHistoryBatch *qib);
-
+/*
+ * Query Editor
+ */
struct _QueryEditor {
GtkBox parent;
QueryEditorPrivate *priv;