PostGIS  2.1.10dev-r@@SVN_REVISION@@
static void pgui_create_connection_window ( )
static

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

References _, entry_pg_db, entry_pg_host, entry_pg_pass, entry_pg_port, entry_pg_user, FALSE, pgui_action_connection_okay(), pgui_event_popup_delete(), TRUE, and window_conn.

Referenced by main().

3186 {
3187  /* Default text width */
3188  static int text_width = 12;
3189 
3190  /* Vbox container */
3191  GtkWidget *vbox;
3192 
3193  /* Reusable label handle */
3194  GtkWidget *label;
3195 
3196  /* PgSQL section */
3197  GtkWidget *frame_pg, *table_pg;
3198 
3199  /* OK button */
3200  GtkWidget *button_okay;
3201 
3202  /* Create the main top level window with a 10px border */
3203  window_conn = gtk_window_new(GTK_WINDOW_TOPLEVEL);
3204  gtk_container_set_border_width(GTK_CONTAINER(window_conn), 10);
3205  gtk_window_set_title(GTK_WINDOW(window_conn), _("PostGIS connection"));
3206  gtk_window_set_position(GTK_WINDOW(window_conn), GTK_WIN_POS_CENTER);
3207  gtk_window_set_modal(GTK_WINDOW(window_conn), TRUE);
3208 
3209  /* Use a vbox as the base container */
3210  vbox = gtk_vbox_new(FALSE, 15);
3211 
3212  /*
3213  ** PostGIS info in a table
3214  */
3215  frame_pg = gtk_frame_new(_("PostGIS Connection"));
3216  table_pg = gtk_table_new(5, 3, TRUE);
3217  gtk_container_set_border_width (GTK_CONTAINER (table_pg), 8);
3218  gtk_table_set_col_spacings(GTK_TABLE(table_pg), 7);
3219  gtk_table_set_row_spacings(GTK_TABLE(table_pg), 3);
3220 
3221  /* User name row */
3222  label = gtk_label_new(_("Username:"));
3223  entry_pg_user = gtk_entry_new();
3224  gtk_table_attach_defaults(GTK_TABLE(table_pg), label, 0, 1, 0, 1 );
3225  gtk_table_attach_defaults(GTK_TABLE(table_pg), entry_pg_user, 1, 3, 0, 1 );
3226 
3227  /* Password row */
3228  label = gtk_label_new(_("Password:"));
3229  entry_pg_pass = gtk_entry_new();
3230  gtk_entry_set_visibility( GTK_ENTRY(entry_pg_pass), FALSE);
3231  gtk_table_attach_defaults(GTK_TABLE(table_pg), label, 0, 1, 1, 2 );
3232  gtk_table_attach_defaults(GTK_TABLE(table_pg), entry_pg_pass, 1, 3, 1, 2 );
3233 
3234  /* Host and port row */
3235  label = gtk_label_new(_("Server Host:"));
3236  entry_pg_host = gtk_entry_new();
3237  gtk_entry_set_width_chars(GTK_ENTRY(entry_pg_host), text_width);
3238  gtk_table_attach_defaults(GTK_TABLE(table_pg), label, 0, 1, 2, 3 );
3239  gtk_table_attach_defaults(GTK_TABLE(table_pg), entry_pg_host, 1, 2, 2, 3 );
3240 
3241  entry_pg_port = gtk_entry_new();
3242  gtk_entry_set_width_chars(GTK_ENTRY(entry_pg_port), 8);
3243  gtk_table_attach_defaults(GTK_TABLE(table_pg), entry_pg_port, 2, 3, 2, 3 );
3244 
3245  /* Database row */
3246  label = gtk_label_new(_("Database:"));
3247  entry_pg_db = gtk_entry_new();
3248  gtk_table_attach_defaults(GTK_TABLE(table_pg), label, 0, 1, 3, 4 );
3249  gtk_table_attach_defaults(GTK_TABLE(table_pg), entry_pg_db, 1, 3, 3, 4 );
3250 
3251  /* Add table into containing frame */
3252  gtk_container_add(GTK_CONTAINER(frame_pg), table_pg);
3253 
3254  /* Add frame into containing vbox */
3255  gtk_container_add(GTK_CONTAINER(window_conn), vbox);
3256 
3257  /* Add the vbox into the window */
3258  gtk_container_add(GTK_CONTAINER(vbox), frame_pg);
3259 
3260  /* Create a simple "OK" button for the dialog */
3261  button_okay = gtk_button_new_with_label(_("OK"));
3262  gtk_container_add(GTK_CONTAINER(vbox), button_okay);
3263  g_signal_connect(G_OBJECT(button_okay), "clicked", G_CALLBACK(pgui_action_connection_okay), NULL);
3264 
3265  /* Hook the delete event so we don't destroy the dialog (only hide it) if cancelled */
3266  gtk_signal_connect(GTK_OBJECT(window_conn), "delete_event", GTK_SIGNAL_FUNC(pgui_event_popup_delete), NULL);
3267 
3268  return;
3269 }
static GtkWidget * entry_pg_db
static GtkWidget * entry_pg_host
#define _(String)
Definition: shpcommon.h:23
static gint pgui_event_popup_delete(GtkWidget *widget, GdkEvent *event, gpointer data)
static GtkWidget * entry_pg_port
static void pgui_action_connection_okay(GtkWidget *widget, gpointer data)
static GtkWidget * entry_pg_user
#define FALSE
Definition: dbfopen.c:169
static GtkWidget * window_conn
static GtkWidget * entry_pg_pass
#define TRUE
Definition: dbfopen.c:170

Here is the call graph for this function:

Here is the caller graph for this function: