17 #include "../postgis_config.h"
30 #define GUI_RCSID "shp2pgsql-gui $Revision$"
31 #define SHAPEFIELDMAXWIDTH 60
39 #if !GTK_CHECK_VERSION(2, 14, 0)
40 #if !defined(gtk_dialog_get_content_area)
41 #define gtk_dialog_get_content_area(dialog) GTK_DIALOG(dialog)->vbox
207 #define GUIMSG_LINE_MAXLEN 256
237 gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(
textview_log), &iter, 0.0,
TRUE, 0.0, 1.0);
240 while (gtk_events_pending())
241 gtk_main_iteration();
282 GtkWidget *dialog, *label;
285 dialog = gtk_dialog_new_with_buttons(
_(
"Error"), GTK_WINDOW(
window_main),
286 GTK_DIALOG_MODAL & GTK_DIALOG_NO_SEPARATOR & GTK_DIALOG_DESTROY_WITH_PARENT,
287 GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
288 gtk_dialog_set_has_separator(GTK_DIALOG(dialog),
FALSE );
289 gtk_container_set_border_width(GTK_CONTAINER(dialog), 5);
290 gtk_container_set_border_width(GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), 15);
291 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), label);
292 gtk_widget_show_all(dialog);
293 gtk_dialog_run(GTK_DIALOG(dialog));
294 gtk_widget_destroy(dialog);
304 PGresult *
res = NULL;
305 ExecStatusType status;
310 if ( !
sql )
return 0;
313 status = PQresultStatus(
res);
317 if ( ! ( status == PGRES_COMMAND_OK || status == PGRES_TUPLES_OK ) )
320 if ( status == PGRES_NONFATAL_ERROR )
327 snprintf(sql_trunc, 255,
"%s",
sql);
328 pgui_logf(
"Failed SQL begins: \"%s\"", sql_trunc);
342 PGresult *
res = NULL;
343 ExecStatusType status;
348 if ( !
sql )
return 0;
351 status = PQresultStatus(
res);
355 if ( status != PGRES_COPY_IN )
358 snprintf(sql_trunc, 255,
"%s",
sql);
359 pgui_logf(
"Failed SQL begins: \"%s\"", sql_trunc);
373 char line_trunc[256];
377 if ( ! line )
return 0;
383 snprintf(line_trunc, 255,
"%s", line);
384 pgui_logf(
"Failed row begins: \"%s\"", line_trunc);
406 if ( rollback ) errmsg =
"Roll back the copy.";
438 if (strlen(filename) > max_width)
439 max_width = strlen(filename);
463 char *connection_string = NULL;
464 char *connection_sanitized = NULL;
473 connection_sanitized = strdup(connection_string);
475 pgui_logf(
"Connecting: %s", connection_sanitized);
476 free(connection_sanitized);
482 free(connection_string);
490 free(connection_string);
504 gtk_widget_hide(GTK_WIDGET(widget));
564 if (entry_encoding && strlen(entry_encoding) > 0)
569 config->
encoding = strdup(entry_encoding);
670 PGresult *result, *geocol_result;
671 GtkTreeIter iter, geocol_iter;
672 GtkListStore *dumper_geocol_combo_list;
673 char *connection_string, *sql_form, *query, *schema, *table, *geocol_query, *geocol_name=NULL;
683 query =
"SELECT tableoids.oid, n.nspname, tableoids.relname, COALESCE((SELECT 1 from pg_attribute WHERE attrelid = tableoids.oid AND atttypid IN (SELECT oid FROM pg_type WHERE typname in ('geometry', 'geography')) LIMIT 1), 0) hasgeo FROM (SELECT c.oid, c.relname, c.relnamespace FROM pg_class c WHERE c.relkind IN ('r', 'v', 'm', 'f','p') AND c.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname NOT ILIKE 'pg_%' AND nspname <> 'information_schema')) tableoids, pg_namespace n WHERE tableoids.relnamespace = n.oid ORDER BY n.nspname, tableoids.relname";
691 for (i = 0; i < PQntuples(result); i++)
699 schema = PQgetvalue(result, i, PQfnumber(result,
"nspname"));
700 table = PQgetvalue(result, i, PQfnumber(result,
"relname"));
702 sql_form =
"SELECT n.nspname, c.relname, a.attname FROM pg_class c, pg_namespace n, pg_attribute a WHERE c.relnamespace = n.oid AND n.nspname = '%s' AND c.relname = '%s' AND a.attrelid = c.oid AND a.atttypid IN (SELECT oid FROM pg_type WHERE typname in ('geometry', 'geography'))";
704 sz = strlen(sql_form) + strlen(schema) + strlen(table) + 1;
705 geocol_query =
malloc(sz);
706 snprintf(geocol_query, sz, sql_form, schema, table);
716 if (PQntuples(geocol_result) > 0)
719 for (j = 0; j < PQntuples(geocol_result); j++)
721 geocol_name = PQgetvalue(geocol_result, j, PQfnumber(geocol_result,
"attname"));
724 gtk_list_store_set(dumper_geocol_combo_list, &geocol_iter,
735 gtk_list_store_set(dumper_geocol_combo_list, &geocol_iter,
741 PQclear(geocol_result);
747 hasgeo = atoi(PQgetvalue(result, i, PQfnumber(result,
"hasgeo")));
808 if (keep_fieldname_case)
886 if (response == GTK_RESPONSE_OK)
902 char *table_start, *table_end;
916 loader_file_config->
shp_file = strdup(filename);
919 table_start = loader_file_config->
shp_file + strlen(loader_file_config->
shp_file);
920 while (*table_start !=
'/' && *table_start !=
'\\' && table_start > loader_file_config->
shp_file)
927 table_end = loader_file_config->
shp_file + strlen(loader_file_config->
shp_file);
928 while (*table_end !=
'.' && table_end > loader_file_config->
shp_file && table_end > table_start )
932 loader_file_config->
table =
malloc(table_end - table_start + 1);
933 memcpy(loader_file_config->
table, table_start, table_end - table_start);
934 loader_file_config->
table[table_end - table_start] =
'\0';
937 for (i = 0; i < table_end - table_start; i++)
939 if (isupper(loader_file_config->
table[i]) != 0)
940 loader_file_config->
table[i] = tolower(loader_file_config->
table[i]);
944 loader_file_config->
schema = strdup(
"public");
952 return loader_file_config;
1023 gchar *schema, *table, *geocol;
1040 dumper_table_config->
schema = strdup(schema);
1041 dumper_table_config->
table = strdup(table);
1044 dumper_table_config->
shp_file = strdup(table);
1046 if (hasgeo && geocol)
1051 return dumper_table_config;
1060 GtkListStore *geocol_liststore;
1072 if (chooser_liststore)
1075 gtk_tree_model_get(GTK_TREE_MODEL(chooser_liststore), chooser_iter,
1113 switch (dbf_fieldtype)
1117 if (!strcmp(pg_fieldtype,
"varchar"))
1123 if (!strcmp(pg_fieldtype,
"date"))
1129 if (!strcmp(pg_fieldtype,
"int2") || !strcmp(pg_fieldtype,
"int4") || !strcmp(pg_fieldtype,
"numeric"))
1135 if (!strcmp(pg_fieldtype,
"float8") || !strcmp(pg_fieldtype,
"numeric"))
1141 if (!strcmp(pg_fieldtype,
"boolean"))
1155 ExecStatusType status;
1158 char *pg_fieldname, *pg_fieldtype;
1162 status = PQresultStatus(result);
1163 if (status == PGRES_TUPLES_OK)
1165 ntuples = PQntuples(result);
1167 switch (config->
opt)
1191 pgui_seterr(
_(
"ERROR: Destination table %s.%s could not be found for appending"), config->
schema, config->
table);
1210 for (j = 0; j < ntuples; j++)
1212 pg_fieldname = PQgetvalue(result, j, PQfnumber(result,
"field"));
1213 pg_fieldtype = PQgetvalue(result, j, PQfnumber(result,
"type"));
1222 pgui_logf(
_(
"Warning: DBF Field '%s' is not compatible with PostgreSQL column '%s' in %s.%s"), state->
field_names[i], pg_fieldname, config->
schema, config->
table);
1231 pgui_logf(
_(
"Warning: DBF Field '%s' within file %s could not be matched to a column within table %s.%s"),
1245 pgui_seterr(
_(
"ERROR: unable to process validation response from remote server"));
1288 if (response == GTK_RESPONSE_OK)
1301 GSList *filename_list, *filename_item;
1311 filename_list = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(
dialog_filechooser));
1313 filename_item = g_slist_nth(filename_list, 0);
1314 while (filename_item)
1317 filename = g_slist_nth_data(filename_item, 0);
1323 filename_item = g_slist_next(filename_item);
1327 g_slist_free(filename_list);
1337 GtkTreeSelection *chooser_selection;
1338 GtkTreeModel *model;
1339 GList *selected_rows_list, *selected_row;
1341 GtkTreePath *tree_path;
1346 pgui_seterr(
_(
"Unable to connect to the database - please check your connection settings"));
1365 chooser_selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(
chooser_tree));
1367 selected_rows_list = gtk_tree_selection_get_selected_rows(chooser_selection, &model);
1368 selected_row = g_list_first(selected_rows_list);
1369 while (selected_row)
1372 tree_path = (GtkTreePath *)g_list_nth_data(selected_row, 0);
1373 gtk_tree_model_get_iter(model, &iter, tree_path);
1380 selected_row = g_list_next(selected_row);
1384 g_list_foreach(selected_row, (GFunc)gtk_tree_path_free, NULL);
1385 g_list_free(selected_row);
1424 char *sql_form, *query, *connection_string, *progress_shapefile = NULL;
1429 char *header, *footer, *record;
1435 pgui_seterr(
_(
"ERROR: You haven't specified any files to import"));
1445 pgui_seterr(
_(
"Unable to connect to the database - please check your connection settings"));
1462 sql_form =
"SELECT a.attnum, a.attname AS field, t.typname AS type, a.attlen AS length, a.atttypmod AS precision FROM pg_class c, pg_attribute a, pg_type t, pg_namespace n WHERE c.relname = '%s' AND n.nspname = '%s' AND a.attnum > 0 AND a.attrelid = c.oid AND a.atttypid = t.oid AND c.relnamespace = n.oid ORDER BY a.attnum";
1474 sz = strlen(sql_form) + strlen(loader_file_config->
schema) + strlen(loader_file_config->
table) + 1;
1476 snprintf(query, sz, sql_form, loader_file_config->
table, loader_file_config->
schema);
1511 pgui_logf(
"\n==============================");
1512 pgui_logf(
"Importing with configuration: %s, %s, %s, %s, mode=%c, dump=%d, simple=%d, geography=%d, index=%d, shape=%d, srid=%d", loader_file_config->
table, loader_file_config->
schema, loader_file_config->
geo_col, loader_file_config->
shp_file, loader_file_config->
opt, loader_file_config->
dump_format, loader_file_config->
simple_geometries, loader_file_config->
geography, loader_file_config->
createindex, loader_file_config->
readshape, loader_file_config->
sr_id);
1523 gtk_widget_set_sensitive(widget,
FALSE);
1526 while (gtk_events_pending())
1527 gtk_main_iteration();
1539 goto import_cleanup;
1543 for (i = strlen(loader_file_config->
shp_file); i >= 0
1544 && loader_file_config->
shp_file[i - 1] !=
'\\' && loader_file_config->
shp_file[i - 1] !=
'/'; i--);
1546 progress_shapefile =
malloc(strlen(loader_file_config->
shp_file));
1547 strcpy(progress_shapefile, &loader_file_config->
shp_file[i]);
1553 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(
progress), 0.0);
1570 goto import_cleanup;
1579 goto import_cleanup;
1585 int records_per_tick = (numrecords / 200) - 1;
1587 if ( records_per_tick < 1 )
1588 records_per_tick = 1;
1600 goto import_cleanup;
1608 goto import_cleanup;
1612 for (i = 0; i < numrecords &&
is_running; i++)
1627 pgui_logf(
_(
"Import failed on record number %d"), i);
1635 goto import_cleanup;
1649 pgui_logf(
_(
"Import failed on record number %d"), i);
1664 if ( i % records_per_tick == 0 )
1665 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(
progress), (
float)i / numrecords);
1668 while (gtk_events_pending())
1669 gtk_main_iteration();
1676 goto import_cleanup;
1679 if (PQresultStatus(result) != PGRES_COMMAND_OK)
1683 goto import_cleanup;
1698 goto import_cleanup;
1704 gtk_label_set_text(GTK_LABEL(
label_progress),
_(
"Creating spatial index..."));
1707 while (gtk_events_pending())
1708 gtk_main_iteration();
1716 goto import_cleanup;
1737 if (progress_shapefile)
1738 free(progress_shapefile);
1748 gtk_widget_set_sensitive(widget,
TRUE);
1751 gtk_widget_hide(widget);
1752 gtk_widget_show(widget);
1758 while (gtk_events_pending())
1759 gtk_main_iteration();
1762 free(connection_string);
1775 char *output_shapefile, *orig_shapefile;
1779 int ret, success =
FALSE, i = 0;
1785 pgui_seterr(
_(
"ERROR: You haven't specified any tables to export"));
1795 pgui_seterr(
_(
"Unable to connect to the database - please check your connection settings"));
1825 pgui_logf(
"\n==============================");
1826 pgui_logf(
"Exporting with configuration: %s, %s, %s", dumper_table_config->
table, dumper_table_config->
schema, dumper_table_config->
shp_file);
1833 gtk_widget_set_sensitive(widget,
FALSE);
1836 while (gtk_events_pending())
1837 gtk_main_iteration();
1844 orig_shapefile = dumper_table_config->
shp_file;
1845 output_shapefile =
malloc(strlen(folder_path) + strlen(dumper_table_config->
shp_file) + 2);
1846 strcpy(output_shapefile, folder_path);
1847 strcat(output_shapefile, G_DIR_SEPARATOR_S);
1848 strcat(output_shapefile, dumper_table_config->
shp_file);
1850 dumper_table_config->
shp_file = output_shapefile;
1859 goto export_cleanup;
1864 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(
progress), 0.0);
1879 goto export_cleanup;
1889 while (gtk_events_pending())
1890 gtk_main_iteration();
1909 goto export_cleanup;
1917 while (gtk_events_pending())
1918 gtk_main_iteration();
1946 dumper_table_config->
shp_file = orig_shapefile;
1960 gtk_widget_set_sensitive(widget,
TRUE);
1963 gtk_widget_hide(widget);
1964 gtk_widget_show(widget);
1970 while (gtk_events_pending())
1971 gtk_main_iteration();
1984 char *filename = NULL;
1986 GError *error = NULL;
1994 filename = g_filename_from_uri(uri, &hostname, &error);
1997 if (filename == NULL)
1999 pgui_logf(
_(
"Unable to process filename: %s\n"), error->message);
2000 g_error_free(error);
2017 gchar *schema, *table, *geo_col, *srid;
2028 if (loader_file_config->
schema)
2031 loader_file_config->
schema = strdup(schema);
2034 if (loader_file_config->
table)
2037 loader_file_config->
table = strdup(table);
2040 if (loader_file_config->
geo_col)
2043 loader_file_config->
geo_col = strdup(geo_col);
2046 loader_file_config->
sr_id = atoi(srid);
2062 GtkSelectionData *selection_data,
2063 guint info, guint t, gpointer
data)
2067 if (selection_data->data == NULL)
2069 pgui_logf(
_(
"Unable to process drag data."));
2073 p = (
char*)selection_data->data;
2080 while (g_ascii_isspace(*p))
2084 while (*q && (*q !=
'\n') && (*q !=
'\r'))
2091 while (q > p && g_ascii_isspace(*q))
2100 p = strchr(p,
'\n');
2113 GtkTreeIter *new_iter,
2139 loader_file_config->
opt =
'a';
2147 loader_file_config->
opt =
'd';
2151 loader_file_config->
opt =
'p';
2155 loader_file_config->
opt =
'c';
2187 if (strlen(new_text) == 0)
2191 columnindex = *(gint *)column;
2205 pgui_logf(
"Invalid SRID requiring more than %d digits: %d",
MAXLEN, loader_file_config->
sr_id);
2255 gchar *schema, *table, *geo_col, *filename;
2266 if (dumper_table_config->
schema)
2269 dumper_table_config->
schema = strdup(schema);
2272 if (dumper_table_config->
table)
2275 dumper_table_config->
table = strdup(table);
2287 dumper_table_config->
shp_file = strdup(filename);
2295 GtkTreeIter *new_iter,
2301 GtkListStore *model;
2324 dumper_table_config->
geo_col_name = strdup(geocol_name);
2346 if (strlen(new_text) == 0)
2350 columnindex = *(gint *)column;
2448 text = gtk_entry_get_text(GTK_ENTRY(
entry_pg_db));
2481 for (i = 0; i < strlen(
conn->
port); i++)
2485 pgui_seterr(
_(
"The connection port must be numeric!"));
2497 char *ptr = strstr(connection_string,
"password");
2501 while ( *ptr !=
'\'' && *ptr !=
'\0' )
2535 pgui_seterr(
_(
"Unable to connect to the database - please check your connection settings"));
2554 const char *authors[] =
2556 "Paul Ramsey <pramsey@cleverelephant.ca>",
2557 "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>",
2558 "Mark Leslie <mark.s.leslie@gmail.com>",
2565 gtk_about_dialog_set_name(GTK_ABOUT_DIALOG(
dialog_about),
_(
"PostGIS Shapefile Import/Export Manager"));
2567 gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(
dialog_about),
"http://postgis.net/");
2568 gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(
dialog_about), authors);
2574 GtkFileFilter *file_filter_shape;
2578 GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CLOSE, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL);
2581 file_filter_shape = gtk_file_filter_new();
2582 gtk_file_filter_add_pattern(GTK_FILE_FILTER(file_filter_shape),
"*.shp");
2583 gtk_file_filter_set_name(GTK_FILE_FILTER(file_filter_shape),
_(
"Shape Files (*.shp)"));
2584 gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(
dialog_filechooser), file_filter_shape);
2587 file_filter_shape = gtk_file_filter_new();
2588 gtk_file_filter_add_pattern(GTK_FILE_FILTER(file_filter_shape),
"*.dbf");
2589 gtk_file_filter_set_name(GTK_FILE_FILTER(file_filter_shape),
_(
"DBF Files (*.dbf)"));
2590 gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(
dialog_filechooser), file_filter_shape);
2601 GtkFileFilter *file_filter_shape;
2605 GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, GTK_STOCK_CANCEL, GTK_RESPONSE_CLOSE, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL);
2608 file_filter_shape = gtk_file_filter_new();
2609 gtk_file_filter_add_pattern(GTK_FILE_FILTER(file_filter_shape),
"*.shp");
2610 gtk_file_filter_set_name(GTK_FILE_FILTER(file_filter_shape),
_(
"Shape Files (*.shp)"));
2614 file_filter_shape = gtk_file_filter_new();
2615 gtk_file_filter_add_pattern(GTK_FILE_FILTER(file_filter_shape),
"*.dbf");
2616 gtk_file_filter_set_name(GTK_FILE_FILTER(file_filter_shape),
_(
"DBF Files (*.dbf)"));
2625 GtkWidget *vbox_progress, *table_progress;
2627 dialog_progress = gtk_dialog_new_with_buttons(
_(
"Working..."), GTK_WINDOW(
window_main), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL);
2635 gtk_box_set_spacing(GTK_BOX(vbox_progress), 15);
2638 table_progress = gtk_table_new(2, 1,
TRUE);
2639 gtk_container_set_border_width (GTK_CONTAINER (table_progress), 12);
2640 gtk_table_set_row_spacings(GTK_TABLE(table_progress), 5);
2641 gtk_table_set_col_spacings(GTK_TABLE(table_progress), 10);
2645 gtk_table_attach_defaults(GTK_TABLE(table_progress),
label_progress, 0, 1, 0, 1);
2649 gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(
progress), GTK_PROGRESS_LEFT_TO_RIGHT);
2650 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(
progress), 0.0);
2651 gtk_table_attach_defaults(GTK_TABLE(table_progress),
progress, 0, 1, 1, 2);
2654 gtk_box_pack_start(GTK_BOX(vbox_progress), table_progress,
FALSE,
FALSE, 0);
2668 GtkWidget *align = gtk_alignment_new(alignment, 0.5, 0.0, 1.0);
2669 GtkWidget *label = gtk_label_new(
str);
2670 gtk_table_attach_defaults(GTK_TABLE(table), align, 1, 3, row, row + 1);
2671 gtk_container_add(GTK_CONTAINER (align), label);
2677 GtkWidget *table_options;
2678 GtkWidget *align_options_center;
2679 static int text_width = 12;
2681 dialog_loader_options = gtk_dialog_new_with_buttons(
_(
"Import Options"), GTK_WINDOW(
window_main), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
2687 table_options = gtk_table_new(7, 3,
TRUE);
2688 gtk_container_set_border_width (GTK_CONTAINER (table_options), 12);
2689 gtk_table_set_row_spacings(GTK_TABLE(table_options), 5);
2690 gtk_table_set_col_spacings(GTK_TABLE(table_options), 10);
2699 align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2700 gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 1, 2 );
2705 align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2706 gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 2, 3 );
2711 align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2712 gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 3, 4 );
2717 align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2718 gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 4, 5 );
2723 align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 0.0 );
2724 gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 5, 6 );
2729 align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2730 gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 6, 7 );
2735 align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2736 gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 7, 8 );
2750 GtkWidget *table_options;
2751 GtkWidget *align_options_center;
2753 dialog_dumper_options = gtk_dialog_new_with_buttons(
_(
"Export Options"), GTK_WINDOW(
window_main), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
2759 table_options = gtk_table_new(3, 3,
TRUE);
2760 gtk_container_set_border_width (GTK_CONTAINER (table_options), 12);
2761 gtk_table_set_row_spacings(GTK_TABLE(table_options), 5);
2762 gtk_table_set_col_spacings(GTK_TABLE(table_options), 10);
2766 align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2767 gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 0, 1 );
2772 align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2773 gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 1, 2 );
2778 align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2779 gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 2, 3 );
2797 GtkWidget *vbox_tree, *table_progress;
2798 GtkWidget *sw, *label;
2799 GtkTreeSelection *chooser_selection;
2803 GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
2814 GTK_TYPE_TREE_MODEL,
2826 chooser_selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(
chooser_tree));
2827 gtk_tree_selection_set_mode(chooser_selection, GTK_SELECTION_MULTIPLE);
2830 sw = gtk_scrolled_window_new(NULL, NULL);
2831 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
2832 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_ETCHED_IN);
2833 gtk_widget_set_size_request(sw, 320, 240);
2835 gtk_box_pack_start(GTK_BOX(vbox_tree), sw,
FALSE,
FALSE, 10);
2863 table_progress = gtk_table_new(1, 2,
FALSE);
2864 gtk_container_set_border_width (GTK_CONTAINER (table_progress), 0);
2865 gtk_table_set_row_spacings(GTK_TABLE(table_progress), 0);
2866 gtk_table_set_col_spacings(GTK_TABLE(table_progress), 0);
2870 label = gtk_label_new(
_(
"Only show tables with geo columns"));
2871 gtk_table_attach(GTK_TABLE(table_progress), label, 1, 2, 0, 1, GTK_FILL, GTK_FILL, 5, 0);
2876 gtk_box_pack_start(GTK_BOX(vbox_tree), table_progress,
FALSE,
FALSE, 10);
2889 GtkWidget *vbox_tree;
2892 gint *column_indexes;
2894 gtk_container_set_border_width (GTK_CONTAINER (import_list_frame), 0);
2896 vbox_tree = gtk_vbox_new(
FALSE, 15);
2897 gtk_container_set_border_width(GTK_CONTAINER(vbox_tree), 5);
2898 gtk_container_add(GTK_CONTAINER(import_list_frame), vbox_tree);
2922 sw = gtk_scrolled_window_new(NULL, NULL);
2923 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
2924 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_ETCHED_IN);
2925 gtk_widget_set_size_request(sw, -1, 150);
2927 gtk_box_pack_start(GTK_BOX(vbox_tree), sw,
TRUE,
TRUE, 0);
2928 gtk_container_add(GTK_CONTAINER (sw),
import_tree);
3059 GtkTargetEntry drop_types[] =
3061 {
"text/uri-list", 0, 0}
3064 gint n_drop_types =
sizeof(drop_types)/
sizeof(drop_types[0]);
3066 GTK_DEST_DEFAULT_ALL,
3067 drop_types, n_drop_types,
3069 g_signal_connect(G_OBJECT(
import_tree),
"drag_data_received",
3080 GtkWidget *vbox_tree;
3082 gint *column_indexes;
3084 gtk_container_set_border_width (GTK_CONTAINER (export_list_frame), 0);
3086 vbox_tree = gtk_vbox_new(
FALSE, 15);
3087 gtk_container_set_border_width(GTK_CONTAINER(vbox_tree), 5);
3088 gtk_container_add(GTK_CONTAINER(export_list_frame), vbox_tree);
3096 GTK_TYPE_TREE_MODEL,
3111 sw = gtk_scrolled_window_new(NULL, NULL);
3112 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
3113 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_ETCHED_IN);
3114 gtk_widget_set_size_request(sw, -1, 150);
3116 gtk_box_pack_start(GTK_BOX(vbox_tree), sw,
TRUE,
TRUE, 0);
3117 gtk_container_add(GTK_CONTAINER (sw),
export_tree);
3199 static int text_width = 12;
3208 GtkWidget *frame_pg, *table_pg;
3211 GtkWidget *button_okay;
3214 window_conn = gtk_window_new(GTK_WINDOW_TOPLEVEL);
3215 gtk_container_set_border_width(GTK_CONTAINER(
window_conn), 10);
3216 gtk_window_set_title(GTK_WINDOW(
window_conn),
_(
"PostGIS connection"));
3217 gtk_window_set_position(GTK_WINDOW(
window_conn), GTK_WIN_POS_CENTER);
3221 vbox = gtk_vbox_new(
FALSE, 15);
3226 frame_pg = gtk_frame_new(
_(
"PostGIS Connection"));
3227 table_pg = gtk_table_new(5, 3,
TRUE);
3228 gtk_container_set_border_width (GTK_CONTAINER (table_pg), 8);
3229 gtk_table_set_col_spacings(GTK_TABLE(table_pg), 7);
3230 gtk_table_set_row_spacings(GTK_TABLE(table_pg), 3);
3233 label = gtk_label_new(
_(
"Username:"));
3235 gtk_table_attach_defaults(GTK_TABLE(table_pg), label, 0, 1, 0, 1 );
3236 gtk_table_attach_defaults(GTK_TABLE(table_pg),
entry_pg_user, 1, 3, 0, 1 );
3239 label = gtk_label_new(
_(
"Password:"));
3242 gtk_table_attach_defaults(GTK_TABLE(table_pg), label, 0, 1, 1, 2 );
3243 gtk_table_attach_defaults(GTK_TABLE(table_pg),
entry_pg_pass, 1, 3, 1, 2 );
3246 label = gtk_label_new(
_(
"Server Host:"));
3248 gtk_entry_set_width_chars(GTK_ENTRY(
entry_pg_host), text_width);
3249 gtk_table_attach_defaults(GTK_TABLE(table_pg), label, 0, 1, 2, 3 );
3250 gtk_table_attach_defaults(GTK_TABLE(table_pg),
entry_pg_host, 1, 2, 2, 3 );
3254 gtk_table_attach_defaults(GTK_TABLE(table_pg),
entry_pg_port, 2, 3, 2, 3 );
3257 label = gtk_label_new(
_(
"Database:"));
3259 gtk_table_attach_defaults(GTK_TABLE(table_pg), label, 0, 1, 3, 4 );
3260 gtk_table_attach_defaults(GTK_TABLE(table_pg),
entry_pg_db, 1, 3, 3, 4 );
3263 gtk_container_add(GTK_CONTAINER(frame_pg), table_pg);
3266 gtk_container_add(GTK_CONTAINER(
window_conn), vbox);
3269 gtk_container_add(GTK_CONTAINER(vbox), frame_pg);
3272 button_okay = gtk_button_new_with_label(
_(
"OK"));
3273 gtk_container_add(GTK_CONTAINER(vbox), button_okay);
3286 GtkWidget *vbox_main, *vbox_loader, *vbox_dumper;
3289 GtkWidget *frame_pg, *import_list_frame, *export_list_frame, *frame_log;
3290 GtkWidget *button_pg_conn;
3293 GtkWidget *notebook;
3296 GtkWidget *loader_hbox_buttons, *loader_button_options, *loader_button_import, *loader_button_cancel, *loader_button_about;
3297 GtkWidget *dumper_hbox_buttons, *dumper_button_options, *dumper_button_export, *dumper_button_cancel, *dumper_button_about;
3300 GtkWidget *scrolledwindow_log;
3303 window_main = gtk_window_new(GTK_WINDOW_TOPLEVEL);
3304 gtk_container_set_border_width(GTK_CONTAINER(
window_main), 10);
3305 gtk_window_set_title(GTK_WINDOW(
window_main),
_(
"PostGIS Shapefile Import/Export Manager"));
3306 gtk_window_set_position(GTK_WINDOW(
window_main), GTK_WIN_POS_CENTER_ALWAYS);
3310 gtk_window_set_default_size(GTK_WINDOW(
window_main), 180, 500);
3319 frame_pg = gtk_frame_new(
_(
"PostGIS Connection"));
3322 button_pg_conn = gtk_button_new_with_label(
_(
"View connection details..."));
3324 gtk_container_set_border_width(GTK_CONTAINER(button_pg_conn), 10);
3325 gtk_container_add(GTK_CONTAINER(frame_pg), button_pg_conn);
3330 notebook = gtk_notebook_new();
3335 import_list_frame = gtk_frame_new(
_(
"Import List"));
3341 loader_hbox_buttons = gtk_hbox_new(
TRUE, 15);
3342 gtk_container_set_border_width (GTK_CONTAINER (loader_hbox_buttons), 0);
3345 loader_button_options = gtk_button_new_with_label(
_(
"Options..."));
3346 loader_button_import = gtk_button_new_with_label(
_(
"Import"));
3347 loader_button_cancel = gtk_button_new_with_label(
_(
"Cancel"));
3348 loader_button_about = gtk_button_new_with_label(
_(
"About"));
3351 g_signal_connect (G_OBJECT (loader_button_import),
"clicked", G_CALLBACK (
pgui_action_import), NULL);
3353 g_signal_connect (G_OBJECT (loader_button_cancel),
"clicked", G_CALLBACK (
pgui_action_cancel), NULL);
3357 gtk_box_pack_start(GTK_BOX(loader_hbox_buttons), loader_button_options,
TRUE,
TRUE, 0);
3358 gtk_box_pack_end(GTK_BOX(loader_hbox_buttons), loader_button_cancel,
TRUE,
TRUE, 0);
3359 gtk_box_pack_end(GTK_BOX(loader_hbox_buttons), loader_button_about,
TRUE,
TRUE, 0);
3360 gtk_box_pack_end(GTK_BOX(loader_hbox_buttons), loader_button_import,
TRUE,
TRUE, 0);
3365 export_list_frame = gtk_frame_new(
_(
"Export List"));
3371 dumper_hbox_buttons = gtk_hbox_new(
TRUE, 15);
3372 gtk_container_set_border_width (GTK_CONTAINER (dumper_hbox_buttons), 0);
3375 dumper_button_options = gtk_button_new_with_label(
_(
"Options..."));
3376 dumper_button_export = gtk_button_new_with_label(
_(
"Export"));
3377 dumper_button_cancel = gtk_button_new_with_label(
_(
"Cancel"));
3378 dumper_button_about = gtk_button_new_with_label(
_(
"About"));
3381 g_signal_connect (G_OBJECT (dumper_button_export),
"clicked", G_CALLBACK (
pgui_action_export), NULL);
3383 g_signal_connect (G_OBJECT (dumper_button_cancel),
"clicked", G_CALLBACK (
pgui_action_cancel), NULL);
3387 gtk_box_pack_start(GTK_BOX(dumper_hbox_buttons), dumper_button_options,
TRUE,
TRUE, 0);
3388 gtk_box_pack_end(GTK_BOX(dumper_hbox_buttons), dumper_button_cancel,
TRUE,
TRUE, 0);
3389 gtk_box_pack_end(GTK_BOX(dumper_hbox_buttons), dumper_button_about,
TRUE,
TRUE, 0);
3390 gtk_box_pack_end(GTK_BOX(dumper_hbox_buttons), dumper_button_export,
TRUE,
TRUE, 0);
3395 frame_log = gtk_frame_new(
_(
"Log Window"));
3396 gtk_container_set_border_width (GTK_CONTAINER (frame_log), 0);
3397 gtk_widget_set_size_request(frame_log, -1, 200);
3400 scrolledwindow_log = gtk_scrolled_window_new(NULL, NULL);
3401 gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(scrolledwindow_log), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
3403 gtk_container_set_border_width (GTK_CONTAINER (
textview_log), 5);
3406 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(
textview_log), GTK_WRAP_WORD);
3407 gtk_container_add (GTK_CONTAINER (scrolledwindow_log),
textview_log);
3408 gtk_container_add (GTK_CONTAINER (frame_log), scrolledwindow_log);
3413 vbox_main = gtk_vbox_new(
FALSE, 10);
3414 gtk_container_set_border_width (GTK_CONTAINER (vbox_main), 0);
3417 vbox_loader = gtk_vbox_new(
FALSE, 10);
3418 gtk_container_set_border_width(GTK_CONTAINER(vbox_loader), 10);
3420 gtk_box_pack_start(GTK_BOX(vbox_loader), import_list_frame,
FALSE,
TRUE, 0);
3421 gtk_box_pack_start(GTK_BOX(vbox_loader), loader_hbox_buttons,
FALSE,
FALSE, 0);
3422 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox_loader, gtk_label_new(
_(
"Import")));
3425 vbox_dumper = gtk_vbox_new(
FALSE, 10);
3426 gtk_container_set_border_width(GTK_CONTAINER(vbox_dumper), 10);
3428 gtk_box_pack_start(GTK_BOX(vbox_dumper), export_list_frame,
FALSE,
TRUE, 0);
3429 gtk_box_pack_start(GTK_BOX(vbox_dumper), dumper_hbox_buttons,
FALSE,
FALSE, 0);
3430 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox_dumper, gtk_label_new(
_(
"Export")));
3433 gtk_box_pack_start(GTK_BOX(vbox_main), frame_pg,
FALSE,
TRUE, 0);
3434 gtk_box_pack_start(GTK_BOX(vbox_main), notebook,
FALSE,
TRUE, 0);
3435 gtk_box_pack_start(GTK_BOX(vbox_main), frame_log,
TRUE,
TRUE, 0);
3438 gtk_container_add(GTK_CONTAINER(
window_main), vbox_main);
3449 printf(
"RCSID: %s RELEASE: %s\n",
S2P_RCSID, POSTGIS_VERSION);
3450 printf(
"USAGE: shp2pgsql-gui [options]\n");
3451 printf(
"OPTIONS:\n");
3452 printf(
" -U <username>\n");
3453 printf(
" -W <password>\n");
3454 printf(
" -h <host>\n");
3455 printf(
" -p <port>\n");
3456 printf(
" -d <database>\n");
3457 printf(
" -? Display this help screen\n");
3466 setlocale (LC_ALL,
"");
3467 bindtextdomain (PACKAGE, PGSQL_LOCALEDIR);
3468 textdomain (PACKAGE);
3489 while ((c =
pgis_getopt(argc, argv,
"U:p:W:d:h:")) != -1)
3517 gtk_init(&argc, &argv);
int pgis_getopt(int argc, char **argv, char *opts)
void set_dumper_config_defaults(SHPDUMPERCONFIG *config)
int ShpDumperGetRecordCount(SHPDUMPERSTATE *state)
void ShpDumperDestroy(SHPDUMPERSTATE *state)
char * shapetypename(int num)
SHPDUMPERSTATE * ShpDumperCreate(SHPDUMPERCONFIG *config)
int ShpDumperConnectDatabase(SHPDUMPERSTATE *state)
int ShpLoaderGenerateShapeRow(SHPDUMPERSTATE *state)
int ShpDumperCloseTable(SHPDUMPERSTATE *state)
int ShpDumperOpenTable(SHPDUMPERSTATE *state)
char * ShpDumperGetConnectionStringFromConn(SHPCONNECTIONCONFIG *conn)
const char SHPAPI_CALL1 * SHPTypeName(int nSHPType);const char SHPAPI_CALL1(*) SHPPartTypeName(int nPartType
int ShpLoaderGetRecordCount(SHPLOADERSTATE *state)
void ShpLoaderDestroy(SHPLOADERSTATE *state)
int ShpLoaderGetSQLCopyStatement(SHPLOADERSTATE *state, char **strheader)
int ShpLoaderOpenShape(SHPLOADERSTATE *state)
int ShpLoaderGenerateSQLRowStatement(SHPLOADERSTATE *state, int item, char **strrecord)
void set_loader_config_defaults(SHPLOADERCONFIG *config)
int ShpLoaderGetSQLFooter(SHPLOADERSTATE *state, char **strfooter)
SHPLOADERSTATE * ShpLoaderCreate(SHPLOADERCONFIG *config)
int ShpLoaderGetSQLHeader(SHPLOADERSTATE *state, char **strheader)
#define GEOGRAPHY_DEFAULT
#define SHPLOADERRECISNULL
#define SHPLOADERRECDELETED
static GtkWidget * label_progress
GtkCellRenderer * export_schema_renderer
@ TABLECHOOSER_GEOCOL_COMBO_TEXT
@ TABLECHOOSER_GEOCOL_COMBO_COLUMNS
static GtkWidget * add_table_button
static GtkWidget * checkbutton_loader_options_dumpformat
static void pgui_action_connection_details(GtkWidget *widget, gpointer data)
int main(int argc, char *argv[])
GtkCellRenderer * chooser_schema_renderer
static GtkTextBuffer * textbuffer_log
GtkCellRenderer * import_table_renderer
static void update_filename_field_width(void)
static void update_options_ui_from_loader_config_globals(void)
GtkCellRenderer * import_remove_renderer
static SHPLOADERCONFIG * create_new_file_config(const char *filename)
static void pgui_set_dumper_configs_from_options_ui()
static void pgui_set_loader_configs_from_options_ui()
static void update_dumper_config_globals_from_options_ui(SHPDUMPERCONFIG *config)
static void pgui_create_filechooser_dialog(void)
static GtkWidget * add_file_button
GtkTreeViewColumn * export_remove_column
static GtkWidget * entry_pg_port
static GtkWidget * progress
static void pgui_seterr(const char *fmt,...)
static GtkWidget * checkbutton_loader_options_simplegeoms
GtkTreeViewColumn * import_table_column
static void pgui_action_handle_file_remove(GtkCellRendererToggle *renderer, gchar *path, gpointer user_data)
static gint pgui_event_popup_delete(GtkWidget *widget, GdkEvent *event, gpointer data)
static int pgui_copy_write(const char *line)
static GtkWidget * checkbutton_loader_options_forceint
static int validate_shape_column_against_pg_column(int dbf_fieldtype, char *pg_fieldtype)
static GtkWidget * dialog_tablechooser
static void update_options_ui_from_dumper_config_globals(void)
GtkCellRenderer * export_geom_column_renderer
static volatile int is_running
static void update_table_chooser_from_database()
static GtkWidget * entry_pg_host
static int validate_remote_loader_columns(SHPLOADERCONFIG *config, PGresult *result)
static SHPDUMPERCONFIG * create_new_table_config(GtkTreeIter *iter)
static GtkWidget * dialog_dumper_options
static void update_loader_config_globals_from_options_ui(SHPLOADERCONFIG *config)
GtkTreeViewColumn * chooser_schema_column
static void update_dumper_table_config_from_listview_iter(GtkTreeIter *iter, SHPDUMPERCONFIG *dumper_table_config)
static void pgui_action_import(GtkWidget *widget, gpointer data)
static void pgui_action_export(GtkWidget *widget, gpointer data)
static GtkWidget * dialog_filechooser
static int pgui_copy_end(const int rollback)
static void pgui_action_handle_table_remove(GtkCellRendererToggle *renderer, gchar *path, gpointer user_data)
static GtkWidget * checkbutton_loader_options_autoindex
GtkListStore * chooser_table_list_store
static void pgui_create_export_table_table(GtkWidget *export_list_frame)
static GtkWidget * entry_pg_user
static void pgui_create_loader_options_dialog()
GtkCellRenderer * import_schema_renderer
static GtkWidget * checkbutton_loader_options_dbfonly
static PGconn * pg_connection
static GtkWidget * textview_log
GtkTreeViewColumn * export_table_column
static void pgui_create_folderchooser_dialog(void)
GtkTreeViewColumn * export_schema_column
GtkTreeViewColumn * import_srid_column
static void pgui_raise_error_dialogue(void)
@ EXPORT_GEOMETRY_LISTSTORE_COLUMN
static GtkWidget * entry_pg_db
static void update_loader_file_config_from_listview_iter(GtkTreeIter *iter, SHPLOADERCONFIG *loader_file_config)
static void pgui_action_dumper_options_close(GtkWidget *widget, gint response, gpointer data)
static void pgui_action_handle_tree_combo(GtkCellRendererCombo *combo, gchar *path_string, GtkTreeIter *new_iter, gpointer user_data)
static GtkWidget * checkbutton_dumper_options_keep_fieldname_case
static void pgui_action_about_open()
static void update_conn_ui_from_conn_config(void)
GtkListStore * chooser_filtered_table_list_store
static int pgui_copy_start(const char *sql)
static GtkWidget * dialog_progress
static void pgui_action_handle_dumper_edit(GtkCellRendererText *renderer, gchar *path, gchar *new_text, gpointer column)
static void pgui_action_handle_table_geocol_combo(GtkCellRendererCombo *combo, gchar *path_string, GtkTreeIter *new_iter, gpointer user_data)
GtkCellRenderer * export_filename_renderer
@ TABLECHOOSER_HASGEO_COLUMN
@ TABLECHOOSER_TABLE_COLUMN
@ TABLECHOOSER_SCHEMA_COLUMN
@ TABLECHOOSER_GEO_LISTSTORE_COLUMN
@ TABLECHOOSER_GEO_COLUMN
#define gtk_dialog_get_content_area(dialog)
static void free_loader_config(SHPLOADERCONFIG *config)
static void pgui_seterr_va(const char *fmt, va_list ap)
static int pgui_validate_connection()
static GtkWidget * entry_pg_pass
static void pgui_action_progress_cancel(GtkDialog *dialog, gint response_id, gpointer user_data)
static void process_single_uri(char *uri)
static void pgui_create_progress_dialog()
#define SHAPEFIELDMAXWIDTH
GtkWidget * loader_mode_combo
static void pgui_action_handle_file_drop(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, GtkSelectionData *selection_data, guint info, guint t, gpointer data)
GtkTreeViewColumn * import_remove_column
static void pgui_create_options_dialog_add_label(GtkWidget *table, const char *str, gfloat alignment, int row)
static void pgui_log_va(const char *fmt, va_list ap)
static GtkWidget * checkbutton_chooser_geoonly
static void add_loader_file_config_to_list(SHPLOADERCONFIG *loader_file_config)
GtkTreeViewColumn * export_geom_column
static void add_dumper_table_config_to_list(SHPDUMPERCONFIG *dumper_table_config, GtkListStore *chooser_liststore, GtkTreeIter *chooser_iter)
static void pgui_action_loader_options_open(GtkWidget *widget, gpointer data)
static int valid_connection
static void pgui_sanitize_connection_string(char *connection_string)
static int connection_test(void)
GtkListStore * export_table_list_store
GtkCellRenderer * chooser_table_renderer
static void pgui_action_open_file_dialog(GtkWidget *widget, gpointer data)
GtkTreeViewColumn * import_schema_column
static GtkWidget * dialog_about
static gint pgui_action_progress_delete(GtkWidget *widget, GdkEvent *event, gpointer data)
static void pgui_quit(GtkWidget *widget, gpointer data)
GtkListStore * import_file_list_store
static gboolean table_chooser_visibility_func(GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
static void pgui_create_connection_window()
static GtkWidget * checkbutton_loader_options_preservecase
static void pgui_action_loader_options_close(GtkWidget *widget, gint response, gpointer data)
static GtkWidget * entry_options_encoding
#define GUIMSG_LINE_MAXLEN
@ LOADER_MODE_COMBO_COLUMNS
@ LOADER_MODE_COMBO_OPTION_CHAR
static void free_dumper_config(SHPDUMPERCONFIG *config)
static GtkWidget * dialog_folderchooser
static void pgui_action_dumper_options_open(GtkWidget *widget, gpointer data)
static void pgui_action_handle_loader_edit(GtkCellRendererText *renderer, gchar *path, gchar *new_text, gpointer column)
GtkTreeViewColumn * import_filename_column
static GtkWidget * window_main
static GtkWidget * checkbutton_dumper_options_unescapedattrs
static int pgui_exec(const char *sql)
GtkTreeViewColumn * chooser_table_column
GtkListStore * loader_mode_combo_list
static void pgui_action_open_table_dialog(GtkWidget *widget, gpointer data)
static GtkWidget * dialog_loader_options
GtkCellRenderer * import_srid_renderer
GtkCellRenderer * import_mode_renderer
static void update_conn_config_from_conn_ui(void)
static SHPCONNECTIONCONFIG * conn
GtkWidget * export_geom_column_combo
static void pgui_action_chooser_toggle_show_geocolumn(GtkToggleButton *togglebutton, gpointer user_data)
GtkCellRenderer * import_filename_renderer
static void pgui_create_main_window(const SHPCONNECTIONCONFIG *conn)
GtkCellRenderer * export_remove_renderer
static void pgui_action_cancel(GtkWidget *widget, gpointer data)
static GtkWidget * window_conn
static void pgui_action_connection_okay(GtkWidget *widget, gpointer data)
GtkCellRenderer * export_table_renderer
static void pgui_create_import_file_table(GtkWidget *import_list_frame)
static SHPLOADERCONFIG * global_loader_config
static SHPDUMPERCONFIG * global_dumper_config
static GtkWidget * checkbutton_loader_options_geography
static char pgui_errmsg[GUIMSG_LINE_MAXLEN+1]
GtkCellRenderer * import_geom_column_renderer
GtkTreeViewColumn * export_filename_column
GtkTreeViewColumn * import_geom_column
static void pgui_create_dumper_options_dialog()
static void pgui_logf(const char *fmt,...)
static void pgui_create_about_dialog(void)
GtkTreeViewColumn * import_mode_column
static GtkWidget * checkbutton_dumper_options_includegid
static void pgui_create_tablechooser_dialog()
#define POSTGIS_LIB_VERSION
SHPCONNECTIONCONFIG * conn
char message[SHPDUMPERMSGLEN]
char message[SHPLOADERMSGLEN]