mirror of https://codeberg.org/cage/tinmop/
- [GUI] refactored code related to the internal IRIs.
This commit is contained in:
parent
652a09177a
commit
4497feadd2
|
@ -166,3 +166,5 @@ General Public License for more details."
|
||||||
(define-constant +file-scheme+ "file" :test #'string=)
|
(define-constant +file-scheme+ "file" :test #'string=)
|
||||||
|
|
||||||
(define-constant +internal-scheme+ "about" :test #'string=)
|
(define-constant +internal-scheme+ "about" :test #'string=)
|
||||||
|
|
||||||
|
(define-constant +internal-path-bookmark+ "bookmark" :test #'string=)
|
||||||
|
|
|
@ -127,6 +127,3 @@
|
||||||
:accessor rows
|
:accessor rows
|
||||||
:initform '()
|
:initform '()
|
||||||
:initarg :rows)))
|
:initarg :rows)))
|
||||||
|
|
||||||
(defun make-internal-iri (path &optional (query nil) (fragment nil))
|
|
||||||
(iri:make-iri +internal-scheme+ nil nil nil path query fragment))
|
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
(in-package :client-main-window)
|
||||||
|
|
||||||
|
(defun make-internal-iri (path &optional (query nil) (fragment nil))
|
||||||
|
(iri:make-iri +internal-scheme+ nil nil nil path query fragment))
|
||||||
|
|
||||||
|
(defun internal-iri-bookmark ()
|
||||||
|
(make-internal-iri +internal-path-bookmark+))
|
||||||
|
|
||||||
|
(defun show-bookmarks-page (main-window)
|
||||||
|
(ev:with-enqueued-process-and-unblock ()
|
||||||
|
(let ((parsed-page (comm:make-request :gemini-generate-bookmark-page 1))
|
||||||
|
(iri (internal-iri-bookmark)))
|
||||||
|
(set-address-bar-text main-window (to-s iri))
|
||||||
|
(clean-gemtext main-window)
|
||||||
|
(collect-ir-lines (to-s iri) main-window parsed-page))))
|
|
@ -27,11 +27,4 @@
|
||||||
|
|
||||||
(defun show-bookmarks-clsr (main-window)
|
(defun show-bookmarks-clsr (main-window)
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(ev:with-enqueued-process-and-unblock ()
|
(client-main-window:show-bookmarks-page main-window)))
|
||||||
(let ((parsed-page (comm:make-request :gemini-generate-bookmark-page 1))
|
|
||||||
(iri (gui-goodies:make-internal-iri "bookmark")))
|
|
||||||
(client-main-window:set-address-bar-text main-window (to-s iri))
|
|
||||||
(client-main-window:clean-gemtext main-window)
|
|
||||||
(client-main-window::collect-ir-lines (to-s iri)
|
|
||||||
main-window
|
|
||||||
parsed-page)))))
|
|
||||||
|
|
|
@ -70,6 +70,7 @@
|
||||||
:+gemini-file-extension+
|
:+gemini-file-extension+
|
||||||
:+file-scheme+
|
:+file-scheme+
|
||||||
:+internal-scheme+
|
:+internal-scheme+
|
||||||
|
:+internal-path-bookmark+
|
||||||
;; GUI
|
;; GUI
|
||||||
:+minimum-padding+
|
:+minimum-padding+
|
||||||
:+ps-file-dialog-filter+
|
:+ps-file-dialog-filter+
|
||||||
|
@ -3382,8 +3383,7 @@
|
||||||
:password-dialog
|
:password-dialog
|
||||||
:table-frame
|
:table-frame
|
||||||
:tree
|
:tree
|
||||||
:rows
|
:rows))
|
||||||
:make-internal-iri))
|
|
||||||
|
|
||||||
(defpackage :client-menu-command
|
(defpackage :client-menu-command
|
||||||
(:use
|
(:use
|
||||||
|
@ -3498,7 +3498,10 @@
|
||||||
:set-address-bar-text
|
:set-address-bar-text
|
||||||
:set-bookmark-button-true
|
:set-bookmark-button-true
|
||||||
:set-bookmark-button-false
|
:set-bookmark-button-false
|
||||||
:clean-gemtext))
|
:clean-gemtext
|
||||||
|
:make-internal-iri
|
||||||
|
:internal-iri-bookmark
|
||||||
|
:show-bookmarks-page))
|
||||||
|
|
||||||
(defpackage :main
|
(defpackage :main
|
||||||
(:use
|
(:use
|
||||||
|
|
|
@ -170,6 +170,7 @@
|
||||||
(:file "stream-window")
|
(:file "stream-window")
|
||||||
(:file "bookmark-window")
|
(:file "bookmark-window")
|
||||||
(:file "menu-command")
|
(:file "menu-command")
|
||||||
|
(:file "internal-paths")
|
||||||
(:file "main-window")))
|
(:file "main-window")))
|
||||||
(:file "main")
|
(:file "main")
|
||||||
(:module tests
|
(:module tests
|
||||||
|
|
Loading…
Reference in New Issue