mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 15:19:35 +02:00
IDE: New project description for an application with UTF8 RTL support.
git-svn-id: trunk@47571 -
This commit is contained in:
parent
4a4651ad58
commit
74d2ec821a
@ -32,6 +32,7 @@ const
|
||||
|
||||
ProjDescGroupName = 'Project';
|
||||
ProjDescNameApplication = 'Application';
|
||||
ProjDescNameUtf8Application = 'UTF-8 Application';
|
||||
ProjDescNameSimpleProgram = 'Simple Program';
|
||||
ProjDescNameProgram = 'Program';
|
||||
ProjDescNameConsoleApplication = 'Console application';
|
||||
|
@ -2326,6 +2326,7 @@ resourcestring
|
||||
dlgProjectOptions = 'Project Options';
|
||||
dlgProjectOptionsFor = 'Options for Project: %s';
|
||||
dlgPOApplication = 'Application';
|
||||
dlgPOUtf8Application = 'UTF-8 Application';
|
||||
dlgPOFroms = 'Forms';
|
||||
dlgPOResources = 'Resources';
|
||||
rsResourceFileName = 'File name';
|
||||
@ -4646,6 +4647,8 @@ resourcestring
|
||||
|
||||
lisApplicationProgramDescriptor = 'A graphical Free Pascal application using'
|
||||
+' the cross-platform LCL library for its GUI.';
|
||||
lisUtf8ApplicationProgramDescriptor = 'A graphical application for FPC 3.0 and higher using'
|
||||
+' the cross-platform LCL library for its GUI and mapping FPC default String to UTF-8 encoding.';
|
||||
lisSimpleProgramProgramDescriptor = 'A most simple Free Pascal command line program.';
|
||||
lisProgramProgramDescriptor = 'A Free Pascal command line program with some useful settings added.';
|
||||
lisConsoleApplicationProgramDescriptor = 'A Free Pascal command line program using'
|
||||
|
@ -2564,6 +2564,7 @@ begin
|
||||
// project descriptors
|
||||
LazProjectDescriptors:=TLazProjectDescriptors.Create;
|
||||
RegisterProjectDescriptor(TProjectApplicationDescriptor.Create);
|
||||
RegisterProjectDescriptor(TProjectUtf8ApplicationDescriptor.Create);
|
||||
RegisterProjectDescriptor(TProjectSimpleProgramDescriptor.Create);
|
||||
RegisterProjectDescriptor(TProjectProgramDescriptor.Create);
|
||||
RegisterProjectDescriptor(TProjectConsoleApplicationDescriptor.Create);
|
||||
|
@ -315,6 +315,14 @@ type
|
||||
function CreateStartFiles({%H-}AProject: TLazProject): TModalResult; override;
|
||||
end;
|
||||
|
||||
TProjectUtf8ApplicationDescriptor = class(TProjectApplicationDescriptor)
|
||||
public
|
||||
constructor Create; override;
|
||||
function GetLocalizedName: string; override;
|
||||
function GetLocalizedDescription: string; override;
|
||||
function InitProject(AProject: TLazProject): TModalResult; override;
|
||||
end;
|
||||
|
||||
{ TProjectSimpleProgramDescriptor }
|
||||
|
||||
TProjectSimpleProgramDescriptor = class(TProjectDescriptor)
|
||||
@ -1261,8 +1269,7 @@ begin
|
||||
Result := GetLocalizedName + LineEnding+LineEnding + lisApplicationProgramDescriptor;
|
||||
end;
|
||||
|
||||
function TProjectApplicationDescriptor.InitProject(
|
||||
AProject: TLazProject): TModalResult;
|
||||
function TProjectApplicationDescriptor.InitProject(AProject: TLazProject): TModalResult;
|
||||
var
|
||||
NewSource: String;
|
||||
MainFile: TLazProjectFile;
|
||||
@ -1312,6 +1319,33 @@ begin
|
||||
[nfIsPartOfProject,nfOpenInEditor,nfCreateDefaultSrc]);
|
||||
end;
|
||||
|
||||
{ TProjectUtf8ApplicationDescriptor }
|
||||
|
||||
constructor TProjectUtf8ApplicationDescriptor.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
Name:=ProjDescNameUtf8Application;
|
||||
end;
|
||||
|
||||
function TProjectUtf8ApplicationDescriptor.GetLocalizedName: string;
|
||||
begin
|
||||
Result:=dlgPOUtf8Application;
|
||||
end;
|
||||
|
||||
function TProjectUtf8ApplicationDescriptor.GetLocalizedDescription: string;
|
||||
begin
|
||||
Result := GetLocalizedName + LineEnding+LineEnding + lisUtf8ApplicationProgramDescriptor;
|
||||
end;
|
||||
|
||||
function TProjectUtf8ApplicationDescriptor.InitProject(AProject: TLazProject): TModalResult;
|
||||
begin
|
||||
Result := inherited InitProject(AProject);
|
||||
Assert(AProject.LazCompilerOptions.CustomOptions='',
|
||||
'TProjectUtf8ApplicationDescriptor.InitProject: CustomOptions<>''');
|
||||
AProject.LazCompilerOptions.CustomOptions := '-dEnableUTF8RTL' + LineEnding
|
||||
+ '-FcUTF8' + LineEnding;
|
||||
end;
|
||||
|
||||
{ TProjectSimpleProgramDescriptor }
|
||||
|
||||
constructor TProjectSimpleProgramDescriptor.Create;
|
||||
|
Loading…
Reference in New Issue
Block a user