mirror of
https://codeberg.org/cage/tinmop/
synced 2024-12-11 22:35:20 +01:00
- added latest entries to chronology menu.
This commit is contained in:
parent
8a626d1c2d
commit
92b5cbb588
@ -262,6 +262,16 @@
|
||||
(setf (fetching-thread stream-wrapper) stream-thread)
|
||||
stream-wrapper)))))
|
||||
|
||||
(defun menu-latest-history-entries ()
|
||||
;; get the history for today
|
||||
(a:when-let ((rows (cev:enqueue-request-and-wait-results :gemini-history-rows
|
||||
1
|
||||
ev:+standard-event-priority+
|
||||
1
|
||||
0)))
|
||||
(mapcar (lambda (a) (getf a :input))
|
||||
(subseq rows 0 (min 5 (length rows))))))
|
||||
|
||||
(defun initialize-menu (parent main-window)
|
||||
(let* ((bar (gui:make-menubar parent))
|
||||
(file (gui:make-menu bar (_ "File")))
|
||||
@ -275,6 +285,19 @@
|
||||
(gui:make-menubutton history
|
||||
(_ "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)))
|
||||
(gui:make-menubutton tools
|
||||
(_ "Certificates")
|
||||
(menu:show-certificates-clsr main-window)
|
||||
|
Loading…
Reference in New Issue
Block a user