mirror of https://codeberg.org/cage/tinmop/
- [GUI] ensured deadline conditions is respected by gemlog subscribing procedures.
This commit is contained in:
parent
4947289eab
commit
165bb30688
|
@ -110,22 +110,28 @@
|
|||
(let ((new-rows (all-rows)))
|
||||
(resync-rows gemlog-frame new-rows)))))
|
||||
|
||||
(defun subscribe-gemlog-or-notify-error (iri)
|
||||
(handler-case
|
||||
(progn
|
||||
(comm:make-request :gemini-gemlog-subscribe 1 iri)
|
||||
t)
|
||||
(error (e)
|
||||
(gui-goodies:notify-request-error e)
|
||||
nil)))
|
||||
|
||||
(defun subscribe-gemlog-clsr (gemlog-frame)
|
||||
(lambda ()
|
||||
(handler-case
|
||||
(let* ((iri (trim-blanks (gui-mw:text-input-dialog gemlog-frame
|
||||
(_ "Info request")
|
||||
(_ "Please, type the gemlog's address")
|
||||
:text "gemini://")))
|
||||
(subscription-ok (comm:make-request :gemini-gemlog-subscribe 1 iri)))
|
||||
(subscription-ok (subscribe-gemlog-or-notify-error iri)))
|
||||
(if subscription-ok
|
||||
(let ((new-rows (all-rows)))
|
||||
(resync-rows gemlog-frame new-rows))
|
||||
(gui-goodies:notify-request-error (format nil
|
||||
(_ "Unable to subscribe to ~s")
|
||||
iri))))
|
||||
(error (e)
|
||||
(gui-goodies:notify-request-error e)))))
|
||||
iri))))))
|
||||
|
||||
(defun open-gemlog-clsr (main-window treeview-gemlogs)
|
||||
(lambda (e)
|
||||
|
|
|
@ -676,10 +676,8 @@ local file paths."
|
|||
(slurp-iri main-window link-value)))))
|
||||
(fs:copy-a-file input-file output-file :overwrite t)))
|
||||
(subscribe-as-gemlog ()
|
||||
(let ((subscription-ok (comm:make-request :gemini-gemlog-subscribe
|
||||
1
|
||||
link-value)))
|
||||
(if subscription-ok
|
||||
(let ((subscribed (client-gemlog-window:subscribe-gemlog-or-notify-error link-value)))
|
||||
(if subscribed
|
||||
(gui-goodies:info-operation-completed main-window)
|
||||
(gui-goodies:notify-request-error (format nil
|
||||
(_ "Unable to subscribe to ~s")
|
||||
|
@ -1495,8 +1493,8 @@ local file paths."
|
|||
(progn
|
||||
(comm:make-request :gemini-gemlog-unsubscribe 1 iri)
|
||||
(set-subscribe-button-unsubscribed main-window))
|
||||
(let ((subscription-ok (comm:make-request :gemini-gemlog-subscribe 1 iri)))
|
||||
(if subscription-ok
|
||||
(let ((subscribed (client-gemlog-window:subscribe-gemlog-or-notify-error iri)))
|
||||
(if subscribed
|
||||
(set-subscribe-button-subscribed main-window)
|
||||
(gui-goodies:notify-request-error (format nil
|
||||
(_ "Unable to subscribe to ~s")
|
||||
|
|
|
@ -416,7 +416,7 @@
|
|||
(defun maybe-log-message (m)
|
||||
(declare (ignorable m))
|
||||
#+debug-json-rpc
|
||||
(misc:dbg m))
|
||||
(misc:dbg "~a" m))
|
||||
|
||||
(defun elaborate-single-request (request)
|
||||
(flet ((make-rpc-error (e id &optional (data nil))
|
||||
|
@ -457,6 +457,9 @@
|
|||
(make-response elaborated id :error-object nil)))
|
||||
(json-rpc-error (e)
|
||||
(make-rpc-error e id request))
|
||||
(condition (c)
|
||||
(maybe-log-message (format nil "jsonrpc request signalled a condition: ~a" c))
|
||||
(make-failed-function-error c id request))
|
||||
(error (e)
|
||||
(maybe-log-message (format nil "jsonrpc request failed: ~a" e))
|
||||
(make-failed-function-error e id request))))
|
||||
|
|
|
@ -3728,6 +3728,7 @@
|
|||
(:gui-shapes :nodgui.shapes)
|
||||
(:menu :client-menu-command))
|
||||
(:export
|
||||
:subscribe-gemlog-or-notify-error
|
||||
:init-window))
|
||||
|
||||
(defpackage :client-search-frame
|
||||
|
|
Loading…
Reference in New Issue