From 9f6adf02c41a271bfb1fee66a7c11b7fadf5ca90 Mon Sep 17 00:00:00 2001 From: cage Date: Sat, 16 May 2020 20:01:41 +0200 Subject: [PATCH] - used correct function when ignoring an account; - changed button label when asking for opening authorization url: from 'OK' to 'Cancel'. --- src/api-client.lisp | 10 +++++++--- src/db.lisp | 2 +- src/ui-goodies.lisp | 18 ++++++++++++++---- src/windows.lisp | 24 +++++++++++++++++------- 4 files changed, 39 insertions(+), 15 deletions(-) diff --git a/src/api-client.lisp b/src/api-client.lisp index da436dc..5316bf5 100644 --- a/src/api-client.lisp +++ b/src/api-client.lisp @@ -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 diff --git a/src/db.lisp b/src/db.lisp index 8e194bd..2e611cc 100644 --- a/src/db.lisp +++ b/src/db.lisp @@ -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) diff --git a/src/ui-goodies.lisp b/src/ui-goodies.lisp index 0d6f5b7..c705bdb 100644 --- a/src/ui-goodies.lisp +++ b/src/ui-goodies.lisp @@ -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) diff --git a/src/windows.lisp b/src/windows.lisp index c9f47dc..4d6b458 100644 --- a/src/windows.lisp +++ b/src/windows.lisp @@ -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)