IDE: do not show build modes on package options, that is too confusing

git-svn-id: trunk@41679 -
This commit is contained in:
mattias 2013-06-11 16:38:33 +00:00
parent 2334f84a57
commit 31bb5200d0
2 changed files with 14 additions and 10 deletions

View File

@ -95,7 +95,7 @@ var
OnSaveIDEOptionsHook: TOnSaveIDEOptions;
function ShowBuildModesDlg(aShowSession: Boolean): TModalResult;
procedure SwitchBuildMode(aBuildModeID: string);
procedure SwitchBuildMode(aBuildModeID: string; LoadSaveProjectOptions: boolean);
procedure UpdateBuildModeCombo(aCombo: TComboBox);
@ -135,12 +135,15 @@ begin
end;
end;
procedure SwitchBuildMode(aBuildModeID: string);
procedure SwitchBuildMode(aBuildModeID: string;
LoadSaveProjectOptions: boolean);
begin
OnSaveIDEOptionsHook(Nil, Project1.CompilerOptions); // Save changes
if LoadSaveProjectOptions then
OnSaveIDEOptionsHook(Nil, Project1.CompilerOptions); // Save changes
Project1.ActiveBuildModeID := aBuildModeID; // Switch
IncreaseBuildMacroChangeStamp;
OnLoadIDEOptionsHook(Nil, Project1.CompilerOptions); // Load options
if LoadSaveProjectOptions then
OnLoadIDEOptionsHook(Nil, Project1.CompilerOptions); // Load options
end;
procedure UpdateBuildModeCombo(aCombo: TComboBox);

View File

@ -85,6 +85,7 @@ type
FPrevEditor: TAbstractIDEOptionsEditor;
FSelectNode: TTreeNode;
FSettings: TIDEOptionsEditorSettings;
FShowBuildModes: boolean;
function FindGroupClass(Node: TTreeNode): TAbstractIDEOptionsClass;
procedure TraverseSettings(AOptions: TAbstractIDEOptions; anAction: TIDEOptsDlgAction);
function CheckValues: boolean;
@ -132,7 +133,7 @@ begin
FEditorsCreated := False;
FEditorToOpen := nil;
SettingsPanel.Constraints.MinHeight:=0;
BuildModeSelectPanel.Height:=0;
BuildModeSelectPanel.Visible:=false;
BuildModeLabel.Caption:=lisBuildMode;
BuildModeInSessionCheckBox.Caption:=lisInSession;
BuildModeInSessionCheckBox.Hint:=
@ -198,11 +199,11 @@ begin
AEditor := TAbstractIDEOptionsEditor(Node.Data);
GroupClass := FindGroupClass(Node);
end;
// Show the Build Mode panel for Compiler Options
if (GroupClass <> nil) and (GroupClass.InheritsFrom(TLazCompilerOptions)) then
BuildModeSelectPanel.Height:=40
// Show the Build Mode panel for project compiler options
if (GroupClass <> nil) and (GroupClass.InheritsFrom(TProjectCompilerOptions)) then
BuildModeSelectPanel.Visible:=true
else
BuildModeSelectPanel.Height:=0;
BuildModeSelectPanel.Visible:=false;
// Hide the old and show the new editor frame
if Assigned(AEditor) then
FNewLastSelected := AEditor.Rec;
@ -225,7 +226,7 @@ begin
BuildModeInSessionCheckBox.Enabled:=false;
end
else begin
SwitchBuildMode(BuildModeComboBox.Text);
SwitchBuildMode(BuildModeComboBox.Text,BuildModeSelectPanel.Visible);
end;
end;