1
0
Fork 0

- used correct function when ignoring an account;

- changed button label when asking for opening authorization url: from
  'OK' to 'Cancel'.
This commit is contained in:
cage 2020-05-16 20:01:41 +02:00
parent a746aef322
commit 9f6adf02c4
4 changed files with 39 additions and 15 deletions

View File

@ -186,10 +186,14 @@ authorizations was performed with success."
(tooter:authorize *client*) (tooter:authorize *client*)
(declare (ignore a)) (declare (ignore a))
(let* ((dialog-msg (authorize-dialog-message)) (let* ((dialog-msg (authorize-dialog-message))
(save-item (_ "Save address")) (save-item (_ "Save address"))
(open-item (_ "Open address")) (open-item (_ "Open address"))
(cancel-item (_ "Cancel"))
(choosen (ui:info-dialog-immediate (format nil "~a~%~a" dialog-msg url) (choosen (ui:info-dialog-immediate (format nil "~a~%~a" dialog-msg url)
:buttons (list save-item open-item)))) :buttons (list save-item
open-item
cancel-item)
:append-ok-button nil)))
(labels ((on-got-authorization-code (value) (labels ((on-got-authorization-code (value)
(handler-case (handler-case
(progn (progn

View File

@ -1881,7 +1881,7 @@ to `timeline' , `folder' and possibly `account-id', older than
"Ignore or unignore the future statuses authored by the user "Ignore or unignore the future statuses authored by the user
identified by the account that wrote the status identified by identified by the account that wrote the status identified by
`status-id'" `status-id'"
(when-let* ((status (fetch-from-id :status status-id)) (when-let* ((status (find-status-id status-id))
(account-id (db-getf status :account-id))) (account-id (db-getf status :account-id)))
(query (make-update :account (query (make-update :account
(:ignoredp) (:ignoredp)

View File

@ -85,18 +85,28 @@
:payload message))) :payload message)))
(push-event event))) (push-event event)))
(defun info-dialog-immediate (message &key (buttons nil) (title (_ "Information"))) (defun info-dialog-immediate (message
&key
(buttons nil)
(title (_ "Information"))
(append-ok-button t))
(let ((dialog-window (windows:make-info-message-dialog specials:*main-window* (let ((dialog-window (windows:make-info-message-dialog specials:*main-window*
title title
message message
buttons))) buttons
append-ok-button)))
(windows:menu-select dialog-window))) (windows:menu-select dialog-window)))
(defun error-dialog-immediate (message &key (buttons nil) (title (_ "Error"))) (defun error-dialog-immediate (message
&key
(buttons nil)
(title (_ "Error"))
(append-ok-button t))
(let ((dialog-window (windows:make-error-message-dialog specials:*main-window* (let ((dialog-window (windows:make-error-message-dialog specials:*main-window*
title title
message message
buttons))) buttons
append-ok-button)))
(windows:menu-select dialog-window))) (windows:menu-select dialog-window)))
(defun input-dialog-immediate (message) (defun input-dialog-immediate (message)

View File

@ -436,11 +436,15 @@ list of strings (the text lines)."
(get-char low-level-window) (get-char low-level-window)
(win-close window))) (win-close window)))
(defun make-dialog (parent title message color-pair &optional (buttons nil)) (defun make-dialog (parent title message color-pair
&optional (buttons nil)
(append-ok-button t))
(let* ((lines (text-utils:split-lines message)) (let* ((lines (text-utils:split-lines message))
(max-line-size (text-utils:find-max-line-length lines)) (max-line-size (text-utils:find-max-line-length lines))
(actual-buttons (append (list +menu-button-ok+) (actual-buttons (if append-ok-button
buttons)) (append (list +menu-button-ok+)
buttons)
buttons))
(max-button-size (text-utils:find-max-line-length actual-buttons)) (max-button-size (text-utils:find-max-line-length actual-buttons))
(max-message-height (- (win-height-no-border parent) (max-message-height (- (win-height-no-border parent)
4)) 4))
@ -468,15 +472,21 @@ list of strings (the text lines)."
(make-instance 'wrapper-window (make-instance 'wrapper-window
:croatoan-window dialog-window))) :croatoan-window dialog-window)))
(defun make-error-message-dialog (parent title message &optional (buttons nil)) (defun make-error-message-dialog (parent title message
&optional
(buttons nil)
(append-ok-button t))
(let ((bg (swconf:win-bg swconf:+key-error-dialog+)) (let ((bg (swconf:win-bg swconf:+key-error-dialog+))
(fg (swconf:win-fg swconf:+key-error-dialog+))) (fg (swconf:win-fg swconf:+key-error-dialog+)))
(make-dialog parent title message (list fg bg) buttons))) (make-dialog parent title message (list fg bg) buttons append-ok-button)))
(defun make-info-message-dialog (parent title message &optional (buttons nil)) (defun make-info-message-dialog (parent title message
&optional
(buttons nil)
(append-ok-button t))
(let ((bg (swconf:win-bg swconf:+key-info-dialog+)) (let ((bg (swconf:win-bg swconf:+key-info-dialog+))
(fg (swconf:win-fg swconf:+key-info-dialog+))) (fg (swconf:win-fg swconf:+key-info-dialog+)))
(make-dialog parent title message (list fg bg) buttons))) (make-dialog parent title message (list fg bg) buttons append-ok-button)))
(defun make-simple-style (foreground background (defun make-simple-style (foreground background
selected-foreground selected-background) selected-foreground selected-background)