pas2js: electron: description

This commit is contained in:
mattias 2022-04-18 13:24:18 +02:00
parent cd0630d395
commit 62f9d457c6
9 changed files with 84 additions and 11 deletions

View File

@ -19,6 +19,10 @@ msgstr ""
msgid "Atom package template directory" msgid "Atom package template directory"
msgstr "Répertoire des modèles de paquets Atom" 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 #: strpas2jsdesign.pjsdbrowse
msgid "Browse" msgid "Browse"
msgstr "Parcourir" msgstr "Parcourir"
@ -40,6 +44,10 @@ msgstr "Créer la page initiale HTML"
msgid "directory \"%s\" not found" msgid "directory \"%s\" not found"
msgstr "répertoire \"%s\" non trouvé" msgstr "répertoire \"%s\" non trouvé"
#: strpas2jsdesign.pjsdelectronwebapplication
msgid "Electron Web Application"
msgstr ""
#: strpas2jsdesign.pjsderror #: strpas2jsdesign.pjsderror
msgid "Error" msgid "Error"
msgstr "" msgstr ""

View File

@ -19,6 +19,10 @@ msgstr ""
msgid "Atom package template directory" msgid "Atom package template directory"
msgstr "" msgstr ""
#: strpas2jsdesign.pjsdawebapplicationusingelectrontorunasdesktopapplicat
msgid "A Web Application using Electron to run as desktop application."
msgstr ""
#: strpas2jsdesign.pjsdbrowse #: strpas2jsdesign.pjsdbrowse
msgid "Browse" msgid "Browse"
msgstr "Böngészés" msgstr "Böngészés"
@ -40,6 +44,10 @@ msgstr "Kezdő HTML lap létrehozása"
msgid "directory \"%s\" not found" msgid "directory \"%s\" not found"
msgstr "a(z) \"%s\" könyvtár nem található" msgstr "a(z) \"%s\" könyvtár nem található"
#: strpas2jsdesign.pjsdelectronwebapplication
msgid "Electron Web Application"
msgstr ""
#: strpas2jsdesign.pjsderror #: strpas2jsdesign.pjsderror
msgid "Error" msgid "Error"
msgstr "" msgstr ""

View File

@ -9,6 +9,10 @@ msgstr ""
msgid "Atom package template directory" msgid "Atom package template directory"
msgstr "" msgstr ""
#: strpas2jsdesign.pjsdawebapplicationusingelectrontorunasdesktopapplicat
msgid "A Web Application using Electron to run as desktop application."
msgstr ""
#: strpas2jsdesign.pjsdbrowse #: strpas2jsdesign.pjsdbrowse
msgid "Browse" msgid "Browse"
msgstr "" msgstr ""
@ -30,6 +34,10 @@ msgstr ""
msgid "directory \"%s\" not found" msgid "directory \"%s\" not found"
msgstr "" msgstr ""
#: strpas2jsdesign.pjsdelectronwebapplication
msgid "Electron Web Application"
msgstr ""
#: strpas2jsdesign.pjsderror #: strpas2jsdesign.pjsderror
msgid "Error" msgid "Error"
msgstr "" msgstr ""

View File

@ -19,6 +19,10 @@ msgstr ""
msgid "Atom package template directory" msgid "Atom package template directory"
msgstr "Diretório de modelos de pacote do Atom" 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 #: strpas2jsdesign.pjsdbrowse
msgid "Browse" msgid "Browse"
msgstr "Navegar" msgstr "Navegar"
@ -40,6 +44,10 @@ msgstr "Criar página HTML inicial"
msgid "directory \"%s\" not found" msgid "directory \"%s\" not found"
msgstr "diretório \"%s\" não encontrado" msgstr "diretório \"%s\" não encontrado"
#: strpas2jsdesign.pjsdelectronwebapplication
msgid "Electron Web Application"
msgstr ""
#: strpas2jsdesign.pjsderror #: strpas2jsdesign.pjsderror
msgid "Error" msgid "Error"
msgstr "" msgstr ""

View File

@ -19,6 +19,10 @@ msgstr ""
msgid "Atom package template directory" msgid "Atom package template directory"
msgstr "" msgstr ""
#: strpas2jsdesign.pjsdawebapplicationusingelectrontorunasdesktopapplicat
msgid "A Web Application using Electron to run as desktop application."
msgstr ""
#: strpas2jsdesign.pjsdbrowse #: strpas2jsdesign.pjsdbrowse
msgid "Browse" msgid "Browse"
msgstr "" msgstr ""
@ -40,6 +44,10 @@ msgstr ""
msgid "directory \"%s\" not found" msgid "directory \"%s\" not found"
msgstr "" msgstr ""
#: strpas2jsdesign.pjsdelectronwebapplication
msgid "Electron Web Application"
msgstr ""
#: strpas2jsdesign.pjsderror #: strpas2jsdesign.pjsderror
msgid "Error" msgid "Error"
msgstr "" msgstr ""

View File

@ -21,6 +21,10 @@ msgstr ""
msgid "Atom package template directory" msgid "Atom package template directory"
msgstr "Тека шаблонів пакунка Atom" msgstr "Тека шаблонів пакунка Atom"
#: strpas2jsdesign.pjsdawebapplicationusingelectrontorunasdesktopapplicat
msgid "A Web Application using Electron to run as desktop application."
msgstr ""
#: strpas2jsdesign.pjsdbrowse #: strpas2jsdesign.pjsdbrowse
msgid "Browse" msgid "Browse"
msgstr "Огляд" msgstr "Огляд"
@ -42,6 +46,10 @@ msgstr "Створити початкову HTML-сторінку"
msgid "directory \"%s\" not found" msgid "directory \"%s\" not found"
msgstr "теку \"%s\" не знайдено" msgstr "теку \"%s\" не знайдено"
#: strpas2jsdesign.pjsdelectronwebapplication
msgid "Electron Web Application"
msgstr ""
#: strpas2jsdesign.pjsderror #: strpas2jsdesign.pjsderror
msgid "Error" msgid "Error"
msgstr "" msgstr ""

View File

@ -20,6 +20,10 @@ msgstr ""
msgid "Atom package template directory" msgid "Atom package template directory"
msgstr "" msgstr ""
#: strpas2jsdesign.pjsdawebapplicationusingelectrontorunasdesktopapplicat
msgid "A Web Application using Electron to run as desktop application."
msgstr ""
#: strpas2jsdesign.pjsdbrowse #: strpas2jsdesign.pjsdbrowse
msgid "Browse" msgid "Browse"
msgstr "" msgstr ""
@ -41,6 +45,10 @@ msgstr ""
msgid "directory \"%s\" not found" msgid "directory \"%s\" not found"
msgstr "" msgstr ""
#: strpas2jsdesign.pjsdelectronwebapplication
msgid "Electron Web Application"
msgstr ""
#: strpas2jsdesign.pjsderror #: strpas2jsdesign.pjsderror
msgid "Error" msgid "Error"
msgstr "" msgstr ""

View File

@ -26,6 +26,7 @@ const
ProjDescNamePas2JSWebApp = 'Web Application'; ProjDescNamePas2JSWebApp = 'Web Application';
ProjDescNamePas2JSProgressiveWebApp = 'Progressive Web Application'; ProjDescNamePas2JSProgressiveWebApp = 'Progressive Web Application';
ProjDescNamePas2JSServiceWorker = 'Pas2JS Service Worker'; ProjDescNamePas2JSServiceWorker = 'Pas2JS Service Worker';
ProjDescNamePas2JSElectronWebApp = 'Electron Web Application';
ProjDescNamePas2JSNodeJSApp = 'NodeJS Application'; ProjDescNamePas2JSNodeJSApp = 'NodeJS Application';
ProjDescNamePas2JSModuleApp = 'Pas2JS Library'; ProjDescNamePas2JSModuleApp = 'Pas2JS Library';
FileDescNameClassFromHTMLFile = 'Class definition from HTML file'; FileDescNameClassFromHTMLFile = 'Class definition from HTML file';
@ -139,6 +140,7 @@ type
FCSSStyleFilename: string; FCSSStyleFilename: string;
FIconSizes: TWordDynArray; FIconSizes: TWordDynArray;
FImagesDir: string; FImagesDir: string;
FLPGFilename: string;
FManifestFilename: string; FManifestFilename: string;
FServiceWorker: TProjectPas2JSServiceWorker; FServiceWorker: TProjectPas2JSServiceWorker;
FServiceWorkerLPR: string; FServiceWorkerLPR: string;
@ -166,13 +168,16 @@ type
property ManifestFilename: string read FManifestFilename write FManifestFilename; property ManifestFilename: string read FManifestFilename write FManifestFilename;
property IconSizes: TWordDynArray read FIconSizes write FIconSizes; property IconSizes: TWordDynArray read FIconSizes write FIconSizes;
property ServiceWorker: TProjectPas2JSServiceWorker read FServiceWorker write FServiceWorker; property ServiceWorker: TProjectPas2JSServiceWorker read FServiceWorker write FServiceWorker;
property LPGFilename: string read FLPGFilename write FLPGFilename;
end; end;
{ TProjectPas2JSElectronWebApp } { TProjectPas2JSElectronWebApp }
TProjectPas2JSElectronWebApp = class(TMultiProjectPas2JSWebApp) TProjectPas2JSElectronWebApp = class(TMultiProjectPas2JSWebApp)
private private
FPackageFilename: string;
protected protected
function ProjectDirSelected: boolean; override;
public public
constructor Create; override; constructor Create; override;
procedure Clear; override; procedure Clear; override;
@ -180,6 +185,7 @@ type
function GetLocalizedDescription: string; override; function GetLocalizedDescription: string; override;
function InitProject(AProject: TLazProject): TModalResult; override; function InitProject(AProject: TLazProject): TModalResult; override;
function CreateStartFiles(AProject: TLazProject): TModalResult; override; function CreateStartFiles(AProject: TLazProject): TModalResult; override;
property PackageFilename: string read FPackageFilename write FPackageFilename;
end; end;
{ TProjectPas2JSNodeJSApp } { TProjectPas2JSNodeJSApp }
@ -333,24 +339,33 @@ end;
{ TProjectPas2JSElectronWebApp } { TProjectPas2JSElectronWebApp }
function TProjectPas2JSElectronWebApp.ProjectDirSelected: boolean;
begin
Result:=inherited ProjectDirSelected;
PackageFilename:=CheckOverwriteFile(ProjectDir+PackageFilename);
end;
constructor TProjectPas2JSElectronWebApp.Create; constructor TProjectPas2JSElectronWebApp.Create;
begin begin
inherited Create; inherited Create;
Name:=ProjDescNamePas2JSElectronWebApp;
end; end;
procedure TProjectPas2JSElectronWebApp.Clear; procedure TProjectPas2JSElectronWebApp.Clear;
begin begin
inherited Clear; inherited Clear;
FPackageFilename:='package.json';
end; end;
function TProjectPas2JSElectronWebApp.GetLocalizedName: string; function TProjectPas2JSElectronWebApp.GetLocalizedName: string;
begin begin
Result:=inherited GetLocalizedName; Result:=pjsdElectronWebApplication;
end; end;
function TProjectPas2JSElectronWebApp.GetLocalizedDescription: string; function TProjectPas2JSElectronWebApp.GetLocalizedDescription: string;
begin begin
Result:=inherited GetLocalizedDescription; Result:=pjsdAWebApplicationUsingElectronToRunAsDesktopApplicat;
end; end;
function TProjectPas2JSElectronWebApp.InitProject(AProject: TLazProject function TProjectPas2JSElectronWebApp.InitProject(AProject: TLazProject
@ -505,9 +520,6 @@ begin
CurProjDir:=AppendPathDelim(CurProjDir); CurProjDir:=AppendPathDelim(CurProjDir);
ProjectDir:=CurProjDir; ProjectDir:=CurProjDir;
CheckOverwriteFile(MainSrcFileName);
CheckOverwriteFile(ChangeFileExt(MainSrcFileName,'.lpi'));
ProjectDirSelected; ProjectDirSelected;
if Overwrites.Count>0 then if Overwrites.Count>0 then
@ -526,6 +538,9 @@ end;
function TMultiProjectPas2JSWebApp.ProjectDirSelected: boolean; function TMultiProjectPas2JSWebApp.ProjectDirSelected: boolean;
begin begin
Result:=true; Result:=true;
ScriptFilename:=ExtractFileNameOnly(MainSrcFileName)+'.js';
CheckOverwriteFile(MainSrcFileName);
CheckOverwriteFile(ChangeFileExt(MainSrcFileName,'.lpi'));
end; end;
constructor TMultiProjectPas2JSWebApp.Create; constructor TMultiProjectPas2JSWebApp.Create;
@ -570,8 +585,7 @@ end;
function TProjectPas2JSProgressiveWebApp.ProjectDirSelected: boolean; function TProjectPas2JSProgressiveWebApp.ProjectDirSelected: boolean;
begin begin
Result:=true; Result:=inherited ProjectDirSelected;
ScriptFilename:=ExtractFileNameOnly(MainSrcFileName)+'.js';
ServiceWorkerLPR:=CheckOverwriteFile(ProjectDir+ServiceWorkerLPR); ServiceWorkerLPR:=CheckOverwriteFile(ProjectDir+ServiceWorkerLPR);
CheckOverwriteFile(ChangeFileExt(ServiceWorkerLPR,'.lpi')); CheckOverwriteFile(ChangeFileExt(ServiceWorkerLPR,'.lpi'));
@ -582,6 +596,8 @@ begin
HTMLFilename:=CheckOverwriteFile(WebDir+HTMLFilename); HTMLFilename:=CheckOverwriteFile(WebDir+HTMLFilename);
ManifestFilename:=CheckOverwriteFile(WebDir+ManifestFilename); ManifestFilename:=CheckOverwriteFile(WebDir+ManifestFilename);
CSSStyleFilename:=CheckOverwriteFile(WebDir+CSSStyleFilename); CSSStyleFilename:=CheckOverwriteFile(WebDir+CSSStyleFilename);
LPGFilename:=CheckOverwriteFile(ChangeFileExt(MainSrcFileName,'.lpg'));
end; end;
function TProjectPas2JSProgressiveWebApp.CreateManifestFile( function TProjectPas2JSProgressiveWebApp.CreateManifestFile(
@ -694,13 +710,11 @@ end;
function TProjectPas2JSProgressiveWebApp.CreateProjectGroup( function TProjectPas2JSProgressiveWebApp.CreateProjectGroup(
AProject: TLazProject): boolean; AProject: TLazProject): boolean;
var var
LPGFilename, ServiceWorkerLPI, WebAppLPI: String; ServiceWorkerLPI: String;
Grp: TProjectGroup; Grp: TProjectGroup;
begin begin
Result:=false; Result:=false;
WebAppLPI:=AProject.ProjectInfoFile;
LPGFilename:=ChangeFileExt(WebAppLPI,'.lpg');
ServiceWorkerLPI:=ChangeFileExt(ServiceWorkerLPR,'.lpi'); ServiceWorkerLPI:=ChangeFileExt(ServiceWorkerLPR,'.lpi');
if not IDEProjectGroupManager.NewProjectGroup(false) then if not IDEProjectGroupManager.NewProjectGroup(false) then
@ -710,7 +724,7 @@ begin
end; end;
Grp:=IDEProjectGroupManager.CurrentProjectGroup; Grp:=IDEProjectGroupManager.CurrentProjectGroup;
Grp.FileName:=LPGFilename; Grp.FileName:=LPGFilename;
Grp.AddTarget(WebAppLPI); Grp.AddTarget(AProject.ProjectInfoFile);
Grp.AddTarget(ServiceWorkerLPI); Grp.AddTarget(ServiceWorkerLPI);
if not IDEProjectGroupManager.SaveProjectGroup then if not IDEProjectGroupManager.SaveProjectGroup then
begin begin

View File

@ -11,6 +11,9 @@ Resourcestring
pjsdWebApplication = 'Web Browser Application'; pjsdWebApplication = 'Web Browser Application';
pjsdWebAppDescription = 'A pas2js program running in the browser.'; pjsdWebAppDescription = 'A pas2js program running in the browser.';
pjsdProgressiveWebApplication = 'Progressive Web Application'; pjsdProgressiveWebApplication = 'Progressive Web Application';
pjsdElectronWebApplication = 'Electron Web Application';
pjsdAWebApplicationUsingElectronToRunAsDesktopApplicat = 'A Web Application '
+'using Electron to run as desktop application.';
pjsdOverwrite = 'Overwrite?'; pjsdOverwrite = 'Overwrite?';
pjsdError = 'Error'; pjsdError = 'Error';
pjsdNewProjectFile = 'New project file'; pjsdNewProjectFile = 'New project file';