X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/ad424400849bde500f1236eb28edd5fb956ca600..c764e832cef2e0828e46762b66ca97cc5541686b:/disobedience/login.c diff --git a/disobedience/login.c b/disobedience/login.c index 4031c3a..0c6e7d7 100644 --- a/disobedience/login.c +++ b/disobedience/login.c @@ -120,11 +120,13 @@ static void set_service(struct config *c, const char *s) { } static void set_username(struct config *c, const char *s) { - c->username = s; + xfree(c->username); + c->username = xstrdup(s); } static void set_password(struct config *c, const char *s) { - c->password = s; + xfree(c->password); + c->password = xstrdup(s); } /** @brief Table used to generate the form */ @@ -230,6 +232,12 @@ static void login_cancel(GtkButton attribute((unused)) *button, gtk_widget_destroy(login_window); } +/** @brief User pressed cancel in the login window */ +static void login_help(GtkButton attribute((unused)) *button, + gpointer attribute((unused)) userdata) { + popup_help("intro.html#login"); +} + /** @brief Keypress handler */ static gboolean login_keypress(GtkWidget attribute((unused)) *widget, GdkEventKey *event, @@ -251,18 +259,25 @@ static gboolean login_keypress(GtkWidget attribute((unused)) *widget, /* Buttons that appear at the bottom of the window */ static struct button buttons[] = { { - "Login", - login_ok, - "(Re-)connect using these settings", + GTK_STOCK_HELP, + login_help, + "Go to manual", 0, - NULL, + gtk_box_pack_start, }, { GTK_STOCK_CLOSE, login_cancel, "Discard changes and close window", 0, - NULL, + gtk_box_pack_end, + }, + { + "Login", + login_ok, + "(Re-)connect using these settings", + 0, + gtk_box_pack_end, }, };