mirror of
https://codeberg.org/cage/tinmop/
synced 2025-02-17 08:10:36 +01:00
- [GUI] added command for copying and bookmarking a link from the contextual menu.
This commit is contained in:
parent
7543b84005
commit
fbdfe648fc
@ -299,23 +299,38 @@
|
||||
query))))
|
||||
|
||||
(defun contextual-menu-link-clrs (link-name link-value main-window)
|
||||
(flet ((download-background-callback ()
|
||||
(open-iri link-value main-window nil :status +stream-status-downloading+)))
|
||||
(flet ((add-to-tour-callback ()
|
||||
(ev:with-enqueued-process-and-unblock ()
|
||||
(comm:make-request :tour-add-link
|
||||
1
|
||||
link-value
|
||||
link-name)))
|
||||
(download-background-callback ()
|
||||
(open-iri link-value main-window nil :status +stream-status-downloading+))
|
||||
(copy-link-callback ()
|
||||
(os-utils:copy-to-clipboard link-value)
|
||||
(print-info-message (format nil
|
||||
(_ "~s has been copied to the clipboard")
|
||||
link-value)))
|
||||
(bookmark-link-callback ()
|
||||
(let ((bookmarkedp (cev:enqueue-request-and-wait-results :gemini-bookmarked-p
|
||||
1
|
||||
ev:+standard-event-priority+
|
||||
link-value)))
|
||||
(if bookmarkedp
|
||||
(print-info-message (format nil
|
||||
(_ "~s already bookmarked")
|
||||
link-value)
|
||||
:bold t)
|
||||
(client-bookmark-window:init-window main-window link-value)))))
|
||||
(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)))))
|
||||
(background-open (gui:make-menubutton popup-menu
|
||||
(_ "Open link in background")
|
||||
#'download-background-callback)))
|
||||
(declare (ignore add-to-tour-button
|
||||
background-open))
|
||||
(let* ((popup-menu (gui:make-menu nil (_"link menu"))))
|
||||
(gui:make-menubutton popup-menu (_ "Add link to bookmarks") #'bookmark-link-callback)
|
||||
(gui:make-menubutton popup-menu (_ "Add link to tour") #'add-to-tour-callback)
|
||||
(gui:make-menubutton popup-menu (_ "Copy link to the clipboard") #'copy-link-callback)
|
||||
(gui:make-menubutton popup-menu
|
||||
(_ "Open link in background")
|
||||
#'download-background-callback)
|
||||
(gui:popup popup-menu (gui:screen-mouse-x) (gui:screen-mouse-y))))))
|
||||
|
||||
(defun collect-ir-lines (request-iri main-window lines)
|
||||
@ -778,16 +793,15 @@
|
||||
(with-accessors ((tool-bar tool-bar)) main-window
|
||||
(with-accessors ((iri-entry iri-entry)) tool-bar
|
||||
(let* ((iri (gui:text iri-entry))
|
||||
(bookmarked-p (cev:enqueue-request-and-wait-results :gemini-bookmarked-p
|
||||
1
|
||||
ev:+standard-event-priority+
|
||||
iri)))
|
||||
(if bookmarked-p
|
||||
(bookmarkedp (cev:enqueue-request-and-wait-results :gemini-bookmarked-p
|
||||
1
|
||||
ev:+standard-event-priority+
|
||||
iri)))
|
||||
(if bookmarkedp
|
||||
(ev:with-enqueued-process-and-unblock ()
|
||||
(comm:make-request :gemini-bookmark-delete 1 iri)
|
||||
(set-bookmark-button-false main-window))
|
||||
(progn
|
||||
(client-bookmark-window:init-window main-window (gui:text iri-entry)))))))))
|
||||
(client-bookmark-window:init-window main-window (gui:text iri-entry))))))))
|
||||
|
||||
(defun tour-visit-next-iri-clsr (main-window)
|
||||
(lambda ()
|
||||
@ -953,7 +967,7 @@
|
||||
:font (gui-conf:gemini-text-font-configuration)))
|
||||
(gui:configure gemtext-widget :wrap :word)
|
||||
(setf info-frame (make-instance 'gui:frame :master object :relief :sunken :borderwidth 1))
|
||||
(setf info-text (make-instance 'gui:text :height 1 :wrap :none :master info-frame))
|
||||
(setf info-text (make-instance 'gui:text :height 2 :wrap :none :master info-frame))
|
||||
(gui:configure info-text :font gui:+tk-small-caption-font+)
|
||||
(setf search-frame (client-search-frame:init-window object))
|
||||
(gui:grid info-text 0 0 :sticky :news)
|
||||
|
Loading…
x
Reference in New Issue
Block a user