PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ pgui_action_open_table_dialog()

static void pgui_action_open_table_dialog ( GtkWidget *  widget,
gpointer  data 
)
static

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

1333 {
1334  SHPDUMPERCONFIG *dumper_table_config;
1335  GtkTreeSelection *chooser_selection;
1336  GtkTreeModel *model;
1337  GList *selected_rows_list, *selected_row;
1338  GtkTreeIter iter;
1339  GtkTreePath *tree_path;
1340 
1341  /* Make sure we can connect to the database first */
1342  if (!connection_test())
1343  {
1344  pgui_seterr(_("Unable to connect to the database - please check your connection settings"));
1346 
1347  /* Open the connections UI for the user */
1349 
1350  gtk_widget_show_all(GTK_WIDGET(window_conn));
1351  return;
1352  }
1353 
1354  /* Setup the form */
1356  gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(chooser_filtered_table_list_store));
1357 
1358  /* Run the dialog */
1359  gtk_widget_show_all(dialog_tablechooser);
1360  if (gtk_dialog_run(GTK_DIALOG(dialog_tablechooser)) == GTK_RESPONSE_OK)
1361  {
1362  /* Create the new dumper configuration based upon the selected iters and add them to the listview */
1363  chooser_selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(chooser_tree));
1364 
1365  selected_rows_list = gtk_tree_selection_get_selected_rows(chooser_selection, &model);
1366  selected_row = g_list_first(selected_rows_list);
1367  while (selected_row)
1368  {
1369  /* Get the tree iter */
1370  tree_path = (GtkTreePath *)g_list_nth_data(selected_row, 0);
1371  gtk_tree_model_get_iter(model, &iter, tree_path);
1372 
1373  /* Get the config and add it to the list */
1374  dumper_table_config = create_new_table_config(&iter);
1376 
1377  /* Get the next row */
1378  selected_row = g_list_next(selected_row);
1379  }
1380 
1381  /* Free the GList */
1382  g_list_foreach(selected_row, (GFunc)gtk_tree_path_free, NULL);
1383  g_list_free(selected_row);
1384  }
1385 
1386  gtk_widget_hide(dialog_tablechooser);
1387 }
static void pgui_seterr(const char *fmt,...)
static GtkWidget * dialog_tablechooser
static void update_table_chooser_from_database()
static SHPDUMPERCONFIG * create_new_table_config(GtkTreeIter *iter)
static void pgui_raise_error_dialogue(void)
static void update_conn_ui_from_conn_config(void)
GtkListStore * chooser_filtered_table_list_store
static void add_dumper_table_config_to_list(SHPDUMPERCONFIG *dumper_table_config, GtkListStore *chooser_liststore, GtkTreeIter *chooser_iter)
static int connection_test(void)
GtkWidget * chooser_tree
static GtkWidget * window_conn
Definition: shp2pgsql-gui.c:98
#define _(String)
Definition: shpcommon.h:24

References _, add_dumper_table_config_to_list(), chooser_filtered_table_list_store, chooser_tree, connection_test(), create_new_table_config(), dialog_tablechooser, pgui_raise_error_dialogue(), pgui_seterr(), update_conn_ui_from_conn_config(), update_table_chooser_from_database(), and window_conn.

Referenced by pgui_create_export_table_table().

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