Replaced custom component with a native one.

git-svn-id: trunk@53463 -
This commit is contained in:
balazs 2016-11-26 09:50:23 +00:00
parent 19085b465e
commit 8096306d2b
7 changed files with 105 additions and 210 deletions

View File

@ -65,34 +65,16 @@ object CreateRepositoryPackagefr: TCreateRepositoryPackagefr
Width = 788
Align = alBottom
end
object pnPackageDir: TPanel
object edPackageDir: TDirectoryEdit
Left = 109
Height = 23
Top = 8
Width = 662
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BevelOuter = bvNone
ClientHeight = 23
ClientWidth = 662
Top = 9
Width = 647
ShowHidden = False
ButtonWidth = 23
NumGlyphs = 1
MaxLength = 0
TabOrder = 0
object edPackageDir: TEdit
Left = 0
Height = 23
Top = 0
Width = 632
Align = alClient
TabOrder = 0
end
object bPackageDir: TSpeedButton
Left = 632
Height = 23
Top = 0
Width = 30
Align = alRight
Caption = '...'
OnClick = bPackageDirClick
end
end
end
object pnData: TPanel

View File

@ -7,7 +7,7 @@ interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, ExtCtrls, StdCtrls, Dialogs,
LazFileUtils, Graphics, Menus, Buttons, Laz2_XMLCfg, opkman_VirtualTrees,
md5, fpjson, LCLIntf, opkman_serializablepackages, opkman_zipper;
md5, fpjson, LCLIntf, EditBtn, opkman_serializablepackages, opkman_zipper;
type
PData = ^TData;
@ -42,13 +42,13 @@ type
Bevel1: TBevel;
cbCategory: TComboBox;
cbOpen: TCheckBox;
edPackageDir: TDirectoryEdit;
edDownloadURL: TEdit;
edDisplayName: TEdit;
edSVNURL: TEdit;
edFPCCompatibility: TEdit;
edHomePageURL: TEdit;
edLazCompatibility: TEdit;
edPackageDir: TEdit;
edSupportedWidgetset: TEdit;
imTree: TImageList;
lbCategory: TLabel;
@ -69,11 +69,9 @@ type
pnBrowse: TPanel;
pnCategory: TPanel;
pnMessage: TPanel;
pnPackageDir: TPanel;
pnPackages: TPanel;
pnData: TPanel;
SDD: TSelectDirectoryDialog;
bPackageDir: TSpeedButton;
spMain: TSplitter;
spMain1: TSplitter;
procedure bCancelClick(Sender: TObject);
@ -429,11 +427,11 @@ end;
procedure TCreateRepositoryPackagefr.pnBrowseResize(Sender: TObject);
begin
pnPackageDir.Top := (pnBrowse.Height - pnPackageDir.Height) div 2;
edPackageDir.Top := (pnBrowse.Height - edPackageDir.Height) div 2;
lbPackageDir.Left := 100;
lbPackageDir.Top := pnPackageDir.Top + (pnPackageDir.Height - lbPackageDir.Height) div 2;
pnPackageDir.Left := lbPackagedir.Left + lbPackagedir.Width + 5;
pnPackageDir.Width := pnBrowse.Width - pnPackageDir.Left - 120;
lbPackageDir.Top := edPackageDir.Top + (edPackageDir.Height - lbPackageDir.Height) div 2;
edPackageDir.Left := lbPackagedir.Left + lbPackagedir.Width + 5;
edPackageDir.Width := pnBrowse.Width - edPackageDir.Left - 120;
end;
procedure TCreateRepositoryPackagefr.bCreateClick(Sender: TObject);

View File

@ -86,7 +86,7 @@ begin
LocalRepoConfig := AppendPathDelim(LocalRepo + cLocalRepositoryConfig);
if not DirectoryExists(LocalRepoConfig) then
CreateDir(LocalRepoConfig);
CreateDirUTF8(LocalRepoConfig);
LocalRepositoryConfigFile := LocalRepoConfig + cLocalRepositoryConfigFile;
end;

