PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ pgui_action_connection_okay()

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

Definition at line 2514 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().

2515 {
2516  /* Update the configuration structure from the form */
2518 
2519  /* Make sure have a valid connection first */
2520  if (!pgui_validate_connection())
2521  {
2523  return;
2524  }
2525 
2526  if (!connection_test())
2527  {
2528  pgui_logf(_("Connection failed."));
2529 
2530  /* If the connection failed, display a warning before closing */
2531  pgui_seterr(_("Unable to connect to the database - please check your connection settings"));
2533  }
2534  else
2535  {
2536  pgui_logf(_("Connection succeeded."));
2537  }
2538 
2539 
2540  /* Hide the window after the test */
2541  gtk_widget_hide(GTK_WIDGET(window_conn));
2542 }
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:98
static void pgui_raise_error_dialogue(void)
Here is the call graph for this function:
Here is the caller graph for this function: