mirror of
https://codeberg.org/cage/tinmop/
synced 2025-02-11 07:30:34 +01:00
- [GUI] added contextual menu for links;
- [GUI] added command to add a link to the tour.
This commit is contained in:
parent
92cac487ff
commit
d3e5782104
@ -290,6 +290,21 @@
|
|||||||
path
|
path
|
||||||
query))))
|
query))))
|
||||||
|
|
||||||
|
(defun contextual-menu-link-clrs (link-name link-value main-window)
|
||||||
|
(declare (ignore main-window))
|
||||||
|
(lambda ()
|
||||||
|
(let* ((popup-menu (gui:make-menu nil (_"link menu")))
|
||||||
|
(add-to-tour-button (gui:make-menubutton popup-menu
|
||||||
|
(_ "Add link to tour")
|
||||||
|
(lambda ()
|
||||||
|
(ev:with-enqueued-process-and-unblock ()
|
||||||
|
(comm:make-request :tour-add-link
|
||||||
|
1
|
||||||
|
link-value
|
||||||
|
link-name))))))
|
||||||
|
(declare (ignore add-to-tour-button))
|
||||||
|
(gui:popup popup-menu (gui:screen-mouse-x) (gui:screen-mouse-y)))))
|
||||||
|
|
||||||
(defun collect-ir-lines (request-iri main-window lines)
|
(defun collect-ir-lines (request-iri main-window lines)
|
||||||
(with-accessors ((ir-lines ir-lines)
|
(with-accessors ((ir-lines ir-lines)
|
||||||
(ir-rendered-lines ir-rendered-lines)
|
(ir-rendered-lines ir-rendered-lines)
|
||||||
@ -377,6 +392,10 @@
|
|||||||
link-bg
|
link-bg
|
||||||
(link-click-mouse-1-callback-clsr target-iri
|
(link-click-mouse-1-callback-clsr target-iri
|
||||||
main-window)
|
main-window)
|
||||||
|
:button-3-callback
|
||||||
|
(contextual-menu-link-clrs link-name
|
||||||
|
link-value
|
||||||
|
main-window)
|
||||||
:over-callback
|
:over-callback
|
||||||
(lambda () (print-info-message target-iri))
|
(lambda () (print-info-message target-iri))
|
||||||
:leave-callback
|
:leave-callback
|
||||||
|
@ -21,10 +21,12 @@
|
|||||||
(shuffle-tour *gemini-window*))
|
(shuffle-tour *gemini-window*))
|
||||||
|
|
||||||
(defun tour-add-link (link-value link-label)
|
(defun tour-add-link (link-value link-label)
|
||||||
(add-tour-link *gemini-window*
|
(progn
|
||||||
|
(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))
|
||||||
|
|
||||||
(defun tour-pop-link ()
|
(defun tour-pop-link ()
|
||||||
(a:when-let ((link (pop-tour-link *gemini-window*)))
|
(a:when-let ((link (pop-tour-link *gemini-window*)))
|
||||||
@ -36,3 +38,20 @@
|
|||||||
|
|
||||||
(defun clear-tour ()
|
(defun clear-tour ()
|
||||||
(clear-tour-link *gemini-window*))
|
(clear-tour-link *gemini-window*))
|
||||||
|
|
||||||
|
(defclass tour (box) ())
|
||||||
|
|
||||||
|
(defmethod yason:encode ((object tour) &optional (stream *standard-output*))
|
||||||
|
(let ((tour (unbox object)))
|
||||||
|
(let ((json:*symbol-encoder* #'json:encode-symbol-as-lowercase)
|
||||||
|
(yason:*list-encoder* #'yason:encode-plist)
|
||||||
|
(json:*symbol-key-encoder* #'json:encode-symbol-as-lowercase))
|
||||||
|
(yason:with-output (stream)
|
||||||
|
(yason:with-array ()
|
||||||
|
(yason:encode-array-element
|
||||||
|
(loop for tour-link in tour collect
|
||||||
|
(list :target (gemini-parser:target tour-link)
|
||||||
|
:name (json:encode (gemini-parser:name tour-link))))))))))
|
||||||
|
|
||||||
|
(defun tour-all-links ()
|
||||||
|
(make-instance 'tour :contents (links-tour *gemini-window*)))
|
||||||
|
@ -106,6 +106,7 @@
|
|||||||
'tour-delete-link
|
'tour-delete-link
|
||||||
"iri" 0)
|
"iri" 0)
|
||||||
(gen-rpc "clear-tour" 'clear-tour)
|
(gen-rpc "clear-tour" 'clear-tour)
|
||||||
|
(gen-rpc "tour-all-links" 'tour-all-links)
|
||||||
(gen-rpc "gemini-generate-bookmark-page" 'gemini-generate-bookmark-page)
|
(gen-rpc "gemini-generate-bookmark-page" 'gemini-generate-bookmark-page)
|
||||||
(gen-rpc "gemini-bookmark-add" 'gemini-bookmark-add
|
(gen-rpc "gemini-bookmark-add" 'gemini-bookmark-add
|
||||||
"iri" 0
|
"iri" 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user