PostGIS  3.7.0dev-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 2201 of file shp2pgsql-gui.c.

2205 {
2206  GtkTreeIter iter;
2207  gpointer gptr;
2208  gint columnindex;
2209  SHPLOADERCONFIG *loader_file_config;
2210 #define MAXLEN 16
2211  char srid[MAXLEN+1];
2212 
2213  /* Empty doesn't fly */
2214  if (strlen(new_text) == 0)
2215  return;
2216 
2217  /* Update the model with the current edit change */
2218  columnindex = *(gint *)column;
2219  gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(import_file_list_store), &iter, path);
2220  gtk_list_store_set(import_file_list_store, &iter, columnindex, new_text, -1);
2221 
2222  /* Grab the SHPLOADERCONFIG from the IMPORT_POINTER_COLUMN for the list store */
2223  gtk_tree_model_get(GTK_TREE_MODEL(import_file_list_store), &iter, IMPORT_POINTER_COLUMN, &gptr, -1);
2224  loader_file_config = (SHPLOADERCONFIG *)gptr;
2225 
2226  /* Update the configuration from the current UI data */
2227  update_loader_file_config_from_listview_iter(&iter, loader_file_config);
2228 
2229  /* Now refresh the listview UI row with the new configuration */
2230  if ( MAXLEN+1 <= snprintf(srid, MAXLEN+1, "%d", loader_file_config->sr_id) )
2231  {
2232  pgui_logf("Invalid SRID requiring more than %d digits: %d", MAXLEN, loader_file_config->sr_id);
2234  srid[MAXLEN] = '\0';
2235  }
2236 
2237  gtk_list_store_set(import_file_list_store, &iter,
2238  IMPORT_SCHEMA_COLUMN, loader_file_config->schema,
2239  IMPORT_TABLE_COLUMN, loader_file_config->table,
2240  IMPORT_GEOMETRY_COLUMN, loader_file_config->geo_col,
2241  IMPORT_SRID_COLUMN, srid,
2242  -1);
2243 
2244  return;
2245 }
static void static void static void pgui_logf(const char *fmt,...) __attribute__((format(printf
static void pgui_raise_error_dialogue(void)
static void update_loader_file_config_from_listview_iter(GtkTreeIter *iter, SHPLOADERCONFIG *loader_file_config)
@ IMPORT_TABLE_COLUMN
@ IMPORT_POINTER_COLUMN
@ IMPORT_GEOMETRY_COLUMN
@ IMPORT_SCHEMA_COLUMN
@ IMPORT_SRID_COLUMN
GtkListStore * import_file_list_store
Definition: shp2pgsql-gui.c:58
#define MAXLEN

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

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