PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ pgui_create_loader_options_dialog()

static void pgui_create_loader_options_dialog ( )
static

Definition at line 2702 of file shp2pgsql-gui.c.

2703{
2704 GtkWidget *table_options;
2705 GtkWidget *align_options_center;
2706 static int text_width = 12;
2707
2708 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);
2709
2710 gtk_window_set_modal (GTK_WINDOW(dialog_loader_options), TRUE);
2711 gtk_window_set_keep_above (GTK_WINDOW(dialog_loader_options), TRUE);
2712 gtk_window_set_default_size (GTK_WINDOW(dialog_loader_options), 180, -1);
2713
2714 table_options = gtk_table_new(7, 3, TRUE);
2715 gtk_container_set_border_width (GTK_CONTAINER (table_options), 12);
2716 gtk_table_set_row_spacings(GTK_TABLE(table_options), 5);
2717 gtk_table_set_col_spacings(GTK_TABLE(table_options), 10);
2718
2719 pgui_create_options_dialog_add_label(table_options, _("DBF file character encoding"), 0.0, 0);
2720 entry_options_encoding = gtk_entry_new();
2721 gtk_entry_set_width_chars(GTK_ENTRY(entry_options_encoding), text_width);
2722 gtk_table_attach_defaults(GTK_TABLE(table_options), entry_options_encoding, 0, 1, 0, 1 );
2723
2724 pgui_create_options_dialog_add_label(table_options, _("Preserve case of column names"), 0.0, 1);
2725 checkbutton_loader_options_preservecase = gtk_check_button_new();
2726 align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2727 gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 1, 2 );
2728 gtk_container_add (GTK_CONTAINER (align_options_center), checkbutton_loader_options_preservecase);
2729
2730 pgui_create_options_dialog_add_label(table_options, _("Do not create 'bigint' columns"), 0.0, 2);
2731 checkbutton_loader_options_forceint = gtk_check_button_new();
2732 align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2733 gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 2, 3 );
2734 gtk_container_add (GTK_CONTAINER (align_options_center), checkbutton_loader_options_forceint);
2735
2736 pgui_create_options_dialog_add_label(table_options, _("Create spatial index automatically after load"), 0.0, 3);
2737 checkbutton_loader_options_autoindex = gtk_check_button_new();
2738 align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2739 gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 3, 4 );
2740 gtk_container_add (GTK_CONTAINER (align_options_center), checkbutton_loader_options_autoindex);
2741
2742 pgui_create_options_dialog_add_label(table_options, _("Load only attribute (dbf) data"), 0.0, 4);
2743 checkbutton_loader_options_dbfonly = gtk_check_button_new();
2744 align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2745 gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 4, 5 );
2746 gtk_container_add (GTK_CONTAINER (align_options_center), checkbutton_loader_options_dbfonly);
2747
2748 pgui_create_options_dialog_add_label(table_options, _("Load data using COPY rather than INSERT"), 0.0, 5);
2749 checkbutton_loader_options_dumpformat = gtk_check_button_new();
2750 align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 0.0 );
2751 gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 5, 6 );
2752 gtk_container_add (GTK_CONTAINER (align_options_center), checkbutton_loader_options_dumpformat);
2753
2754 pgui_create_options_dialog_add_label(table_options, _("Load into GEOGRAPHY column"), 0.0, 6);
2755 checkbutton_loader_options_geography = gtk_check_button_new();
2756 align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2757 gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 6, 7 );
2758 gtk_container_add (GTK_CONTAINER (align_options_center), checkbutton_loader_options_geography);
2759
2760 pgui_create_options_dialog_add_label(table_options, _("Generate simple geometries instead of MULTI geometries"), 0.0, 7);
2761 checkbutton_loader_options_simplegeoms = gtk_check_button_new();
2762 align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2763 gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 7, 8 );
2764 gtk_container_add (GTK_CONTAINER (align_options_center), checkbutton_loader_options_simplegeoms);
2765
2766 /* Catch the response from the dialog */
2767 g_signal_connect(dialog_loader_options, "response", G_CALLBACK(pgui_action_loader_options_close), dialog_loader_options);
2768 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_loader_options)->vbox), table_options, FALSE, FALSE, 0);
2769
2770 /* Hook the delete event so we don't destroy the dialog (just hide) if cancelled */
2771 gtk_signal_connect(GTK_OBJECT(dialog_loader_options), "delete_event", GTK_SIGNAL_FUNC(pgui_event_popup_delete), NULL);
2772}
#define TRUE
Definition dbfopen.c:73
#define FALSE
Definition dbfopen.c:72
static GtkWidget * checkbutton_loader_options_dumpformat
static GtkWidget * checkbutton_loader_options_simplegeoms
static gint pgui_event_popup_delete(GtkWidget *widget, GdkEvent *event, gpointer data)
static GtkWidget * checkbutton_loader_options_forceint
static GtkWidget * checkbutton_loader_options_autoindex
static GtkWidget * checkbutton_loader_options_dbfonly
static void pgui_create_options_dialog_add_label(GtkWidget *table, const char *str, gfloat alignment, int row)
static GtkWidget * checkbutton_loader_options_preservecase
static void pgui_action_loader_options_close(GtkWidget *widget, gint response, gpointer data)
static GtkWidget * entry_options_encoding
static GtkWidget * window_main
static GtkWidget * dialog_loader_options
static GtkWidget * checkbutton_loader_options_geography
#define _(String)
Definition shpcommon.h:24

References _, checkbutton_loader_options_autoindex, checkbutton_loader_options_dbfonly, checkbutton_loader_options_dumpformat, checkbutton_loader_options_forceint, checkbutton_loader_options_geography, checkbutton_loader_options_preservecase, checkbutton_loader_options_simplegeoms, dialog_loader_options, entry_options_encoding, FALSE, pgui_action_loader_options_close(), pgui_create_options_dialog_add_label(), pgui_event_popup_delete(), TRUE, and window_main.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function: