+/** @brief User pressed OK in login window */
+static void login_ok(GtkButton attribute((unused)) *button,
+ gpointer attribute((unused)) userdata) {
+ disorder_client *c;
+
+ /* Copy the new config into @ref config */
+ login_update_config();
+ /* Attempt a login with the new details */
+ c = disorder_new(0);
+ if(!disorder_connect(c)) {
+ /* Success; save the config and start using it */
+ login_save_config();
+ logged_in();
+ /* Pop down login window */
+ gtk_widget_destroy(login_window);
+ } else {
+ /* Failed to connect - report the error */
+ popup_msg(GTK_MESSAGE_ERROR, disorder_last(c));
+ }
+ disorder_close(c); /* no use for this any more */
+}
+
+/** @brief User pressed cancel in the login window */