revision
This commit is contained in:
parent
47e64a8fad
commit
81599b7b49
1 changed files with 7 additions and 11 deletions
|
|
@ -16,8 +16,6 @@
|
|||
|
||||
(in-package :qml-ui-variables)
|
||||
|
||||
(defparameter *warn-if-exists* nil)
|
||||
|
||||
(defparameter *qml-items* (qfind-children qml:*quick-view*))
|
||||
|
||||
(defun class-name* (item)
|
||||
|
|
@ -116,18 +114,16 @@
|
|||
t)))
|
||||
|
||||
(defun run ()
|
||||
(let ((ui "lisp/ui-vars.lisp"))
|
||||
(when (and *warn-if-exists*
|
||||
(probe-file ui)
|
||||
(/= |QMessageBox.Yes|
|
||||
(|question.QMessageBox| nil "Replace?"
|
||||
(format nil "File ~S already exists.<br>Replace it?" ui)
|
||||
(logior |QMessageBox.Yes| |QMessageBox.Cancel|))))
|
||||
(return-from run))
|
||||
(let ((ui "lisp/ui-vars.lisp.try"))
|
||||
(ensure-directories-exist ui)
|
||||
(with-open-file (out ui :direction :output :if-exists :supersede)
|
||||
(if (write-ui-file out)
|
||||
(format t "~%UI file generated: ~S~%~%" ui)
|
||||
(progn
|
||||
(let ((new (subseq ui 0 (- (length ui) #.(length ".try")))))
|
||||
(when (probe-file new)
|
||||
(delete-file new))
|
||||
(rename-file ui (file-namestring new))
|
||||
(format t "~%UI file generated: ~S~%~%" new)))
|
||||
(format t "~%File not generated, please correct names and try again.~%~%")))))
|
||||
|
||||
(run)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue