PostGIS  2.1.10dev-r@@SVN_REVISION@@
static void update_loader_config_globals_from_options_ui ( SHPLOADERCONFIG config)
static

Definition at line 539 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, shp_loader_config::createindex, shp_loader_config::dump_format, shp_loader_config::encoding, entry_options_encoding, shp_loader_config::forceint4, shp_loader_config::geo_col, shp_loader_config::geography, GEOGRAPHY_DEFAULT, GEOMETRY_DEFAULT, shp_loader_config::quoteidentifiers, shp_loader_config::readshape, and shp_loader_config::simple_geometries.

Referenced by pgui_set_loader_configs_from_options_ui().

540 {
541  const char *entry_encoding = gtk_entry_get_text(GTK_ENTRY(entry_options_encoding));
542  gboolean preservecase = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_loader_options_preservecase));
543  gboolean forceint = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_loader_options_forceint));
544  gboolean createindex = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_loader_options_autoindex));
545  gboolean dbfonly = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_loader_options_dbfonly));
546  gboolean dumpformat = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_loader_options_dumpformat));
547  gboolean geography = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_loader_options_geography));
548  gboolean simplegeoms = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_loader_options_simplegeoms));
549 
550  if (geography)
551  {
552  config->geography = 1;
553 
554  if (config->geo_col)
555  free(config->geo_col);
556 
557  config->geo_col = strdup(GEOGRAPHY_DEFAULT);
558  }
559  else
560  {
561  config->geography = 0;
562 
563  if (config->geo_col)
564  free(config->geo_col);
565 
566  config->geo_col = strdup(GEOMETRY_DEFAULT);
567  }
568 
569  /* Encoding */
570  if (entry_encoding && strlen(entry_encoding) > 0)
571  {
572  if (config->encoding)
573  free(config->encoding);
574 
575  config->encoding = strdup(entry_encoding);
576  }
577 
578  /* Preserve case */
579  if (preservecase)
580  config->quoteidentifiers = 1;
581  else
582  config->quoteidentifiers = 0;
583 
584  /* No long integers in table */
585  if (forceint)
586  config->forceint4 = 1;
587  else
588  config->forceint4 = 0;
589 
590  /* Create spatial index after load */
591  if (createindex)
592  config->createindex = 1;
593  else
594  config->createindex = 0;
595 
596  /* Read the .shp file, don't ignore it */
597  if (dbfonly)
598  {
599  config->readshape = 0;
600 
601  /* There will be no spatial column so don't create a spatial index */
602  config->createindex = 0;
603  }
604  else
605  config->readshape = 1;
606 
607  /* Use COPY rather than INSERT format */
608  if (dumpformat)
609  config->dump_format = 1;
610  else
611  config->dump_format = 0;
612 
613  /* Simple geometries only */
614  if (simplegeoms)
615  config->simple_geometries = 1;
616  else
617  config->simple_geometries = 0;
618 
619  return;
620 }
static GtkWidget * checkbutton_loader_options_preservecase
static GtkWidget * checkbutton_loader_options_dumpformat
static GtkWidget * checkbutton_loader_options_geography
#define GEOGRAPHY_DEFAULT
static GtkWidget * checkbutton_loader_options_forceint
#define GEOMETRY_DEFAULT
static GtkWidget * entry_options_encoding
static GtkWidget * checkbutton_loader_options_simplegeoms
static GtkWidget * checkbutton_loader_options_dbfonly
static GtkWidget * checkbutton_loader_options_autoindex

Here is the caller graph for this function: