IDE: Simplify the publish module dialog more and rename it.

git-svn-id: trunk@58804 -
This commit is contained in:
juha 2018-08-30 11:16:09 +00:00
parent c01e05aaf0
commit 066994a334
9 changed files with 177 additions and 367 deletions

4
.gitattributes vendored
View File

@ -7037,8 +7037,8 @@ ide/projectuserresources.pas svneol=native#text/pascal
ide/projectwizarddlg.lfm svneol=native#text/plain ide/projectwizarddlg.lfm svneol=native#text/plain
ide/projectwizarddlg.pas svneol=native#text/plain ide/projectwizarddlg.pas svneol=native#text/plain
ide/publishmodule.pas svneol=native#text/pascal ide/publishmodule.pas svneol=native#text/pascal
ide/publishprojectdlg.lfm svneol=native#text/plain ide/publishmoduledlg.lfm svneol=native#text/plain
ide/publishprojectdlg.pas svneol=native#text/pascal ide/publishmoduledlg.pas svneol=native#text/pascal
ide/qfinitlocalvardlg.lfm svneol=native#text/plain ide/qfinitlocalvardlg.lfm svneol=native#text/plain
ide/qfinitlocalvardlg.pas svneol=native#text/plain ide/qfinitlocalvardlg.pas svneol=native#text/plain
ide/raw_window.pas svneol=native#text/plain ide/raw_window.pas svneol=native#text/plain

View File

@ -363,7 +363,7 @@ begin
P.Sources.AddSrc('projectresources.pas'); P.Sources.AddSrc('projectresources.pas');
P.Sources.AddSrc('projectwizarddlg.pas'); P.Sources.AddSrc('projectwizarddlg.pas');
P.Sources.AddSrc('publishmodule.pas'); P.Sources.AddSrc('publishmodule.pas');
P.Sources.AddSrc('publishprojectdlg.pas'); P.Sources.AddSrc('publishmoduledlg.pas');
P.Sources.AddSrc('restrictionbrowser.pas'); P.Sources.AddSrc('restrictionbrowser.pas');
P.Sources.AddSrc('runparamsopts.pas'); P.Sources.AddSrc('runparamsopts.pas');
P.Sources.AddSrc('searchfrm.pas'); P.Sources.AddSrc('searchfrm.pas');

View File

@ -55,10 +55,8 @@ uses
const const
// these are the names of the various history lists in the IDE: // these are the names of the various history lists in the IDE:
hlPublishProjectDestDirs = 'PublishProjectDestinationDirectories'; hlPublishModuleDestDirs = 'PublishModuleDestinationDirectories';
//hlPublishProjectCommandsAfter = 'PublishProjectCommmandsAfter'; hlPublishModuleFileFilter = 'PublishModuleFileFilter';
hlPublishProjectIncludeFileFilter = 'PublishProjectIncludeFileFilter';
hlPublishProjectExcludeFileFilter = 'PublishProjectExcludeFileFilter';
hlMakeResourceStringSections = 'MakeResourceStringSections'; hlMakeResourceStringSections = 'MakeResourceStringSections';
hlMakeResourceStringPrefixes = 'MakeResourceStringPrefixes'; hlMakeResourceStringPrefixes = 'MakeResourceStringPrefixes';
hlMakeResourceStringLengths = 'MakeResourceStringLengths'; hlMakeResourceStringLengths = 'MakeResourceStringLengths';

View File

@ -1262,34 +1262,6 @@ resourcestring
dlgObjInsp = 'Object Inspector'; dlgObjInsp = 'Object Inspector';
dlgEnvFiles = 'Files'; dlgEnvFiles = 'Files';
// Publish project / package
lisDestinationDirectory = 'Destination directory';
lisChooseDirectory = 'Choose directory';
lisCompress = 'Compress';
lisCompressHint = 'The resulting directory will be compressed into a ZIP file.';
lisPublishModuleNote = 'Files belonging to project / package will be included automatically.';
lisSimpleSyntax = 'Simple syntax';
lisNormallyTheFilterIsARegularExpressionInSimpleSynta = 'Normally the '
+'filter is a regular expression. In simple syntax a . is a normal '
+'character, a * stands for anything, a ? stands for any character, and '
+'comma and semicolon separates alternatives. For example: Simple '
+'syntax *.pas;*.pp corresponds to ^(.*\.pas|.*\.pp)$';
lisUseFiltersForExtraFiles = 'Use filters for extra files';
lisIncludeFilter = 'Include filter';
lisExcludeFilter = 'Exclude filter';
lisInvalidPublishingDirectory = 'Invalid publishing Directory';
lisSourceDirectoryAndDestinationDirectoryAreTheSameMa = 'Source directory "%s"'
+'%sand destination directory "%s"'
+'%sare the same. Maybe you misunderstand this feature.'
+'%sIt will clean/recreate the destination directory and copy the package/project into it.';
lisClearDirectory = 'Clear Directory?';
lisInOrderToCreateACleanCopyOfTheProjectPackageAllFil = 'In order to create '
+'a clean copy of the project/package, all files in the following '
+'directory will be deleted and all its content will be lost.'
+'%sDelete all files in "%s"?';
lisUnableToCleanUpDestinationDirectory = 'Unable to clean up destination directory';
lisUnableToCleanUpPleaseCheckPermissions = 'Unable to clean up "%s".%sPlease check permissions.';
// //
dlgEnvBckup = 'Backup'; dlgEnvBckup = 'Backup';
dlgNaming = 'Naming'; dlgNaming = 'Naming';
@ -2773,12 +2745,6 @@ resourcestring
lisShowPackages = 'Show packages'; lisShowPackages = 'Show packages';
lisShowUnits = 'Show units'; lisShowUnits = 'Show units';
lisShowIdentifiers = 'Show identifiers'; lisShowIdentifiers = 'Show identifiers';
lisFilter = 'Filter';
lisCreateFilter = 'Create Filter';
lisIssues = 'Issues';
lisRegularExpression = 'Regular expression';
lisInvalidFilter = 'Invalid filter';
lisInvalidExpression = 'Invalid expression:%s%s%s%s';
lisPrivate = 'Private'; lisPrivate = 'Private';
lisProtected = 'Protected'; lisProtected = 'Protected';
lisEMDPublic = 'Public'; lisEMDPublic = 'Public';
@ -3898,9 +3864,39 @@ resourcestring
lisSortSelIgnoreSpace = 'Ignore Space'; lisSortSelIgnoreSpace = 'Ignore Space';
lisSortSelSort = 'Accept'; lisSortSelSort = 'Accept';
// publish project dialog // Publish project/package + Add dir to package
lisPublProjInvalidIncludeFilter = 'Invalid include filter'; lisDestinationDirectory = 'Destination directory';
lisPublProjInvalidExcludeFilter = 'Invalid exclude filter'; lisChooseDirectory = 'Choose directory';
lisCompress = 'Compress';
lisCompressHint = 'The resulting directory will be compressed into a ZIP file.';
lisPublishModuleNote = 'Files belonging to project / package will be included automatically.';
lisSimpleSyntax = 'Simple syntax';
lisNormallyTheFilterIsARegularExpressionInSimpleSynta = 'Normally the '
+'filter is a regular expression. In simple syntax a . is a normal '
+'character, a * stands for anything, a ? stands for any character, and '
+'comma and semicolon separates alternatives. For example: Simple '
+'syntax *.pas;*.pp corresponds to ^(.*\.pas|.*\.pp)$';
lisUseFilterForExtraFiles = 'Use filter for extra files';
lisIncludeFilter = 'Include filter';
lisExcludeFilter = 'Exclude filter';
lisInvalidPublishingDirectory = 'Invalid publishing Directory';
lisSourceDirectoryAndDestinationDirectoryAreTheSameMa = 'Source directory "%s"'
+'%sand destination directory "%s"'
+'%sare the same. Maybe you misunderstand this feature.'
+'%sIt will clean/recreate the destination directory and copy the package/project into it.';
lisClearDirectory = 'Clear Directory?';
lisInOrderToCreateACleanCopyOfTheProjectPackageAllFil = 'In order to create '
+'a clean copy of the project/package, all files in the following '
+'directory will be deleted and all its content will be lost.'
+'%sDelete all files in "%s"?';
lisUnableToCleanUpDestinationDirectory = 'Unable to clean up destination directory';
lisUnableToCleanUpPleaseCheckPermissions = 'Unable to clean up "%s".%sPlease check permissions.';
lisFilter = 'Filter';
lisCreateFilter = 'Create Filter';
lisIssues = 'Issues';
lisRegularExpression = 'Regular expression';
lisInvalidFilter = 'Invalid filter';
lisInvalidExpression = 'Invalid expression:%s%s%s%s';
// project options // project options
lisProjOptsUnableToChangeTheAutoCreateFormList = 'Unable to change the auto ' lisProjOptsUnableToChangeTheAutoCreateFormList = 'Unable to change the auto '

View File

@ -90,7 +90,7 @@ uses
ExtTools, ExtToolsIDE, ExtTools, ExtToolsIDE,
// projects // projects
ProjectResources, Project, ProjectDefs, NewProjectDlg, ProjectResources, Project, ProjectDefs, NewProjectDlg,
PublishProjectDlg, ProjectInspector, PackageDefs, ProjectDescriptors, PublishModuleDlg, ProjectInspector, PackageDefs, ProjectDescriptors,
// help manager // help manager
IDEContextHelpEdit, IDEHelpIntf, IDEHelpManager, CodeHelp, HelpOptions, IDEContextHelpEdit, IDEHelpIntf, IDEHelpManager, CodeHelp, HelpOptions,
// designer // designer

View File

@ -50,28 +50,21 @@ type
private private
FCompressFinally: boolean; FCompressFinally: boolean;
FDestinationDirectory: string; FDestinationDirectory: string;
FExcludeFileFilter: string; FFileFilter: string;
FExcludeFilterRegExpr: TRegExpr; FFilterRegExpr: TRegExpr;
FExcludeFilterSimpleSyntax: boolean; FFilterSimpleSyntax: boolean;
FExcludeFilterValid: boolean; FFilterValid: boolean;
FIncludeFileFilter: string;
FIncludeFilterRegExpr: TRegExpr;
FIncludeFilterSimpleSyntax: boolean;
FIncludeFilterValid: boolean;
FModified: boolean; FModified: boolean;
FModifiedLock: integer; FModifiedLock: integer;
FOwner: TObject; FOwner: TObject;
FUseFileFilters: boolean; FUseFileFilters: boolean;
procedure SetCompressFinally(const AValue: boolean); procedure SetCompressFinally(const AValue: boolean);
procedure SetDestinationDirectory(const AValue: string); procedure SetDestinationDirectory(const AValue: string);
procedure SetExcludeFileFilter(const AValue: string); procedure SetFileFilter(const AValue: string);
procedure SetExcludeFilterSimpleSyntax(const AValue: boolean); procedure SetFilterSimpleSyntax(const AValue: boolean);
procedure SetIncludeFileFilter(const AValue: string);
procedure SetIncludeFilterSimpleSyntax(const AValue: boolean);
procedure SetModified(const AValue: boolean); procedure SetModified(const AValue: boolean);
procedure SetUseFileFilters(const AValue: boolean); procedure SetUseFileFilters(const AValue: boolean);
procedure UpdateIncludeFilter; procedure UpdateFilter;
procedure UpdateExcludeFilter;
protected protected
procedure DoOnModifyChange; virtual; procedure DoOnModifyChange; virtual;
public public
@ -93,28 +86,20 @@ type
// destination // destination
property DestinationDirectory: string property DestinationDirectory: string
read FDestinationDirectory write SetDestinationDirectory; read FDestinationDirectory write SetDestinationDirectory;
property CompressFinally: boolean read FCompressFinally write SetCompressFinally; property CompressFinally: boolean read FCompressFinally write SetCompressFinally;
property UseFileFilters: boolean read FUseFileFilters write SetUseFileFilters; property UseFileFilters: boolean read FUseFileFilters write SetUseFileFilters;
// Include Filter // Filter
property IncludeFilterSimpleSyntax: boolean property FilterSimpleSyntax: boolean read FFilterSimpleSyntax write SetFilterSimpleSyntax;
read FIncludeFilterSimpleSyntax write SetIncludeFilterSimpleSyntax; property FileFilter: string read FFileFilter write SetFileFilter;
property IncludeFileFilter: string property FilterValid: boolean read FFilterValid;
read FIncludeFileFilter write SetIncludeFileFilter;
property IncludeFilterValid: boolean read FIncludeFilterValid;
// Exclude Filter
property ExcludeFilterSimpleSyntax: boolean
read FExcludeFilterSimpleSyntax write SetExcludeFilterSimpleSyntax;
property ExcludeFileFilter: string
read FExcludeFileFilter write SetExcludeFileFilter;
property ExcludeFilterValid: boolean read FExcludeFilterValid;
end; end;
const const
PublishModulOptsVersion = 2; PublishModulOptsVersion = 2;
DefPublModIncFilter = '*.(pas|pp|inc|lpr|lfm|lrs|lpi|lpk|xml|sh)'; DefPublModIncFilter = '*.(pas|pp|inc|lpr|lfm|lrs|lpi|lpk|xml|sh)';
DefPublModExcFilter = '*.(bak|ppu|ppl|a|o|so);*~;backup'; //DefPublModExcFilter = '*.(bak|ppu|ppl|a|o|so);*~;backup';
function RealPublishDir(AOptions: TPublishModuleOptions): string; function RealPublishDir(AOptions: TPublishModuleOptions): string;
@ -151,35 +136,19 @@ begin
Modified:=true; Modified:=true;
end; end;
procedure TPublishModuleOptions.SetExcludeFileFilter(const AValue: string); procedure TPublishModuleOptions.SetFileFilter(const AValue: string);
begin begin
if FExcludeFileFilter=AValue then exit; if FFileFilter=AValue then exit;
FExcludeFileFilter:=AValue; FFileFilter:=AValue;
UpdateExcludeFilter; UpdateFilter;
Modified:=true; Modified:=true;
end; end;
procedure TPublishModuleOptions.SetExcludeFilterSimpleSyntax(const AValue: boolean); procedure TPublishModuleOptions.SetFilterSimpleSyntax(const AValue: boolean);
begin begin
if FExcludeFilterSimpleSyntax=AValue then exit; if FFilterSimpleSyntax=AValue then exit;
FExcludeFilterSimpleSyntax:=AValue; FFilterSimpleSyntax:=AValue;
UpdateExcludeFilter; UpdateFilter;
Modified:=true;
end;
procedure TPublishModuleOptions.SetIncludeFileFilter(const AValue: string);
begin
if FIncludeFileFilter=AValue then exit;
FIncludeFileFilter:=AValue;
UpdateIncludeFilter;
Modified:=true;
end;
procedure TPublishModuleOptions.SetIncludeFilterSimpleSyntax(const AValue: boolean);
begin
if FIncludeFilterSimpleSyntax=AValue then exit;
FIncludeFilterSimpleSyntax:=AValue;
UpdateIncludeFilter;
Modified:=true; Modified:=true;
end; end;
@ -198,44 +167,23 @@ begin
Modified:=true; Modified:=true;
end; end;
procedure TPublishModuleOptions.UpdateIncludeFilter; procedure TPublishModuleOptions.UpdateFilter;
var var
Expr: string; Expr: string;
begin begin
if FIncludeFilterRegExpr=nil then if FFilterRegExpr=nil then
FIncludeFilterRegExpr:=TRegExpr.Create; FFilterRegExpr:=TRegExpr.Create;
if IncludeFilterSimpleSyntax then if FilterSimpleSyntax then
Expr:=SimpleSyntaxToRegExpr(FIncludeFileFilter) Expr:=SimpleSyntaxToRegExpr(FFileFilter)
else else
Expr:=FIncludeFileFilter; Expr:=FFileFilter;
try try
FIncludeFilterRegExpr.Expression:=Expr; FFilterRegExpr.Expression:=Expr;
FIncludeFilterValid:=true; FFilterValid:=true;
except except
on E: Exception do begin on E: Exception do begin
DebugLn('Invalid Include File Expression ',Expr,' ',E.Message); DebugLn('Invalid File Expression ',Expr,' ',E.Message);
FIncludeFilterValid:=false; FFilterValid:=false;
end;
end;
end;
procedure TPublishModuleOptions.UpdateExcludeFilter;
var
Expr: string;
begin
if FExcludeFilterRegExpr=nil then
FExcludeFilterRegExpr:=TRegExpr.Create;
if ExcludeFilterSimpleSyntax then
Expr:=SimpleSyntaxToRegExpr(FExcludeFileFilter)
else
Expr:=FExcludeFileFilter;
try
FExcludeFilterRegExpr.Expression:=Expr;
FExcludeFilterValid:=true;
except
on E: Exception do begin
DebugLn('Invalid Exclude File Expression ',Expr,' ',E.Message);
FExcludeFilterValid:=false;
end; end;
end; end;
end; end;
@ -254,8 +202,7 @@ end;
destructor TPublishModuleOptions.Destroy; destructor TPublishModuleOptions.Destroy;
begin begin
Clear; Clear;
FIncludeFilterRegExpr.Free; FFilterRegExpr.Free;
FExcludeFilterRegExpr.Free;
inherited Destroy; inherited Destroy;
end; end;
@ -269,10 +216,8 @@ begin
DestinationDirectory:=GetDefaultDestinationDir; DestinationDirectory:=GetDefaultDestinationDir;
CompressFinally:=true; CompressFinally:=true;
UseFileFilters:=true; UseFileFilters:=true;
IncludeFilterSimpleSyntax:=true; FilterSimpleSyntax:=true;
IncludeFileFilter:=DefPublModIncFilter; FileFilter:=DefPublModIncFilter;
ExcludeFilterSimpleSyntax:=true;
ExcludeFileFilter:=DefPublModExcFilter;
end; end;
procedure TPublishModuleOptions.LoadFromXMLConfig(XMLConfig: TXMLConfig; procedure TPublishModuleOptions.LoadFromXMLConfig(XMLConfig: TXMLConfig;
@ -291,14 +236,9 @@ begin
GetDefaultDestinationDir)); GetDefaultDestinationDir));
CompressFinally:=XMLConfig.GetValue(APath+'CompressFinally/Value',true); CompressFinally:=XMLConfig.GetValue(APath+'CompressFinally/Value',true);
UseFileFilters:=XMLConfig.GetValue(APath+'UseFileFilters/Value',false); UseFileFilters:=XMLConfig.GetValue(APath+'UseFileFilters/Value',false);
IncludeFilterSimpleSyntax:=XMLConfig.GetValue(APath+'IncludeFilterSimpleSyntax/Value',true); FilterSimpleSyntax:=XMLConfig.GetValue(APath+'FilterSimpleSyntax/Value',true);
ExcludeFilterSimpleSyntax:=XMLConfig.GetValue(APath+'ExcludeFilterSimpleSyntax/Value',true); if XMLVersion>=2 then
if XMLVersion>=2 then begin FileFilter:=XMLConfig.GetValue(APath+'FileFilter/Value',DefPublModIncFilter);
IncludeFileFilter:=XMLConfig.GetValue(APath+'IncludeFileFilter/Value',
DefPublModIncFilter);
ExcludeFileFilter:=XMLConfig.GetValue(APath+'ExcludeFileFilter/Value',
DefPublModExcFilter);
end;
end; end;
procedure TPublishModuleOptions.SaveToXMLConfig(XMLConfig: TXMLConfig; procedure TPublishModuleOptions.SaveToXMLConfig(XMLConfig: TXMLConfig;
@ -316,31 +256,14 @@ begin
f(GetDefaultDestinationDir)); f(GetDefaultDestinationDir));
XMLConfig.SetDeleteValue(APath+'CompressFinally/Value',CompressFinally,true); XMLConfig.SetDeleteValue(APath+'CompressFinally/Value',CompressFinally,true);
XMLConfig.SetDeleteValue(APath+'UseFileFilters/Value',UseFileFilters,false); XMLConfig.SetDeleteValue(APath+'UseFileFilters/Value',UseFileFilters,false);
XMLConfig.SetDeleteValue(APath+'IncludeFilterSimpleSyntax/Value', XMLConfig.SetDeleteValue(APath+'FilterSimpleSyntax/Value',FilterSimpleSyntax,true);
IncludeFilterSimpleSyntax,true); XMLConfig.SetDeleteValue(APath+'FileFilter/Value',FileFilter,DefPublModIncFilter);
XMLConfig.SetDeleteValue(APath+'IncludeFileFilter/Value',IncludeFileFilter,
DefPublModIncFilter);
XMLConfig.SetDeleteValue(APath+'ExcludeFilterSimpleSyntax/Value',
ExcludeFilterSimpleSyntax,true);
XMLConfig.SetDeleteValue(APath+'ExcludeFileFilter/Value',ExcludeFileFilter,
DefPublModExcFilter);
end; end;
function TPublishModuleOptions.FileCanBePublished(const AFilename: string): boolean; function TPublishModuleOptions.FileCanBePublished(const AFilename: string): boolean;
begin begin
Result:=false; // check file filter
// check include filter Result := (FFilterRegExpr=nil) or FFilterRegExpr.Exec(ExtractFilename(AFilename));
if (FIncludeFilterRegExpr<>nil)
and (not FIncludeFilterRegExpr.Exec(ExtractFilename(AFilename))) then
exit;
// check exclude filter
if (FExcludeFilterRegExpr<>nil)
and (FExcludeFilterRegExpr.Exec(ExtractFilename(AFilename))) then
exit;
// check binaries
//if IgnoreBinaries and (not DirPathExists(AFilename))
//and (not FileIsText(AFilename)) then exit;
Result:=true;
end; end;
procedure TPublishModuleOptions.LockModified; procedure TPublishModuleOptions.LockModified;

View File

@ -1,11 +1,11 @@
object PublishProjectDialog: TPublishProjectDialog object PublishModuleDialog: TPublishModuleDialog
Left = 391 Left = 391
Height = 442 Height = 320
Top = 56 Top = 56
Width = 642 Width = 642
BorderIcons = [biSystemMenu] BorderIcons = [biSystemMenu]
Caption = 'Publish Project' Caption = 'Publish Module'
ClientHeight = 442 ClientHeight = 320
ClientWidth = 642 ClientWidth = 642
OnClose = FormClose OnClose = FormClose
OnCreate = FormCreate OnCreate = FormCreate
@ -52,15 +52,15 @@ object PublishProjectDialog: TPublishProjectDialog
end end
end end
object OptionsGroupbox: TGroupBox object OptionsGroupbox: TGroupBox
AnchorSideTop.Control = FiltersPanel AnchorSideTop.Control = FilterCombobox
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 6 Left = 6
Height = 53 Height = 53
Top = 279 Top = 203
Width = 628 Width = 628
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
AutoSize = True AutoSize = True
BorderSpacing.Around = 6 BorderSpacing.Around = 18
Caption = 'Options' Caption = 'Options'
ChildSizing.TopBottomSpacing = 6 ChildSizing.TopBottomSpacing = 6
ClientHeight = 33 ClientHeight = 33
@ -93,7 +93,7 @@ object PublishProjectDialog: TPublishProjectDialog
object ButtonPanel1: TButtonPanel object ButtonPanel1: TButtonPanel
Left = 6 Left = 6
Height = 26 Height = 26
Top = 410 Top = 288
Width = 630 Width = 630
OKButton.Name = 'OKButton' OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True OKButton.DefaultCaption = True
@ -103,7 +103,7 @@ object PublishProjectDialog: TPublishProjectDialog
CloseButton.DefaultCaption = True CloseButton.DefaultCaption = True
CancelButton.Name = 'CancelButton' CancelButton.Name = 'CancelButton'
CancelButton.DefaultCaption = True CancelButton.DefaultCaption = True
TabOrder = 3 TabOrder = 2
ShowBevel = False ShowBevel = False
end end
object UseFiltersCheckbox: TCheckBox object UseFiltersCheckbox: TCheckBox
@ -111,114 +111,12 @@ object PublishProjectDialog: TPublishProjectDialog
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 6 Left = 6
Height = 21 Height = 21
Top = 103 Top = 115
Width = 174 Width = 168
BorderSpacing.Around = 6 BorderSpacing.Around = 18
Caption = 'Use filters for extra files' Caption = 'Use filter for extra files'
OnClick = UseFiltersCheckboxClick OnClick = UseFiltersCheckboxClick
TabOrder = 4 TabOrder = 3
end
object FiltersPanel: TPanel
AnchorSideLeft.Control = UseFiltersCheckbox
AnchorSideTop.Control = UseFiltersCheckbox
AnchorSideTop.Side = asrBottom
Left = 21
Height = 143
Top = 130
Width = 615
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BorderSpacing.Left = 15
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ClientHeight = 143
ClientWidth = 615
TabOrder = 2
TabStop = True
object IncFilterSimpleSyntaxCheckbox: TCheckBox
AnchorSideLeft.Control = IncludeFilterCombobox
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = IncludeFilterCombobox
AnchorSideTop.Side = asrCenter
Left = 462
Height = 21
Top = 37
Width = 111
BorderSpacing.Around = 6
Caption = 'Simple Syntax'
ParentShowHint = False
ShowHint = True
TabOrder = 0
end
object IncludeFilterCombobox: TComboBox
AnchorSideLeft.Control = IncludeFilterLabel
AnchorSideTop.Control = IncludeFilterLabel
AnchorSideTop.Side = asrBottom
AnchorSideRight.Side = asrBottom
Left = 7
Height = 31
Top = 32
Width = 449
Anchors = [akTop, akLeft, akRight]
AutoSize = False
ItemHeight = 0
TabOrder = 1
Text = 'IncludeFilterCombobox'
end
object IncludeFilterLabel: TLabel
AnchorSideLeft.Control = FiltersPanel
AnchorSideTop.Control = FiltersPanel
Left = 7
Height = 19
Top = 7
Width = 112
BorderSpacing.Around = 6
Caption = 'IncludeFilterLabel'
ParentColor = False
end
object ExcludeFilterLabel: TLabel
AnchorSideLeft.Control = FiltersPanel
AnchorSideTop.Control = IncludeFilterCombobox
AnchorSideTop.Side = asrBottom
Left = 7
Height = 19
Top = 80
Width = 113
BorderSpacing.Top = 11
BorderSpacing.Around = 6
Caption = 'ExcludeFilterLabel'
ParentColor = False
end
object ExcludeFilterCombobox: TComboBox
AnchorSideLeft.Control = ExcludeFilterLabel
AnchorSideTop.Control = ExcludeFilterLabel
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = IncludeFilterCombobox
AnchorSideRight.Side = asrBottom
Left = 7
Height = 31
Top = 105
Width = 449
Anchors = [akTop, akLeft, akRight]
ItemHeight = 0
TabOrder = 2
Text = 'ExcludeFilterCombobox'
end
object ExcFilterSimpleSyntaxCheckbox: TCheckBox
AnchorSideLeft.Control = ExcludeFilterCombobox
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ExcludeFilterCombobox
AnchorSideTop.Side = asrCenter
Left = 462
Height = 21
Top = 110
Width = 111
BorderSpacing.Around = 6
Caption = 'Simple Syntax'
ParentShowHint = False
ShowHint = True
TabOrder = 3
end
end end
object NoteLabel: TLabel object NoteLabel: TLabel
AnchorSideTop.Control = DestDirGroupBox AnchorSideTop.Control = DestDirGroupBox
@ -234,4 +132,35 @@ object PublishProjectDialog: TPublishProjectDialog
ParentColor = False ParentColor = False
ParentFont = False ParentFont = False
end end
object FilterCombobox: TComboBox
AnchorSideLeft.Control = UseFiltersCheckbox
AnchorSideTop.Control = UseFiltersCheckbox
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = FilterSimpleSyntaxCheckbox
Left = 24
Height = 31
Top = 154
Width = 462
Anchors = [akTop, akLeft, akRight]
AutoSize = False
BorderSpacing.Left = 18
ItemHeight = 0
TabOrder = 4
Text = 'FilterCombobox'
end
object FilterSimpleSyntaxCheckbox: TCheckBox
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = FilterCombobox
AnchorSideTop.Side = asrCenter
Left = 499
Height = 21
Top = 159
Width = 111
Anchors = [akTop, akRight]
BorderSpacing.Around = 13
Caption = 'Simple Syntax'
ParentShowHint = False
ShowHint = True
TabOrder = 5
end
end end

