add alternate dir for projects

This commit is contained in:
David Botton 2024-07-17 08:46:39 -04:00
parent a42a99b37d
commit 604ae6af47
5 changed files with 85 additions and 14 deletions

View file

@ -1 +1 @@
sbcl --eval "(ql:quickload :<%= (@ sys-name) %>/tools)" --eval "(clog-tools:clog-builder :project :<%= (@ sys-name) %> :port 0 :app t)" sbcl --eval "(pushnew (uiop:getcwd) ql:*local-project-directories* :test #'equalp)"--eval "(ql:quickload :<%= (@ sys-name) %>/tools)" --eval "(clog-tools:clog-builder :project :<%= (@ sys-name) %> :port 0 :app t)"

View file

@ -1 +1 @@
sbcl --eval "(ql:quickload :<%= (@ sys-name) %>/tools)" --eval "(clog-tools:clog-builder :project :<%= (@ sys-name) %> :port 0 :app t)" sbcl --eval "(pushnew (uiop:getcwd) ql:*local-project-directories* :test #'equalp)" --eval "(ql:quickload :<%= (@ sys-name) %>/tools)" --eval "(clog-tools:clog-builder :project :<%= (@ sys-name) %> :port 0 :app t)"

View file

@ -90,8 +90,7 @@ create-div's"
(asdf:system-source-directory :clog) (asdf:system-source-directory :clog)
(getf tmpl-rec :www)))) (getf tmpl-rec :www))))
(setf (hiddenp (win panel)) t) (setf (hiddenp (win panel)) t)
(input-dialog (input-dialog (win panel) "Enter new system name:"
(win panel) "Enter new system name:"
(lambda (sys-name) (lambda (sys-name)
(cond (sys-name (cond (sys-name
(let* ((*default-title-class* *builder-title-class*) (let* ((*default-title-class* *builder-title-class*)

View file

@ -1,2 +1,33 @@
<data id="I3928741146" data-in-package="clog-tools" data-custom-slots="(on-done :accessor on-done :initform nil)" data-clog-next-id="5" data-clog-title="project-dir"></data><div data-clog-type="flex-col" data-clog-name="frame" style="display: flex; flex-direction: column; box-sizing: content-box; position: absolute; inset: 10px 10px 10px 11px; justify-content: normal; align-items: center;"><select data-clog-type="listbox" size="4" data-clog-name="project-list" style="box-sizing: content-box; position: static; width: 90%; height: 80%;" data-on-create="(add-select-options (project-list panel) (projects-local-directories)) <data id="I3930209047" data-in-package="clog-tools"
(setf (value (project-list panel)) (car (projects-local-directories)))" data-on-double-click="(funcall (on-done panel) panel)"></select><button data-clog-type="button" data-clog-name="select-button" style="box-sizing: content-box; position: static;" data-on-click="(funcall (on-done panel) panel)" class="w3-margin">Select Project Directory</button></div> data-custom-slots="(on-done :accessor on-done :initform nil)"
data-clog-next-id="6" data-clog-title="project-dir"></data>
<div data-clog-type="flex-col" data-clog-name="frame"
style="display: flex; flex-direction: column; box-sizing: content-box; position: absolute; inset: 10px; justify-content: normal; align-items: center;">
<select data-clog-type="listbox" size="4" data-clog-name="project-list"
style="box-sizing: content-box; position: static; width: 90%; height: 80%;"
data-on-create="(add-select-options (project-list panel) (projects-local-directories))
(setf (value (project-list panel)) (car (projects-local-directories)))"
data-on-double-click="(funcall (on-done panel) panel)"></select><button
data-clog-type="button" data-clog-name="select-button"
style="box-sizing: content-box; position: static; width: 220px;"
data-on-click="(funcall (on-done panel) panel)" class="w3-margin">Select
Project Directory</button><button data-clog-type="button"
data-clog-name="other-button"
style="box-sizing: content-box; position: static; left: 31px; top: 3px; width: 220px; height: 22px;"
class="" data-on-click="(let ((*default-title-class* *builder-title-class*)
(*default-border-class* *builder-border-class*))
(input-dialog panel &quot;Add Project Directory&quot;
(lambda (result)
(when result
(pushnew result ql:*local-project-directories* :test #'equalp)
(add-select-option (project-list panel) result result :selected t)
(let ((*default-title-class* *builder-title-class*)
(*default-border-class* *builder-border-class*))
(alert-dialog panel (format nil &quot;~A added to ql:*local-project-directories* temporarily.~% ~
Use the generated run-ql or run-ocicl scripts in the created project ~%
or add to Options -> Edit preferences.lisp to work with your project in ~%
future.&quot;
result)
:width 500 :height 250))))))
">Add Alternative Directory</button>
</div>

View file

@ -1,26 +1,42 @@
;;;; CLOG Builder generated code - modify original .clog file and rerender ;;;; CLOG Builder generated code - modify original .clog file and rerender
(in-package :clog-tools) (in-package :clog-tools)
(defclass project-dir (clog:clog-panel) (defclass project-dir (clog:clog-panel)
((select-button :reader select-button) ((other-button :reader other-button)
(select-button :reader select-button)
(project-list :reader project-list) (frame :reader frame) (project-list :reader project-list) (frame :reader frame)
(on-done :accessor on-done :initform nil))) (on-done :accessor on-done :initform nil)))
(defun create-project-dir (defun create-project-dir
(clog-obj &key (hidden nil) (class nil) (html-id nil) (auto-place t)) (clog-obj &key hidden class style html-id (auto-place t))
(let ((panel (let ((panel
(change-class (change-class
(clog:create-div clog-obj :content (clog:create-div clog-obj :content
"<div style=\"display: flex; flex-direction: column; box-sizing: content-box; position: absolute; inset: 10px 10px 10px 11px; justify-content: normal; align-items: center;\" id=\"CLOGB3928741015\" data-clog-name=\"frame\"><select size=\"4\" style=\"box-sizing: content-box; position: static; width: 90%; height: 80%;\" id=\"CLOGB3928741016\" data-clog-name=\"project-list\"></select><button style=\"box-sizing: content-box; position: static;\" class=\"w3-margin\" id=\"CLOGB3928741017\" data-clog-name=\"select-button\">Select Project Directory</button></div>" "<div style=\"display: flex; flex-direction: column; box-sizing: content-box; position: absolute; inset: 10px; justify-content: normal; align-items: center;\"
:hidden hidden :class class :html-id html-id id=\"CLOGB3930207069\" data-clog-name=\"frame\">
:auto-place auto-place) <select size=\"4\"
style=\"box-sizing: content-box; position: static; width: 90%; height: 80%;\"
id=\"CLOGB3930207070\" data-clog-name=\"project-list\"></select><button
style=\"box-sizing: content-box; position: static; width: 220px;\"
class=\"w3-margin\" id=\"CLOGB3930207071\"
data-clog-name=\"select-button\">Select
Project Directory</button><button
style=\"box-sizing: content-box; position: static; left: 31px; top: 3px; width: 220px; height: 22px;\"
class=\"\" id=\"CLOGB3930207072\" data-clog-name=\"other-button\">Add
Alternative Directory</button>
</div>"
:hidden hidden :class class :style style :html-id
html-id :auto-place auto-place)
'project-dir))) 'project-dir)))
(setf (slot-value panel 'other-button)
(attach-as-child clog-obj "CLOGB3930207072" :clog-type
'clog:clog-button :new-id t))
(setf (slot-value panel 'select-button) (setf (slot-value panel 'select-button)
(attach-as-child clog-obj "CLOGB3928741017" :clog-type (attach-as-child clog-obj "CLOGB3930207071" :clog-type
'clog:clog-button :new-id t)) 'clog:clog-button :new-id t))
(setf (slot-value panel 'project-list) (setf (slot-value panel 'project-list)
(attach-as-child clog-obj "CLOGB3928741016" :clog-type (attach-as-child clog-obj "CLOGB3930207070" :clog-type
'clog:clog-select :new-id t)) 'clog:clog-select :new-id t))
(setf (slot-value panel 'frame) (setf (slot-value panel 'frame)
(attach-as-child clog-obj "CLOGB3928741015" :clog-type (attach-as-child clog-obj "CLOGB3930207069" :clog-type
'clog:clog-div :new-id t)) 'clog:clog-div :new-id t))
(let ((target (project-list panel))) (let ((target (project-list panel)))
(declare (ignorable target)) (declare (ignorable target))
@ -34,4 +50,29 @@
(lambda (target) (lambda (target)
(declare (ignorable target)) (declare (ignorable target))
(funcall (on-done panel) panel))) (funcall (on-done panel) panel)))
(clog:set-on-click (other-button panel)
(lambda (target)
(declare (ignorable target))
(let ((*default-title-class* *builder-title-class*)
(*default-border-class* *builder-border-class*))
(input-dialog panel "Add Project Directory"
(lambda (result)
(when result
(pushnew result
quicklisp-client:*local-project-directories*
:test #'equalp)
(add-select-option (project-list panel) result
result :selected t)
(let ((*default-title-class*
*builder-title-class*)
(*default-border-class*
*builder-border-class*))
(alert-dialog panel
(format nil
"~A added to ql:*local-project-directories* temporarily.~% ~
Use the generated run-ql or run-ocicl scripts in the created project ~%
or add to Options -> Edit preferences.lisp to work with your project in ~%
future."
result)
:width 500 :height 250))))))))
panel)) panel))