mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 15:59:15 +02:00
IDE: install package dialog: double click on a package moves it to the other list
git-svn-id: trunk@14761 -
This commit is contained in:
parent
78c6aa38dd
commit
16af84f993
@ -13,6 +13,7 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
|||||||
OnCreate = InstallPkgSetDialogCreate
|
OnCreate = InstallPkgSetDialogCreate
|
||||||
OnDestroy = InstallPkgSetDialogDestroy
|
OnDestroy = InstallPkgSetDialogDestroy
|
||||||
OnResize = InstallPkgSetDialogResize
|
OnResize = InstallPkgSetDialogResize
|
||||||
|
LCLVersion = '0.9.25'
|
||||||
object InstallPkgGroupBox: TGroupBox
|
object InstallPkgGroupBox: TGroupBox
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 291
|
Height = 291
|
||||||
@ -21,26 +22,26 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
|||||||
Anchors = [akTop, akLeft, akBottom]
|
Anchors = [akTop, akLeft, akBottom]
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'InstallPkgGroupBox'
|
Caption = 'InstallPkgGroupBox'
|
||||||
ClientHeight = 272
|
ClientHeight = 273
|
||||||
ClientWidth = 251
|
ClientWidth = 251
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object InstallListBox: TListBox
|
object InstallListBox: TListBox
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 167
|
Height = 168
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 239
|
Width = 239
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
ClickOnSelChange = False
|
ClickOnSelChange = False
|
||||||
MultiSelect = True
|
MultiSelect = True
|
||||||
|
OnDblClick = InstallListBoxDblClick
|
||||||
OnSelectionChange = InstallListBoxSelectionChange
|
OnSelectionChange = InstallListBoxSelectionChange
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
TopIndex = -1
|
|
||||||
end
|
end
|
||||||
object UninstallButton: TButton
|
object UninstallButton: TButton
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 179
|
Top = 180
|
||||||
Width = 239
|
Width = 239
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
@ -51,7 +52,7 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
|||||||
object ImportButton: TButton
|
object ImportButton: TButton
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 210
|
Top = 211
|
||||||
Width = 239
|
Width = 239
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
@ -62,7 +63,7 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
|||||||
object ExportButton: TButton
|
object ExportButton: TButton
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 241
|
Top = 242
|
||||||
Width = 239
|
Width = 239
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
@ -79,26 +80,26 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
|||||||
Anchors = [akTop, akLeft, akBottom]
|
Anchors = [akTop, akLeft, akBottom]
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'AvailablePkgGroupBox'
|
Caption = 'AvailablePkgGroupBox'
|
||||||
ClientHeight = 272
|
ClientHeight = 273
|
||||||
ClientWidth = 251
|
ClientWidth = 251
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object AvailableListBox: TListBox
|
object AvailableListBox: TListBox
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 229
|
Height = 230
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 239
|
Width = 239
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
ClickOnSelChange = False
|
ClickOnSelChange = False
|
||||||
MultiSelect = True
|
MultiSelect = True
|
||||||
|
OnDblClick = AvailableListBoxDblClick
|
||||||
OnSelectionChange = AvailableListBoxSelectionChange
|
OnSelectionChange = AvailableListBoxSelectionChange
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
TopIndex = -1
|
|
||||||
end
|
end
|
||||||
object AddToInstallButton: TButton
|
object AddToInstallButton: TButton
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 241
|
Top = 242
|
||||||
Width = 239
|
Width = 239
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
@ -109,9 +110,9 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
|||||||
end
|
end
|
||||||
object CancelButton: TButton
|
object CancelButton: TButton
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 29
|
Height = 23
|
||||||
Top = 402
|
Top = 408
|
||||||
Width = 98
|
Width = 90
|
||||||
Anchors = [akLeft, akBottom]
|
Anchors = [akLeft, akBottom]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Cancel = True
|
Cancel = True
|
||||||
@ -121,10 +122,10 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
|||||||
end
|
end
|
||||||
object SaveAndRebuildButton: TButton
|
object SaveAndRebuildButton: TButton
|
||||||
AnchorSideRight.Control = SaveAndExitButton
|
AnchorSideRight.Control = SaveAndExitButton
|
||||||
Left = 224
|
Left = 261
|
||||||
Height = 29
|
Height = 23
|
||||||
Top = 402
|
Top = 408
|
||||||
Width = 157
|
Width = 137
|
||||||
Anchors = [akRight, akBottom]
|
Anchors = [akRight, akBottom]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
@ -133,10 +134,10 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
|||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
end
|
end
|
||||||
object SaveAndExitButton: TButton
|
object SaveAndExitButton: TButton
|
||||||
Left = 387
|
Left = 404
|
||||||
Height = 29
|
Height = 23
|
||||||
Top = 402
|
Top = 408
|
||||||
Width = 135
|
Width = 118
|
||||||
Anchors = [akRight, akBottom]
|
Anchors = [akRight, akBottom]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = 'SaveAndExitButton'
|
Caption = 'SaveAndExitButton'
|
||||||
@ -150,11 +151,11 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
|||||||
Width = 515
|
Width = 515
|
||||||
Anchors = [akLeft, akRight, akBottom]
|
Anchors = [akLeft, akRight, akBottom]
|
||||||
Caption = 'PkgInfoGroupBox'
|
Caption = 'PkgInfoGroupBox'
|
||||||
ClientHeight = 66
|
ClientHeight = 67
|
||||||
ClientWidth = 511
|
ClientWidth = 511
|
||||||
TabOrder = 5
|
TabOrder = 5
|
||||||
object PkgInfoMemo: TMemo
|
object PkgInfoMemo: TMemo
|
||||||
Height = 66
|
Height = 67
|
||||||
Width = 511
|
Width = 511
|
||||||
Align = alClient
|
Align = alClient
|
||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
|
@ -7,47 +7,48 @@ LazarusResources.Add('TInstallPkgSetDialog','FORMDATA',[
|
|||||||
+'rStyle'#7#13'bsSizeToolWin'#7'Caption'#6#19'InstallPkgSetDialog'#12'ClientH'
|
+'rStyle'#7#13'bsSizeToolWin'#7'Caption'#6#19'InstallPkgSetDialog'#12'ClientH'
|
||||||
+'eight'#3#185#1#11'ClientWidth'#3#17#2#8'OnCreate'#7#25'InstallPkgSetDialogC'
|
+'eight'#3#185#1#11'ClientWidth'#3#17#2#8'OnCreate'#7#25'InstallPkgSetDialogC'
|
||||||
+'reate'#9'OnDestroy'#7#26'InstallPkgSetDialogDestroy'#8'OnResize'#7#25'Insta'
|
+'reate'#9'OnDestroy'#7#26'InstallPkgSetDialogDestroy'#8'OnResize'#7#25'Insta'
|
||||||
+'llPkgSetDialogResize'#0#9'TGroupBox'#18'InstallPkgGroupBox'#4'Left'#2#6#6'H'
|
+'llPkgSetDialogResize'#10'LCLVersion'#6#6'0.9.25'#0#9'TGroupBox'#18'InstallP'
|
||||||
+'eight'#3'#'#1#3'Top'#2#6#5'Width'#3#255#0#7'Anchors'#11#5'akTop'#6'akLeft'#8
|
+'kgGroupBox'#4'Left'#2#6#6'Height'#3'#'#1#3'Top'#2#6#5'Width'#3#255#0#7'Anch'
|
||||||
+'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#18'InstallPkgGroupBox'
|
|
||||||
+#12'ClientHeight'#3#16#1#11'ClientWidth'#3#251#0#8'TabOrder'#2#0#0#8'TListBo'
|
|
||||||
+'x'#14'InstallListBox'#4'Left'#2#6#6'Height'#3#167#0#3'Top'#2#6#5'Width'#3
|
|
||||||
+#239#0#5'Align'#7#8'alClient'#20'BorderSpacing.Around'#2#6#16'ClickOnSelChan'
|
|
||||||
+'ge'#8#11'MultiSelect'#9#17'OnSelectionChange'#7#29'InstallListBoxSelectionC'
|
|
||||||
+'hange'#8'TabOrder'#2#0#8'TopIndex'#2#255#0#0#7'TButton'#15'UninstallButton'
|
|
||||||
+#4'Left'#2#6#6'Height'#2#25#3'Top'#3#179#0#5'Width'#3#239#0#5'Align'#7#8'alB'
|
|
||||||
+'ottom'#20'BorderSpacing.Around'#2#6#7'Caption'#6#15'UninstallButton'#7'OnCl'
|
|
||||||
+'ick'#7#20'UninstallButtonClick'#8'TabOrder'#2#1#0#0#7'TButton'#12'ImportBut'
|
|
||||||
+'ton'#4'Left'#2#6#6'Height'#2#25#3'Top'#3#210#0#5'Width'#3#239#0#5'Align'#7#8
|
|
||||||
+'alBottom'#20'BorderSpacing.Around'#2#6#7'Caption'#6#12'ImportButton'#7'OnCl'
|
|
||||||
+'ick'#7#17'ImportButtonClick'#8'TabOrder'#2#2#0#0#7'TButton'#12'ExportButton'
|
|
||||||
+#4'Left'#2#6#6'Height'#2#25#3'Top'#3#241#0#5'Width'#3#239#0#5'Align'#7#8'alB'
|
|
||||||
+'ottom'#20'BorderSpacing.Around'#2#6#7'Caption'#6#12'ExportButton'#7'OnClick'
|
|
||||||
+#7#17'ExportButtonClick'#8'TabOrder'#2#3#0#0#0#9'TGroupBox'#20'AvailablePkgG'
|
|
||||||
+'roupBox'#4'Left'#3#11#1#6'Height'#3'#'#1#3'Top'#2#6#5'Width'#3#255#0#7'Anch'
|
|
||||||
+'ors'#11#5'akTop'#6'akLeft'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Cap'
|
+'ors'#11#5'akTop'#6'akLeft'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Cap'
|
||||||
+'tion'#6#20'AvailablePkgGroupBox'#12'ClientHeight'#3#16#1#11'ClientWidth'#3
|
+'tion'#6#18'InstallPkgGroupBox'#12'ClientHeight'#3#17#1#11'ClientWidth'#3#251
|
||||||
+#251#0#8'TabOrder'#2#1#0#8'TListBox'#16'AvailableListBox'#4'Left'#2#6#6'Heig'
|
+#0#8'TabOrder'#2#0#0#8'TListBox'#14'InstallListBox'#4'Left'#2#6#6'Height'#3
|
||||||
+'ht'#3#229#0#3'Top'#2#6#5'Width'#3#239#0#5'Align'#7#8'alClient'#20'BorderSpa'
|
+#168#0#3'Top'#2#6#5'Width'#3#239#0#5'Align'#7#8'alClient'#20'BorderSpacing.A'
|
||||||
+'cing.Around'#2#6#16'ClickOnSelChange'#8#11'MultiSelect'#9#17'OnSelectionCha'
|
+'round'#2#6#16'ClickOnSelChange'#8#11'MultiSelect'#9#10'OnDblClick'#7#22'Ins'
|
||||||
+'nge'#7#31'AvailableListBoxSelectionChange'#8'TabOrder'#2#0#8'TopIndex'#2#255
|
+'tallListBoxDblClick'#17'OnSelectionChange'#7#29'InstallListBoxSelectionChan'
|
||||||
+#0#0#7'TButton'#18'AddToInstallButton'#4'Left'#2#6#6'Height'#2#25#3'Top'#3
|
+'ge'#8'TabOrder'#2#0#0#0#7'TButton'#15'UninstallButton'#4'Left'#2#6#6'Height'
|
||||||
+#241#0#5'Width'#3#239#0#5'Align'#7#8'alBottom'#20'BorderSpacing.Around'#2#6#7
|
+#2#25#3'Top'#3#180#0#5'Width'#3#239#0#5'Align'#7#8'alBottom'#20'BorderSpacin'
|
||||||
+'Caption'#6#18'AddToInstallButton'#7'OnClick'#7#23'AddToInstallButtonClick'#8
|
+'g.Around'#2#6#7'Caption'#6#15'UninstallButton'#7'OnClick'#7#20'UninstallBut'
|
||||||
+'TabOrder'#2#1#0#0#0#7'TButton'#12'CancelButton'#4'Left'#2#6#6'Height'#2#29#3
|
+'tonClick'#8'TabOrder'#2#1#0#0#7'TButton'#12'ImportButton'#4'Left'#2#6#6'Hei'
|
||||||
+'Top'#3#146#1#5'Width'#2'b'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'
|
+'ght'#2#25#3'Top'#3#211#0#5'Width'#3#239#0#5'Align'#7#8'alBottom'#20'BorderS'
|
||||||
+#9#6'Cancel'#9#7'Caption'#6#12'CancelButton'#11'ModalResult'#2#2#8'TabOrder'
|
+'pacing.Around'#2#6#7'Caption'#6#12'ImportButton'#7'OnClick'#7#17'ImportButt'
|
||||||
+#2#2#0#0#7'TButton'#20'SaveAndRebuildButton'#23'AnchorSideRight.Control'#7#17
|
+'onClick'#8'TabOrder'#2#2#0#0#7'TButton'#12'ExportButton'#4'Left'#2#6#6'Heig'
|
||||||
+'SaveAndExitButton'#4'Left'#3#224#0#6'Height'#2#29#3'Top'#3#146#1#5'Width'#3
|
+'ht'#2#25#3'Top'#3#242#0#5'Width'#3#239#0#5'Align'#7#8'alBottom'#20'BorderSp'
|
||||||
+#157#0#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing'
|
+'acing.Around'#2#6#7'Caption'#6#12'ExportButton'#7'OnClick'#7#17'ExportButto'
|
||||||
+'.Around'#2#6#7'Caption'#6#20'SaveAndRebuildButton'#7'OnClick'#7#18'InstallB'
|
+'nClick'#8'TabOrder'#2#3#0#0#0#9'TGroupBox'#20'AvailablePkgGroupBox'#4'Left'
|
||||||
+'uttonClick'#8'TabOrder'#2#3#0#0#7'TButton'#17'SaveAndExitButton'#4'Left'#3
|
+#3#11#1#6'Height'#3'#'#1#3'Top'#2#6#5'Width'#3#255#0#7'Anchors'#11#5'akTop'#6
|
||||||
+#131#1#6'Height'#2#29#3'Top'#3#146#1#5'Width'#3#135#0#7'Anchors'#11#7'akRigh'
|
+'akLeft'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#20'Availabl'
|
||||||
+'t'#8'akBottom'#0#8'AutoSize'#9#7'Caption'#6#17'SaveAndExitButton'#7'OnClick'
|
+'ePkgGroupBox'#12'ClientHeight'#3#17#1#11'ClientWidth'#3#251#0#8'TabOrder'#2
|
||||||
+#7#22'SaveAndExitButtonClick'#8'TabOrder'#2#4#0#0#9'TGroupBox'#15'PkgInfoGro'
|
+#1#0#8'TListBox'#16'AvailableListBox'#4'Left'#2#6#6'Height'#3#230#0#3'Top'#2
|
||||||
+'upBox'#4'Left'#2#7#6'Height'#2'U'#3'Top'#3'2'#1#5'Width'#3#3#2#7'Anchors'#11
|
+#6#5'Width'#3#239#0#5'Align'#7#8'alClient'#20'BorderSpacing.Around'#2#6#16'C'
|
||||||
+#6'akLeft'#7'akRight'#8'akBottom'#0#7'Caption'#6#15'PkgInfoGroupBox'#12'Clie'
|
+'lickOnSelChange'#8#11'MultiSelect'#9#10'OnDblClick'#7#24'AvailableListBoxDb'
|
||||||
+'ntHeight'#2'B'#11'ClientWidth'#3#255#1#8'TabOrder'#2#5#0#5'TMemo'#11'PkgInf'
|
+'lClick'#17'OnSelectionChange'#7#31'AvailableListBoxSelectionChange'#8'TabOr'
|
||||||
+'oMemo'#6'Height'#2'B'#5'Width'#3#255#1#5'Align'#7#8'alClient'#8'ReadOnly'#9
|
+'der'#2#0#0#0#7'TButton'#18'AddToInstallButton'#4'Left'#2#6#6'Height'#2#25#3
|
||||||
+#10'ScrollBars'#7#14'ssAutoVertical'#8'TabOrder'#2#0#0#0#0#0
|
+'Top'#3#242#0#5'Width'#3#239#0#5'Align'#7#8'alBottom'#20'BorderSpacing.Aroun'
|
||||||
|
+'d'#2#6#7'Caption'#6#18'AddToInstallButton'#7'OnClick'#7#23'AddToInstallButt'
|
||||||
|
+'onClick'#8'TabOrder'#2#1#0#0#0#7'TButton'#12'CancelButton'#4'Left'#2#6#6'He'
|
||||||
|
+'ight'#2#23#3'Top'#3#152#1#5'Width'#2'Z'#7'Anchors'#11#6'akLeft'#8'akBottom'
|
||||||
|
+#0#8'AutoSize'#9#6'Cancel'#9#7'Caption'#6#12'CancelButton'#11'ModalResult'#2
|
||||||
|
+#2#8'TabOrder'#2#2#0#0#7'TButton'#20'SaveAndRebuildButton'#23'AnchorSideRigh'
|
||||||
|
+'t.Control'#7#17'SaveAndExitButton'#4'Left'#3#5#1#6'Height'#2#23#3'Top'#3#152
|
||||||
|
+#1#5'Width'#3#137#0#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20
|
||||||
|
+'BorderSpacing.Around'#2#6#7'Caption'#6#20'SaveAndRebuildButton'#7'OnClick'#7
|
||||||
|
+#18'InstallButtonClick'#8'TabOrder'#2#3#0#0#7'TButton'#17'SaveAndExitButton'
|
||||||
|
+#4'Left'#3#148#1#6'Height'#2#23#3'Top'#3#152#1#5'Width'#2'v'#7'Anchors'#11#7
|
||||||
|
+'akRight'#8'akBottom'#0#8'AutoSize'#9#7'Caption'#6#17'SaveAndExitButton'#7'O'
|
||||||
|
+'nClick'#7#22'SaveAndExitButtonClick'#8'TabOrder'#2#4#0#0#9'TGroupBox'#15'Pk'
|
||||||
|
+'gInfoGroupBox'#4'Left'#2#7#6'Height'#2'U'#3'Top'#3'2'#1#5'Width'#3#3#2#7'An'
|
||||||
|
+'chors'#11#6'akLeft'#7'akRight'#8'akBottom'#0#7'Caption'#6#15'PkgInfoGroupBo'
|
||||||
|
+'x'#12'ClientHeight'#2'C'#11'ClientWidth'#3#255#1#8'TabOrder'#2#5#0#5'TMemo'
|
||||||
|
+#11'PkgInfoMemo'#6'Height'#2'C'#5'Width'#3#255#1#5'Align'#7#8'alClient'#8'Re'
|
||||||
|
+'adOnly'#9#10'ScrollBars'#7#14'ssAutoVertical'#8'TabOrder'#2#0#0#0#0#0
|
||||||
]);
|
]);
|
||||||
|
@ -65,10 +65,12 @@ type
|
|||||||
SaveAndExitButton: TButton;
|
SaveAndExitButton: TButton;
|
||||||
UninstallButton: TButton;
|
UninstallButton: TButton;
|
||||||
procedure AddToInstallButtonClick(Sender: TObject);
|
procedure AddToInstallButtonClick(Sender: TObject);
|
||||||
|
procedure AvailableListBoxDblClick(Sender: TObject);
|
||||||
procedure AvailableListBoxSelectionChange(Sender: TObject; User: boolean);
|
procedure AvailableListBoxSelectionChange(Sender: TObject; User: boolean);
|
||||||
procedure ExportButtonClick(Sender: TObject);
|
procedure ExportButtonClick(Sender: TObject);
|
||||||
procedure ImportButtonClick(Sender: TObject);
|
procedure ImportButtonClick(Sender: TObject);
|
||||||
procedure InstallButtonClick(Sender: TObject);
|
procedure InstallButtonClick(Sender: TObject);
|
||||||
|
procedure InstallListBoxDblClick(Sender: TObject);
|
||||||
procedure InstallListBoxSelectionChange(Sender: TObject; User: boolean);
|
procedure InstallListBoxSelectionChange(Sender: TObject; User: boolean);
|
||||||
procedure InstallPkgSetDialogCreate(Sender: TObject);
|
procedure InstallPkgSetDialogCreate(Sender: TObject);
|
||||||
procedure InstallPkgSetDialogDestroy(Sender: TObject);
|
procedure InstallPkgSetDialogDestroy(Sender: TObject);
|
||||||
@ -97,6 +99,8 @@ type
|
|||||||
function IndexOfNewInstalledPkgByName(const APackageName: string): integer;
|
function IndexOfNewInstalledPkgByName(const APackageName: string): integer;
|
||||||
procedure SavePackageListToFile(const AFilename: string);
|
procedure SavePackageListToFile(const AFilename: string);
|
||||||
procedure LoadPackageListFromFile(const AFilename: string);
|
procedure LoadPackageListFromFile(const AFilename: string);
|
||||||
|
procedure AddToInstall;
|
||||||
|
procedure AddToUninstall;
|
||||||
public
|
public
|
||||||
function GetNewInstalledPackages: TFPList;
|
function GetNewInstalledPackages: TFPList;
|
||||||
property OldInstalledPackages: TPkgDependency read FOldInstalledPackages
|
property OldInstalledPackages: TPkgDependency read FOldInstalledPackages
|
||||||
@ -164,6 +168,11 @@ begin
|
|||||||
ModalResult:=mrOk;
|
ModalResult:=mrOk;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TInstallPkgSetDialog.InstallListBoxDblClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
AddToUninstall;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TInstallPkgSetDialog.AvailableListBoxSelectionChange(Sender: TObject;
|
procedure TInstallPkgSetDialog.AvailableListBoxSelectionChange(Sender: TObject;
|
||||||
User: boolean);
|
User: boolean);
|
||||||
begin
|
begin
|
||||||
@ -216,73 +225,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TInstallPkgSetDialog.AddToInstallButtonClick(Sender: TObject);
|
procedure TInstallPkgSetDialog.AddToInstallButtonClick(Sender: TObject);
|
||||||
var
|
|
||||||
i: Integer;
|
|
||||||
NewPackageID: TLazPackageID;
|
|
||||||
j: LongInt;
|
|
||||||
APackage: TLazPackage;
|
|
||||||
Additions: TFPList;
|
|
||||||
begin
|
begin
|
||||||
Additions:=TFPList.Create;
|
AddToInstall;
|
||||||
NewPackageID:=TLazPackageID.Create;
|
end;
|
||||||
try
|
|
||||||
for i:=0 to AvailableListBox.Items.Count-1 do begin
|
procedure TInstallPkgSetDialog.AvailableListBoxDblClick(Sender: TObject);
|
||||||
if not AvailableListBox.Selected[i] then continue;
|
begin
|
||||||
// check string
|
AddToInstall;
|
||||||
if not NewPackageID.StringToID(AvailableListBox.Items[i]) then begin
|
|
||||||
AvailableListBox.Selected[i]:=false;
|
|
||||||
debugln('TInstallPkgSetDialog.AddToInstallButtonClick invalid ID: ',
|
|
||||||
AvailableListBox.Items[i]);
|
|
||||||
continue;
|
|
||||||
end;
|
|
||||||
// check if already in list
|
|
||||||
if NewInstalledPackagesContains(NewPackageID) then begin
|
|
||||||
MessageDlg('Double',
|
|
||||||
'The package '+NewPackageID.Name+' is already in the list',mtError,
|
|
||||||
[mbCancel],0);
|
|
||||||
AvailableListBox.Selected[i]:=false;
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
// check if a package with same name is already in the list
|
|
||||||
j:=IndexOfNewInstalledPkgByName(NewPackageID.Name);
|
|
||||||
if j>=0 then begin
|
|
||||||
MessageDlg('Conflict',
|
|
||||||
'There is already a package '+NewPackageID.Name+' in the list',
|
|
||||||
mtError,[mbCancel],0);
|
|
||||||
AvailableListBox.Selected[i]:=false;
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
// check if package is loaded and has some attributes that prevents
|
|
||||||
// installation in the IDE
|
|
||||||
APackage:=PackageGraph.FindPackageWithID(NewPackageID);
|
|
||||||
if APackage<>nil then begin
|
|
||||||
if APackage.PackageType=lptRunTime then begin
|
|
||||||
MessageDlg('Not a designtime package',
|
|
||||||
'The package '+APackage.IDAsString+' is not a design time package.'
|
|
||||||
+' It can not be installed in the IDE',mtError,
|
|
||||||
[mbCancel],0);
|
|
||||||
AvailableListBox.Selected[i]:=false;
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
// ok => add to list
|
|
||||||
Additions.Add(NewPackageID);
|
|
||||||
NewPackageID:=TLazPackageID.Create;
|
|
||||||
end;
|
|
||||||
AvailableListBox.ItemIndex:=-1;
|
|
||||||
// all ok => add to list
|
|
||||||
for i:=0 to Additions.Count-1 do
|
|
||||||
FNewInstalledPackages.Add(Additions[i]);
|
|
||||||
Additions.Clear;
|
|
||||||
UpdateNewInstalledPackages;
|
|
||||||
UpdateButtonStates;
|
|
||||||
finally
|
|
||||||
// clean up
|
|
||||||
NewPackageID.Free;
|
|
||||||
for i:=0 to Additions.Count-1 do
|
|
||||||
TObject(Additions[i]).Free;
|
|
||||||
Additions.Free;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TInstallPkgSetDialog.InstallListBoxSelectionChange(Sender: TObject;
|
procedure TInstallPkgSetDialog.InstallListBoxSelectionChange(Sender: TObject;
|
||||||
@ -318,44 +267,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TInstallPkgSetDialog.UninstallButtonClick(Sender: TObject);
|
procedure TInstallPkgSetDialog.UninstallButtonClick(Sender: TObject);
|
||||||
var
|
|
||||||
i: Integer;
|
|
||||||
OldPackageID: TLazPackageID;
|
|
||||||
APackage: TLazPackage;
|
|
||||||
Deletions: TFPList;
|
|
||||||
begin
|
begin
|
||||||
Deletions:=TFPList.Create;
|
AddToUninstall;
|
||||||
try
|
|
||||||
for i:=0 to InstallListBox.Items.Count-1 do begin
|
|
||||||
if not InstallListBox.Selected[i] then continue;
|
|
||||||
OldPackageID:=TLazPackageID(FNewInstalledPackages[i]);
|
|
||||||
// get package
|
|
||||||
APackage:=PackageGraph.FindPackageWithID(OldPackageID);
|
|
||||||
if APackage<>nil then begin
|
|
||||||
// check if package is a base package
|
|
||||||
if APackage.AutoCreated then begin
|
|
||||||
InstallListBox.Selected[i]:=false;
|
|
||||||
MessageDlg('Uninstall impossible',
|
|
||||||
'The package '+APackage.Name+' can not be uninstalled, because it '
|
|
||||||
+'is needed by the IDE itself.',mtError,[mbCancel],0);
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
// ok => add to deletions
|
|
||||||
Deletions.Add(OldPackageID);
|
|
||||||
end;
|
|
||||||
// ok => remove from list
|
|
||||||
InstallListBox.ItemIndex:=-1;
|
|
||||||
for i:=0 to Deletions.Count-1 do begin
|
|
||||||
OldPackageID:=TLazPackageID(Deletions[i]);
|
|
||||||
FNewInstalledPackages.Remove(OldPackageID);
|
|
||||||
OldPackageID.Free;
|
|
||||||
end;
|
|
||||||
UpdateNewInstalledPackages;
|
|
||||||
UpdateButtonStates;
|
|
||||||
finally
|
|
||||||
Deletions.Free;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TInstallPkgSetDialog.SetOldInstalledPackages(
|
procedure TInstallPkgSetDialog.SetOldInstalledPackages(
|
||||||
@ -685,6 +598,117 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TInstallPkgSetDialog.AddToInstall;
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
NewPackageID: TLazPackageID;
|
||||||
|
j: LongInt;
|
||||||
|
APackage: TLazPackage;
|
||||||
|
Additions: TFPList;
|
||||||
|
begin
|
||||||
|
Additions:=TFPList.Create;
|
||||||
|
NewPackageID:=TLazPackageID.Create;
|
||||||
|
try
|
||||||
|
for i:=0 to AvailableListBox.Items.Count-1 do begin
|
||||||
|
if not AvailableListBox.Selected[i] then continue;
|
||||||
|
// check string
|
||||||
|
if not NewPackageID.StringToID(AvailableListBox.Items[i]) then begin
|
||||||
|
AvailableListBox.Selected[i]:=false;
|
||||||
|
debugln('TInstallPkgSetDialog.AddToInstallButtonClick invalid ID: ',
|
||||||
|
AvailableListBox.Items[i]);
|
||||||
|
continue;
|
||||||
|
end;
|
||||||
|
// check if already in list
|
||||||
|
if NewInstalledPackagesContains(NewPackageID) then begin
|
||||||
|
MessageDlg('Double',
|
||||||
|
'The package '+NewPackageID.Name+' is already in the list',mtError,
|
||||||
|
[mbCancel],0);
|
||||||
|
AvailableListBox.Selected[i]:=false;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
// check if a package with same name is already in the list
|
||||||
|
j:=IndexOfNewInstalledPkgByName(NewPackageID.Name);
|
||||||
|
if j>=0 then begin
|
||||||
|
MessageDlg('Conflict',
|
||||||
|
'There is already a package '+NewPackageID.Name+' in the list',
|
||||||
|
mtError,[mbCancel],0);
|
||||||
|
AvailableListBox.Selected[i]:=false;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
// check if package is loaded and has some attributes that prevents
|
||||||
|
// installation in the IDE
|
||||||
|
APackage:=PackageGraph.FindPackageWithID(NewPackageID);
|
||||||
|
if APackage<>nil then begin
|
||||||
|
if APackage.PackageType=lptRunTime then begin
|
||||||
|
MessageDlg('Not a designtime package',
|
||||||
|
'The package '+APackage.IDAsString+' is not a design time package.'
|
||||||
|
+' It can not be installed in the IDE',mtError,
|
||||||
|
[mbCancel],0);
|
||||||
|
AvailableListBox.Selected[i]:=false;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
// ok => add to list
|
||||||
|
Additions.Add(NewPackageID);
|
||||||
|
NewPackageID:=TLazPackageID.Create;
|
||||||
|
end;
|
||||||
|
AvailableListBox.ItemIndex:=-1;
|
||||||
|
// all ok => add to list
|
||||||
|
for i:=0 to Additions.Count-1 do
|
||||||
|
FNewInstalledPackages.Add(Additions[i]);
|
||||||
|
Additions.Clear;
|
||||||
|
UpdateNewInstalledPackages;
|
||||||
|
UpdateButtonStates;
|
||||||
|
finally
|
||||||
|
// clean up
|
||||||
|
NewPackageID.Free;
|
||||||
|
for i:=0 to Additions.Count-1 do
|
||||||
|
TObject(Additions[i]).Free;
|
||||||
|
Additions.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TInstallPkgSetDialog.AddToUninstall;
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
OldPackageID: TLazPackageID;
|
||||||
|
APackage: TLazPackage;
|
||||||
|
Deletions: TFPList;
|
||||||
|
begin
|
||||||
|
Deletions:=TFPList.Create;
|
||||||
|
try
|
||||||
|
for i:=0 to InstallListBox.Items.Count-1 do begin
|
||||||
|
if not InstallListBox.Selected[i] then continue;
|
||||||
|
OldPackageID:=TLazPackageID(FNewInstalledPackages[i]);
|
||||||
|
// get package
|
||||||
|
APackage:=PackageGraph.FindPackageWithID(OldPackageID);
|
||||||
|
if APackage<>nil then begin
|
||||||
|
// check if package is a base package
|
||||||
|
if APackage.AutoCreated then begin
|
||||||
|
InstallListBox.Selected[i]:=false;
|
||||||
|
MessageDlg('Uninstall impossible',
|
||||||
|
'The package '+APackage.Name+' can not be uninstalled, because it '
|
||||||
|
+'is needed by the IDE itself.',mtError,[mbCancel],0);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
// ok => add to deletions
|
||||||
|
Deletions.Add(OldPackageID);
|
||||||
|
end;
|
||||||
|
// ok => remove from list
|
||||||
|
InstallListBox.ItemIndex:=-1;
|
||||||
|
for i:=0 to Deletions.Count-1 do begin
|
||||||
|
OldPackageID:=TLazPackageID(Deletions[i]);
|
||||||
|
FNewInstalledPackages.Remove(OldPackageID);
|
||||||
|
OldPackageID.Free;
|
||||||
|
end;
|
||||||
|
UpdateNewInstalledPackages;
|
||||||
|
UpdateButtonStates;
|
||||||
|
finally
|
||||||
|
Deletions.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TInstallPkgSetDialog.GetNewInstalledPackages: TFPList;
|
function TInstallPkgSetDialog.GetNewInstalledPackages: TFPList;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user