View File

@ -1,12 +1,12 @@
object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 585
Height = 480
Height = 475
Top = 250
Width = 822
Width = 825
BorderIcons = [biSystemMenu]
Caption = 'CreateRepositoryPackagesFrm'
ClientHeight = 480
ClientWidth = 822
ClientHeight = 475
ClientWidth = 825
Color = clBtnFace
Constraints.MinHeight = 450
Constraints.MinWidth = 650
@ -16,96 +16,86 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Position = poOwnerFormCenter
LCLVersion = '1.7'
inline frCreateRep: TCreateRepositoryPackagefr
Height = 480
Width = 822
Height = 475
Width = 825
Align = alClient
ClientHeight = 480
ClientWidth = 822
ClientHeight = 475
ClientWidth = 825
inherited pnMessage: TPanel
Height = 374
Width = 560
Height = 369
Width = 563
end
inherited pnPackages: TPanel
Height = 374
Height = 369
end
inherited pnBrowse: TPanel
Width = 822
ClientWidth = 822
Width = 825
ClientWidth = 825
inherited Bevel1: TBevel
Width = 822
end
inherited pnPackageDir: TPanel
Width = 696
ClientWidth = 696
inherited edPackageDir: TEdit
Width = 666
end
inherited bPackageDir: TSpeedButton
Left = 666
end
Width = 825
end
end
inherited pnData: TPanel
Height = 374
Width = 560
ClientHeight = 374
ClientWidth = 560
Height = 369
Width = 563
ClientHeight = 369
ClientWidth = 563
inherited pnPackageData: TPanel
Height = 182
Width = 560
ClientHeight = 178
ClientWidth = 556
Height = 177
Width = 563
ClientHeight = 173
ClientWidth = 559
inherited edSupportedWidgetset: TEdit
Width = 358
Width = 361
end
inherited edLazCompatibility: TEdit
Width = 359
Width = 362
end
inherited edFPCCompatibility: TEdit
Width = 358
Width = 361
end
inherited lbOF1: TLabel
Left = 531
Left = 534
end
inherited lbOF3: TLabel
Left = 531
Left = 534
end
inherited lbOF4: TLabel
Left = 531
Left = 534
end
end
inherited spMain1: TSplitter
Width = 560
Width = 563
end
inherited pnCategory: TPanel
Width = 560
ClientWidth = 556
Width = 563
ClientWidth = 559
inherited edHomePageURL: TEdit
Width = 358
Width = 361
end
inherited edDownloadURL: TEdit
Width = 358
Width = 361
end
inherited edSVNURL: TEdit
Width = 358
Width = 361
end
inherited edDisplayName: TEdit
Width = 358
Width = 361
end
end
end
inherited spMain: TSplitter
Height = 374
Height = 369
end
inherited pnButtons: TPanel
Top = 439
Width = 822
ClientWidth = 818
Top = 434
Width = 825
ClientWidth = 821
inherited bCreate: TButton
Left = 656
Left = 659
end
inherited bCancel: TButton
Left = 733
Left = 736
end
end
end

View File

@ -208,11 +208,11 @@ end;
procedure TOptions.CreateMissingPaths;
begin
if not DirectoryExists(FLocalRepositoryPackages) then
CreateDir(FLocalRepositoryPackages);
CreateDirUTF8(FLocalRepositoryPackages);
if not DirectoryExists(FLocalRepositoryArchive) then
CreateDirUTF8(FLocalRepositoryArchive);
if not DirectoryExists(FLocalRepositoryUpdate) then
CreateDir(FLocalRepositoryUpdate);
CreateDirUTF8(FLocalRepositoryUpdate);
end;
procedure TOptions.SetRemoteRepository(const ARemoteRepository: String);

View File

