mirror of
https://codeberg.org/cage/tinmop/
synced 2024-12-13 22:46:13 +01:00
Compare commits
2 Commits
338dd77e70
...
2f26583f78
Author | SHA1 | Date | |
---|---|---|---|
|
2f26583f78 | ||
|
56dd0798a6 |
@ -126,10 +126,13 @@
|
||||
(fit-toc-char-width main-window toc-widget-width)))
|
||||
main-window)))
|
||||
|
||||
(defun slurp-gemini-stream (main-window iri stream-wrapper &key
|
||||
(use-cache t)
|
||||
(process-function #'identity)
|
||||
(aborting-function (constantly nil)))
|
||||
(defun slurp-gemini-stream (main-window iri stream-wrapper
|
||||
&key
|
||||
(use-cache t)
|
||||
(process-function #'identity)
|
||||
(aborting-function (constantly nil)))
|
||||
(ev:with-enqueued-process-and-unblock ()
|
||||
(set-focus-to-gemtext main-window))
|
||||
(enqueue-request-notify-error :gemini-request 1 iri use-cache)
|
||||
(labels ((stream-exausted-p ()
|
||||
(let ((status-completed (comm:make-request :gemini-stream-completed-p
|
||||
@ -160,10 +163,10 @@
|
||||
1
|
||||
ev:+standard-event-priority+
|
||||
iri)
|
||||
(ev:with-enqueued-process-and-unblock ()
|
||||
(set-bookmark-button-true main-window))
|
||||
(ev:with-enqueued-process-and-unblock ()
|
||||
(set-bookmark-button-false main-window)))
|
||||
(ev:with-enqueued-process-and-unblock ()
|
||||
(set-bookmark-button-true main-window))
|
||||
(ev:with-enqueued-process-and-unblock ()
|
||||
(set-bookmark-button-false main-window)))
|
||||
(ev:with-enqueued-process-and-unblock ()
|
||||
(set-gemlog-toolbar-button-appearance main-window iri))
|
||||
(ev:with-enqueued-process-and-unblock ()
|
||||
@ -1071,12 +1074,6 @@
|
||||
(gui:bind toc-listbox
|
||||
#$<<ListboxSelect>>$
|
||||
(toc-callback-clsr main-window))
|
||||
(gui:bind gemtext-widget
|
||||
#$<Enter>$
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(gui:configure-mouse-pointer gemtext-widget (gui:find-cursor :xterm))
|
||||
(gui:force-focus (gui:root-toplevel))))
|
||||
(setf (gui:command go-button) (open-iri-clsr main-window t))
|
||||
(setf (gui:command reload-button) (reload-iri-clsr main-window))
|
||||
(setf (gui:command back-button) (back-iri-clsr main-window))
|
||||
@ -1325,98 +1322,101 @@
|
||||
(setf (gui:text (iri-entry (tool-bar main-window))) text)
|
||||
(gui:clear-selection entry)))
|
||||
|
||||
(defun set-focus-to-gemtext (main-window)
|
||||
(gui:focus (gui:inner-text (gemtext-widget main-window))))
|
||||
|
||||
(defun get-address-bar-text (main-window)
|
||||
(trim-blanks (gui:text (iri-entry (tool-bar main-window)))))
|
||||
|
||||
(defun initialize-keybindings (main-window)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(client-configuration:get-keybinding :quit)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(menu:quit)))
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(client-configuration:get-keybinding :search)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(funcall (menu:show-search-frame-clsr main-window)))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(client-configuration:get-keybinding :stream)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(menu:show-streams))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(client-configuration:get-keybinding :certificates)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(menu:show-certificates))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(client-configuration:config-keybinding-tour-manage)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(menu:show-tour))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(client-configuration:get-keybinding :gemlog)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(menu:manage-gemlogs))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(client-configuration:get-keybinding :about)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(menu:help-about))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(client-configuration:get-keybinding :type-address)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(let* ((autocomplete-entry (iri-entry (tool-bar main-window)))
|
||||
(entry (nodgui.mw:autocomplete-entry-widget autocomplete-entry)))
|
||||
(gui:focus entry)
|
||||
(gui:set-selection entry 0 :end)))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(client-configuration:config-keybinding-tour-shuffle)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(client-tour-window:enqueue-shuffle-tour))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(client-configuration:config-keybinding-tour-next)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(funcall (tour-visit-next-iri-clsr main-window)))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(client-configuration:get-keybinding :back)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(funcall (back-iri-clsr main-window)))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(client-configuration:get-keybinding :up)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(funcall (up-iri-clsr main-window)))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(client-configuration:config-keybinding-bookmark-toggle)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(funcall (toggle-bookmark-iri-clsr main-window)))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(client-configuration:config-keybinding-bookmark-show)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(funcall (menu:show-bookmarks-clsr main-window)))
|
||||
:exclusive t))
|
||||
(let ((inner-gemtext-widget (gui:inner-text (gemtext-widget main-window))))
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:get-keybinding :quit)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(menu:quit)))
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:get-keybinding :search)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(funcall (menu:show-search-frame-clsr main-window)))
|
||||
:exclusive t)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:get-keybinding :stream)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(menu:show-streams))
|
||||
:exclusive t)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:get-keybinding :certificates)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(menu:show-certificates))
|
||||
:exclusive t)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:config-keybinding-tour-manage)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(menu:show-tour))
|
||||
:exclusive t)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:get-keybinding :gemlog)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(menu:manage-gemlogs))
|
||||
:exclusive t)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:get-keybinding :about)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(menu:help-about))
|
||||
:exclusive t)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:get-keybinding :type-address)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(let* ((autocomplete-entry (iri-entry (tool-bar main-window)))
|
||||
(entry (nodgui.mw:autocomplete-entry-widget autocomplete-entry)))
|
||||
(gui:focus entry)
|
||||
(gui:set-selection entry 0 :end)))
|
||||
:exclusive t)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:config-keybinding-tour-shuffle)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(client-tour-window:enqueue-shuffle-tour))
|
||||
:exclusive t)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:config-keybinding-tour-next)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(funcall (tour-visit-next-iri-clsr main-window)))
|
||||
:exclusive t)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:get-keybinding :back)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(funcall (back-iri-clsr main-window)))
|
||||
:exclusive t)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:get-keybinding :up)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(funcall (up-iri-clsr main-window)))
|
||||
:exclusive t)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:config-keybinding-bookmark-toggle)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(funcall (toggle-bookmark-iri-clsr main-window)))
|
||||
:exclusive t)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:config-keybinding-bookmark-show)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(funcall (menu:show-bookmarks-clsr main-window))))))
|
||||
|
||||
(defun init-main-window ()
|
||||
(defun init-main-window (starting-iri)
|
||||
(setf gui:*debug-tk* nil)
|
||||
(gui:with-nodgui (:title +program-name+ :debugger-class 'gui:graphical-condition-handler)
|
||||
(icons:load-icons)
|
||||
@ -1428,4 +1428,8 @@
|
||||
(initialize-menu gui:*tk* main-frame)
|
||||
(gui:grid main-frame 0 0 :sticky :nswe)
|
||||
(initialize-keybindings main-frame)
|
||||
(gui-goodies:gui-resize-grid-all gui-goodies:*toplevel*))))
|
||||
(gui-goodies:gui-resize-grid-all gui-goodies:*toplevel*)
|
||||
(gui:wait-complete-redraw)
|
||||
(when (string-not-empty-p starting-iri)
|
||||
(set-address-bar-text main-frame starting-iri)
|
||||
(open-iri starting-iri main-frame nil)))))
|
||||
|
@ -265,7 +265,7 @@ etc.) happened"
|
||||
(command-line:*rpc-client-mode*
|
||||
(rpc-client-init)
|
||||
(json-rpc-communication::start-client)
|
||||
(client-main-window:init-main-window))
|
||||
(client-main-window:init-main-window command-line:*net-address*))
|
||||
(command-line:*print-lisp-dependencies*
|
||||
(misc:all-program-dependencies t))
|
||||
(command-line:*script-file*
|
||||
|
Loading…
Reference in New Issue
Block a user