mirror of https://codeberg.org/cage/tinmop/
- [GUI] implemented a feature to saving contet of a link to a file.
This commit is contained in:
parent
dc2b5da552
commit
45813f5317
|
@ -478,7 +478,14 @@
|
|||
(if (inline-possible-p link-value)
|
||||
(gui-goodies:with-busy* (main-window)
|
||||
(inline-image main-window link-value line-number))
|
||||
(funcall (link-click-mouse-1-callback-clsr link-value main-window))))))
|
||||
(funcall (link-click-mouse-1-callback-clsr link-value main-window)))))
|
||||
(save-link-as-callback ()
|
||||
(a:when-let* ((output-file (gui:get-save-file :initial-dir "."
|
||||
:parent main-window
|
||||
:title (_ "Choose a file for saving")))
|
||||
(input-file (gui-goodies:with-busy* (main-window)
|
||||
(slurp-iri main-window link-value))))
|
||||
(fs:copy-a-file input-file output-file :overwrite t))))
|
||||
(lambda ()
|
||||
(let* ((popup-menu (gui:make-menu nil (_"link menu")))
|
||||
(x (gui:screen-mouse-x))
|
||||
|
@ -490,9 +497,12 @@
|
|||
(gui:make-menubutton popup-menu
|
||||
(_ "Inline")
|
||||
(open-inline-clsr (gui:cursor-index (gemtext-widget main-window)))))
|
||||
(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 (_ "Add link to bookmarks") #'bookmark-link-callback)
|
||||
(when (or (gemini-client:absolute-gemini-url-p link-value)
|
||||
(not (iri:absolute-url-p link-value)))
|
||||
(gui:make-menubutton popup-menu (_ "Save link as…") #'save-link-as-callback))
|
||||
(gui:make-menubutton popup-menu
|
||||
(_ "Open link in background")
|
||||
#'download-background-callback)
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
(when (string-empty-p (trim-blanks (gui:text (data-text titan-frame))))
|
||||
(a:when-let ((current-file-chosen (file-chosen titan-frame)))
|
||||
(setf initial-dir (fs:parent-dir-path current-file-chosen)))
|
||||
(let ((new-file-path (gui:get-open-file :initial-dir initial-dir
|
||||
(a:when-let ((new-file-path (gui:get-open-file :initial-dir initial-dir
|
||||
:parent titan-frame
|
||||
:multiple nil
|
||||
:title (_ "Choose the file"))))
|
||||
|
|
Loading…
Reference in New Issue