@ -1,7 +1,7 @@
object OptionsFrm: TOptionsFrm
Left = 661
Left = 624
Height = 300
Top = 304
Top = 287
Width = 450
BorderIcons = [biSystemMenu]
Caption = 'Options'
@ -58,9 +58,9 @@ object OptionsFrm: TOptionsFrm
Height = 261
Top = 0
Width = 450
ActivePage = tsGeneral
ActivePage = tsFolders
Align = alClient
TabIndex = 0
TabIndex = 2
TabOrder = 1
object tsGeneral: TTabSheet
Caption = 'General'
@ -240,37 +240,6 @@ object OptionsFrm: TOptionsFrm
Color = clBtnFace
ParentColor = False
TabOrder = 0
object pnLocalRepositoryPackages: TPanel
Left = 15
Height = 23
Top = 32
Width = 413
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BevelOuter = bvNone
ClientHeight = 23
ClientWidth = 413
TabOrder = 0
object edLocalRepositoryPackages: TEdit
Left = 0
Height = 23
Top = 0
Width = 383
Align = alClient
ParentShowHint = False
ShowHint = True
TabOrder = 0
end
object bLocalRepositoryPackages: TSpeedButton
Left = 383
Height = 23
Top = 0
Width = 30
Align = alRight
Caption = '...'
OnClick = bLocalRepositoryPackagesClick
end
end
object lbLocalRepositoryPackages: TLabel
Left = 15
Height = 15
@ -280,88 +249,61 @@ object OptionsFrm: TOptionsFrm
ParentColor = False
ParentShowHint = False
end
object pnLocalRepositoryArchive: TPanel
Left = 15
Height = 23
Top = 87
Width = 413
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BevelOuter = bvNone
ClientHeight = 23
ClientWidth = 413
TabOrder = 1
object edLocalRepositoryArchive: TEdit
Left = 0
Height = 23
Top = 0
Width = 383
Align = alClient
ParentShowHint = False
ShowHint = True
TabOrder = 0
end
object bLocalRepositoryArchive: TSpeedButton
Tag = 1
Left = 383
Height = 23
Top = 0
Width = 30
Align = alRight
Caption = '...'
OnClick = bLocalRepositoryPackagesClick
end
end
object lbLocalRepositoryArchive: TLabel
Left = 15
Height = 15
Top = 69
Top = 74
Width = 125
Caption = 'Local repository archive'
ParentColor = False
ParentShowHint = False
end
object pnLocalRepositoryUpdate: TPanel
Left = 15
Height = 23
Top = 145
Width = 413
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BevelOuter = bvNone
ClientHeight = 23
ClientWidth = 413
TabOrder = 2
object edLocalRepositoryUpdate: TEdit
Left = 0
Height = 23
Top = 0
Width = 383
Align = alClient
ParentShowHint = False
ShowHint = True
TabOrder = 0
end
object bLocalRepositoryUpdate: TSpeedButton
Tag = 2
Left = 383
Height = 23
Top = 0
Width = 30
Align = alRight
Caption = '...'
OnClick = bLocalRepositoryPackagesClick
end
end
object lbLocalRepositoryUpdate: TLabel
Left = 15
Height = 15
Top = 128
Top = 130
Width = 124
Caption = 'Local repository update'
ParentColor = False
ParentShowHint = False
end
object edLocalRepositoryPackages: TDirectoryEdit
Left = 14
Height = 23
Top = 32
Width = 412
Directory = 'edLocalRepositoryPackages'
ShowHidden = False
ButtonWidth = 23
NumGlyphs = 1
MaxLength = 0
TabOrder = 0
Text = 'edLocalRepositoryPackages'
end
object edLocalRepositoryArchive: TDirectoryEdit
Tag = 1
Left = 14
Height = 23
Top = 91
Width = 412
ShowHidden = False
ButtonWidth = 23
NumGlyphs = 1
MaxLength = 0
TabOrder = 1
end
object edLocalRepositoryUpdate: TDirectoryEdit
Tag = 2
Left = 14
Height = 23
Top = 147
Width = 412
ShowHidden = False
ButtonWidth = 23
NumGlyphs = 1
MaxLength = 0
TabOrder = 2
end
end
end
object tsExtensions: TTabSheet

