pas2jsdsgn: started using compileserver

git-svn-id: trunk@62127 -
This commit is contained in:
mattias 2019-10-27 09:02:17 +00:00
parent 09588f6575
commit b78a86c467
19 changed files with 527 additions and 196 deletions

2
.gitattributes vendored
View File

@ -11291,7 +11291,7 @@ packager/globallinks/multithreadprocslaz-1.2.1.lpl svneol=native#text/plain
packager/globallinks/notlcldesigner-0.lpl svneol=native#text/plain
packager/globallinks/onlinepackagemanager-1.0.1.2.lpl svneol=native#text/plain
packager/globallinks/packagetabs-0.1.1.lpl svneol=native#text/plain
packager/globallinks/pas2jsdsgn-1.0.1.lpl svneol=native#text/plain
packager/globallinks/pas2jsdsgn-1.0.2.lpl svneol=native#text/plain
packager/globallinks/pascalscript-0.0.0.1.lpl svneol=native#text/plain
packager/globallinks/pascalscriptfcl-0.0.0.1.lpl svneol=native#text/plain
packager/globallinks/pochecker-1.lpl svneol=native#text/plain

View File

@ -71,7 +71,7 @@ end;
procedure TPasJSWebserverProcessesForm.Localize;
begin
LCount.Caption:=Format(SWebserversCount, ['0']);
LCount.Caption:=SafeFormat(SWebserversCount, ['0']);
Caption:=SWebserversCaption;
With LVProcesses do
begin
@ -144,10 +144,10 @@ begin
if (C=Nil) or (C.ServerInstances=Nil) or (C.ServerInstances.Count=0) then
begin
LVProcesses.Items.Clear;
LCount.Caption:=Format(SWebserversCount, ['0']);
LCount.Caption:=SafeFormat(SWebserversCount, ['0']);
exit;
end;
LCount.Caption:=Format(SWebserversCount, [IntToStr(C.ServerInstances.Count)]);
LCount.Caption:=SafeFormat(SWebserversCount, [IntToStr(C.ServerInstances.Count)]);
With LVProcesses.Items do
try
BeginUpdate;

View File

@ -15,8 +15,9 @@ msgstr ""
msgid "Browse"
msgstr ""
#: strpas2jsdesign.pjsdbrowsertousewhenopeninghtmlpage
msgid "Browser to use when opening HTML page"
#: strpas2jsdesign.pjsdbrowsertoopenhtmlpage
msgctxt "strpas2jsdesign.pjsdbrowsertoopenhtmlpage"
msgid "Browser to open HTML page, macro $(Pas2JSBrowser)"
msgstr ""
#: strpas2jsdesign.pjsdcreateinitialhtmlpage
@ -82,18 +83,42 @@ msgstr ""
msgid "Pas2JS selected NodeJS excutable"
msgstr ""
#: strpas2jsdesign.pjsdpas2jswebserverexe
msgid "Pas2JS webserver executable"
msgstr ""
#: strpas2jsdesign.pjsdpas2jswebserverport
msgid "Pas2JS webserver port"
msgstr ""
#: strpas2jsdesign.pjsdpathof
#, object-pascal-format
msgid "Path of %s"
msgstr ""
#: strpas2jsdesign.pjsdpathofnodejsexecutable
msgid "Path of Node.js executable"
msgid "Path of Node.js executable, macro $(Pas2JSNodeJS)"
msgstr ""
#: strpas2jsdesign.pjsdportnumberstostartallocatingfrom
#: strpas2jsdesign.pjsdpathofpas2jsexecutablemacropas2js
msgid "Path of pas2js executable, macro $(pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdpathofxmacropas2js
#, object-pascal-format
msgid "Port numbers to start allocating from %s"
msgctxt "strpas2jsdesign.pjsdpathofxmacropas2js"
msgid "Path of %s, macro $(pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdpathofxmacropas2jswebserver
#, object-pascal-format
msgctxt "strpas2jsdesign.pjsdpathofxmacropas2jswebserver"
msgid "Path of %s, macro $(Pas2JSWebServer)"
msgstr ""
#: strpas2jsdesign.pjsdportnumbertostartallocatingfrom
#, object-pascal-format
msgid "Port number to start allocating from %s"
msgstr ""
#: strpas2jsdesign.pjsdprojecthtmlpage
@ -132,8 +157,9 @@ msgstr ""
msgid "Select pas2js executable"
msgstr ""
#: strpas2jsdesign.pjsdselectsimpleserverexecutable
msgid "Select simpleserver executable"
#: strpas2jsdesign.pjsdselectxexecutable
#, object-pascal-format
msgid "Select %s executable"
msgstr ""
#: strpas2jsdesign.pjsdserverinstanceswillbestartedwithaportstartingfromt
@ -181,7 +207,9 @@ msgstr ""
msgid "You can use IDE macros like $MakeExe(). Without a full path, %s is searched in PATH."
msgstr ""
#: strpas2jsdesign.spasjswebserverscaption
#: strpas2jsdesign.spasjswebservercaption
#, fuzzy
msgctxt "strpas2jsdesign.spasjswebservercaption"
msgid "Pas2JS WebServers"
msgstr "WebServers Pas2JS"

View File

@ -15,8 +15,9 @@ msgstr ""
msgid "Browse"
msgstr ""
#: strpas2jsdesign.pjsdbrowsertousewhenopeninghtmlpage
msgid "Browser to use when opening HTML page"
#: strpas2jsdesign.pjsdbrowsertoopenhtmlpage
msgctxt "strpas2jsdesign.pjsdbrowsertoopenhtmlpage"
msgid "Browser to open HTML page, macro $(Pas2JSBrowser)"
msgstr ""
#: strpas2jsdesign.pjsdcreateinitialhtmlpage
@ -82,18 +83,42 @@ msgstr ""
msgid "Pas2JS selected NodeJS excutable"
msgstr ""
#: strpas2jsdesign.pjsdpas2jswebserverexe
msgid "Pas2JS webserver executable"
msgstr ""
#: strpas2jsdesign.pjsdpas2jswebserverport
msgid "Pas2JS webserver port"
msgstr ""
#: strpas2jsdesign.pjsdpathof
#, object-pascal-format
msgid "Path of %s"
msgstr ""
#: strpas2jsdesign.pjsdpathofnodejsexecutable
msgid "Path of Node.js executable"
msgid "Path of Node.js executable, macro $(Pas2JSNodeJS)"
msgstr ""
#: strpas2jsdesign.pjsdportnumberstostartallocatingfrom
#: strpas2jsdesign.pjsdpathofpas2jsexecutablemacropas2js
msgid "Path of pas2js executable, macro $(pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdpathofxmacropas2js
#, object-pascal-format
msgid "Port numbers to start allocating from %s"
msgctxt "strpas2jsdesign.pjsdpathofxmacropas2js"
msgid "Path of %s, macro $(pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdpathofxmacropas2jswebserver
#, object-pascal-format
msgctxt "strpas2jsdesign.pjsdpathofxmacropas2jswebserver"
msgid "Path of %s, macro $(Pas2JSWebServer)"
msgstr ""
#: strpas2jsdesign.pjsdportnumbertostartallocatingfrom
#, object-pascal-format
msgid "Port number to start allocating from %s"
msgstr ""
#: strpas2jsdesign.pjsdprojecthtmlpage
@ -132,8 +157,9 @@ msgstr ""
msgid "Select pas2js executable"
msgstr ""
#: strpas2jsdesign.pjsdselectsimpleserverexecutable
msgid "Select simpleserver executable"
#: strpas2jsdesign.pjsdselectxexecutable
#, object-pascal-format
msgid "Select %s executable"
msgstr ""
#: strpas2jsdesign.pjsdserverinstanceswillbestartedwithaportstartingfromt
@ -181,7 +207,9 @@ msgstr ""
msgid "You can use IDE macros like $MakeExe(). Without a full path, %s is searched in PATH."
msgstr ""
#: strpas2jsdesign.spasjswebserverscaption
#: strpas2jsdesign.spasjswebservercaption
#, fuzzy
msgctxt "strpas2jsdesign.spasjswebservercaption"
msgid "Pas2JS WebServers"
msgstr "Pas2JS webkiszolgálók"

View File

@ -5,8 +5,9 @@ msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Browse"
msgstr ""
#: strpas2jsdesign.pjsdbrowsertousewhenopeninghtmlpage
msgid "Browser to use when opening HTML page"
#: strpas2jsdesign.pjsdbrowsertoopenhtmlpage
msgctxt "strpas2jsdesign.pjsdbrowsertoopenhtmlpage"
msgid "Browser to open HTML page, macro $(Pas2JSBrowser)"
msgstr ""
#: strpas2jsdesign.pjsdcreateinitialhtmlpage
@ -72,18 +73,42 @@ msgstr ""
msgid "Pas2JS selected NodeJS excutable"
msgstr ""
#: strpas2jsdesign.pjsdpas2jswebserverexe
msgid "Pas2JS webserver executable"
msgstr ""
#: strpas2jsdesign.pjsdpas2jswebserverport
msgid "Pas2JS webserver port"
msgstr ""
#: strpas2jsdesign.pjsdpathof
#, object-pascal-format
msgid "Path of %s"
msgstr ""
#: strpas2jsdesign.pjsdpathofnodejsexecutable
msgid "Path of Node.js executable"
msgid "Path of Node.js executable, macro $(Pas2JSNodeJS)"
msgstr ""
#: strpas2jsdesign.pjsdportnumberstostartallocatingfrom
#: strpas2jsdesign.pjsdpathofpas2jsexecutablemacropas2js
msgid "Path of pas2js executable, macro $(pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdpathofxmacropas2js
#, object-pascal-format
msgid "Port numbers to start allocating from %s"
msgctxt "strpas2jsdesign.pjsdpathofxmacropas2js"
msgid "Path of %s, macro $(pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdpathofxmacropas2jswebserver
#, object-pascal-format
msgctxt "strpas2jsdesign.pjsdpathofxmacropas2jswebserver"
msgid "Path of %s, macro $(Pas2JSWebServer)"
msgstr ""
#: strpas2jsdesign.pjsdportnumbertostartallocatingfrom
#, object-pascal-format
msgid "Port number to start allocating from %s"
msgstr ""
#: strpas2jsdesign.pjsdprojecthtmlpage
@ -122,8 +147,9 @@ msgstr ""
msgid "Select pas2js executable"
msgstr ""
#: strpas2jsdesign.pjsdselectsimpleserverexecutable
msgid "Select simpleserver executable"
#: strpas2jsdesign.pjsdselectxexecutable
#, object-pascal-format
msgid "Select %s executable"
msgstr ""
#: strpas2jsdesign.pjsdserverinstanceswillbestartedwithaportstartingfromt
@ -171,7 +197,8 @@ msgstr ""
msgid "You can use IDE macros like $MakeExe(). Without a full path, %s is searched in PATH."
msgstr ""
#: strpas2jsdesign.spasjswebserverscaption
#: strpas2jsdesign.spasjswebservercaption
msgctxt "strpas2jsdesign.spasjswebservercaption"
msgid "Pas2JS WebServers"
msgstr ""

View File

@ -15,9 +15,10 @@ msgstr ""
msgid "Browse"
msgstr "Navegar"
#: strpas2jsdesign.pjsdbrowsertousewhenopeninghtmlpage
msgid "Browser to use when opening HTML page"
msgstr "Navegador a ser utilizado na abertura de página HTML"
#: strpas2jsdesign.pjsdbrowsertoopenhtmlpage
msgctxt "strpas2jsdesign.pjsdbrowsertoopenhtmlpage"
msgid "Browser to open HTML page, macro $(Pas2JSBrowser)"
msgstr ""
#: strpas2jsdesign.pjsdcreateinitialhtmlpage
msgid "Create initial HTML page"
@ -84,19 +85,45 @@ msgstr "Executável selecionado do navegador Pas2JS"
msgid "Pas2JS selected NodeJS excutable"
msgstr "Executável NodeJS selecionado Pas2JS"
#: strpas2jsdesign.pjsdpas2jswebserverexe
msgid "Pas2JS webserver executable"
msgstr ""
#: strpas2jsdesign.pjsdpas2jswebserverport
msgid "Pas2JS webserver port"
msgstr ""
#: strpas2jsdesign.pjsdpathof
#, object-pascal-format
msgid "Path of %s"
msgstr "Caminho para %s"
#: strpas2jsdesign.pjsdpathofnodejsexecutable
msgid "Path of Node.js executable"
#, fuzzy
#| msgid "Path of Node.js executable"
msgid "Path of Node.js executable, macro $(Pas2JSNodeJS)"
msgstr "Caminho do executável Node.js"
#: strpas2jsdesign.pjsdportnumberstostartallocatingfrom
#: strpas2jsdesign.pjsdpathofpas2jsexecutablemacropas2js
msgid "Path of pas2js executable, macro $(pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdpathofxmacropas2js
#, object-pascal-format
msgid "Port numbers to start allocating from %s"
msgstr "Números de porta para iniciar alocação de %s"
msgctxt "strpas2jsdesign.pjsdpathofxmacropas2js"
msgid "Path of %s, macro $(pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdpathofxmacropas2jswebserver
#, object-pascal-format
msgctxt "strpas2jsdesign.pjsdpathofxmacropas2jswebserver"
msgid "Path of %s, macro $(Pas2JSWebServer)"
msgstr ""
#: strpas2jsdesign.pjsdportnumbertostartallocatingfrom
#, object-pascal-format
msgid "Port number to start allocating from %s"
msgstr ""
#: strpas2jsdesign.pjsdprojecthtmlpage
msgid "Project HTML page:"
@ -134,9 +161,10 @@ msgstr "Selecionar executável Node.js"
msgid "Select pas2js executable"
msgstr "Selecionar executável pas2js"
#: strpas2jsdesign.pjsdselectsimpleserverexecutable
msgid "Select simpleserver executable"
msgstr "Selecionar executável \"simpleserver\""
#: strpas2jsdesign.pjsdselectxexecutable
#, object-pascal-format
msgid "Select %s executable"
msgstr ""
#: strpas2jsdesign.pjsdserverinstanceswillbestartedwithaportstartingfromt
msgid "Server instances will be started with a port starting from this number, increasing per new project"
@ -185,7 +213,9 @@ msgstr "Projeto Web (pas2js)"
msgid "You can use IDE macros like $MakeExe(). Without a full path, %s is searched in PATH."
msgstr "Você pode usar macros IDE como \"$MakeExe()\". Sem um caminho completo, %s é pesquisado em \"PATH\""
#: strpas2jsdesign.spasjswebserverscaption
#: strpas2jsdesign.spasjswebservercaption
#, fuzzy
msgctxt "strpas2jsdesign.spasjswebservercaption"
msgid "Pas2JS WebServers"
msgstr "Pas2JS WebServers"

View File

@ -15,9 +15,10 @@ msgstr ""
msgid "Browse"
msgstr "Обзор"
#: strpas2jsdesign.pjsdbrowsertousewhenopeninghtmlpage
msgid "Browser to use when opening HTML page"
msgstr "Браузер для открытия страницы HTML"
#: strpas2jsdesign.pjsdbrowsertoopenhtmlpage
msgctxt "strpas2jsdesign.pjsdbrowsertoopenhtmlpage"
msgid "Browser to open HTML page, macro $(Pas2JSBrowser)"
msgstr ""
#: strpas2jsdesign.pjsdcreateinitialhtmlpage
msgid "Create initial HTML page"
@ -82,19 +83,45 @@ msgstr "Выбранный исполнимый файл браузера для
msgid "Pas2JS selected NodeJS excutable"
msgstr "Выбранный исполнимый файл NodeJS для Pas2JS"
#: strpas2jsdesign.pjsdpas2jswebserverexe
msgid "Pas2JS webserver executable"
msgstr ""
#: strpas2jsdesign.pjsdpas2jswebserverport
msgid "Pas2JS webserver port"
msgstr ""
#: strpas2jsdesign.pjsdpathof
#, object-pascal-format
msgid "Path of %s"
msgstr "Путь к %s"
#: strpas2jsdesign.pjsdpathofnodejsexecutable
msgid "Path of Node.js executable"
#, fuzzy
#| msgid "Path of Node.js executable"
msgid "Path of Node.js executable, macro $(Pas2JSNodeJS)"
msgstr "Путь к исполнимому файлу Node.js"
#: strpas2jsdesign.pjsdportnumberstostartallocatingfrom
#: strpas2jsdesign.pjsdpathofpas2jsexecutablemacropas2js
msgid "Path of pas2js executable, macro $(pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdpathofxmacropas2js
#, object-pascal-format
msgid "Port numbers to start allocating from %s"
msgstr "Начало диапазона запрашиваемых у %s портов"
msgctxt "strpas2jsdesign.pjsdpathofxmacropas2js"
msgid "Path of %s, macro $(pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdpathofxmacropas2jswebserver
#, object-pascal-format
msgctxt "strpas2jsdesign.pjsdpathofxmacropas2jswebserver"
msgid "Path of %s, macro $(Pas2JSWebServer)"
msgstr ""
#: strpas2jsdesign.pjsdportnumbertostartallocatingfrom
#, object-pascal-format
msgid "Port number to start allocating from %s"
msgstr ""
#: strpas2jsdesign.pjsdprojecthtmlpage
msgid "Project HTML page:"
@ -132,9 +159,10 @@ msgstr "Выберите исполнимый файл Node.js"
msgid "Select pas2js executable"
msgstr "Выберите исполнимый файл pas2js"
#: strpas2jsdesign.pjsdselectsimpleserverexecutable
msgid "Select simpleserver executable"
msgstr "Выберите исполнимый файл simpleserver"
#: strpas2jsdesign.pjsdselectxexecutable
#, object-pascal-format
msgid "Select %s executable"
msgstr ""
#: strpas2jsdesign.pjsdserverinstanceswillbestartedwithaportstartingfromt
msgid "Server instances will be started with a port starting from this number, increasing per new project"
@ -181,7 +209,9 @@ msgstr "Веб-проект (pas2js)"
msgid "You can use IDE macros like $MakeExe(). Without a full path, %s is searched in PATH."
msgstr "Можно использовать макросы IDE, например, $MakeExe(). Если полный путь не указан, поиск %s производится при помощи переменной окружения PATH."
#: strpas2jsdesign.spasjswebserverscaption
#: strpas2jsdesign.spasjswebservercaption
#, fuzzy
msgctxt "strpas2jsdesign.spasjswebservercaption"
msgid "Pas2JS WebServers"
msgstr "Веб-серверы Pas2JS"

View File

@ -15,8 +15,9 @@ msgstr ""
msgid "Browse"
msgstr ""
#: strpas2jsdesign.pjsdbrowsertousewhenopeninghtmlpage
msgid "Browser to use when opening HTML page"
#: strpas2jsdesign.pjsdbrowsertoopenhtmlpage
msgctxt "strpas2jsdesign.pjsdbrowsertoopenhtmlpage"
msgid "Browser to open HTML page, macro $(Pas2JSBrowser)"
msgstr ""
#: strpas2jsdesign.pjsdcreateinitialhtmlpage
@ -82,18 +83,42 @@ msgstr ""
msgid "Pas2JS selected NodeJS excutable"
msgstr ""
#: strpas2jsdesign.pjsdpas2jswebserverexe
msgid "Pas2JS webserver executable"
msgstr ""
#: strpas2jsdesign.pjsdpas2jswebserverport
msgid "Pas2JS webserver port"
msgstr ""
#: strpas2jsdesign.pjsdpathof
#, object-pascal-format
msgid "Path of %s"
msgstr ""
#: strpas2jsdesign.pjsdpathofnodejsexecutable
msgid "Path of Node.js executable"
msgid "Path of Node.js executable, macro $(Pas2JSNodeJS)"
msgstr ""
#: strpas2jsdesign.pjsdportnumberstostartallocatingfrom
#: strpas2jsdesign.pjsdpathofpas2jsexecutablemacropas2js
msgid "Path of pas2js executable, macro $(pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdpathofxmacropas2js
#, object-pascal-format
msgid "Port numbers to start allocating from %s"
msgctxt "strpas2jsdesign.pjsdpathofxmacropas2js"
msgid "Path of %s, macro $(pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdpathofxmacropas2jswebserver
#, object-pascal-format
msgctxt "strpas2jsdesign.pjsdpathofxmacropas2jswebserver"
msgid "Path of %s, macro $(Pas2JSWebServer)"
msgstr ""
#: strpas2jsdesign.pjsdportnumbertostartallocatingfrom
#, object-pascal-format
msgid "Port number to start allocating from %s"
msgstr ""
#: strpas2jsdesign.pjsdprojecthtmlpage
@ -132,8 +157,9 @@ msgstr ""
msgid "Select pas2js executable"
msgstr ""
#: strpas2jsdesign.pjsdselectsimpleserverexecutable
msgid "Select simpleserver executable"
#: strpas2jsdesign.pjsdselectxexecutable
#, object-pascal-format
msgid "Select %s executable"
msgstr ""
#: strpas2jsdesign.pjsdserverinstanceswillbestartedwithaportstartingfromt
@ -181,7 +207,9 @@ msgstr ""
msgid "You can use IDE macros like $MakeExe(). Without a full path, %s is searched in PATH."
msgstr ""
#: strpas2jsdesign.spasjswebserverscaption
#: strpas2jsdesign.spasjswebservercaption
#, fuzzy
msgctxt "strpas2jsdesign.spasjswebservercaption"
msgid "Pas2JS WebServers"
msgstr "Pas2JS Web Sunucuları"

View File

@ -17,9 +17,10 @@ msgstr ""
msgid "Browse"
msgstr "Огляд"
#: strpas2jsdesign.pjsdbrowsertousewhenopeninghtmlpage
msgid "Browser to use when opening HTML page"
msgstr "Оглядач для відкривання файлів HTML"
#: strpas2jsdesign.pjsdbrowsertoopenhtmlpage
msgctxt "strpas2jsdesign.pjsdbrowsertoopenhtmlpage"
msgid "Browser to open HTML page, macro $(Pas2JSBrowser)"
msgstr ""
#: strpas2jsdesign.pjsdcreateinitialhtmlpage
msgid "Create initial HTML page"
@ -84,19 +85,45 @@ msgstr "Виконуваний файл вибраного оглядача Pas2
msgid "Pas2JS selected NodeJS excutable"
msgstr "Виконуваний файл вибраного NodeJS Pas2JS"
#: strpas2jsdesign.pjsdpas2jswebserverexe
msgid "Pas2JS webserver executable"
msgstr ""
#: strpas2jsdesign.pjsdpas2jswebserverport
msgid "Pas2JS webserver port"
msgstr ""
#: strpas2jsdesign.pjsdpathof
#, object-pascal-format
msgid "Path of %s"
msgstr "Шлях до %s"
#: strpas2jsdesign.pjsdpathofnodejsexecutable
msgid "Path of Node.js executable"
#, fuzzy
#| msgid "Path of Node.js executable"
msgid "Path of Node.js executable, macro $(Pas2JSNodeJS)"
msgstr "Шлях до виконуваного файлу Node.js"
#: strpas2jsdesign.pjsdportnumberstostartallocatingfrom
#: strpas2jsdesign.pjsdpathofpas2jsexecutablemacropas2js
msgid "Path of pas2js executable, macro $(pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdpathofxmacropas2js
#, object-pascal-format
msgid "Port numbers to start allocating from %s"
msgstr "Номери портів для початку розміщення з %s"
msgctxt "strpas2jsdesign.pjsdpathofxmacropas2js"
msgid "Path of %s, macro $(pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdpathofxmacropas2jswebserver
#, object-pascal-format
msgctxt "strpas2jsdesign.pjsdpathofxmacropas2jswebserver"
msgid "Path of %s, macro $(Pas2JSWebServer)"
msgstr ""
#: strpas2jsdesign.pjsdportnumbertostartallocatingfrom
#, object-pascal-format
msgid "Port number to start allocating from %s"
msgstr ""
#: strpas2jsdesign.pjsdprojecthtmlpage
msgid "Project HTML page:"
@ -134,9 +161,10 @@ msgstr "Вибрати виконуваний файл Node.js"
msgid "Select pas2js executable"
msgstr "Вибрати виконуваний файл pas2js"
#: strpas2jsdesign.pjsdselectsimpleserverexecutable
msgid "Select simpleserver executable"
msgstr "Вибрати виконуваний файл simpleserver"
#: strpas2jsdesign.pjsdselectxexecutable
#, object-pascal-format
msgid "Select %s executable"
msgstr ""
#: strpas2jsdesign.pjsdserverinstanceswillbestartedwithaportstartingfromt
msgid "Server instances will be started with a port starting from this number, increasing per new project"
@ -183,7 +211,9 @@ msgstr "Веб-проєкт (pas2js)"
msgid "You can use IDE macros like $MakeExe(). Without a full path, %s is searched in PATH."
msgstr "Можна використовувати макроси ІСР на зразок $MakeExe(). Без повного шляху %s буде шукатись у PATH."
#: strpas2jsdesign.spasjswebserverscaption
#: strpas2jsdesign.spasjswebservercaption
#, fuzzy
msgctxt "strpas2jsdesign.spasjswebservercaption"
msgid "Pas2JS WebServers"
msgstr "Веб-сервери Pas2JS"

View File

@ -16,8 +16,9 @@ msgstr ""
msgid "Browse"
msgstr ""
#: strpas2jsdesign.pjsdbrowsertousewhenopeninghtmlpage
msgid "Browser to use when opening HTML page"
#: strpas2jsdesign.pjsdbrowsertoopenhtmlpage
msgctxt "strpas2jsdesign.pjsdbrowsertoopenhtmlpage"
msgid "Browser to open HTML page, macro $(Pas2JSBrowser)"
msgstr ""
#: strpas2jsdesign.pjsdcreateinitialhtmlpage
@ -83,18 +84,42 @@ msgstr ""
msgid "Pas2JS selected NodeJS excutable"
msgstr ""
#: strpas2jsdesign.pjsdpas2jswebserverexe
msgid "Pas2JS webserver executable"
msgstr ""
#: strpas2jsdesign.pjsdpas2jswebserverport
msgid "Pas2JS webserver port"
msgstr ""
#: strpas2jsdesign.pjsdpathof
#, object-pascal-format
msgid "Path of %s"
msgstr ""
#: strpas2jsdesign.pjsdpathofnodejsexecutable
msgid "Path of Node.js executable"
msgid "Path of Node.js executable, macro $(Pas2JSNodeJS)"
msgstr ""
#: strpas2jsdesign.pjsdportnumberstostartallocatingfrom
#: strpas2jsdesign.pjsdpathofpas2jsexecutablemacropas2js
msgid "Path of pas2js executable, macro $(pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdpathofxmacropas2js
#, object-pascal-format
msgid "Port numbers to start allocating from %s"
msgctxt "strpas2jsdesign.pjsdpathofxmacropas2js"
msgid "Path of %s, macro $(pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdpathofxmacropas2jswebserver
#, object-pascal-format
msgctxt "strpas2jsdesign.pjsdpathofxmacropas2jswebserver"
msgid "Path of %s, macro $(Pas2JSWebServer)"
msgstr ""
#: strpas2jsdesign.pjsdportnumbertostartallocatingfrom
#, object-pascal-format
msgid "Port number to start allocating from %s"
msgstr ""
#: strpas2jsdesign.pjsdprojecthtmlpage
@ -133,8 +158,9 @@ msgstr ""
msgid "Select pas2js executable"
msgstr ""
#: strpas2jsdesign.pjsdselectsimpleserverexecutable
msgid "Select simpleserver executable"
#: strpas2jsdesign.pjsdselectxexecutable
#, object-pascal-format
msgid "Select %s executable"
msgstr ""
#: strpas2jsdesign.pjsdserverinstanceswillbestartedwithaportstartingfromt
@ -182,7 +208,9 @@ msgstr ""
msgid "You can use IDE macros like $MakeExe(). Without a full path, %s is searched in PATH."
msgstr ""
#: strpas2jsdesign.spasjswebserverscaption
#: strpas2jsdesign.spasjswebservercaption
#, fuzzy
msgctxt "strpas2jsdesign.spasjswebservercaption"
msgid "Pas2JS WebServers"
msgstr "Pas2JS Web服务器(WebServers)"

View File

@ -7,7 +7,7 @@
<CompilerOptions>
<Version Value="11"/>
<SearchPaths>
<UnitOutputDirectory Value=" units/$(TargetCPU)-$(TargetOS)/$(LCLWidgetType)"/>
<UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)/$(LCLWidgetType)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
@ -17,7 +17,7 @@
</CompilerOptions>
<Description Value="Adds a Lazarus project for pas2js browser applications."/>
<License Value="GPL-2"/>
<Version Major="1" Release="1"/>
<Version Major="1" Release="2"/>
<Files Count="9">
<Item1>
<Filename Value="pjsdsgnregister.pas"/>

View File

@ -58,6 +58,8 @@ Type
FOnRefresh: TNotifyEvent;
FServerInstances: TServerInstanceList;
function GetPas2JSPath(const s: string; const {%H-}Data: PtrInt; var Abort: boolean): string;
function GetPas2JSWebServerPath(const s: string; const {%H-}Data: PtrInt; var Abort: boolean): string;
function GetPas2JSWebServerPort(const s: string; const {%H-}Data: PtrInt; var Abort: boolean): string;
function GetPas2JSBrowser(const s: string; const {%H-}Data: PtrInt; var Abort: boolean): string;
function GetPas2JSNodeJS(const s: string; const {%H-}Data: PtrInt; var Abort: boolean): string;
function GetPas2jsProjectURL(const s: string; const {%H-}Data: PtrInt; var Abort: boolean): string;
@ -206,6 +208,28 @@ begin
Result:='pas2js'; // always return something to get nicer error messages
end;
function TPJSController.GetPas2JSWebServerPath(const s: string;
const Data: PtrInt; var Abort: boolean): string;
begin
Abort:=False;
if (s<>'') and (ConsoleVerbosity>=0) then
debugln(['Hint: (lazarus) [TPJSController.GetPas2JSWebServerPath] ignoring macro Pas2JSWebServer parameter "',s,'"']);
Result:=PJSOptions.GetParsedWebServerFilename;
if Result='' then
Result:=PJSDefaultWebServerName; // always return something to get nicer error messages
end;
function TPJSController.GetPas2JSWebServerPort(const s: string;
const Data: PtrInt; var Abort: boolean): string;
begin
Abort:=False;
if (s<>'') and (ConsoleVerbosity>=0) then
debugln(['Hint: (lazarus) [TPJSController.GetPas2JSWebServerPort] ignoring macro Pas2JSWebServerPort parameter "',s,'"']);
Result:=PJSOptions.GetParsedWebServerFilename;
if Result='' then
Result:=PJSDefaultWebServerName; // always return something to get nicer error messages
end;
function TPJSController.GetPas2JSBrowser(const s: string; const Data: PtrInt; var Abort: boolean): string;
begin
@ -309,7 +333,7 @@ begin
else
begin
// Writeln('No instance running on port ',ServerPort, 'allocating it');
aInstance:=ServerInstances.AddInstance(ServerPort,BaseDir,PJSOptions.GetParsedHTTPServerFilename);
aInstance:=ServerInstances.AddInstance(ServerPort,BaseDir,PJSOptions.GetParsedWebServerFilename);
end;
aInstance.LastProject:=LazarusIDE.ActiveProject.ProjectInfoFile;
aInstance.StartServer;
@ -333,6 +357,10 @@ procedure TPJSController.Hook;
begin
IDEMacros.Add(TTransferMacro.Create('Pas2JS', '', pjsdPas2JSExecutable, @
GetPas2JSPath, []));
IDEMacros.Add(TTransferMacro.Create('Pas2JSWebServer', '', pjsdPas2JSWebServerExe, @
GetPas2JSWebServerPath, []));
IDEMacros.Add(TTransferMacro.Create('Pas2JSWebServerPort', '', pjsdPas2JSWebServerPort, @
GetPas2JSWebServerPort, []));
IDEMacros.Add(TTransferMacro.Create('Pas2JSBrowser', '',
pjsdPas2JSSelectedBrowserExecutable, @GetPas2JSBrowser, []));
IDEMacros.Add(TTransferMacro.Create('Pas2JSNodeJS', '',

View File

@ -21,8 +21,10 @@ uses
const
PJSDsgnOptsFile = 'pas2jsdsgnoptions.xml';
PJSDefaultCompiler = '$MakeExe(IDE,pas2js)';
PJSDefaultHTTPServer = '$MakeExe(IDE,simpleserver)';
PJSDefaultStartAtPort = 4000; // Simpleserver default
PJSDefaultWebServerName = 'compileserver';
PJSDefaultWebServer = '$MakeExe(IDE,'+PJSDefaultWebServerName+')';
PJSDefaultStartAtPort = 3000; // compileserver default port
PJSDefaultHTTPServerParams = '-s -p $()';
PJSDefaultBrowser = '$MakeExe(IDE,firefox)';
PJSDefaultNodeJS = '$MakeExe(IDE,nodejs)';
@ -31,10 +33,19 @@ Type
p2jcoCompilerFilename,
p2jcoBrowserFilename,
p2jcoHTTPServerFilename,
p2jcoHTTPServerPort,
p2jcoNodeJSFilename
);
TPas2jsCachedOptions = set of TPas2jsCachedOption;
const
p2jcoFilenames = [
p2jcoCompilerFilename,
p2jcoBrowserFilename,
p2jcoHTTPServerFilename,
p2jcoNodeJSFilename
];
type
TPas2jsCachedValue = record
RawValue: string;
Stamp: int64;
@ -52,12 +63,13 @@ Type
FStartAtPort: Word;
function GetBrowserFileName: String;
function GetCompilerFilename: string;
function GetHTTPServerFileName: string;
function GetStartAtPort: Word;
function GetWebServerFileName: string;
function GetModified: boolean;
function GetNodeJSFileName: string;
function GetParsedOptionValue(Option: TPas2jsCachedOption): string;
procedure SetBrowserFileName(AValue: String);
procedure SetHTTPServerFileName(AValue: string);
procedure SetWebServerFileName(AValue: string);
procedure SetModified(AValue: boolean);
procedure SetCompilerFilename(AValue: string);
procedure SetNodeJSFileName(AValue: string);
@ -71,16 +83,17 @@ Type
procedure Save;
function GetParsedBrowserFilename: string;
function GetParsedCompilerFilename: string;
function GetParsedHTTPServerFilename: string;
function GetParsedWebServerFilename: string;
function GetParsedWebServerPort: string;
function GetParsedNodeJSFilename: string;
procedure LoadFromConfig(Cfg: TConfigStorage);
procedure SaveToConfig(Cfg: TConfigStorage);
public
property CompilerFilename: string read GetCompilerFilename write SetCompilerFilename;
Property HTTPServerFileName : string Read GetHTTPServerFileName Write SetHTTPServerFileName;
Property WebServerFileName : string Read GetWebServerFileName Write SetWebServerFileName;
Property NodeJSFileName : string Read GetNodeJSFileName Write SetNodeJSFileName;
Property BrowserFileName : String Read GetBrowserFileName Write SetBrowserFileName;
Property StartAtPort : Word Read FStartAtPort Write SetStartAtPort;
Property StartAtPort : Word Read GetStartAtPort Write SetStartAtPort;
property ChangeStamp: int64 read FChangeStamp;
property Modified: boolean read GetModified write SetModified;
end;
@ -89,7 +102,7 @@ var
PJSOptions: TPas2jsOptions = nil;
function GetStandardPas2jsExe: string;
function GetStandardHTTPServer: string;
function GetStandardWebServerExe: string;
function GetStandardBrowser: string;
function GetStandardNodeJS: string;
function GetPas2jsQuality(Filename: string; out Msg: string): boolean;
@ -114,12 +127,12 @@ begin
Result:='nodejs'+GetExeExt;
end;
function GetStandardHTTPServer: string;
function GetStandardWebServerExe: string;
begin
Result:=PJSDefaultHTTPServer;
Result:=PJSDefaultWebServer;
if not IDEMacros.SubstituteMacros(Result) then
Result:='simpleserver'+GetExeExt;
Result:='PJSDefaultHTTPServerCmd'+GetExeExt;
end;
function GetStandardBrowser: string;
@ -155,15 +168,15 @@ begin
exit(false);
end;
if not FileExistsCached(Filename) then begin
Msg:=Format(pjsdFileNotFound, [Filename]);
Msg:=SafeFormat(pjsdFileNotFound, [Filename]);
exit(false);
end;
if not DirPathExistsCached(ExtractFilePath(Filename)) then begin
Msg:=Format(pjsdDirectoryNotFound, [ExtractFilePath(Filename)]);
Msg:=SafeFormat(pjsdDirectoryNotFound, [ExtractFilePath(Filename)]);
exit(false);
end;
if not FileIsExecutable(Filename) then begin
Msg:=Format(pjsdFileNotExecutable, [Filename]);
Msg:=SafeFormat(pjsdFileNotExecutable, [Filename]);
exit(false);
end;
ShortFile:=ExtractFileNameOnly(Filename);
@ -200,7 +213,12 @@ begin
Result:=FCachedOptions[p2jcoCompilerFilename].RawValue;
end;
function TPas2jsOptions.GetHTTPServerFileName: string;
function TPas2jsOptions.GetStartAtPort: Word;
begin
Result:=StrToIntDef(FCachedOptions[p2jcoHTTPServerPort].RawValue,PJSDefaultStartAtPort);
end;
function TPas2jsOptions.GetWebServerFileName: string;
begin
Result:=FCachedOptions[p2jcoHTTPServerFilename].RawValue;
end;
@ -228,7 +246,7 @@ var
begin
FChangeStamp:=LUInvalidChangeStamp64;
FCachedOptions[p2jcoCompilerFilename].RawValue:=PJSDefaultCompiler;
FCachedOptions[p2jcoHTTPServerFilename].RawValue:=PJSDefaultHTTPServer;
FCachedOptions[p2jcoHTTPServerFilename].RawValue:=PJSDefaultWebServer;
FCachedOptions[p2jcoNodeJSFilename].RawValue:=PJSDefaultNodeJS;
FCachedOptions[p2jcoBrowserFilename].RawValue:=PJSDefaultBrowser;
for o in TPas2jsCachedOption do
@ -280,7 +298,7 @@ procedure TPas2jsOptions.LoadFromConfig(Cfg: TConfigStorage);
begin
CompilerFilename:=Cfg.GetValue(KeyCompiler,PJSDefaultCompiler);
HTTPServerFileName:=Cfg.GetValue(KeyHTTPServer,PJSDefaultHTTPServer);
WebServerFileName:=Cfg.GetValue(KeyHTTPServer,PJSDefaultWebServer);
BrowserFileName:=Cfg.GetValue(KeyBrowser,PJSDefaultBrowser);
NodeJSFileName:=Cfg.GetValue(KeyNodeJS,PJSDefaultNodeJS);
StartAtPort :=Cfg.GetValue(KeyStartPortAt,PJSDefaultStartAtPort);
@ -291,7 +309,7 @@ procedure TPas2jsOptions.SaveToConfig(Cfg: TConfigStorage);
begin
Cfg.SetDeleteValue(KeyCompiler,CompilerFilename,PJSDefaultCompiler);
Cfg.SetDeleteValue(KeyHTTPServer,HTTPServerFileName,PJSDefaultHTTPServer);
Cfg.SetDeleteValue(KeyHTTPServer,WebServerFileName,PJSDefaultWebServer);
Cfg.SetDeleteValue(KeyStartPortAt,StartAtPort,PJSDefaultStartAtPort);
Cfg.SetDeleteValue(KeyNodeJS,NodeJSFileName,PJSDefaultNodeJS);
Cfg.SetDeleteValue(KeyBrowser,BrowserFileName,PJSDefaultBrowser);
@ -303,11 +321,16 @@ begin
Result:=GetParsedOptionValue(p2jcoCompilerFilename);
end;
function TPas2jsOptions.GetParsedHTTPServerFilename: string;
function TPas2jsOptions.GetParsedWebServerFilename: string;
begin
Result:=GetParsedOptionValue(p2jcoHTTPServerFilename);
end;
function TPas2jsOptions.GetParsedWebServerPort: string;
begin
Result:=GetParsedOptionValue(p2jcoHTTPServerPort);
end;
function TPas2jsOptions.GetParsedNodeJSFilename: string;
begin
Result:=GetParsedOptionValue(p2jcoNodeJSFilename);
@ -317,6 +340,7 @@ function TPas2jsOptions.GetParsedOptionValue(Option: TPas2jsCachedOption
): string;
var
p: PPas2jsCachedValue;
IsFilename: Boolean;
begin
p:=@FCachedOptions[Option];
if p^.Stamp<>IDEMacros.BaseTimeStamp then
@ -324,25 +348,30 @@ begin
p^.Stamp:=IDEMacros.BaseTimeStamp;
p^.ParsedValue:=p^.RawValue;
IDEMacros.SubstituteMacros(p^.ParsedValue);
p^.ParsedValue:=TrimFilename(p^.ParsedValue);
if (p^.ParsedValue<>'')
and not FilenameIsAbsolute(p^.ParsedValue) then
IsFilename:=Option in p2jcoFilenames;
if IsFilename then
begin
if ExtractFilePath(p^.ParsedValue)='' then
p^.ParsedValue:=FindDefaultExecutablePath(p^.ParsedValue)
else
p^.ParsedValue:=''; // not found
p^.ParsedValue:=TrimFilename(p^.ParsedValue);
if (p^.ParsedValue<>'')
and not FilenameIsAbsolute(p^.ParsedValue) then
begin
if ExtractFilePath(p^.ParsedValue)='' then
p^.ParsedValue:=FindDefaultExecutablePath(p^.ParsedValue)
else
p^.ParsedValue:=''; // not found
end;
end;
if p^.ParsedValue='' then
begin
case Option of
p2jcoCompilerFilename: p^.ParsedValue:=GetStandardPas2jsExe;
p2jcoBrowserFilename: p^.ParsedValue:=GetStandardBrowser;
p2jcoHTTPServerFilename: p^.ParsedValue:=GetStandardHTTPServer;
p2jcoHTTPServerFilename: p^.ParsedValue:=GetStandardWebServerExe;
p2jcoHTTPServerPort: p^.ParsedValue:=IntToStr(PJSDefaultStartAtPort);
p2jcoNodeJSFilename: p^.ParsedValue:=GetStandardNodeJS;
end;
if (p^.ParsedValue<>'')
and not FilenameIsAbsolute(p^.ParsedValue) then
if IsFilename and (p^.ParsedValue<>'')
and not FilenameIsAbsolute(p^.ParsedValue) then
begin
if ExtractFilePath(p^.ParsedValue)='' then
p^.ParsedValue:=FindDefaultExecutablePath(p^.ParsedValue)
@ -365,7 +394,7 @@ begin
SetCachedOption(p2jcoBrowserFilename,AValue);
end;
procedure TPas2jsOptions.SetHTTPServerFileName(AValue: string);
procedure TPas2jsOptions.SetWebServerFileName(AValue: string);
begin
AValue:=TrimFilename(AValue);
SetCachedOption(p2jcoHTTPServerFilename,AValue);

View File

@ -15,10 +15,10 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
Left = 6
Height = 15
Top = 6
Width = 151
Width = 192
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'Pas2JS command executable'
Caption = 'Pas2JS executable, macro $(pas2js)'
ParentColor = False
ParentShowHint = False
ShowHint = True
@ -29,11 +29,11 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Pas2jsPathBrowseButton
Left = 6
Height = 23
Height = 27
Top = 21
Width = 380
Width = 394
Anchors = [akTop, akLeft, akRight]
ItemHeight = 15
ItemHeight = 0
TabOrder = 0
end
object Pas2jsPathBrowseButton: TButton
@ -42,10 +42,10 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Pas2jsPathComboBox
AnchorSideBottom.Side = asrBottom
Left = 386
Height = 23
Left = 400
Height = 27
Top = 21
Width = 35
Width = 21
Anchors = [akTop, akRight, akBottom]
AutoSize = True
BorderSpacing.Right = 6
@ -61,11 +61,11 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideTop.Side = asrBottom
Left = 6
Height = 15
Top = 52
Width = 162
Top = 56
Width = 132
BorderSpacing.Left = 6
BorderSpacing.Top = 8
Caption = 'Simple HTTP Server command'
Caption = 'HTTP Server executable'
ParentColor = False
ParentShowHint = False
ShowHint = True
@ -77,10 +77,10 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = HTTPServerComboBox
AnchorSideBottom.Side = asrBottom
Left = 386
Height = 23
Top = 67
Width = 35
Left = 400
Height = 27
Top = 71
Width = 21
Anchors = [akTop, akRight, akBottom]
AutoSize = True
BorderSpacing.Right = 6
@ -96,11 +96,11 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = HTTPServerBrowseButton
Left = 6
Height = 23
Top = 67
Width = 380
Height = 27
Top = 71
Width = 394
Anchors = [akTop, akLeft, akRight]
ItemHeight = 15
ItemHeight = 0
TabOrder = 3
end
object ServerPortSpinEdit: TSpinEdit
@ -108,8 +108,8 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideTop.Control = ServerPortLabel
AnchorSideTop.Side = asrBottom
Left = 6
Height = 23
Top = 113
Height = 25
Top = 121
Width = 74
MaxValue = 65353
MinValue = 1024
@ -122,8 +122,8 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideTop.Side = asrBottom
Left = 6
Height = 15
Top = 98
Width = 106
Top = 106
Width = 114
BorderSpacing.Left = 6
BorderSpacing.Top = 8
Caption = 'Standard server port'
@ -137,11 +137,11 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = BBrowserBrowseButton
Left = 6
Height = 23
Top = 157
Width = 380
Height = 27
Top = 167
Width = 394
Anchors = [akTop, akLeft, akRight]
ItemHeight = 15
ItemHeight = 0
TabOrder = 5
Text = 'BrowserComboBox'
end
@ -151,8 +151,8 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideTop.Side = asrBottom
Left = 6
Height = 15
Top = 142
Width = 250
Top = 152
Width = 258
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'Browser to launch when opening project HTML'
@ -166,10 +166,10 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = BrowserComboBox
AnchorSideBottom.Side = asrBottom
Left = 386
Height = 23
Top = 157
Width = 35
Left = 400
Height = 27
Top = 167
Width = 21
Anchors = [akTop, akRight, akBottom]
AutoSize = True
BorderSpacing.Right = 6
@ -183,8 +183,8 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideTop.Side = asrBottom
Left = 6
Height = 15
Top = 186
Width = 99
Top = 200
Width = 105
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'Node.js executable'
@ -196,11 +196,11 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = NodeJSBrowseButton
Left = 6
Height = 23
Top = 201
Width = 380
Height = 27
Top = 215
Width = 394
Anchors = [akTop, akLeft, akRight]
ItemHeight = 15
ItemHeight = 0
TabOrder = 7
Text = 'NodeJSComboBox'
end
@ -210,10 +210,10 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = NodeJSComboBox
AnchorSideBottom.Side = asrBottom
Left = 386
Height = 23
Top = 201
Width = 35
Left = 400
Height = 27
Top = 215
Width = 21
Anchors = [akTop, akRight, akBottom]
AutoSize = True
BorderSpacing.Right = 6

View File

@ -14,9 +14,9 @@ uses
// LCL
Forms, StdCtrls, Dialogs, Spin,
// LazUtils
LazFileCache, LazFileUtils,
LazFileCache, LazFileUtils, FileUtil,
// IdeIntf
IDEOptionsIntf, IDEOptEditorIntf, IDEUtils,
IDEOptionsIntf, IDEOptEditorIntf, IDEUtils, IDEDialogs,
// Pas2Js
PJSDsgnOptions, strpas2jsdesign;
@ -25,18 +25,18 @@ Type
TPas2jsOptionsFrame = class(TAbstractIDEOptionsEditor)
BBrowserBrowseButton: TButton;
NodeJSBrowseButton: TButton;
BrowserComboBox: TComboBox;
BrowserLabel: TLabel;
HTTPServerBrowseButton: TButton;
HTTPServerCmdLabel: TLabel;
HTTPServerComboBox: TComboBox;
NodeJSBrowseButton: TButton;
NodeJSComboBox: TComboBox;
NodeJSLabel: TLabel;
HTTPServerBrowseButton: TButton;
HTTPServerComboBox: TComboBox;
HTTPServerCmdLabel: TLabel;
BrowserLabel: TLabel;
ServerPortLabel: TLabel;
Pas2jsPathBrowseButton: TButton;
Pas2jsPathComboBox: TComboBox;
Pas2jsPathLabel: TLabel;
ServerPortLabel: TLabel;
ServerPortSpinEdit: TSpinEdit;
procedure BBrowserBrowseButtonClick(Sender: TObject);
procedure HTTPServerBrowseButtonClick(Sender: TObject);
@ -89,11 +89,11 @@ begin
try
//InputHistories.ApplyFileDialogSettings(OpenDialog);
OpenDialog.Options:=OpenDialog.Options+[ofPathMustExist];
OpenDialog.Title:=pjsdSelectSimpleserverExecutable;
OpenDialog.Title:=SafeFormat(pjsdSelectXExecutable,[PJSDefaultWebServer]);
if OpenDialog.Execute then begin
AFilename:=CleanAndExpandFilename(OpenDialog.Filename);
SetComboBoxText(HTTPServerComboBox,AFilename,cstFilename,30);
PJSOptions.HTTPServerFileName:=AFileName;
PJSOptions.WebServerFileName:=AFileName;
end;
finally
OpenDialog.Free;
@ -146,15 +146,31 @@ end;
function TPas2jsOptionsFrame.CheckCompiler(Buttons: TMsgDlgButtons): boolean;
var
NewExe: string;
NewExe, ErrMsg: string;
begin
NewExe:=Pas2jsPathComboBox.Text;
if NewExe=PJSOptions.CompilerFilename then exit(true);
Result:=false;
PJSOptions.CompilerFilename:=NewExe;
// ToDo: check file
//NewExe:=PJSOptions.GetParsedCompilerExe;
NewExe:=PJSOptions.GetParsedCompilerFilename;
if (NewExe='') or not FileExistsUTF8(NewExe) then
ErrMsg:='Unable to find pas2js at "'+PJSOptions.CompilerFilename+'"'
else if not FileIsExecutable(NewExe) then
ErrMsg:='pas2js is not executable at "'+PJSOptions.CompilerFilename+'"'
else
ErrMsg:='';
if ErrMsg<>'' then
begin
IDEMessageDialog('Error',ErrMsg,mtError,[mbOk]);
exit(false);
end;
if Pos('pas2js',lowercase(ExtractFileNameOnly(NewExe)))<1 then
begin
IDEMessageDialog('Warning','The pas2js executable filename "'+NewExe+'" does not look like pas2js',mtWarning,[mbOk]);
exit(true);
end;
// todo: run and check if this pas2js returns macros
end;
function TPas2jsOptionsFrame.GetTitle: String;
@ -163,48 +179,47 @@ begin
end;
procedure TPas2jsOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
var
ExeName: String;
ServerName : String;
//BrowserName : String;
DefPas2jsExe: String;
begin
ExeName:=GetStandardPas2jsExe;
ServerName:=GetStandardHTTPServer;
//BrowserName:=GetStandardBrowser;
Pas2jsPathLabel.Caption:=Format(pjsdPathOf, [ExeName]);
DefPas2jsExe:=GetStandardPas2jsExe;
Pas2jsPathLabel.Caption:=SafeFormat(pjsdPathOfXMacroPas2js, ['pas2js'+GetExeExt]);
Pas2jsPathLabel.Hint:=Format(
pjsdYouCanUseIDEMacrosLikeMakeExeWithoutAFullPathIsSea, [ExeName]);
pjsdYouCanUseIDEMacrosLikeMakeExeWithoutAFullPathIsSea, [DefPas2jsExe]);
Pas2jsPathBrowseButton.Hint:=pjsdBrowse;
HTTPServerCmdLabel.Caption:=Format(pjsdPathOf, [ServerName]);
HTTPServerCmdLabel.Hint:=Format(
pjsdYouCanUseIDEMacrosLikeMakeExeWithoutAFullPathIsSea, [ServerName]);
HTTPServerCmdLabel.Caption:=SafeFormat(pjsdPathOfXMacroPas2JSWebServer, [
PJSDefaultWebServerName+GetExeExt]);
HTTPServerCmdLabel.Hint:=SafeFormat(
pjsdYouCanUseIDEMacrosLikeMakeExeWithoutAFullPathIsSea, [PJSDefaultWebServerName]);
HTTPServerBrowseButton.Hint:=pjsdBrowse;
ServerPortLabel.Caption:=Format(pjsdPortNumbersToStartAllocatingFrom, [
ServerName]);
ServerPortLabel.Caption:=pjsdPortNumberToStartAllocatingFrom;
ServerPortLabel.Hint:=pjsdServerInstancesWillBeStartedWithAPortStartingFromT;
BrowserLabel.Caption:=pjsdBrowserToUseWhenOpeningHTMLPage;
BrowserLabel.Caption:=pjsdBrowserToOpenHTMLPage;
BrowserLabel.Hint:=pjsdUseThisBrowserWhenOpeningTheURLOrHTMLFileOfAWebBro;
NodeJSLabel.Caption:=pjsdPathOfNodeJsExecutable;
end;
procedure TPas2jsOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
begin
SetComboBoxText(Pas2jsPathComboBox,PJSOptions.CompilerFilename,cstFilename,30);
SetComboBoxText(HTTPServerComboBox,PJSOptions.HTTPServerFileName,cstFilename,30);
SetComboBoxText(HTTPServerComboBox,PJSOptions.WebServerFileName,cstFilename,30);
ServerPortSpinEdit.Value:=PJSOptions.StartAtPort;
SetComboBoxText(BrowserComboBox,PJSOptions.BrowserFileName,cstFilename,30);
SetComboBoxText(NodeJSComboBox,PJSOptions.NodejsFileName,cstFilename,30);
ServerPortSpinEdit.Value:=PJSOptions.StartAtPort;
end;
procedure TPas2jsOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
begin
PJSOptions.CompilerFilename:=Pas2jsPathComboBox.Text;
PJSOptions.HTTPServerFileName:=HTTPServerComboBox.Text;
PJSOptions.WebServerFileName:=HTTPServerComboBox.Text;
PJSOptions.StartAtPort:=ServerPortSpinEdit.Value;
PJSOptions.BrowserFileName:=BrowserComboBox.Text;
PJSOptions.NodeJSFileName:=NodeJSComboBox.Text;
PJSOptions.StartAtPort:=ServerPortSpinEdit.Value;
If PJSOptions.Modified then
PJSOptions.Save;
end;

