some revisions

This commit is contained in:
polos 2016-12-29 17:07:48 +01:00
parent 929f28d768
commit b59821c838
8 changed files with 71 additions and 75 deletions

View file

@ -13,7 +13,7 @@
(setf *lib-reloaded* 'show-current-apropos) (setf *lib-reloaded* 'show-current-apropos)
(defun show-current-apropos (variable plugin) (defun show-current-apropos (variable plugin)
(qset (qapp) "quitOnLastWindowClosed" nil) (! "setQuitOnLastWindowClosed" "QGuiApplication" nil)
(let ((obj (symbol-value variable))) (let ((obj (symbol-value variable)))
(assert (qt-object-p obj)) (assert (qt-object-p obj))
(qmsg (with-output-to-string (*standard-output*) (qmsg (with-output-to-string (*standard-output*)

View file

@ -1,3 +1,4 @@
QT += widgets
TEMPLATE = app TEMPLATE = app
CONFIG += no_keywords release CONFIG += no_keywords release
CONFIG += console CONFIG += console

View file

@ -1,7 +1,7 @@
#undef SLOT #undef SLOT
#include <ecl/ecl.h> #include <ecl/ecl.h>
#include <QCoreApplication> #include <QApplication>
#include <QTextCodec> #include <QTextCodec>
#include "eql.h" #include "eql.h"
@ -18,7 +18,7 @@ int main(int argc, char** argv) {
EQL::ini(argv); EQL::ini(argv);
QCoreApplication qapp(argc, argv); QApplication qapp(argc, argv);
QTextCodec* utf8 = QTextCodec::codecForName("UTF-8"); QTextCodec* utf8 = QTextCodec::codecForName("UTF-8");
QTextCodec::setCodecForLocale(utf8); QTextCodec::setCodecForLocale(utf8);

View file

@ -66,7 +66,7 @@
(ini-streams) (ini-streams)
(set-debugger-hook) (set-debugger-hook)
(setf si::*tpl-print-current-hook* 'send-file-position) (setf si::*tpl-print-current-hook* 'send-file-position)
(qset (qapp) "quitOnLastWindowClosed" nil) (! "setQuitOnLastWindowClosed" "QGuiApplication" nil)
(qconnect *server* "newConnection()" 'new-client-connection) (qconnect *server* "newConnection()" 'new-client-connection)
(multiple-value-bind (eql-version qt-version) (multiple-value-bind (eql-version qt-version)
(qversion) (qversion)
@ -318,11 +318,5 @@
(push block data))) (push block data)))
(unless (zerop size) (unless (zerop size)
(values (read-from-string (qfrom-utf8 (apply 'concatenate 'vector (nreverse data)))))))))))) (values (read-from-string (qfrom-utf8 (apply 'concatenate 'vector (nreverse data))))))))))))
#|
(defun %log (str)
(with-open-file (out "/tmp/log.txt" :direction :output :if-does-not-exist :create :if-exists :append)
(format out "### ~A~%" (subseq str 0 (min (length str) 80)))))
|#
(ini) (ini)

View file

@ -1,51 +1,51 @@
#undef SLOT #undef SLOT
#include <ecl/ecl.h> #include <ecl/ecl.h>
#include <QApplication> #include <QApplication>
#include <QTextCodec> #include <QTextCodec>
#include <QSettings> #include <QSettings>
#include <QTranslator> #include <QTranslator>
#include "eql.h" #include "eql.h"
extern "C" void ini_app(cl_object); extern "C" void ini_app(cl_object);
int catch_all_qexec() { int catch_all_qexec() {
int ret = 0; int ret = 0;
CL_CATCH_ALL_BEGIN(ecl_process_env()) { CL_CATCH_ALL_BEGIN(ecl_process_env()) {
ret = QApplication::exec(); } ret = QApplication::exec(); }
CL_CATCH_ALL_END; CL_CATCH_ALL_END;
return ret; } return ret; }
int main(int argc, char** argv) { int main(int argc, char** argv) {
EQL::ini(argv); // best initialized here EQL::ini(argv); // best initialized here
QApplication qapp(argc, argv); QApplication qapp(argc, argv);
QTextCodec* utf8 = QTextCodec::codecForName("UTF-8"); QTextCodec* utf8 = QTextCodec::codecForName("UTF-8");
QTextCodec::setCodecForLocale(utf8); QTextCodec::setCodecForLocale(utf8);
// Hint: use QSettings or similar to store your language settings. // Hint: use QSettings or similar to store your language settings.
// It is put here because it must load _before_ the Lisp code is executed. // It is put here because it must load _before_ the Lisp code is executed.
// You'll probably find a more elegant solution by yourself. // You'll probably find a more elegant solution by yourself.
QString language("es"); // example: spanish QString language("es"); // example: spanish
QTranslator tr, trQt; QTranslator tr, trQt;
if(tr.load("eql_" + language)) { if(tr.load("eql_" + language)) {
qapp.installTranslator(&tr); qapp.installTranslator(&tr);
if(trQt.load("qt_" + language)) { if(trQt.load("qt_" + language)) {
qapp.installTranslator(&trQt); }} qapp.installTranslator(&trQt); }}
EQL eql; EQL eql;
/* /*
#ifdef Q_OS_WINDOWS #ifdef Q_OS_WINDOWS
// print output would crash program // print output would crash program
eql.ignoreIOStreams(); // TODO eql.ignoreIOStreams(); // TODO
#endif #endif
*/ */
eql.exec(ini_app, // see make.lisp eql.exec(ini_app, // see make.lisp
"(start)", // initial form to be evaluated (optional) "(start)", // initial form to be evaluated (optional)
"example"); // package name (optional) "example"); // package name (optional)
return catch_all_qexec(); } // closing the main/last window will quit the program return catch_all_qexec(); } // closing the main/last window will quit the program

View file

@ -1,13 +1,13 @@
QT += widgets printsupport uitools QT += widgets printsupport uitools
TEMPLATE = app TEMPLATE = app
CONFIG += no_keywords release CONFIG += no_keywords release
INCLUDEPATH += ../src INCLUDEPATH += ../src
LIBS += -lecl -L. -lmy_lib -L.. -leql5 LIBS += -lecl -L. -lmy_lib -L.. -leql5
TARGET = my_app TARGET = my_app
DESTDIR = ./ DESTDIR = ./
OBJECTS_DIR = ./tmp/ OBJECTS_DIR = ./tmp/
MOC_DIR = ./tmp/ MOC_DIR = ./tmp/
include(../src/windows.pri) include(../src/windows.pri)
SOURCES += main.cpp SOURCES += main.cpp

View file

@ -42,6 +42,7 @@ QString EQL::home() {
/* /*
void EQL::ignoreIOStreams() { void EQL::ignoreIOStreams() {
// [Windows] print output would cause the executable to crash // [Windows] print output would cause the executable to crash
// TODO
} }
*/ */

View file

@ -1,6 +1,6 @@
;;; Mark error position (when loading a file in ECL) ;;; Mark error position (when loading a file in ECL)
;;; ;;;
;;; example: eql mark file.lisp 5775 (will insert "#|TODO|#") ;;; example: eql5 mark file.lisp 5775 (will insert "#|TODO|#")
(let* ((args (|arguments.QCoreApplication|)) (let* ((args (|arguments.QCoreApplication|))
(file (third args)) (file (third args))