IDE: In ConfigureBuildLazarusDlg, show a single checkbox for "Clean common files" when installation dir is read-only.

git-svn-id: trunk@44449 -
This commit is contained in:
juha 2014-03-16 21:35:11 +00:00
parent 042680da83
commit 7c3e1eeadf
2 changed files with 66 additions and 16 deletions

View File

@ -1,7 +1,7 @@
object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg
Left = 349
Left = 378
Height = 480
Top = 200
Top = 195
Width = 700
VertScrollBar.Visible = False
BorderIcons = [biSystemMenu]
@ -488,6 +488,7 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg
Width = 189
Caption = 'CleanAutoRadioButton'
Checked = True
OnClick = CleanRadioButtonClick
TabOrder = 0
TabStop = True
end
@ -497,6 +498,7 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg
Top = 27
Width = 189
Caption = 'CleanCommonRadioButton'
OnClick = CleanRadioButtonClick
TabOrder = 1
end
object CleanAllRadioButton: TRadioButton
@ -505,6 +507,7 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg
Top = 48
Width = 189
Caption = 'CleanAllRadioButton'
OnClick = CleanRadioButtonClick
TabOrder = 2
end
object CleanOnceCheckBox: TCheckBox
@ -516,6 +519,18 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg
Caption = 'CleanOnceCheckBox'
TabOrder = 3
end
object CleanCommonCheckBox: TCheckBox
AnchorSideTop.Control = CleanAutoRadioButton
Left = 6
Height = 21
Top = 12
Width = 173
BorderSpacing.Top = 6
Caption = 'CleanCommonCheckBox'
OnClick = CleanCommonCheckBoxClick
TabOrder = 4
Visible = False
end
end
end
end

View File

@ -81,6 +81,7 @@ type
CleanAutoRadioButton: TRadioButton;
CleanCommonRadioButton: TRadioButton;
CleanOnceCheckBox: TCheckBox;
CleanCommonCheckBox: TCheckBox;
CommonsDividerBevel: TDividerBevel;
ConfirmBuildCheckBox: TCheckBox;
DefinesButton: TButton;
@ -119,6 +120,8 @@ type
UpdateRevisionIncCheckBox: TCheckBox;
procedure BuildProfileButtonClick(Sender: TObject);
procedure BuildProfileComboBoxSelect(Sender: TObject);
procedure CleanRadioButtonClick(Sender: TObject);
procedure CleanCommonCheckBoxClick(Sender: TObject);
procedure CompileAdvancedButtonClick(Sender: TObject);
procedure CompileButtonClick(Sender: TObject);
procedure DefinesButtonClick(Sender: TObject);
@ -956,6 +959,7 @@ begin
CleanAllRadioButton.Caption:=lisCleanAll;
CleanOnceCheckBox.Caption:=lisCleanOnlyOnce;
CleanOnceCheckBox.Hint:=lisAfterCleaningUpSwitchToAutomaticClean;
CleanCommonCheckBox.Caption:=lisCleanCommonFiles;
UpdateRevisionIncCheckBox.Caption := lisLazBuildUpdateRevInc;
UpdateRevisionIncCheckBox.Hint := lisLazBuildUpdateRevisionInfoInAboutLazarusDialog;
@ -1080,20 +1084,32 @@ procedure TConfigureBuildLazarusDlg.CopyProfileToUI(AProfile: TBuildLazarusProfi
var
i: Integer;
begin
LCLWidgetTypeComboBox.ItemIndex :=ord(AProfile.TargetPlatform);
UpdateRevisionIncCheckBox.Checked :=AProfile.UpdateRevisionInc;
TargetOSComboBox.Text :=AProfile.TargetOS;
TargetDirectoryComboBox.Text :=AProfile.TargetDirectory;
TargetCPUComboBox.Text :=AProfile.TargetCPU;
case AProfile.IdeBuildMode of
bmBuild: CleanAutoRadioButton.Checked:=true;
bmCleanBuild: CleanCommonRadioButton.Checked:=true;
bmCleanAllBuild: CleanAllRadioButton.Checked:=true;
CleanAutoRadioButton.OnClick:=Nil;
CleanCommonRadioButton.OnClick:=Nil;
CleanAllRadioButton.OnClick:=Nil;
CleanCommonCheckBox.OnClick:=Nil;
try
LCLWidgetTypeComboBox.ItemIndex :=ord(AProfile.TargetPlatform);
UpdateRevisionIncCheckBox.Checked :=AProfile.UpdateRevisionInc;
TargetOSComboBox.Text :=AProfile.TargetOS;
TargetDirectoryComboBox.Text :=AProfile.TargetDirectory;
TargetCPUComboBox.Text :=AProfile.TargetCPU;
case AProfile.IdeBuildMode of
bmBuild: CleanAutoRadioButton.Checked:=true;
bmCleanBuild: CleanCommonRadioButton.Checked:=true;
bmCleanAllBuild: CleanAllRadioButton.Checked:=true;
end;
CleanCommonCheckBox.Checked := AProfile.IdeBuildMode=bmCleanBuild;
CleanOnceCheckBox.Checked:=AProfile.CleanOnce;
OptionsMemo.Lines.Assign(AProfile.OptionsLines);
for i:=0 to DefinesListBox.Items.Count-1 do
DefinesListBox.Checked[i]:=AProfile.Defines.IndexOf(DefinesListBox.Items[i]) > -1;
finally
CleanAutoRadioButton.OnClick:=@CleanRadioButtonClick;
CleanCommonRadioButton.OnClick:=@CleanRadioButtonClick;
CleanAllRadioButton.OnClick:=@CleanRadioButtonClick;
CleanCommonCheckBox.OnClick:=@CleanCommonCheckBoxClick;
end;
CleanOnceCheckBox.Checked:=AProfile.CleanOnce;
OptionsMemo.Lines.Assign(AProfile.OptionsLines);
for i:=0 to DefinesListBox.Items.Count-1 do
DefinesListBox.Checked[i]:=AProfile.Defines.IndexOf(DefinesListBox.Items[i]) > -1;
end;
procedure TConfigureBuildLazarusDlg.CopyUIToProfile(AProfile: TBuildLazarusProfile);
@ -1227,13 +1243,17 @@ begin
end;
procedure TConfigureBuildLazarusDlg.ShowHideCleanup(aShow: Boolean);
// When target directory is read-only, hide Radiobuttons and show a single checkbox.
begin
CleanAutoRadioButton.Visible:=aShow;
CleanCommonRadioButton.Visible:=aShow;
CleanAllRadioButton.Visible:=aShow;
CleanOnceCheckBox.Visible:=aShow;
CleanCommonCheckBox.Visible:=not aShow;
end;
procedure TConfigureBuildLazarusDlg.CompileAdvancedButtonClick(Sender: TObject);
// mrOk=change selected profiles. Selected profiels will be saved or discarded
// mrOk=change selected profiles. Selected profiles will be saved or discarded
// depending on the calling dialog
// mrYes=save and compile
// mrCancel=do nothing
@ -1337,5 +1357,20 @@ begin
ShowHideCleanup(not fBuilder.IsWriteProtected(fProfiles.Current));
end;
procedure TConfigureBuildLazarusDlg.CleanRadioButtonClick(Sender: TObject);
begin
CleanCommonCheckBox.Checked:=CleanCommonRadioButton.Checked;
DebugLn(['TConfigureBuildLazarusDlg.CleanRadioButtonClick: set CleanCommonCheckBox to ', CleanCommonRadioButton.Checked]);
end;
procedure TConfigureBuildLazarusDlg.CleanCommonCheckBoxClick(Sender: TObject);
begin
if CleanCommonCheckBox.Checked then
CleanCommonRadioButton.Checked:=True
else
CleanAutoRadioButton.Checked:=True;
DebugLn(['TConfigureBuildLazarusDlg.CleanCommonCheckBoxClick: set CleanCommonRadioButton to ', CleanCommonCheckBox.Checked]);
end;
end.