View File

@ -101,7 +101,7 @@ begin
end;
Const
sPas2JSWebserversName = 'Pas2JSWebservers';
sPas2JSWebserverName = 'Pas2JSWebservers';
procedure Register;
@ -122,12 +122,12 @@ begin
ViewCategory := IDECommandList.FindCategoryByName(CommandCategoryViewName);
if ViewCategory <> nil then
begin
IDECommand := RegisterIDECommand(ViewCategory,SPas2JSWebserversName,SPasJSWebserversCaption,
IDECommand := RegisterIDECommand(ViewCategory,sPas2JSWebserverName,SPasJSWebserverCaption,
CleanIDEShortCut,CleanIDEShortCut,Nil,@ShowServerDialog);
if IDECommand <> nil then
RegisterIDEButtonCommand(IDECommand);
end;
RegisterIdeMenuCommand(itmViewDebugWindows,SPas2JSWebserversName,SPasJSWebserversCaption,nil,@ShowServerDialog);
RegisterIdeMenuCommand(itmViewDebugWindows,sPas2JSWebserverName,SPasJSWebserverCaption,nil,@ShowServerDialog);
// Add project options frame
RegisterIDEOptionsEditor(GroupProject,TPas2JSProjectOptionsFrame, Pas2JSOptionsIndex);
end;

View File

@ -4,6 +4,8 @@ unit strpas2jsdesign;
interface
uses FileProcs, sysutils;
Resourcestring
// "Create new" dialog
pjsdWebApplication = 'Web Browser Application';
@ -12,7 +14,7 @@ Resourcestring
pjsdNodeJSAppDescription = 'A pas2js program running in node.js';
// menu item
SPasJSWebserversCaption = 'Pas2JS WebServers';
SPasJSWebserverCaption = 'Pas2JS WebServers';
// Static texts webservers form
SWebserversStatus = 'Status';
@ -30,22 +32,26 @@ Resourcestring
// IDE options frame
pjsdSelectPas2jsExecutable = 'Select pas2js executable';
pjsdSelectSimpleserverExecutable = 'Select simpleserver executable';
pjsdSelectXExecutable = 'Select %s executable';
pjsdSelectNodeJSExecutable = 'Select Node.js executable';
pjsdSelectBrowserExecutable = 'Select browser executable';
pjsdPathOf = 'Path of %s';
pjsdYouCanUseIDEMacrosLikeMakeExeWithoutAFullPathIsSea = 'You can use IDE '
+'macros like $MakeExe(). Without a full path, %s is searched in PATH.';
pjsdPathOfXMacroPas2js = 'Path of %s, macro $(pas2js)';
pjsdPathOfPas2jsExecutableMacroPas2js = 'Path of pas2js executable, macro $('
+'pas2js)';
pjsdBrowse = 'Browse';
pjsdPortNumbersToStartAllocatingFrom = 'Port numbers to start allocating '
+'from %s';
pjsdPathOfXMacroPas2JSWebServer = 'Path of %s, macro $(Pas2JSWebServer)';
pjsdPortNumberToStartAllocatingFrom = 'Port number to start allocating '
+'from, macro $(Pas2JSWebServerPort)';
pjsdServerInstancesWillBeStartedWithAPortStartingFromT = 'Server instances '
+'will be started with a port starting from this number, increasing per '
+'new project';
pjsdBrowserToUseWhenOpeningHTMLPage = 'Browser to use when opening HTML page';
pjsdBrowserToOpenHTMLPage = 'Browser to open HTML page, macro $(Pas2JSBrowser)';
pjsdUseThisBrowserWhenOpeningTheURLOrHTMLFileOfAWebBro = 'Use this browser '
+'when opening the URL or HTML file of a web browser project';
pjsdPathOfNodeJsExecutable = 'Path of Node.js executable';
pjsdPathOfNodeJsExecutable = 'Path of Node.js executable, macro $(Pas2JSNodeJS)';
// Project options frame
pjsdWebProjectPas2js = 'Web Project (pas2js)';
@ -74,6 +80,8 @@ Resourcestring
// Macros names
pjsdPas2JSExecutable = 'Pas2JS executable';
pjsdPas2JSWebServerExe = 'Pas2JS webserver executable';
pjsdPas2JSWebServerPort = 'Pas2JS webserver port';
pjsdPas2JSSelectedBrowserExecutable = 'Pas2JS selected browser executable';
pjsdPas2JSSelectedNodeJSExcutable = 'Pas2JS selected NodeJS excutable';
pjsdPas2JSCurrentProjectURL = 'Pas2JS current project URL';
@ -85,7 +93,27 @@ Resourcestring
pjsdFileNotExecutable = 'file "%s" not executable';
pjsdFileNameDoesNotStartWithPas2js = 'filename does not start with "pas2js"';
function SafeFormat(const Fmt: String; const Args: Array of const): String;
implementation
function SafeFormat(const Fmt: String; const Args: array of const): String;
begin
// try with translated resourcestring
try
Result:=Format(Fmt,Args);
exit;
except
on E: Exception do
debugln(['ERROR: SafeFormat: ',E.Message]);
end;
// translation didn't work
// ToDo: find out how to get the resourcestring default value
//ResetResourceTables;
// use a safe fallback
Result:=SimpleFormat(Fmt,Args);
end;
end.

View File

@ -1,9 +1,11 @@
{
Todo:
- run (with debug):
- start compile server, keep running, restart when options change
- close on IDE quit
- activate project when project is opened
- deactivate project when project is closed
- show active build mode
- auto load last group on IDE start when option enabled
}
unit ProjectGroupEditor;