View File

@ -31,7 +31,7 @@ interface
uses
Classes, SysUtils, FileUtil, opkman_VirtualTrees, Forms, Controls, Graphics, Dialogs,
StdCtrls, ExtCtrls, Spin, ComCtrls, Buttons, LazFileUtils;
StdCtrls, ExtCtrls, Spin, ComCtrls, Buttons, EditBtn, LazFileUtils;
type
@ -39,17 +39,14 @@ type
TOptionsFrm = class(TForm)
bCancel: TButton;
bLocalRepositoryArchive: TSpeedButton;
bLocalRepositoryUpdate: TSpeedButton;
bOk: TButton;
bLocalRepositoryPackages: TSpeedButton;
bRestore: TButton;
cbProxy: TCheckBox;
cbForceDownloadExtract: TCheckBox;
cbDeleteZipAfterInstall: TCheckBox;
edLocalRepositoryPackages: TEdit;
edLocalRepositoryArchive: TEdit;
edLocalRepositoryUpdate: TEdit;
edLocalRepositoryUpdate: TDirectoryEdit;
edLocalRepositoryPackages: TDirectoryEdit;
edLocalRepositoryArchive: TDirectoryEdit;
edProxyPassword: TEdit;
edProxyServer: TEdit;
edProxyUser: TEdit;
@ -65,9 +62,6 @@ type
lbPassword: TLabel;
pnExtensions: TPanel;
pnFolders: TPanel;
pnLocalRepositoryPackages: TPanel;
pnLocalRepositoryArchive: TPanel;
pnLocalRepositoryUpdate: TPanel;
pnProxy: TPanel;
pnGeneral: TPanel;
pgOptions: TPageControl;
@ -78,7 +72,6 @@ type
tsExtensions: TTabSheet;
tsGeneral: TTabSheet;
tsProxy: TTabSheet;
procedure bLocalRepositoryPackagesClick(Sender: TObject);
procedure bOkClick(Sender: TObject);
procedure bRestoreClick(Sender: TObject);
procedure cbProxyChange(Sender: TObject);
@ -151,7 +144,6 @@ begin
Options.LocalRepositoryPackages := AppendPathDelim(edLocalRepositoryPackages.Text);
Options.LocalRepositoryArchive := AppendPathDelim(edLocalRepositoryArchive.Text);
Options.LocalRepositoryUpdate := AppendPathDelim(edLocalRepositoryUpdate.Text);
Options.Save;
ModalResult := mrOk;
end;
@ -171,16 +163,6 @@ begin
gbProxySettings.Enabled:= cbProxy.Checked;
end;
procedure TOptionsFrm.bLocalRepositoryPackagesClick(Sender: TObject);
begin
if SDD.Execute then
case (Sender as TSpeedButton).Tag of
0: edLocalRepositoryPackages.Text := SDD.FileName;
1: edLocalRepositoryArchive.Text := SDD.FileName;
2: edLocalRepositoryUpdate.Text := SDD.FileName;
end;
end;
procedure TOptionsFrm.edRemoteRepositoryKeyPress(Sender: TObject; var Key: char);
begin
if Key = #13 then
@ -221,6 +203,7 @@ begin
edLocalRepositoryArchive.Hint := rsOptions_edLocalRepositoryArchive_Hint;
lbLocalRepositoryUpdate.Caption := rsOptions_lbLocalRepositoryUpdate_Caption;
edLocalRepositoryUpdate.Hint := rsOptions_edLocalRepositoryUpdate_Hint;
edLocalRepositoryPackages.Text := Options.LocalRepositoryPackages;
edLocalRepositoryArchive.Text := Options.LocalRepositoryArchive;
edLocalRepositoryUpdate.Text := Options.LocalRepositoryUpdate;