mirror of https://codeberg.org/cage/tinmop/
Compare commits
2 Commits
34d639e094
...
38988b76a0
Author | SHA1 | Date |
---|---|---|
cage | 38988b76a0 | |
cage | 29afea2b36 |
|
@ -110,6 +110,23 @@
|
|||
(let ((new-rows (all-rows)))
|
||||
(resync-rows gemlog-frame new-rows)))))
|
||||
|
||||
(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)))
|
||||
(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)))))
|
||||
|
||||
(defun open-gemlog-clsr (main-window treeview-gemlogs)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
|
@ -181,6 +198,10 @@
|
|||
(gui:with-toplevel (toplevel :master master :title (_ "Gemlogs"))
|
||||
(let* ((table (make-instance 'gemlog-frame :master toplevel))
|
||||
(buttons-frame (make-instance 'gui:frame :master toplevel))
|
||||
(subscribe-button (make-instance 'gui:button
|
||||
:master buttons-frame
|
||||
:image icons:*document-add*
|
||||
:command (subscribe-gemlog-clsr table)))
|
||||
(unsubscribe-button (make-instance 'gui:button
|
||||
:master buttons-frame
|
||||
:image icons:*document-delete*
|
||||
|
@ -194,8 +215,9 @@
|
|||
(refresh-button (_ "refresh all subscription")))
|
||||
(gui:grid table 0 0 :sticky :nwe)
|
||||
(gui:grid buttons-frame 1 0 :sticky :s)
|
||||
(gui:grid unsubscribe-button 0 0 :sticky :s)
|
||||
(gui:grid refresh-button 0 1 :sticky :s)
|
||||
(gui:grid subscribe-button 0 0 :sticky :s)
|
||||
(gui:grid unsubscribe-button 0 1 :sticky :s)
|
||||
(gui:grid refresh-button 0 2 :sticky :s)
|
||||
(gui:bind (gui:treeview (gui-goodies:tree table))
|
||||
#$<<TreeviewSelect>>$
|
||||
(open-gemlog-clsr main-window table))
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
(list (cons "url" gemlog-url)
|
||||
(cons "new-posts"
|
||||
(gemini-subscription:refresh-subscription-low-level gemlog-url)))
|
||||
(error (e)
|
||||
(condition (e)
|
||||
(error (format nil (_ "Error getting posts from ~s: ~a") gemlog-url e)))))
|
||||
|
||||
(defclass gemini-gemlog-subscriptions-refreshed (box) ())
|
||||
|
|
Loading…
Reference in New Issue