PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ pgui_create_loader_options_dialog()

static void pgui_create_loader_options_dialog ( )
static

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

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().

2672 {
2673  GtkWidget *table_options;
2674  GtkWidget *align_options_center;
2675  static int text_width = 12;
2676 
2677  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);
2678 
2679  gtk_window_set_modal (GTK_WINDOW(dialog_loader_options), TRUE);
2680  gtk_window_set_keep_above (GTK_WINDOW(dialog_loader_options), TRUE);
2681  gtk_window_set_default_size (GTK_WINDOW(dialog_loader_options), 180, -1);
2682 
2683  table_options = gtk_table_new(7, 3, TRUE);
2684  gtk_container_set_border_width (GTK_CONTAINER (table_options), 12);
2685  gtk_table_set_row_spacings(GTK_TABLE(table_options), 5);
2686  gtk_table_set_col_spacings(GTK_TABLE(table_options), 10);
2687 
2688  pgui_create_options_dialog_add_label(table_options, _("DBF file character encoding"), 0.0, 0);
2689  entry_options_encoding = gtk_entry_new();
2690  gtk_entry_set_width_chars(GTK_ENTRY(entry_options_encoding), text_width);
2691  gtk_table_attach_defaults(GTK_TABLE(table_options), entry_options_encoding, 0, 1, 0, 1 );
2692 
2693  pgui_create_options_dialog_add_label(table_options, _("Preserve case of column names"), 0.0, 1);
2694  checkbutton_loader_options_preservecase = gtk_check_button_new();
2695  align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2696  gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 1, 2 );
2697  gtk_container_add (GTK_CONTAINER (align_options_center), checkbutton_loader_options_preservecase);
2698 
2699  pgui_create_options_dialog_add_label(table_options, _("Do not create 'bigint' columns"), 0.0, 2);
2700  checkbutton_loader_options_forceint = gtk_check_button_new();
2701  align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2702  gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 2, 3 );
2703  gtk_container_add (GTK_CONTAINER (align_options_center), checkbutton_loader_options_forceint);
2704 
2705  pgui_create_options_dialog_add_label(table_options, _("Create spatial index automatically after load"), 0.0, 3);
2706  checkbutton_loader_options_autoindex = gtk_check_button_new();
2707  align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2708  gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 3, 4 );
2709  gtk_container_add (GTK_CONTAINER (align_options_center), checkbutton_loader_options_autoindex);
2710 
2711  pgui_create_options_dialog_add_label(table_options, _("Load only attribute (dbf) data"), 0.0, 4);
2712  checkbutton_loader_options_dbfonly = gtk_check_button_new();
2713  align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2714  gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 4, 5 );
2715  gtk_container_add (GTK_CONTAINER (align_options_center), checkbutton_loader_options_dbfonly);
2716 
2717  pgui_create_options_dialog_add_label(table_options, _("Load data using COPY rather than INSERT"), 0.0, 5);
2718  checkbutton_loader_options_dumpformat = gtk_check_button_new();
2719  align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 0.0 );
2720  gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 5, 6 );
2721  gtk_container_add (GTK_CONTAINER (align_options_center), checkbutton_loader_options_dumpformat);
2722 
2723  pgui_create_options_dialog_add_label(table_options, _("Load into GEOGRAPHY column"), 0.0, 6);
2724  checkbutton_loader_options_geography = gtk_check_button_new();
2725  align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2726  gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 6, 7 );
2727  gtk_container_add (GTK_CONTAINER (align_options_center), checkbutton_loader_options_geography);
2728 
2729  pgui_create_options_dialog_add_label(table_options, _("Generate simple geometries instead of MULTI geometries"), 0.0, 7);
2730  checkbutton_loader_options_simplegeoms = gtk_check_button_new();
2731  align_options_center = gtk_alignment_new( 0.5, 0.5, 0.0, 1.0 );
2732  gtk_table_attach_defaults(GTK_TABLE(table_options), align_options_center, 0, 1, 7, 8 );
2733  gtk_container_add (GTK_CONTAINER (align_options_center), checkbutton_loader_options_simplegeoms);
2734 
2735  /* Catch the response from the dialog */
2736  g_signal_connect(dialog_loader_options, "response", G_CALLBACK(pgui_action_loader_options_close), dialog_loader_options);
2737  gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_loader_options)->vbox), table_options, FALSE, FALSE, 0);
2738 
2739  /* Hook the delete event so we don't destroy the dialog (just hide) if cancelled */
2740  gtk_signal_connect(GTK_OBJECT(dialog_loader_options), "delete_event", GTK_SIGNAL_FUNC(pgui_event_popup_delete), NULL);
2741 }
static GtkWidget * window_main
Definition: shp2pgsql-gui.c:50
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)
#define _(String)
Definition: shpcommon.h:24
static GtkWidget * checkbutton_loader_options_dumpformat
static GtkWidget * checkbutton_loader_options_geography
static gint pgui_event_popup_delete(GtkWidget *widget, GdkEvent *event, gpointer data)
static GtkWidget * checkbutton_loader_options_forceint
static GtkWidget * entry_options_encoding
static GtkWidget * checkbutton_loader_options_simplegeoms
static GtkWidget * dialog_loader_options
static GtkWidget * checkbutton_loader_options_dbfonly
#define FALSE
Definition: dbfopen.c:168
static GtkWidget * checkbutton_loader_options_autoindex
#define TRUE
Definition: dbfopen.c:169
Here is the call graph for this function:
Here is the caller graph for this function: