IDE: new project: set activerunmode

This commit is contained in:
mattias 2022-04-20 10:45:12 +02:00
parent a1d2e6c037
commit 268bfdc250
4 changed files with 16 additions and 1 deletions

View File

@ -161,10 +161,18 @@ msgstr "Исполнимый файл Pas2JS"
msgid "Pas2JS selected browser executable"
msgstr "Выбранный исполнимый файл браузера для Pas2JS"
#: strpas2jsdesign.pjsdpas2jsselectedelectronexcutable
msgid "Pas2JS selected Electron excutable"
msgstr ""
#: strpas2jsdesign.pjsdpas2jsselectednodejsexcutable
msgid "Pas2JS selected NodeJS excutable"
msgstr "Выбранный исполнимый файл NodeJS для Pas2JS"
#: strpas2jsdesign.pjsdpathofelectronexecutablemacropas2jselectron
msgid "Path of Electron executable, macro $(Pas2JSElectron)"
msgstr ""
#: strpas2jsdesign.pjsdpathofnodejsexecutable
msgid "Path of Node.js executable, macro $(Pas2JSNodeJS)"
msgstr "Путь к исполнимому файлу Node.js, макрос $(Pas2JSNodeJS)"

View File

@ -1323,7 +1323,7 @@ begin
// all three projects can run the electron app
RunMode:=AProject.RunParameters.GetOrCreate('default');
RunMode.UseLaunchingApplication:=true;
RunMode.LaunchingApplicationPathPlusParams:='$MakeExe(IDE,electron) .';
RunMode.LaunchingApplicationPathPlusParams:='"$(Pas2JSElectron)" .';
Result:=mrOk;
end;

View File

@ -6315,6 +6315,10 @@ begin
Result.EndUpdate;
end;
with Result.RunParameterOptions do
if (GetActiveMode=nil) and (Count>0) then
ActiveModeName:=Modes[0].Name;
Result.MainProject:=true;
Result.OnFileBackup:=@MainBuildBoss.BackupFileForWrite;
Result.OnLoadProjectInfo:=@OnLoadProjectInfoFromXMLConfig;

View File

@ -3675,6 +3675,9 @@ begin
// or the project main source is not auto updated by the IDE
OpenMainUnit(-1,-1,[]);
end;
with Project1.RunParameterOptions do
if (GetActiveMode=nil) and (Count>0) then
ActiveModeName:=Modes[0].Name;
// init resource files
if not Project1.ProjResources.Regenerate(Project1.MainFilename, True, False,'') then