mirror of
https://codeberg.org/cage/tinmop/
synced 2025-03-02 09:57:48 +01:00
- [GUI] refreshed URLs history when a new URL is opened.
This commit is contained in:
parent
92b5cbb588
commit
c400282c29
@ -272,6 +272,22 @@
|
||||
(mapcar (lambda (a) (getf a :input))
|
||||
(subseq rows 0 (min 5 (length rows))))))
|
||||
|
||||
(defun initialize-urls-history-menu-entries (main-window)
|
||||
(with-accessors ((menu-history menu-history)) main-window
|
||||
(gui:menu-delete menu-history 2)
|
||||
(let ((history-urls (menu-latest-history-entries)))
|
||||
(if history-urls
|
||||
(map nil
|
||||
(lambda (url)
|
||||
(gui:make-menubutton menu-history
|
||||
(ellipsize url 50)
|
||||
(lambda () (open-iri url main-window t))))
|
||||
history-urls)
|
||||
(gui:make-menubutton menu-history
|
||||
(_ "History empty")
|
||||
(constantly t)
|
||||
:state :disabled)))))
|
||||
|
||||
(defun initialize-menu (parent main-window)
|
||||
(let* ((bar (gui:make-menubar parent))
|
||||
(file (gui:make-menu bar (_ "File")))
|
||||
@ -286,18 +302,9 @@
|
||||
(_ "Manage")
|
||||
(menu:manage-history-clsr main-window))
|
||||
(gui:add-separator history)
|
||||
(let ((history-urls (menu-latest-history-entries)))
|
||||
(if history-urls
|
||||
(map nil
|
||||
(lambda (url)
|
||||
(gui:make-menubutton history
|
||||
(ellipsize url 50)
|
||||
(lambda () (open-iri url main-window t))))
|
||||
history-urls)
|
||||
(gui:make-menubutton history
|
||||
(_ "History empty")
|
||||
(constantly t)
|
||||
:state :disabled)))
|
||||
(setf (menu-bar main-window) bar)
|
||||
(setf (menu-history main-window) history)
|
||||
(initialize-urls-history-menu-entries main-window)
|
||||
(gui:make-menubutton tools
|
||||
(_ "Certificates")
|
||||
(menu:show-certificates-clsr main-window)
|
||||
@ -359,7 +366,8 @@
|
||||
(gui:make-menubutton gemlogs
|
||||
(_ "Show")
|
||||
#'menu:manage-gemlogs
|
||||
:accelerator (client-configuration:get-keybinding :gemlog))))
|
||||
:accelerator (client-configuration:get-keybinding :gemlog))
|
||||
bar))
|
||||
|
||||
(defclass tool-bar (gui:frame)
|
||||
((iri-entry
|
||||
@ -1473,7 +1481,8 @@ local file paths."
|
||||
(cond
|
||||
((gemini-client:gemini-file-stream-p meta)
|
||||
(ev:with-enqueued-process-and-unblock ()
|
||||
(comm:make-request :gemini-save-url-db-history 1 iri))
|
||||
(comm:make-request :gemini-save-url-db-history 1 iri)
|
||||
(initialize-urls-history-menu-entries main-window))
|
||||
(maybe-stop-streaming-stream-thread)
|
||||
(clear-gemtext main-window)
|
||||
(initialize-ir-lines main-window)
|
||||
@ -1829,7 +1838,15 @@ local file paths."
|
||||
main-window)
|
||||
|
||||
(defclass main-frame (gui:frame)
|
||||
((gempub-metadata
|
||||
((menu-bar
|
||||
:initform nil
|
||||
:initarg :menu-bar
|
||||
:accessor menu-bar)
|
||||
(menu-history
|
||||
:initform nil
|
||||
:initarg :menu-history
|
||||
:accessor menu-history)
|
||||
(gempub-metadata
|
||||
:initform nil
|
||||
:initarg :gempub-metadata
|
||||
:accessor gempub-metadata)
|
||||
|
Loading…
x
Reference in New Issue
Block a user