From f64f45c5d15e6133ac5e9241f1d170a8fbf804a4 Mon Sep 17 00:00:00 2001 From: cage Date: Sun, 10 May 2020 11:21:19 +0200 Subject: [PATCH] - shown an error dialog window when the credential to log on the instance are no more valids; - close a menu dialog window after an entry was choosen. --- src/api-client.lisp | 12 +++++++----- src/windows.lisp | 7 ++++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/api-client.lisp b/src/api-client.lisp index e06ccd2..bf43478 100644 --- a/src/api-client.lisp +++ b/src/api-client.lisp @@ -170,11 +170,13 @@ authorizations was performed with success." (progn (copy-credentials-to-client) (tooter:authorize *client*) - (when (null (application-credentials)) - (ui:error-dialog-immediate - (format nil - (_ "Credential invalid. Try to remove ~a and restart the software to authenticate again.") - (res:get-data-file +credentials-filename+))))) + (handler-case + (application-credentials) + (error () + (ui:error-dialog-immediate + (format nil + (_ "Credential invalid. Try to remove ~a and restart the software to authenticate again.") + (res:get-data-file +credentials-filename+)))))) (multiple-value-bind (server-socket server-port) (open-catch-code-socket) (setf *client* (make-default-client)) diff --git a/src/windows.lisp b/src/windows.lisp index a430a7d..4ed0c88 100644 --- a/src/windows.lisp +++ b/src/windows.lisp @@ -128,7 +128,11 @@ height, position and so on)" (gen-simple-win->croatoan-specialized-wrapper touch win) -(gen-simple-win->croatoan-specialized-wrapper select menu) +(defun menu-select (window) + (with-croatoan-window (croatoan-window window) + (prog1 + (select croatoan-window) + (win-close window)))) (defun win-visible-p (win) (with-croatoan-window (croatoan-window win) @@ -441,6 +445,7 @@ list of strings (the text lines)." 4)) (message (join-with-strings lines (format nil "~%"))) (dialog-window (make-instance 'dialog-window + :stacked nil :center t :message-text message :input-blocking t