PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ pgui_create_loader_options_dialog()

static void pgui_create_loader_options_dialog ( )
static

Definition at line 2670 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().

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