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*)
(declare (ignore a))
(let* ((dialog-msg (authorize-dialog-message))
(save-item (_ "Save address"))
(open-item (_ "Open address"))
(save-item (_ "Save address"))
(open-item (_ "Open address"))
(cancel-item (_ "Cancel"))
(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)
(handler-case
(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
identified by the account that wrote the status identified by
`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)))
(query (make-update :account
(:ignoredp)

View File

@ -85,18 +85,28 @@
:payload message)))
(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*
title
message
buttons)))
buttons
append-ok-button)))
(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*
title
message
buttons)))
buttons
append-ok-button)))
(windows:menu-select dialog-window)))
(defun input-dialog-immediate (message)

View File

@ -436,11 +436,15 @@ list of strings (the text lines)."
(get-char low-level-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))
(max-line-size (text-utils:find-max-line-length lines))
(actual-buttons (append (list +menu-button-ok+)
buttons))
(actual-buttons (if append-ok-button
(append (list +menu-button-ok+)
buttons)
buttons))
(max-button-size (text-utils:find-max-line-length actual-buttons))
(max-message-height (- (win-height-no-border parent)
4))
@ -468,15 +472,21 @@ list of strings (the text lines)."
(make-instance 'wrapper-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+))
(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+))
(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
selected-foreground selected-background)