1
0
Fork 0

- [gemini] fixed regression opening gemini link is possible again;

- prevented hiding of notifications by the gemini TOC window.
This commit is contained in:
cage 2021-05-16 16:19:14 +02:00
parent 50c76209c5
commit 76a11da2fc
3 changed files with 18 additions and 10 deletions

View File

@ -406,8 +406,8 @@
(if (not (downloading-allowed-p wrapper-object))
(ui:notify (_ "Gemini document downloading aborted"))
(progn
(ui:notify (_ "Gemini document downloading completed"))
(maybe-render-toc)
(ui:notify (_ "Gemini document downloading completed"))
(setf (stream-status wrapper-object) :completed)))
;; (allow-downloading wrapper-object)
(gemini-client:close-ssl-socket download-socket))))))))
@ -770,7 +770,8 @@
(defun load-gemini-url (url &key
(priority program-events:+standard-event-priority+)
(give-focus-to-message-window t)
(use-cached-file-if-exists nil))
(use-cached-file-if-exists nil)
(enqueue nil))
"Load `url', that is a web resource or a local file. This function
can be used only when the event polling is enabled (e.g. from user
command) otherwise te actual code to get the resource will never be
@ -779,5 +780,6 @@ executed."
:give-focus-to-message-window give-focus-to-message-window
:priority priority
:use-cached-file-if-exists use-cached-file-if-exists
:url url)))
:enqueue enqueue
:url url)))
(program-events:push-event event)))

View File

@ -84,8 +84,9 @@
(db:gemlog-mark-as-seen url)
(gemini-viewer:ensure-just-one-stream-rendering)
(program-events:push-event event)
(gemini-viewer:request url :enqueue enqueue
:use-cached-file-if-exists t)))
(gemini-viewer:load-gemini-url url
:enqueue enqueue
:use-cached-file-if-exists t)))
((fs:dirp decoded-path)
(let ((program-events:*process-events-immediately* t)
(event (make-instance 'program-events:gemini-push-behind-downloading-event

View File

@ -1002,13 +1002,18 @@
:initform t
:initarg :give-focus-to-message-window
:reader give-focus-to-message-window-p
:writer (setf give-focus-to-message-window))))
:writer (setf give-focus-to-message-window))
(enqueue
:initform nil
:initarg :enqueue
:accessor enqueue)))
(defmethod process-event ((object gemini-request-event))
(tui:with-notify-errors
(with-accessors ((url url) ; if a local file *not* percent encoded
(give-focus-to-message-window-p give-focus-to-message-window-p)
(use-cached-file-if-exists use-cached-file-if-exists)) object
(use-cached-file-if-exists use-cached-file-if-exists)
(enqueue enqueue)) object
(let ((window specials:*message-window*)
(local-path (if (text-utils:percent-encoded-p url)
(complete:tilde-expand-string (text-utils:percent-decode url))
@ -1021,7 +1026,9 @@
((text-utils:string-empty-p url)
(ui:error-message (_ "Empty address")))
((gemini-client:absolute-gemini-url-p url)
(gemini-viewer:request url :use-cached-file-if-exists use-cached-file-if-exists))
(gemini-viewer:request url
:enqueue enqueue
:use-cached-file-if-exists use-cached-file-if-exists))
((fs:dirp local-path)
(let* ((index-path (uri:normalize-path (fs:prepend-pwd local-path)))
(all-paths (mapcar #'uri:normalize-path
@ -1126,8 +1133,6 @@
(when (and (gemini-viewer:downloading-allowed-p wrapper-object)
(not (skip-rendering-p object))
(message-window:display-gemini-text-p win))
(setf (windows:keybindings win)
keybindings:*gemini-message-keymap*)
(refresh-gemini-message-window links source ir-line append-text)
(windows:draw win))))))