PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ pgui_action_handle_tree_combo()

static void pgui_action_handle_tree_combo ( GtkCellRendererCombo *  combo,
gchar *  path_string,
GtkTreeIter *  new_iter,
gpointer  user_data 
)
static

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

References shp_loader_config::createindex, import_file_list_store, IMPORT_MODE_COLUMN, IMPORT_POINTER_COLUMN, loader_mode_combo_list, LOADER_MODE_COMBO_OPTION_CHAR, LOADER_MODE_COMBO_TEXT, and shp_loader_config::opt.

Referenced by pgui_create_import_file_table().

2111 {
2112  GtkTreeIter iter;
2113  SHPLOADERCONFIG *loader_file_config;
2114  char opt;
2115  gchar *combo_text;
2116  gpointer gptr;
2117 
2118  /* Grab the SHPLOADERCONFIG from the IMPORT_POINTER_COLUMN for the list store */
2119  gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(import_file_list_store), &iter, path_string);
2120  gtk_tree_model_get(GTK_TREE_MODEL(import_file_list_store), &iter, IMPORT_POINTER_COLUMN, &gptr, -1);
2121  loader_file_config = (SHPLOADERCONFIG *)gptr;
2122 
2123  /* Now grab the row selected within the combo box */
2124  gtk_tree_model_get(GTK_TREE_MODEL(loader_mode_combo_list), new_iter, LOADER_MODE_COMBO_OPTION_CHAR, &opt, -1);
2125 
2126  /* Update the configuration */
2127 
2128  /* Hack for index creation: we must disable it if we are appending, otherwise we
2129  end up trying to generate the index again */
2130  loader_file_config->createindex = global_loader_config->createindex;
2131 
2132  switch (opt)
2133  {
2134  case 'a':
2135  loader_file_config->opt = 'a';
2136 
2137  /* Other half of index creation hack */
2138  loader_file_config->createindex = 0;
2139 
2140  break;
2141 
2142  case 'd':
2143  loader_file_config->opt = 'd';
2144  break;
2145 
2146  case 'p':
2147  loader_file_config->opt = 'p';
2148  break;
2149 
2150  case 'c':
2151  loader_file_config->opt = 'c';
2152  break;
2153  }
2154 
2155  /* Update the selection in the listview with the text from the combo */
2156  gtk_tree_model_get(GTK_TREE_MODEL(loader_mode_combo_list), new_iter, LOADER_MODE_COMBO_TEXT, &combo_text, -1);
2157  gtk_list_store_set(import_file_list_store, &iter, IMPORT_MODE_COLUMN, combo_text, -1);
2158 
2159  return;
2160 }
GtkListStore * loader_mode_combo_list
Definition: shp2pgsql-gui.c:77
static SHPLOADERCONFIG * global_loader_config
GtkListStore * import_file_list_store
Definition: shp2pgsql-gui.c:56
Here is the caller graph for this function: