diff --git a/source/clog-body.lisp b/source/clog-body.lisp index 42a999e..0f9b65a 100644 --- a/source/clog-body.lisp +++ b/source/clog-body.lisp @@ -52,7 +52,7 @@ user close of connection / browser.")) (defmethod run ((obj clog-body)) (loop (if (validp obj) - (sleep 10) + (sleep 1) (return)))) ;;;;;;;;;;;;;;;;;;;;;;; diff --git a/tools/clog-builder-projects.lisp b/tools/clog-builder-projects.lisp index 89f8410..f02ff9a 100644 --- a/tools/clog-builder-projects.lisp +++ b/tools/clog-builder-projects.lisp @@ -51,42 +51,43 @@ (pprint n s)))))) (defun projects-rerender (panel) - (let* ((app (connection-data-item panel "builder-app-data")) - (sel (text-value (project-list panel))) - (sys (asdf:find-system (format nil "~A/tools" sel)))) - (dolist (n (asdf:module-components sys)) - (let ((name (format nil "~A" (asdf:component-relative-pathname n))) - (file-name (asdf:component-pathname n))) - (when (and (> (length name) 5) - (equal (subseq name (- (length name) 5)) ".clog")) - (let* ((win (create-gui-window panel :top 40 :left 225 - :width 645 :height 430)) - (box (create-panel-box-layout (window-content win) - :left-width 0 :right-width 0 - :top-height 33 :bottom-height 0)) - (content (center-panel box)) - (panel-id (html-id content)) - (render-file-name (format nil "~A~A.lisp" - (directory-namestring file-name) - (pathname-name file-name)))) - (setf-next-id content 1) - (setf (overflow content) :auto) - (init-control-list app panel-id) - (clrhash (get-control-list app panel-id)) - ;; preset in case of empty clog file - (setf (attribute content "data-clog-name") "empty-clog-file") - (setf (attribute content "data-clog-type") "clog-data") - (setf (attribute content "data-in-package") "clog-user") - (setf (attribute content "data-custom-slots") "") - (setf (inner-html content) - (or (read-file file-name) - "")) - (on-populate-loaded-window content :win win) - (setf (window-title win) (attribute content "data-clog-name")) - (write-file (render-clog-code content (bottom-panel box)) - render-file-name) - (window-close win) - (format t "~A -> ~A~%" file-name render-file-name))))))) + (let ((app (connection-data-item panel "builder-app-data")) + (sel (text-value (project-list panel)))) + (unless (equal sel "None") + (let ((sys (asdf:find-system (format nil "~A/tools" sel)))) + (dolist (n (asdf:module-components sys)) + (let ((name (format nil "~A" (asdf:component-relative-pathname n))) + (file-name (asdf:component-pathname n))) + (when (and (> (length name) 5) + (equal (subseq name (- (length name) 5)) ".clog")) + (let* ((win (create-gui-window panel :top 40 :left 225 + :width 645 :height 430)) + (box (create-panel-box-layout (window-content win) + :left-width 0 :right-width 0 + :top-height 33 :bottom-height 0)) + (content (center-panel box)) + (panel-id (html-id content)) + (render-file-name (format nil "~A~A.lisp" + (directory-namestring file-name) + (pathname-name file-name)))) + (setf-next-id content 1) + (setf (overflow content) :auto) + (init-control-list app panel-id) + (clrhash (get-control-list app panel-id)) + ;; preset in case of empty clog file + (setf (attribute content "data-clog-name") "empty-clog-file") + (setf (attribute content "data-clog-type") "clog-data") + (setf (attribute content "data-in-package") "clog-user") + (setf (attribute content "data-custom-slots") "") + (setf (inner-html content) + (or (read-file file-name) + "")) + (on-populate-loaded-window content :win win) + (setf (window-title win) (attribute content "data-clog-name")) + (write-file (render-clog-code content (bottom-panel box)) + render-file-name) + (window-close win) + (format t "~A -> ~A~%" file-name render-file-name))))))))) (defun projects-populate (panel) (let ((app (connection-data-item panel "builder-app-data")) diff --git a/tools/projects.clog b/tools/projects.clog index 9b743a6..4d7dc30 100644 --- a/tools/projects.clog +++ b/tools/projects.clog @@ -1,11 +1,13 @@ -Current ProjectCurrent ProjectEdit .asdEntry Point - package:functionRunNewUnloadReloadRerenderRuntime System(double click to launch)UnloadReloadRerenderRuntime System(double click to launch)Add .lispCurrent ProjectEdit .asdEntry Point - package:functionRunNewUnloadReloadRerenderRuntime System(double click to launch)Add .lispRemoveView DirRuntime Dependecies(double click to launch)AddRemoveDesign Time System (/tools)Add .clogAdd .lispRemoveDesign DependeciesAddRemovePlugin" + "Current ProjectEdit .asdEntry Point - package:functionRunNewUnloadReloadRerenderRuntime System(double click to launch)Add .lispRemoveView DirRuntime Dependecies(double click to launch)AddRemoveDesign Time System (/tools)Add .clogAdd .lispRemoveDesign DependeciesAddRemovePlugin" :hidden hidden :class class :html-id html-id :auto-place auto-place) 'projects))) (setf (slot-value panel 'design-plugin) - (attach-as-child clog-obj "CLOGB3871045230" :clog-type + (attach-as-child clog-obj "CLOGB3871065936" :clog-type 'clog:clog-button :new-id t)) (setf (slot-value panel 'design-del-dep) - (attach-as-child clog-obj "CLOGB3871045229" :clog-type + (attach-as-child clog-obj "CLOGB3871065935" :clog-type 'clog:clog-button :new-id t)) (setf (slot-value panel 'design-add-dep) - (attach-as-child clog-obj "CLOGB3871045228" :clog-type + (attach-as-child clog-obj "CLOGB3871065934" :clog-type 'clog:clog-button :new-id t)) (setf (slot-value panel 'design-deps) - (attach-as-child clog-obj "CLOGB3871045227" :clog-type + (attach-as-child clog-obj "CLOGB3871065933" :clog-type 'clog:clog-select :new-id t)) (setf (slot-value panel 'design-deps-label) - (attach-as-child clog-obj "CLOGB3871045226" :clog-type + (attach-as-child clog-obj "CLOGB3871065932" :clog-type 'clog:clog-label :new-id t)) (setf (slot-value panel 'designtime-delete) - (attach-as-child clog-obj "CLOGB3871045225" :clog-type + (attach-as-child clog-obj "CLOGB3871065931" :clog-type 'clog:clog-button :new-id t)) (setf (slot-value panel 'designtime-add-lisp) - (attach-as-child clog-obj "CLOGB3871045224" :clog-type + (attach-as-child clog-obj "CLOGB3871065930" :clog-type 'clog:clog-button :new-id t)) (setf (slot-value panel 'designtime-add-clog) - (attach-as-child clog-obj "CLOGB3871045223" :clog-type + (attach-as-child clog-obj "CLOGB3871065929" :clog-type 'clog:clog-button :new-id t)) (setf (slot-value panel 'designtime-list) - (attach-as-child clog-obj "CLOGB3871045222" :clog-type + (attach-as-child clog-obj "CLOGB3871065928" :clog-type 'clog:clog-select :new-id t)) (setf (slot-value panel 'designtime-label) - (attach-as-child clog-obj "CLOGB3871045220" :clog-type + (attach-as-child clog-obj "CLOGB3871065927" :clog-type 'clog:clog-label :new-id t)) (setf (slot-value panel 'runtime-del-dep) - (attach-as-child clog-obj "CLOGB3871045219" :clog-type + (attach-as-child clog-obj "CLOGB3871065926" :clog-type 'clog:clog-button :new-id t)) (setf (slot-value panel 'runtime-add-dep) - (attach-as-child clog-obj "CLOGB3871045218" :clog-type + (attach-as-child clog-obj "CLOGB3871065925" :clog-type 'clog:clog-button :new-id t)) (setf (slot-value panel 'runtime-deps) - (attach-as-child clog-obj "CLOGB3871045217" :clog-type + (attach-as-child clog-obj "CLOGB3871065924" :clog-type 'clog:clog-select :new-id t)) (setf (slot-value panel 'dbl-click2) - (attach-as-child clog-obj "CLOGB3871045221" :clog-type + (attach-as-child clog-obj "CLOGB3871065923" :clog-type 'clog:clog-label :new-id t)) (setf (slot-value panel 'runtime-deps-label) - (attach-as-child clog-obj "CLOGB3871045216" :clog-type + (attach-as-child clog-obj "CLOGB3871065922" :clog-type 'clog:clog-label :new-id t)) (setf (slot-value panel 'runtime-dir) - (attach-as-child clog-obj "CLOGB387104523944" :clog-type + (attach-as-child clog-obj "CLOGB3871065921" :clog-type 'clog:clog-button :new-id t)) (setf (slot-value panel 'runtime-delete) - (attach-as-child clog-obj "CLOGB3871045215" :clog-type + (attach-as-child clog-obj "CLOGB3871065920" :clog-type 'clog:clog-button :new-id t)) (setf (slot-value panel 'runtime-add-lisp) - (attach-as-child clog-obj "CLOGB3871045214" :clog-type + (attach-as-child clog-obj "CLOGB3871065919" :clog-type 'clog:clog-button :new-id t)) (setf (slot-value panel 'runtime-list) - (attach-as-child clog-obj "CLOGB3871045213" :clog-type + (attach-as-child clog-obj "CLOGB3871065918" :clog-type 'clog:clog-select :new-id t)) (setf (slot-value panel 'dbl-click1) - (attach-as-child clog-obj "CLOGB3871045212" :clog-type + (attach-as-child clog-obj "CLOGB3871065917" :clog-type 'clog:clog-label :new-id t)) (setf (slot-value panel 'runtime-label) - (attach-as-child clog-obj "CLOGB3871045211" :clog-type + (attach-as-child clog-obj "CLOGB3871065916" :clog-type 'clog:clog-label :new-id t)) (setf (slot-value panel 'file-group) - (attach-as-child clog-obj "CLOGB3871045210" :clog-type + (attach-as-child clog-obj "CLOGB3871065915" :clog-type 'clog:clog-div :new-id t)) (setf (slot-value panel 'rerender-button) - (attach-as-child clog-obj "CLOGB3871045209" :clog-type + (attach-as-child clog-obj "CLOGB3871065914" :clog-type 'clog:clog-button :new-id t)) (setf (slot-value panel 'reload-project-button) - (attach-as-child clog-obj "CLOGB3871045208" :clog-type + (attach-as-child clog-obj "CLOGB3871065913" :clog-type 'clog:clog-button :new-id t)) (setf (slot-value panel 'unload-project-button) - (attach-as-child clog-obj "CLOGB3871045207" :clog-type + (attach-as-child clog-obj "CLOGB3871065912" :clog-type 'clog:clog-button :new-id t)) (setf (slot-value panel 'new-project-button) - (attach-as-child clog-obj "CLOGB3871045206" :clog-type + (attach-as-child clog-obj "CLOGB3871065911" :clog-type 'clog:clog-button :new-id t)) (setf (slot-value panel 'run-button) - (attach-as-child clog-obj "CLOGB3871045205" :clog-type + (attach-as-child clog-obj "CLOGB3871065910" :clog-type 'clog:clog-button :new-id t)) (setf (slot-value panel 'entry-point) - (attach-as-child clog-obj "CLOGB3871045204" :clog-type + (attach-as-child clog-obj "CLOGB3871065909" :clog-type 'clog:clog-form-element :new-id t)) (setf (slot-value panel 'entry-point-label) - (attach-as-child clog-obj "CLOGB3871045203" :clog-type + (attach-as-child clog-obj "CLOGB3871065908" :clog-type 'clog:clog-label :new-id t)) (setf (slot-value panel 'edit-asd) - (attach-as-child clog-obj "CLOGB3871045202" :clog-type + (attach-as-child clog-obj "CLOGB3871065907" :clog-type 'clog:clog-button :new-id t)) (setf (slot-value panel 'project-list) - (attach-as-child clog-obj "CLOGB3871045201" :clog-type + (attach-as-child clog-obj "CLOGB3871065906" :clog-type 'clog:clog-select :new-id t)) (setf (slot-value panel 'projects-label) - (attach-as-child clog-obj "CLOGB3871045200" :clog-type + (attach-as-child clog-obj "CLOGB3871065905" :clog-type 'clog:clog-label :new-id t)) (let ((target (projects-label panel))) (declare (ignorable target)) @@ -204,15 +204,17 @@ (lambda (target) (declare (ignorable target)) (let ((sel (text-value (project-list panel)))) - (asdf/system-registry:clear-system sel) - (setf (text-value (project-list panel)) "None") - (projects-populate panel)))) + (unless (equal sel "None") + (asdf/system-registry:clear-system sel) + (setf (text-value (project-list panel)) "None") + (projects-populate panel))))) (clog:set-on-click (reload-project-button panel) (lambda (target) (declare (ignorable target)) (let ((sel (text-value (project-list panel)))) - (asdf/system-registry:clear-system sel) - (projects-populate panel)))) + (unless (equal sel "None") + (asdf/system-registry:clear-system sel) + (projects-populate panel))))) (clog:set-on-click (rerender-button panel) (lambda (target) (declare (ignorable target))