choose-dir

This commit is contained in:
2026-02-23 23:47:52 +01:00
parent 6ada260fef
commit 3b07bfb16d
3 changed files with 22 additions and 10 deletions

View File

@@ -665,11 +665,15 @@
)
(define/public (choose-dir caption base-dir)
(let ((r (ww-choose-dir win-id caption base-dir)))
(ww-debug (format "choose-dir: ~a" r))
(if (eq? r 'cmd-nok)
#f
r)))
(let ((bdir (string-trim base-dir)))
(when (or (string=? bdir "") (string=? bdir ".") (string=? bdir ".."))
(set! bdir (path->string (find-system-path 'home-dir))))
(ww-debug (format "ww-choose-dir ~a ~a ~a" win-id caption bdir))
(let ((r (ww-choose-dir win-id caption bdir)))
(ww-debug (format "choose-dir: ~a" r))
(if (eq? r 'cmd-nok)
#f
r))))
(define/public (dir-choosen handle choosen dir)
(ww-debug (format "dir-choosen: handle=~a, choosen=~a, dir=~a" handle choosen dir))

View File

@@ -222,7 +222,10 @@
(payload* (substring evt (string-length (list-ref m 0))))
(payload (if (string=? payload* "")
(make-hash)
(with-input-from-string (substring payload* 1) read-json)))
(begin
(write payload*)(newline)
(with-input-from-string (substring payload* 1) read-json)))
)
)
(if (eq? evt-handler #f)
(ww-error (format "process-event: no event handler to handle event ~a" evt))