revisions

This commit is contained in:
pls.153 2022-03-12 17:58:00 +01:00
parent caca998979
commit 052d7c2a97
3 changed files with 36 additions and 12 deletions

View file

@ -65,3 +65,11 @@ The best example to take as a template for development on mobile is
[examples/advanced-qml-auto-reload](examples/advanced-qml-auto-reload).
Please see `readme` and `readme-build` of that example.
iOS icons
---------
Since adding an app icon requires an asset catalog with many different sizes,
it's convenient to automate this process. In the App Store you find 'Asset
Catalog Creator', which is free for basic use like creating app icons.

View file

@ -20,10 +20,16 @@
#-interpreter #.(remote-ip))
#+(or android ios)
(defun load-on-reloaded ()
(defun load* (file)
(load (make-string-input-stream
(funcall (%sym 'curl :qml)
(x:cc *remote-ip* "lisp/qml-reload/on-reloaded.lisp")))))
(x:cc *remote-ip* file)))))
(export 'load*)
#+(or android ios)
(defun load-on-reloaded ()
(load* "lisp/qml-reload/on-reloaded.lisp"))
#+(or android ios)
(defun qml:view-status-changed (status)
@ -33,8 +39,11 @@
#+(or android ios)
(defun reload-main-p ()
(or *reload-all*
(string= "main.qml" *edited-file*)))
(prog1
(or *reload-all*
(string= "main.qml" *edited-file*))
(when (eql :once *reload-all*)
(setf *reload-all* nil))))
#+(or android ios)
(let ((load t)
@ -45,10 +54,11 @@
(setf load nil)
(require :ecl-curl)
(load "curl"))
(let ((curr/file (ignore-errors (x:split (funcall (%sym 'curl :qml)
(x:cc *remote-ip*
"cgi-bin/qml-last-modified.py"))
#.(coerce (list #\Return #\Newline) 'string)))))
(let ((curr/file (ignore-errors
(x:split (funcall (%sym 'curl :qml)
(x:cc *remote-ip*
"cgi-bin/qml-last-modified.py"))
#.(coerce (list #\Return #\Newline) 'string)))))
(when (= 2 (length curr/file))
(destructuring-bind (curr file)
curr/file
@ -62,7 +72,7 @@
(let ((src (qget *quick-view* |source|)))
;; this causes an initial reload of everything
(qset *quick-view* |source| (subseq src #.(length "qrc:///")))
(load-on-reloaded)))
(setf *reload-all* :once)))
(if (reload-main-p)
(qml:reload)
(qjs |reload| *edited-file*)))

View file

@ -15,12 +15,18 @@
(defvar *remote-ip* #+interpreter nil
#-interpreter #.(remote-ip))
#+(or android ios)
(defun load* (file)
(load (make-string-input-stream
(funcall (%sym 'curl :qml)
(x:cc *remote-ip* file)))))
(export 'load*)
#+(or android ios)
(defun qml:view-status-changed (status)
(when (= 1 status)
(load (make-string-input-stream
(funcall (%sym 'curl :qml)
(x:cc *remote-ip* "lisp/qml-reload/on-reloaded.lisp"))))))
(load* "lisp/qml-reload/on-reloaded.lisp")))
#+(or android ios)
(let ((load t)