PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ pgui_action_connection_okay()

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

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

References _, connection_test(), pgui_logf(), pgui_raise_error_dialogue(), pgui_seterr(), pgui_validate_connection(), update_conn_config_from_conn_ui(), and window_conn.

Referenced by pgui_create_connection_window().

2514 {
2515  /* Update the configuration structure from the form */
2517 
2518  /* Make sure have a valid connection first */
2519  if (!pgui_validate_connection())
2520  {
2522  return;
2523  }
2524 
2525  if (!connection_test())
2526  {
2527  pgui_logf(_("Connection failed."));
2528 
2529  /* If the connection failed, display a warning before closing */
2530  pgui_seterr(_("Unable to connect to the database - please check your connection settings"));
2532  }
2533  else
2534  {
2535  pgui_logf(_("Connection succeeded."));
2536  }
2537 
2538 
2539  /* Hide the window after the test */
2540  gtk_widget_hide(GTK_WIDGET(window_conn));
2541 }
static int connection_test(void)
static int pgui_validate_connection()
#define _(String)
Definition: shpcommon.h:24
static void pgui_logf(const char *fmt,...)
static void pgui_seterr(const char *fmt,...)
static void update_conn_config_from_conn_ui(void)
static GtkWidget * window_conn
Definition: shp2pgsql-gui.c:97
static void pgui_raise_error_dialogue(void)
Here is the call graph for this function:
Here is the caller graph for this function: