PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ pgui_action_handle_loader_edit()

static void pgui_action_handle_loader_edit ( GtkCellRendererText *  renderer,
gchar *  path,
gchar *  new_text,
gpointer  column 
)
static

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

References shp_loader_config::geo_col, import_file_list_store, IMPORT_GEOMETRY_COLUMN, IMPORT_POINTER_COLUMN, IMPORT_SCHEMA_COLUMN, IMPORT_SRID_COLUMN, IMPORT_TABLE_COLUMN, MAXLEN, pgui_logf(), pgui_raise_error_dialogue(), shp_loader_config::schema, shp_loader_config::sr_id, shp_loader_config::table, and update_loader_file_config_from_listview_iter().

Referenced by pgui_create_export_table_table(), pgui_create_import_file_table(), and pgui_create_tablechooser_dialog().

2174 {
2175  GtkTreeIter iter;
2176  gpointer gptr;
2177  gint columnindex;
2178  SHPLOADERCONFIG *loader_file_config;
2179 #define MAXLEN 16
2180  char srid[MAXLEN+1];
2181 
2182  /* Empty doesn't fly */
2183  if (strlen(new_text) == 0)
2184  return;
2185 
2186  /* Update the model with the current edit change */
2187  columnindex = *(gint *)column;
2188  gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(import_file_list_store), &iter, path);
2189  gtk_list_store_set(import_file_list_store, &iter, columnindex, new_text, -1);
2190 
2191  /* Grab the SHPLOADERCONFIG from the IMPORT_POINTER_COLUMN for the list store */
2192  gtk_tree_model_get(GTK_TREE_MODEL(import_file_list_store), &iter, IMPORT_POINTER_COLUMN, &gptr, -1);
2193  loader_file_config = (SHPLOADERCONFIG *)gptr;
2194 
2195  /* Update the configuration from the current UI data */
2196  update_loader_file_config_from_listview_iter(&iter, loader_file_config);
2197 
2198  /* Now refresh the listview UI row with the new configuration */
2199  if ( MAXLEN+1 <= snprintf(srid, MAXLEN+1, "%d", loader_file_config->sr_id) )
2200  {
2201  pgui_logf("Invalid SRID requiring more than %d digits: %d", MAXLEN, loader_file_config->sr_id);
2203  srid[MAXLEN] = '\0';
2204  }
2205 
2206  gtk_list_store_set(import_file_list_store, &iter,
2207  IMPORT_SCHEMA_COLUMN, loader_file_config->schema,
2208  IMPORT_TABLE_COLUMN, loader_file_config->table,
2209  IMPORT_GEOMETRY_COLUMN, loader_file_config->geo_col,
2210  IMPORT_SRID_COLUMN, srid,
2211  -1);
2212 
2213  return;
2214 }
static void pgui_logf(const char *fmt,...)
static void update_loader_file_config_from_listview_iter(GtkTreeIter *iter, SHPLOADERCONFIG *loader_file_config)
#define MAXLEN
GtkListStore * import_file_list_store
Definition: shp2pgsql-gui.c:56
static void pgui_raise_error_dialogue(void)
Here is the call graph for this function:
Here is the caller graph for this function: