diff options
author | Leonardo Robol <leo@robol.it> | 2012-09-08 11:20:04 +0200 |
---|---|---|
committer | Leonardo Robol <leo@robol.it> | 2012-09-08 11:20:04 +0200 |
commit | 673136a790b3198334caa49f0ba3537e5011aad4 (patch) | |
tree | 66c23b183669e69abbfa33d1dfb345c2d2f1b3b2 /src/trg-main-window.c | |
parent | c810a1e074736711bb70ed3b2910ef0147541899 (diff) |
Open the preferences dialog if the user has not specified a hostname
for the connection. This will probably happen on application first
start.
Diffstat (limited to 'src/trg-main-window.c')
-rw-r--r-- | src/trg-main-window.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/trg-main-window.c b/src/trg-main-window.c index 6189fb7..4654266 100644 --- a/src/trg-main-window.c +++ b/src/trg-main-window.c @@ -596,20 +596,25 @@ void connect_cb(GtkWidget * w, gpointer data) switch (populate_result) { case TRG_NO_HOSTNAME_SET: - msg = _("No hostname set"); + msg = _("No host specified. Set it in the preferences dialog."); break; default: msg = _("Unknown error getting settings"); break; } - dialog = gtk_message_dialog_new(GTK_WINDOW(data), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, - "%s", msg); - gtk_dialog_run(GTK_DIALOG(dialog)); - gtk_widget_destroy(dialog); + dialog = gtk_message_dialog_new(GTK_WINDOW(data), + GTK_DIALOG_DESTROY_WITH_PARENT, + (populate_result == TRG_NO_HOSTNAME_SET) ? GTK_MESSAGE_INFO : GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + "%s", msg); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); reset_connect_args(TRG_MAIN_WINDOW(data)); + + if (populate_result == TRG_NO_HOSTNAME_SET) + open_local_prefs_cb (NULL, win); + return; } |