1
0
Fork 0

- [GUI] implemented reload iri button command.

This commit is contained in:
cage 2023-04-03 19:53:05 +02:00
parent 41b2f7a571
commit 2787544c2f
1 changed files with 15 additions and 4 deletions

View File

@ -648,7 +648,7 @@
(lambda () (lambda ()
(with-accessors ((tool-bar tool-bar)) main-window (with-accessors ((tool-bar tool-bar)) main-window
(with-accessors ((iri-entry iri-entry)) tool-bar (with-accessors ((iri-entry iri-entry)) tool-bar
(let* ((iri (trim-blanks (gui:text iri-entry)))) (let ((iri (trim-blanks (gui:text iri-entry))))
(gui-mw::hide-candidates iri-entry) (gui-mw::hide-candidates iri-entry)
(open-iri iri main-window use-cache)))))) (open-iri iri main-window use-cache))))))
@ -692,7 +692,15 @@
(toc-callback-clsr main-window)) (toc-callback-clsr main-window))
(setf (gui:command go-button) (open-iri-clsr main-window t)))))) (setf (gui:command go-button) (open-iri-clsr main-window t))))))
(defmethod initialize-instance :after ((object tool-bar) &key &allow-other-keys) (defun reload-iri-clsr (main-window)
(lambda ()
(with-accessors ((tool-bar tool-bar)) main-window
(with-accessors ((iri-entry iri-entry)) tool-bar
(let* ((iri (trim-blanks (gui:text iri-entry))))
(open-iri iri main-window nil))))))
(defmethod initialize-instance :after ((object tool-bar)
&key (main-window nil) &allow-other-keys)
(with-accessors ((iri-entry iri-entry) (with-accessors ((iri-entry iri-entry)
(back-button back-button) (back-button back-button)
(reload-button reload-button) (reload-button reload-button)
@ -703,7 +711,10 @@
:master object :master object
:autocomplete-function (autocomplete-iri-clsr object))) :autocomplete-function (autocomplete-iri-clsr object)))
(setf back-button (make-instance 'gui:button :master object :image icons:*back*)) (setf back-button (make-instance 'gui:button :master object :image icons:*back*))
(setf reload-button (make-instance 'gui:button :master object :image icons:*refresh*)) (setf reload-button (make-instance 'gui:button
:master object
:image icons:*refresh*
:command (reload-iri-clsr main-window)))
(setf go-button (make-instance 'gui:button :master object :image icons:*open-iri*)) (setf go-button (make-instance 'gui:button :master object :image icons:*open-iri*))
(setf up-button (make-instance 'gui:button :master object :image icons:*up*)) (setf up-button (make-instance 'gui:button :master object :image icons:*up*))
(gui-goodies:attach-tooltips (back-button (_ "go back")) (gui-goodies:attach-tooltips (back-button (_ "go back"))
@ -784,7 +795,7 @@
(info-frame info-frame) (info-frame info-frame)
(info-text info-text) (info-text info-text)
(gemtext-widget gemtext-widget)) object (gemtext-widget gemtext-widget)) object
(setf tool-bar (make-instance 'tool-bar :master object)) (setf tool-bar (make-instance 'tool-bar :master object :main-window object))
(setf toc-frame (make-instance 'toc-frame :master object)) (setf toc-frame (make-instance 'toc-frame :master object))
(setf gemtext-widget (make-instance 'gui:scrolled-text (setf gemtext-widget (make-instance 'gui:scrolled-text
:master object :master object