mirror of https://codeberg.org/cage/tinmop/
- [GUI] prevented adding the same link to tour more than once.
This commit is contained in:
parent
ec507a0235
commit
b237e4bd91
|
@ -447,7 +447,12 @@
|
||||||
(comm:make-request :tour-add-link
|
(comm:make-request :tour-add-link
|
||||||
1
|
1
|
||||||
link-value
|
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 ()
|
(download-background-callback ()
|
||||||
(open-iri link-value main-window nil :status +stream-status-downloading+))
|
(open-iri link-value main-window nil :status +stream-status-downloading+))
|
||||||
(copy-link-callback ()
|
(copy-link-callback ()
|
||||||
|
|
|
@ -39,10 +39,15 @@
|
||||||
|
|
||||||
(defmethod add-tour-link ((object gemini-window) (link gemini-parser:gemini-link))
|
(defmethod add-tour-link ((object gemini-window) (link gemini-parser:gemini-link))
|
||||||
(with-accessors ((links-tour links-tour)) object
|
(with-accessors ((links-tour links-tour)) object
|
||||||
(a:reversef links-tour)
|
(when (not (find link
|
||||||
(push link links-tour)
|
links-tour
|
||||||
(a:reversef links-tour)
|
:test (lambda (a b)
|
||||||
object))
|
(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))
|
(defmethod pop-tour-link ((object gemini-window))
|
||||||
(with-accessors ((links-tour links-tour)) object
|
(with-accessors ((links-tour links-tour)) object
|
||||||
|
|
|
@ -25,9 +25,9 @@
|
||||||
(defun tour-add-link (link-value link-label)
|
(defun tour-add-link (link-value link-label)
|
||||||
(progn
|
(progn
|
||||||
(add-tour-link *gemini-window*
|
(add-tour-link *gemini-window*
|
||||||
(make-instance 'gemini-parser:gemini-link
|
(make-instance 'gemini-parser:gemini-link
|
||||||
:name link-label
|
:name link-label
|
||||||
:target link-value))
|
:target link-value))
|
||||||
t))
|
t))
|
||||||
|
|
||||||
(defclass popped-tour-link (box) ())
|
(defclass popped-tour-link (box) ())
|
||||||
|
|
Loading…
Reference in New Issue