View File

@ -1,9 +1,4 @@
{ /*************************************************************************** {
publishprojectdlg.pp - Lazarus IDE unit
-----------------------------------------
***************************************************************************/
*************************************************************************** ***************************************************************************
* * * *
* This source is free software; you can redistribute it and/or modify * * This source is free software; you can redistribute it and/or modify *
@ -26,11 +21,11 @@
Author: Juha Manninen Author: Juha Manninen
Abstract: Abstract:
- TPublishProjectDialog - TPublishModuleDialog
The dialog for TPublishModuleOptions to publish projects and packages. The dialog for TPublishModuleOptions to publish projects and packages.
} }
unit PublishProjectDlg; unit PublishModuleDlg;
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
@ -49,20 +44,15 @@ uses
LazarusIDEStrConsts, IDEProcs, EnvironmentOpts; LazarusIDEStrConsts, IDEProcs, EnvironmentOpts;
type type
{ TPublishProjectDialog } { TPublishModuleDialog }
TPublishProjectDialog = class(TForm) TPublishModuleDialog = class(TForm)
ButtonPanel1: TButtonPanel; ButtonPanel1: TButtonPanel;
DestDirGroupBox: TGroupBox; DestDirGroupBox: TGroupBox;
DestDirComboBox: TComboBox; DestDirComboBox: TComboBox;
BrowseDestDirBitBtn: TBitBtn; BrowseDestDirBitBtn: TBitBtn;
ExcFilterSimpleSyntaxCheckbox: TCheckBox; FilterCombobox: TComboBox;
ExcludeFilterCombobox: TComboBox; FilterSimpleSyntaxCheckbox: TCheckBox;
ExcludeFilterLabel: TLabel;
FiltersPanel: TPanel;
IncFilterSimpleSyntaxCheckbox: TCheckBox;
IncludeFilterCombobox: TComboBox;
IncludeFilterLabel: TLabel;
Label1: TLabel; Label1: TLabel;
NoteLabel: TLabel; NoteLabel: TLabel;
OptionsGroupbox: TGroupBox; OptionsGroupbox: TGroupBox;
@ -132,10 +122,10 @@ implementation
function ShowPublishDialog(AOptions: TPublishModuleOptions): TModalResult; function ShowPublishDialog(AOptions: TPublishModuleOptions): TModalResult;
var var
PublishProjectDialog: TPublishProjectDialog; PublishModuleDialog: TPublishModuleDialog;
begin begin
PublishProjectDialog:=TPublishProjectDialog.Create(nil); PublishModuleDialog:=TPublishModuleDialog.Create(nil);
with PublishProjectDialog do with PublishModuleDialog do
begin begin
Options:=AOptions; Options:=AOptions;
Result:=ShowModal; Result:=ShowModal;
@ -428,42 +418,34 @@ begin
IDEMessageDialog(lisSuccess, 'Published to '+FDestDir, mtInformation,[mbOk]); IDEMessageDialog(lisSuccess, 'Published to '+FDestDir, mtInformation,[mbOk]);
end; end;
{ TPublishProjectDialog } { TPublishModuleDialog }
constructor TPublishProjectDialog.Create(TheOwner: TComponent); constructor TPublishModuleDialog.Create(TheOwner: TComponent);
begin begin
inherited Create(TheOwner); inherited Create(TheOwner);
Position:=poScreenCenter; Position:=poScreenCenter;
IDEDialogLayoutList.ApplyLayout(Self, 600, 400); IDEDialogLayoutList.ApplyLayout(Self, 600, 350);
LoadHistoryLists; LoadHistoryLists;
end; end;
destructor TPublishProjectDialog.Destroy; destructor TPublishModuleDialog.Destroy;
begin begin
SaveHistoryLists; SaveHistoryLists;
inherited Destroy; inherited Destroy;
end; end;
procedure TPublishProjectDialog.FormClose(Sender: TObject; var CloseAction: TCloseAction); procedure TPublishModuleDialog.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin begin
IDEDialogLayoutList.SaveLayout(Self); IDEDialogLayoutList.SaveLayout(Self);
end; end;
procedure TPublishProjectDialog.FormCreate(Sender: TObject); procedure TPublishModuleDialog.FormCreate(Sender: TObject);
begin begin
DestDirGroupBox.Caption:=lisDestinationDirectory; DestDirGroupBox.Caption:=lisDestinationDirectory;
NoteLabel.Caption:=lisPublishModuleNote; NoteLabel.Caption:=lisPublishModuleNote;
UseFiltersCheckbox.Caption:=lisUseFiltersForExtraFiles; UseFiltersCheckbox.Caption:=lisUseFilterForExtraFiles;
FilterSimpleSyntaxCheckbox.Caption:=lisSimpleSyntax;
IncludeFilterLabel.Caption:=lisIncludeFilter; FilterSimpleSyntaxCheckbox.Hint:=lisNormallyTheFilterIsARegularExpressionInSimpleSynta;
IncFilterSimpleSyntaxCheckbox.Caption:=lisSimpleSyntax;
IncFilterSimpleSyntaxCheckbox.Hint:=
lisNormallyTheFilterIsARegularExpressionInSimpleSynta;
ExcludeFilterLabel.Caption:=lisExcludeFilter;
ExcFilterSimpleSyntaxCheckbox.Caption:=lisSimpleSyntax;
ExcFilterSimpleSyntaxCheckbox.Hint:=
lisNormallyTheFilterIsARegularExpressionInSimpleSynta;
OptionsGroupbox.Caption:=lisOptions; OptionsGroupbox.Caption:=lisOptions;
CompressCheckbox.Caption:=lisCompress; CompressCheckbox.Caption:=lisCompress;
@ -471,7 +453,6 @@ begin
ButtonPanel1.OkButton.Caption := lisMenuOk; ButtonPanel1.OkButton.Caption := lisMenuOk;
ButtonPanel1.OKButton.OnClick := @OkButtonCLICK; ButtonPanel1.OKButton.OnClick := @OkButtonCLICK;
ButtonPanel1.CloseButton.Caption := lisSaveSettings; ButtonPanel1.CloseButton.Caption := lisSaveSettings;
ButtonPanel1.CloseButton.ModalResult := mrNone; ButtonPanel1.CloseButton.ModalResult := mrNone;
ButtonPanel1.CloseButton.Kind := bkCustom; ButtonPanel1.CloseButton.Kind := bkCustom;
@ -479,11 +460,10 @@ begin
if ButtonPanel1.CloseButton.Glyph.Empty then if ButtonPanel1.CloseButton.Glyph.Empty then
IDEImages.AssignImage(ButtonPanel1.CloseButton, 'laz_save'); IDEImages.AssignImage(ButtonPanel1.CloseButton, 'laz_save');
ButtonPanel1.CloseButton.OnClick := @SaveSettingsButtonCLICK; ButtonPanel1.CloseButton.OnClick := @SaveSettingsButtonCLICK;
ButtonPanel1.HelpButton.OnClick := @HelpButtonClick; ButtonPanel1.HelpButton.OnClick := @HelpButtonClick;
end; end;
procedure TPublishProjectDialog.BrowseDestDirBitBtnCLICK(Sender: TObject); procedure TPublishModuleDialog.BrowseDestDirBitBtnCLICK(Sender: TObject);
var var
SelectDirDialog: TSelectDirectoryDialog; SelectDirDialog: TSelectDirectoryDialog;
NewDir: String; NewDir: String;
@ -498,78 +478,71 @@ begin
SelectDirDialog.Free; SelectDirDialog.Free;
end; end;
procedure TPublishProjectDialog.HelpButtonClick(Sender: TObject); procedure TPublishModuleDialog.HelpButtonClick(Sender: TObject);
begin begin
LazarusHelp.ShowHelpForIDEControl(Self); LazarusHelp.ShowHelpForIDEControl(Self);
end; end;
procedure TPublishProjectDialog.OkButtonCLICK(Sender: TObject); procedure TPublishModuleDialog.OkButtonCLICK(Sender: TObject);
begin begin
if not CheckFilter then exit; if not CheckFilter then exit;
if Options<>nil then SaveToOptions(Options); if Options<>nil then
SaveToOptions(Options);
end; end;
procedure TPublishProjectDialog.SaveSettingsButtonClick(Sender: TObject); procedure TPublishModuleDialog.SaveSettingsButtonClick(Sender: TObject);
begin begin
if not CheckFilter then exit; if not CheckFilter then exit;
if Options<>nil then SaveToOptions(Options); if Options<>nil then
SaveToOptions(Options);
end; end;
procedure TPublishProjectDialog.UseFiltersCheckboxClick(Sender: TObject); procedure TPublishModuleDialog.UseFiltersCheckboxClick(Sender: TObject);
begin begin
FiltersPanel.Enabled := (Sender as TCheckBox).Checked; FilterCombobox.Enabled := (Sender as TCheckBox).Checked;
FilterSimpleSyntaxCheckbox.Enabled := FilterCombobox.Enabled;
end; end;
procedure TPublishProjectDialog.SetComboBox(AComboBox: TComboBox; procedure TPublishModuleDialog.SetComboBox(AComboBox: TComboBox;
const NewText: string; MaxItemCount: integer); const NewText: string; MaxItemCount: integer);
begin begin
AComboBox.AddHistoryItem(NewText,MaxItemCount,true,false); AComboBox.AddHistoryItem(NewText,MaxItemCount,true,false);
end; end;
procedure TPublishProjectDialog.LoadHistoryLists; procedure TPublishModuleDialog.LoadHistoryLists;
var var
hl: THistoryList; hl: THistoryList;
begin begin
// destination directories // destination directories
hl:=InputHistories.HistoryLists.GetList(hlPublishProjectDestDirs,true,rltFile); hl:=InputHistories.HistoryLists.GetList(hlPublishModuleDestDirs,true,rltFile);
hl.AppendEntry(GetForcedPathDelims('$(TestDir)/publishedproject/')); hl.AppendEntry(GetForcedPathDelims('$(TestDir)/publishedproject/'));
hl.AppendEntry(GetForcedPathDelims('$(TestDir)/publishedpackage/')); hl.AppendEntry(GetForcedPathDelims('$(TestDir)/publishedpackage/'));
hl.AppendEntry(GetForcedPathDelims('$(ProjPath)/published/')); hl.AppendEntry(GetForcedPathDelims('$(ProjPath)/published/'));
DestDirComboBox.Items.Assign(hl); DestDirComboBox.Items.Assign(hl);
// file filters // file filter
hl:=InputHistories.HistoryLists.GetList(hlPublishProjectIncludeFileFilter, hl:=InputHistories.HistoryLists.GetList(hlPublishModuleFileFilter,true,rltFile);
true,rltFile);
if hl.Count=0 then if hl.Count=0 then
hl.Add(DefPublModIncFilter); hl.Add(DefPublModIncFilter);
IncludeFilterCombobox.Items.Assign(hl); FilterCombobox.Items.Assign(hl);
hl:=InputHistories.HistoryLists.GetList(hlPublishProjectExcludeFileFilter,
true,rltFile);
if hl.Count=0 then
hl.Add(DefPublModExcFilter);
ExcludeFilterCombobox.Items.Assign(hl);
end; end;
procedure TPublishProjectDialog.SaveHistoryLists; procedure TPublishModuleDialog.SaveHistoryLists;
var var
hl: THistoryList; hl: THistoryList;
begin begin
// destination directories // destination directories
SetComboBox(DestDirComboBox,DestDirComboBox.Text,20); SetComboBox(DestDirComboBox,DestDirComboBox.Text,20);
hl:=InputHistories.HistoryLists.GetList(hlPublishProjectDestDirs,true,rltFile); hl:=InputHistories.HistoryLists.GetList(hlPublishModuleDestDirs,true,rltFile);
hl.Assign(DestDirComboBox.Items); hl.Assign(DestDirComboBox.Items);
// file filters // file filters
SetComboBox(IncludeFilterCombobox,IncludeFilterCombobox.Text,20); SetComboBox(FilterCombobox,FilterCombobox.Text,20);
hl:=InputHistories.HistoryLists.GetList(hlPublishProjectIncludeFileFilter,true,rltFile); hl:=InputHistories.HistoryLists.GetList(hlPublishModuleFileFilter,true,rltFile);
hl.Assign(IncludeFilterCombobox.Items); hl.Assign(FilterCombobox.Items);
SetComboBox(ExcludeFilterCombobox,ExcludeFilterCombobox.Text,20);
hl:=InputHistories.HistoryLists.GetList(hlPublishProjectExcludeFileFilter,true,rltFile);
hl.Assign(ExcludeFilterCombobox.Items);
end; end;
procedure TPublishProjectDialog.SetOptions(const AValue: TPublishModuleOptions); procedure TPublishModuleDialog.SetOptions(const AValue: TPublishModuleOptions);
begin begin
if FOptions=AValue then exit; if FOptions=AValue then exit;
FOptions:=AValue; FOptions:=AValue;
@ -580,25 +553,20 @@ begin
LoadFromOptions(FOptions); LoadFromOptions(FOptions);
end; end;
function TPublishProjectDialog.CheckFilter: boolean; function TPublishModuleDialog.CheckFilter: boolean;
begin begin
Result:=false; Result:=false;
if Options<>nil then begin if Options<>nil then begin
if not Options.IncludeFilterValid then begin if not Options.FilterValid then begin
if IDEMessageDialog(lisCCOErrorCaption, lisPublProjInvalidIncludeFilter, if IDEMessageDialog(lisCCOErrorCaption, lisInvalidFilter,
mtError, [mbIgnore,mbCancel]) = mrCancel mtError, [mbIgnore,mbCancel]) = mrCancel
then exit; then exit;
end; end;
if not Options.ExcludeFilterValid then begin
if IDEMessageDialog(lisCCOErrorCaption, lisPublProjInvalidExcludeFilter,
mtError, [mbIgnore,mbCancel]) = mrCancel
then exit;
end;
end; end;
Result:=true; Result:=true;
end; end;
procedure TPublishProjectDialog.LoadFromOptions(SrcOpts: TPublishModuleOptions); procedure TPublishModuleDialog.LoadFromOptions(SrcOpts: TPublishModuleOptions);
begin begin
// destination // destination
SeTComboBox(DestDirComboBox,SrcOpts.DestinationDirectory,20); SeTComboBox(DestDirComboBox,SrcOpts.DestinationDirectory,20);
@ -606,13 +574,11 @@ begin
// file filters // file filters
CompressCheckbox.Checked:=SrcOpts.CompressFinally; CompressCheckbox.Checked:=SrcOpts.CompressFinally;
UseFiltersCheckbox.Checked:=SrcOpts.UseFileFilters; UseFiltersCheckbox.Checked:=SrcOpts.UseFileFilters;
IncFilterSimpleSyntaxCheckbox.Checked:=SrcOpts.IncludeFilterSimpleSyntax; FilterSimpleSyntaxCheckbox.Checked:=SrcOpts.FilterSimpleSyntax;
SeTComboBox(IncludeFilterCombobox,SrcOpts.IncludeFileFilter,20); SeTComboBox(FilterCombobox,SrcOpts.FileFilter,20);
ExcFilterSimpleSyntaxCheckbox.Checked:=SrcOpts.ExcludeFilterSimpleSyntax;
SeTComboBox(ExcludeFilterCombobox,SrcOpts.ExcludeFileFilter,20);
end; end;
procedure TPublishProjectDialog.SaveToOptions(DestOpts: TPublishModuleOptions); procedure TPublishModuleDialog.SaveToOptions(DestOpts: TPublishModuleOptions);
begin begin
// destination // destination
DestOpts.DestinationDirectory:=DestDirComboBox.Text; DestOpts.DestinationDirectory:=DestDirComboBox.Text;
@ -620,10 +586,8 @@ begin
// file filters // file filters
DestOpts.CompressFinally:=CompressCheckbox.Checked; DestOpts.CompressFinally:=CompressCheckbox.Checked;
DestOpts.UseFileFilters:=UseFiltersCheckbox.Checked; DestOpts.UseFileFilters:=UseFiltersCheckbox.Checked;
DestOpts.IncludeFilterSimpleSyntax:=IncFilterSimpleSyntaxCheckbox.Checked; DestOpts.FilterSimpleSyntax:=FilterSimpleSyntaxCheckbox.Checked;
DestOpts.IncludeFileFilter:=IncludeFilterCombobox.Text; DestOpts.FileFilter:=FilterCombobox.Text;
DestOpts.ExcludeFilterSimpleSyntax:=ExcFilterSimpleSyntaxCheckbox.Checked;
DestOpts.ExcludeFileFilter:=ExcludeFilterCombobox.Text;
end; end;
end. end.

View File

@ -68,7 +68,7 @@ uses
PkgGraphExplorer, BrokenDependenciesDlg, CompilerOptions, IDETranslations, PkgGraphExplorer, BrokenDependenciesDlg, CompilerOptions, IDETranslations,
TransferMacros, BuildLazDialog, NewDialog, FindInFilesDlg, ProjectInspector, TransferMacros, BuildLazDialog, NewDialog, FindInFilesDlg, ProjectInspector,
SourceEditor, ProjPackChecks, AddFileToAPackageDlg, LazarusPackageIntf, SourceEditor, ProjPackChecks, AddFileToAPackageDlg, LazarusPackageIntf,
PublishProjectDlg, PkgLinksDlg, InterPkgConflictFiles, InstallPkgSetDlg, PublishModuleDlg, PkgLinksDlg, InterPkgConflictFiles, InstallPkgSetDlg,
ConfirmPkgListDlg, NewPkgComponentDlg, BaseBuildManager, BasePkgManager, ConfirmPkgListDlg, NewPkgComponentDlg, BaseBuildManager, BasePkgManager,
MainBar, MainIntf, MainBase, ModeMatrixOpts; MainBar, MainIntf, MainBase, ModeMatrixOpts;