diff --git a/components/pas2js/languages/strpas2jsdesign.fr.po b/components/pas2js/languages/strpas2jsdesign.fr.po index d8a7c5e46f..62771a1b7a 100644 --- a/components/pas2js/languages/strpas2jsdesign.fr.po +++ b/components/pas2js/languages/strpas2jsdesign.fr.po @@ -19,6 +19,10 @@ msgstr "" msgid "Atom package template directory" msgstr "Répertoire des modèles de paquets Atom" +#: strpas2jsdesign.pjsdawebapplicationusingelectrontorunasdesktopapplicat +msgid "A Web Application using Electron to run as desktop application." +msgstr "" + #: strpas2jsdesign.pjsdbrowse msgid "Browse" msgstr "Parcourir" @@ -40,6 +44,10 @@ msgstr "Créer la page initiale HTML" msgid "directory \"%s\" not found" msgstr "répertoire \"%s\" non trouvé" +#: strpas2jsdesign.pjsdelectronwebapplication +msgid "Electron Web Application" +msgstr "" + #: strpas2jsdesign.pjsderror msgid "Error" msgstr "" diff --git a/components/pas2js/languages/strpas2jsdesign.hu.po b/components/pas2js/languages/strpas2jsdesign.hu.po index d6b0d63c61..fbc63bff33 100644 --- a/components/pas2js/languages/strpas2jsdesign.hu.po +++ b/components/pas2js/languages/strpas2jsdesign.hu.po @@ -19,6 +19,10 @@ msgstr "" msgid "Atom package template directory" msgstr "" +#: strpas2jsdesign.pjsdawebapplicationusingelectrontorunasdesktopapplicat +msgid "A Web Application using Electron to run as desktop application." +msgstr "" + #: strpas2jsdesign.pjsdbrowse msgid "Browse" msgstr "Böngészés" @@ -40,6 +44,10 @@ msgstr "Kezdő HTML lap létrehozása" msgid "directory \"%s\" not found" msgstr "a(z) \"%s\" könyvtár nem található" +#: strpas2jsdesign.pjsdelectronwebapplication +msgid "Electron Web Application" +msgstr "" + #: strpas2jsdesign.pjsderror msgid "Error" msgstr "" diff --git a/components/pas2js/languages/strpas2jsdesign.pot b/components/pas2js/languages/strpas2jsdesign.pot index 5a76459fa0..30d46c5900 100644 --- a/components/pas2js/languages/strpas2jsdesign.pot +++ b/components/pas2js/languages/strpas2jsdesign.pot @@ -9,6 +9,10 @@ msgstr "" msgid "Atom package template directory" msgstr "" +#: strpas2jsdesign.pjsdawebapplicationusingelectrontorunasdesktopapplicat +msgid "A Web Application using Electron to run as desktop application." +msgstr "" + #: strpas2jsdesign.pjsdbrowse msgid "Browse" msgstr "" @@ -30,6 +34,10 @@ msgstr "" msgid "directory \"%s\" not found" msgstr "" +#: strpas2jsdesign.pjsdelectronwebapplication +msgid "Electron Web Application" +msgstr "" + #: strpas2jsdesign.pjsderror msgid "Error" msgstr "" diff --git a/components/pas2js/languages/strpas2jsdesign.pt_BR.po b/components/pas2js/languages/strpas2jsdesign.pt_BR.po index 1635e689b4..a2b581ddd8 100644 --- a/components/pas2js/languages/strpas2jsdesign.pt_BR.po +++ b/components/pas2js/languages/strpas2jsdesign.pt_BR.po @@ -19,6 +19,10 @@ msgstr "" msgid "Atom package template directory" msgstr "Diretório de modelos de pacote do Atom" +#: strpas2jsdesign.pjsdawebapplicationusingelectrontorunasdesktopapplicat +msgid "A Web Application using Electron to run as desktop application." +msgstr "" + #: strpas2jsdesign.pjsdbrowse msgid "Browse" msgstr "Navegar" @@ -40,6 +44,10 @@ msgstr "Criar página HTML inicial" msgid "directory \"%s\" not found" msgstr "diretório \"%s\" não encontrado" +#: strpas2jsdesign.pjsdelectronwebapplication +msgid "Electron Web Application" +msgstr "" + #: strpas2jsdesign.pjsderror msgid "Error" msgstr "" diff --git a/components/pas2js/languages/strpas2jsdesign.tr.po b/components/pas2js/languages/strpas2jsdesign.tr.po index dff8dbba4a..4279527ab7 100644 --- a/components/pas2js/languages/strpas2jsdesign.tr.po +++ b/components/pas2js/languages/strpas2jsdesign.tr.po @@ -19,6 +19,10 @@ msgstr "" msgid "Atom package template directory" msgstr "" +#: strpas2jsdesign.pjsdawebapplicationusingelectrontorunasdesktopapplicat +msgid "A Web Application using Electron to run as desktop application." +msgstr "" + #: strpas2jsdesign.pjsdbrowse msgid "Browse" msgstr "" @@ -40,6 +44,10 @@ msgstr "" msgid "directory \"%s\" not found" msgstr "" +#: strpas2jsdesign.pjsdelectronwebapplication +msgid "Electron Web Application" +msgstr "" + #: strpas2jsdesign.pjsderror msgid "Error" msgstr "" diff --git a/components/pas2js/languages/strpas2jsdesign.uk.po b/components/pas2js/languages/strpas2jsdesign.uk.po index 6dad8cec4d..a6faee6d67 100644 --- a/components/pas2js/languages/strpas2jsdesign.uk.po +++ b/components/pas2js/languages/strpas2jsdesign.uk.po @@ -21,6 +21,10 @@ msgstr "" msgid "Atom package template directory" msgstr "Тека шаблонів пакунка Atom" +#: strpas2jsdesign.pjsdawebapplicationusingelectrontorunasdesktopapplicat +msgid "A Web Application using Electron to run as desktop application." +msgstr "" + #: strpas2jsdesign.pjsdbrowse msgid "Browse" msgstr "Огляд" @@ -42,6 +46,10 @@ msgstr "Створити початкову HTML-сторінку" msgid "directory \"%s\" not found" msgstr "теку \"%s\" не знайдено" +#: strpas2jsdesign.pjsdelectronwebapplication +msgid "Electron Web Application" +msgstr "" + #: strpas2jsdesign.pjsderror msgid "Error" msgstr "" diff --git a/components/pas2js/languages/strpas2jsdesign.zh_CN.po b/components/pas2js/languages/strpas2jsdesign.zh_CN.po index bd0659c103..b16d9dc83f 100644 --- a/components/pas2js/languages/strpas2jsdesign.zh_CN.po +++ b/components/pas2js/languages/strpas2jsdesign.zh_CN.po @@ -20,6 +20,10 @@ msgstr "" msgid "Atom package template directory" msgstr "" +#: strpas2jsdesign.pjsdawebapplicationusingelectrontorunasdesktopapplicat +msgid "A Web Application using Electron to run as desktop application." +msgstr "" + #: strpas2jsdesign.pjsdbrowse msgid "Browse" msgstr "" @@ -41,6 +45,10 @@ msgstr "" msgid "directory \"%s\" not found" msgstr "" +#: strpas2jsdesign.pjsdelectronwebapplication +msgid "Electron Web Application" +msgstr "" + #: strpas2jsdesign.pjsderror msgid "Error" msgstr "" diff --git a/components/pas2js/pjsdsgnregister.pas b/components/pas2js/pjsdsgnregister.pas index 659940582f..be785fda37 100644 --- a/components/pas2js/pjsdsgnregister.pas +++ b/components/pas2js/pjsdsgnregister.pas @@ -26,6 +26,7 @@ const ProjDescNamePas2JSWebApp = 'Web Application'; ProjDescNamePas2JSProgressiveWebApp = 'Progressive Web Application'; ProjDescNamePas2JSServiceWorker = 'Pas2JS Service Worker'; + ProjDescNamePas2JSElectronWebApp = 'Electron Web Application'; ProjDescNamePas2JSNodeJSApp = 'NodeJS Application'; ProjDescNamePas2JSModuleApp = 'Pas2JS Library'; FileDescNameClassFromHTMLFile = 'Class definition from HTML file'; @@ -139,6 +140,7 @@ type FCSSStyleFilename: string; FIconSizes: TWordDynArray; FImagesDir: string; + FLPGFilename: string; FManifestFilename: string; FServiceWorker: TProjectPas2JSServiceWorker; FServiceWorkerLPR: string; @@ -166,13 +168,16 @@ type property ManifestFilename: string read FManifestFilename write FManifestFilename; property IconSizes: TWordDynArray read FIconSizes write FIconSizes; property ServiceWorker: TProjectPas2JSServiceWorker read FServiceWorker write FServiceWorker; + property LPGFilename: string read FLPGFilename write FLPGFilename; end; { TProjectPas2JSElectronWebApp } TProjectPas2JSElectronWebApp = class(TMultiProjectPas2JSWebApp) private + FPackageFilename: string; protected + function ProjectDirSelected: boolean; override; public constructor Create; override; procedure Clear; override; @@ -180,6 +185,7 @@ type function GetLocalizedDescription: string; override; function InitProject(AProject: TLazProject): TModalResult; override; function CreateStartFiles(AProject: TLazProject): TModalResult; override; + property PackageFilename: string read FPackageFilename write FPackageFilename; end; { TProjectPas2JSNodeJSApp } @@ -333,24 +339,33 @@ end; { TProjectPas2JSElectronWebApp } +function TProjectPas2JSElectronWebApp.ProjectDirSelected: boolean; +begin + Result:=inherited ProjectDirSelected; + + PackageFilename:=CheckOverwriteFile(ProjectDir+PackageFilename); +end; + constructor TProjectPas2JSElectronWebApp.Create; begin inherited Create; + Name:=ProjDescNamePas2JSElectronWebApp; end; procedure TProjectPas2JSElectronWebApp.Clear; begin inherited Clear; + FPackageFilename:='package.json'; end; function TProjectPas2JSElectronWebApp.GetLocalizedName: string; begin - Result:=inherited GetLocalizedName; + Result:=pjsdElectronWebApplication; end; function TProjectPas2JSElectronWebApp.GetLocalizedDescription: string; begin - Result:=inherited GetLocalizedDescription; + Result:=pjsdAWebApplicationUsingElectronToRunAsDesktopApplicat; end; function TProjectPas2JSElectronWebApp.InitProject(AProject: TLazProject @@ -505,9 +520,6 @@ begin CurProjDir:=AppendPathDelim(CurProjDir); ProjectDir:=CurProjDir; - CheckOverwriteFile(MainSrcFileName); - CheckOverwriteFile(ChangeFileExt(MainSrcFileName,'.lpi')); - ProjectDirSelected; if Overwrites.Count>0 then @@ -526,6 +538,9 @@ end; function TMultiProjectPas2JSWebApp.ProjectDirSelected: boolean; begin Result:=true; + ScriptFilename:=ExtractFileNameOnly(MainSrcFileName)+'.js'; + CheckOverwriteFile(MainSrcFileName); + CheckOverwriteFile(ChangeFileExt(MainSrcFileName,'.lpi')); end; constructor TMultiProjectPas2JSWebApp.Create; @@ -570,8 +585,7 @@ end; function TProjectPas2JSProgressiveWebApp.ProjectDirSelected: boolean; begin - Result:=true; - ScriptFilename:=ExtractFileNameOnly(MainSrcFileName)+'.js'; + Result:=inherited ProjectDirSelected; ServiceWorkerLPR:=CheckOverwriteFile(ProjectDir+ServiceWorkerLPR); CheckOverwriteFile(ChangeFileExt(ServiceWorkerLPR,'.lpi')); @@ -582,6 +596,8 @@ begin HTMLFilename:=CheckOverwriteFile(WebDir+HTMLFilename); ManifestFilename:=CheckOverwriteFile(WebDir+ManifestFilename); CSSStyleFilename:=CheckOverwriteFile(WebDir+CSSStyleFilename); + + LPGFilename:=CheckOverwriteFile(ChangeFileExt(MainSrcFileName,'.lpg')); end; function TProjectPas2JSProgressiveWebApp.CreateManifestFile( @@ -694,13 +710,11 @@ end; function TProjectPas2JSProgressiveWebApp.CreateProjectGroup( AProject: TLazProject): boolean; var - LPGFilename, ServiceWorkerLPI, WebAppLPI: String; + ServiceWorkerLPI: String; Grp: TProjectGroup; begin Result:=false; - WebAppLPI:=AProject.ProjectInfoFile; - LPGFilename:=ChangeFileExt(WebAppLPI,'.lpg'); ServiceWorkerLPI:=ChangeFileExt(ServiceWorkerLPR,'.lpi'); if not IDEProjectGroupManager.NewProjectGroup(false) then @@ -710,7 +724,7 @@ begin end; Grp:=IDEProjectGroupManager.CurrentProjectGroup; Grp.FileName:=LPGFilename; - Grp.AddTarget(WebAppLPI); + Grp.AddTarget(AProject.ProjectInfoFile); Grp.AddTarget(ServiceWorkerLPI); if not IDEProjectGroupManager.SaveProjectGroup then begin diff --git a/components/pas2js/strpas2jsdesign.pp b/components/pas2js/strpas2jsdesign.pp index 4840c2f16d..e29f3211ff 100644 --- a/components/pas2js/strpas2jsdesign.pp +++ b/components/pas2js/strpas2jsdesign.pp @@ -11,6 +11,9 @@ Resourcestring pjsdWebApplication = 'Web Browser Application'; pjsdWebAppDescription = 'A pas2js program running in the browser.'; pjsdProgressiveWebApplication = 'Progressive Web Application'; + pjsdElectronWebApplication = 'Electron Web Application'; + pjsdAWebApplicationUsingElectronToRunAsDesktopApplicat = 'A Web Application ' + +'using Electron to run as desktop application.'; pjsdOverwrite = 'Overwrite?'; pjsdError = 'Error'; pjsdNewProjectFile = 'New project file';