1
0
Fork 0

- input dialog reurn :canceled if the user pressed the 'cancel' button;

- fixed an infinite loop when the user chose to cancel saving the URI to autorize the client.
This commit is contained in:
cage 2023-02-11 21:01:58 +01:00
parent 5ee623d312
commit 9e7966f697
2 changed files with 17 additions and 15 deletions

View File

@ -233,18 +233,19 @@ Returns nil if the user did not provided a server in the configuration file"
(save-credentials () (save-credentials ()
(let* ((message (_ "Please enter below the file where to save the address")) (let* ((message (_ "Please enter below the file where to save the address"))
(filepath (ui:input-dialog-immediate message))) (filepath (ui:input-dialog-immediate message)))
(cond (when (not (eq filepath :canceled))
((null filepath) (cond
(save-credentials)) ((null filepath)
((fs:file-exists-p filepath) (save-credentials))
(if (ui:confirm-file-overwrite-dialog-immediate filepath) ((fs:file-exists-p filepath)
(progn (if (ui:confirm-file-overwrite-dialog-immediate filepath)
(fs:dump-sequence-to-file url filepath) (progn
(notify-file-saved filepath)) (fs:dump-sequence-to-file url filepath)
(save-credentials))) (notify-file-saved filepath))
(t (save-credentials)))
(fs:dump-sequence-to-file url filepath) (t
(notify-file-saved filepath)))))) (fs:dump-sequence-to-file url filepath)
(notify-file-saved filepath)))))))
(cond (cond
((string= choosen open-item) ((string= choosen open-item)
(os-utils:xdg-open url) (os-utils:xdg-open url)

View File

@ -648,13 +648,14 @@ inserted by the user"
:croatoan-window low-level-window))) :croatoan-window low-level-window)))
(win-set-background window (make-win-background bg :color-fg fg)) (win-set-background window (make-win-background bg :color-fg fg))
(add-flush-left-text window message 2 :has-border-p t) (add-flush-left-text window message 2 :has-border-p t)
(win-refresh window) (win-refresh window)
(setf (c:cursor-visible-p screen-low-level) t) (setf (c:cursor-visible-p screen-low-level) t)
(let ((res (croatoan:edit low-level-window))) (let ((res (croatoan:edit low-level-window)))
(setf (c:cursor-visible-p screen-low-level) nil) (setf (c:cursor-visible-p screen-low-level) nil)
(win-close window) (win-close window)
(and res (if (null res)
(c:value field)))))) :canceled
(c:value field))))))
(defun make-checklist-dialog (screen parent title options) (defun make-checklist-dialog (screen parent title options)
(with-croatoan-window (screen-low-level screen) (with-croatoan-window (screen-low-level screen)