1
0
Fork 0

- [GUI] prevented adding the same link to tour more than once.

This commit is contained in:
cage 2023-05-14 14:54:28 +02:00
parent ec507a0235
commit b237e4bd91
3 changed files with 18 additions and 8 deletions

View File

@ -447,7 +447,12 @@
(comm:make-request :tour-add-link
1
link-value
link-name)))
link-name)
(print-info-message (format nil
(_ "~a added to tour")
(if (string-not-empty-p link-name)
link-name
link-value)))))
(download-background-callback ()
(open-iri link-value main-window nil :status +stream-status-downloading+))
(copy-link-callback ()

View File

@ -39,10 +39,15 @@
(defmethod add-tour-link ((object gemini-window) (link gemini-parser:gemini-link))
(with-accessors ((links-tour links-tour)) object
(a:reversef links-tour)
(push link links-tour)
(a:reversef links-tour)
object))
(when (not (find link
links-tour
:test (lambda (a b)
(string= (gemini-parser:target a)
(gemini-parser:target b)))))
(a:reversef links-tour)
(push link links-tour)
(a:reversef links-tour)
object)))
(defmethod pop-tour-link ((object gemini-window))
(with-accessors ((links-tour links-tour)) object

View File

@ -25,9 +25,9 @@
(defun tour-add-link (link-value link-label)
(progn
(add-tour-link *gemini-window*
(make-instance 'gemini-parser:gemini-link
:name link-label
:target link-value))
(make-instance 'gemini-parser:gemini-link
:name link-label
:target link-value))
t))
(defclass popped-tour-link (box) ())