IDE: added IDE Startup option to check fppkg configuration at startup, disabled by default

This commit is contained in:
mattias 2022-10-14 09:42:55 +02:00
parent d42800f8bb
commit 4b9fb1e051
7 changed files with 183 additions and 138 deletions

View File

@ -537,6 +537,7 @@ type
FDebuggerAllowFunctionCalls: boolean;
FDebuggerAutoSetInstanceFromClass: boolean;
FDebuggerShowExitCodeMessage: boolean;
FFppkgCheck: boolean;
FHasActiveDebuggerEntry: Boolean;
fRegisteredSubConfig: TObjectList;
FDebuggerAutoCloseAsm: boolean;
@ -902,6 +903,7 @@ type
property DebuggerAutoCloseAsm: boolean read FDebuggerAutoCloseAsm write FDebuggerAutoCloseAsm;
property DebuggerAutoSetInstanceFromClass: boolean read FDebuggerAutoSetInstanceFromClass write FDebuggerAutoSetInstanceFromClass;
property DebuggerAllowFunctionCalls: boolean read FDebuggerAllowFunctionCalls write FDebuggerAllowFunctionCalls;
property FppkgCheck: boolean read FFppkgCheck write FFppkgCheck;
property FppkgConfigFile: string read GetFppkgConfigFile write SetFppkgConfigFile;
property FppkgConfigFileHistory: TStringList read FFppkgConfigFileHistory write FFppkgConfigFileHistory;
// ShowCompileDialog and AutoCloseCompileDialog are currently not used.
@ -1943,6 +1945,7 @@ begin
FDebuggerFileHistory.OwnsObjects := True;
FDebuggerProperties := TDebuggerPropertiesConfigList.Create;
FDebuggerEventLogColors:=DebuggerDefaultColors;
FppkgCheck:=false;
FppkgConfigFile:='';
FFppkgConfigFileHistory:=TStringList.Create;
TestBuildDirectory:=GetDefaultTestBuildDirectory;
@ -2197,6 +2200,7 @@ begin
LoadRecentList(FXMLCfg,FMakeFileHistory,Path+'MakeFilename/History/',rltFile);
if FMakeFileHistory.Count=0 then
GetDefaultMakeFilenames(FMakeFileHistory);
FppkgCheck:=FXMLCfg.GetValue(Path+'FppkgCheck/Value',false);
FppkgConfigFile:=FXMLCfg.GetValue(Path+'FppkgConfigFile/Value',FppkgConfigFile);
LoadRecentList(FXMLCfg,FFppkgConfigFileHistory,Path+'FppkgConfigFile/History/',rltFile);
@ -2604,6 +2608,7 @@ begin
SaveRecentList(FXMLCfg,FTestBuildDirHistory,Path+'TestBuildDirectory/History/');
FXMLCfg.SetDeleteValue(Path+'CompilerMessagesFilename/Value',CompilerMessagesFilename,'');
SaveRecentList(FXMLCfg,FCompilerMessagesFileHistory,Path+'CompilerMessagesFilename/History/');
FXMLCfg.SetDeleteValue(Path+'FppkgCheck/Value',FppkgCheck,false);
FXMLCfg.SetDeleteValue(Path+'FppkgConfigFile/Value',FppkgConfigFile,'');
SaveRecentList(FXMLCfg,FFppkgConfigFileHistory,Path+'FppkgConfigFile/History/');
// Note: ManyBuildModesSelection is not stored here any more. Moved to project settings.
@ -2611,7 +2616,7 @@ begin
// Primary-config verification
FXMLCfg.SetDeleteValue(Path+'LastCalledByLazarusFullPath/Value',FLastCalledByLazarusFullPath,'');
// global buid options
// global build options
FConfigStore.AppendBasePath('BuildMatrix');
FBuildMatrixOptions.SaveToConfig(FConfigStore,IsGlobalMode);
FConfigStore.UndoAppendBasePath;

View File

@ -6,24 +6,24 @@ object IdeStartupFrame: TIdeStartupFrame
ClientHeight = 470
ClientWidth = 589
TabOrder = 0
DesignLeft = 317
DesignTop = 418
DesignLeft = 706
DesignTop = 369
object OpenLastProjectAtStartCheckBox: TCheckBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = lblProjectToOpen
AnchorSideTop.Control = divProjectToOpen
AnchorSideTop.Side = asrBottom
AnchorSideRight.Side = asrBottom
Left = 6
Height = 19
Top = 84
Width = 195
Height = 23
Top = 91
Width = 212
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'OpenLastProjectAtStartCheckBox'
OnChange = OpenLastProjectAtStartCheckBoxChange
TabOrder = 1
end
object lblFileAssociation: TDividerBevel
object divFileAssociation: TDividerBevel
AnchorSideTop.Control = Owner
Left = 0
Height = 15
@ -35,12 +35,12 @@ object IdeStartupFrame: TIdeStartupFrame
ParentColor = False
ParentFont = False
end
object lblProjectToOpen: TDividerBevel
object divProjectToOpen: TDividerBevel
AnchorSideTop.Control = LazarusInstancesCB
AnchorSideTop.Side = asrBottom
Left = 0
Height = 15
Top = 63
Top = 70
Width = 597
Caption = 'Project to Open or Create'
Anchors = [akTop, akLeft, akRight]
@ -55,27 +55,28 @@ object IdeStartupFrame: TIdeStartupFrame
AnchorSideTop.Side = asrCenter
Left = 3
Height = 15
Top = 29
Width = 116
Top = 33
Width = 121
BorderSpacing.Left = 3
Caption = 'LazarusInstancesLabel'
Color = clDefault
ParentColor = False
end
object LazarusInstancesCB: TComboBox
AnchorSideLeft.Control = LazarusInstancesLabel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = lblFileAssociation
AnchorSideTop.Control = divFileAssociation
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 127
Height = 23
Left = 132
Height = 30
Top = 25
Width = 462
Width = 457
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 8
BorderSpacing.Top = 8
ItemHeight = 15
ItemHeight = 0
Style = csDropDownList
TabOrder = 0
end
@ -86,15 +87,15 @@ object IdeStartupFrame: TIdeStartupFrame
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 104
Height = 23
Top = 114
Width = 485
Left = 109
Height = 30
Top = 125
Width = 480
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 8
BorderSpacing.Top = 11
DropDownCount = 20
ItemHeight = 15
ItemHeight = 0
Style = csDropDownList
TabOrder = 2
end
@ -104,10 +105,38 @@ object IdeStartupFrame: TIdeStartupFrame
AnchorSideTop.Side = asrCenter
Left = 3
Height = 15
Top = 118
Width = 93
Top = 133
Width = 98
BorderSpacing.Left = 3
Caption = 'New Project Type'
Color = clDefault
ParentColor = False
end
object CheckFPPkgCheckBox: TCheckBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = divInitialChecks
AnchorSideTop.Side = asrBottom
Left = 6
Height = 23
Top = 191
Width = 146
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'CheckFPPkgCheckBox'
TabOrder = 3
end
object divInitialChecks: TDividerBevel
AnchorSideTop.Control = ProjectTypeCB
AnchorSideTop.Side = asrBottom
Left = 0
Height = 15
Top = 170
Width = 597
Caption = 'Initial Checks'
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 15
Font.Style = [fsBold]
ParentColor = False
ParentFont = False
end
end

View File

@ -50,10 +50,12 @@ type
{ TIdeStartupFrame }
TIdeStartupFrame = class(TAbstractIDEOptionsEditor)
CheckFPPkgCheckBox: TCheckBox;
divInitialChecks: TDividerBevel;
ProjectTypeLabel: TLabel;
ProjectTypeCB: TComboBox;
lblFileAssociation: TDividerBevel;
lblProjectToOpen: TDividerBevel;
divFileAssociation: TDividerBevel;
divProjectToOpen: TDividerBevel;
LazarusInstancesCB: TComboBox;
LazarusInstancesLabel: TLabel;
OpenLastProjectAtStartCheckBox: TCheckBox;
@ -98,7 +100,7 @@ var
pd: TProjectDescriptor;
begin
// Using File Association in OS
lblFileAssociation.Caption := dlgFileAssociationInOS;
divFileAssociation.Caption := dlgFileAssociationInOS;
LazarusInstancesLabel.Caption := dlgLazarusInstances;
with LazarusInstancesCB.Items do
begin
@ -110,7 +112,7 @@ begin
end;
Assert(LazarusInstancesCB.Items.Count = Ord(High(TIDEMultipleInstancesOption))+1);
// Project to Open or Create
lblProjectToOpen.Caption := dlgProjectToOpenOrCreate;
divProjectToOpen.Caption := dlgProjectToOpenOrCreate;
OpenLastProjectAtStartCheckBox.Caption := dlgQOpenLastPrj;
ProjectTypeLabel.Caption := dlgNewProjectType;
for i:=0 to ProjectDescriptors.Count-1 do
@ -119,6 +121,8 @@ begin
if pd.VisibleInNewDialog then
ProjectTypeCB.Items.AddObject(pd.GetLocalizedName, pd);
end;
CheckFPPkgCheckBox.Caption:=lisQuickCheckFppkgConfigurationAtStart;
end;
procedure TIdeStartupFrame.ReadSettings(AOptions: TAbstractIDEOptions);
@ -134,16 +138,19 @@ begin
OpenLastProjectAtStartCheckBox.Checked:=OpenLastProjectAtStart;
FOldProjectTemplateAtStart := NewProjectTemplateAtStart;
for i := 0 to ProjectTypeCB.Items.Count-1 do
i:=ProjectTypeCB.Items.Count-1;
while i>=0 do
begin
pd := TProjectDescriptor(ProjectTypeCB.Items.Objects[i]);
if pd.Name = FOldProjectTemplateAtStart then
begin
ProjectTypeCB.ItemIndex := i;
Exit;
end;
break;
dec(i);
end;
ProjectTypeCB.ItemIndex := 0;
if i<0 then i:=0;
ProjectTypeCB.ItemIndex := i;
CheckFPPkgCheckBox.Checked:=FppkgCheck;
debugln(['TIdeStartupFrame.ReadSettings ',CheckFPPkgCheckBox.Checked,' ',FppkgCheck]);
end;
end;
@ -159,6 +166,9 @@ begin
// Don't use the localized name from ProjectTypeCB.Text.
pd := TProjectDescriptor(ProjectTypeCB.Items.Objects[ProjectTypeCB.ItemIndex]);
NewProjectTemplateAtStart := pd.Name;
FppkgCheck:=CheckFPPkgCheckBox.Checked;
debugln(['TIdeStartupFrame.WriteSettings FppkgCheck=',FppkgCheck,' ',CheckFPPkgCheckBox.Checked]);
end;
end;

View File

@ -10,7 +10,7 @@ object InitialSetupDialog: TInitialSetupDialog
OnCreate = FormCreate
OnDestroy = FormDestroy
Position = poScreenCenter
LCLVersion = '2.1.0.0'
LCLVersion = '2.3.0.0'
object PropertiesTreeView: TTreeView
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = WelcomePaintBox
@ -18,7 +18,7 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideRight.Control = Splitter1
AnchorSideBottom.Control = BtnPanel
Left = 6
Height = 276
Height = 280
Top = 54
Width = 159
Anchors = [akTop, akLeft, akRight, akBottom]
@ -40,7 +40,7 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideBottom.Control = PropertiesTreeView
AnchorSideBottom.Side = asrBottom
Left = 165
Height = 276
Height = 280
Top = 54
Width = 5
Align = alNone
@ -48,22 +48,22 @@ object InitialSetupDialog: TInitialSetupDialog
end
object BtnPanel: TPanel
Left = 10
Height = 35
Top = 340
Height = 31
Top = 344
Width = 600
Align = alBottom
AutoSize = True
BorderSpacing.Around = 10
BevelOuter = bvNone
ClientHeight = 35
ClientHeight = 31
ClientWidth = 600
ParentFont = False
TabOrder = 2
object StartIDEBitBtn: TBitBtn
Left = 485
Height = 35
Left = 500
Height = 31
Top = 0
Width = 115
Width = 100
Align = alRight
AutoSize = True
Caption = 'StartIDEBitBtn'
@ -82,7 +82,7 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideBottom.Control = Splitter1
AnchorSideBottom.Side = asrBottom
Left = 170
Height = 276
Height = 280
Top = 54
Width = 444
ActivePage = FppkgTabSheet
@ -99,16 +99,17 @@ object InitialSetupDialog: TInitialSetupDialog
ChildSizing.TopBottomSpacing = 6
ChildSizing.HorizontalSpacing = 6
ChildSizing.VerticalSpacing = 6
ClientHeight = 243
ClientHeight = 251
ClientWidth = 434
ParentFont = False
object LazDirLabel: TLabel
Left = 6
Height = 19
Height = 15
Top = 6
Width = 422
Align = alTop
Caption = 'LazDirLabel'
Color = clDefault
ParentColor = False
ParentFont = False
WordWrap = True
@ -120,8 +121,8 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideRight.Control = LazarusTabSheet
AnchorSideRight.Side = asrBottom
Left = 6
Height = 36
Top = 31
Height = 30
Top = 27
Width = 422
Anchors = [akTop, akLeft, akRight]
ItemHeight = 0
@ -134,8 +135,8 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideTop.Control = LazDirBrowseButton
AnchorSideTop.Side = asrBottom
Left = 6
Height = 123
Top = 114
Height = 145
Top = 100
Width = 422
Align = alBottom
Anchors = [akTop, akLeft, akRight, akBottom]
@ -156,9 +157,9 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideTop.Side = asrBottom
AnchorSideRight.Side = asrBottom
Left = 6
Height = 35
Top = 73
Width = 155
Height = 31
Top = 63
Width = 131
AutoSize = True
Caption = 'LazDirBrowseButton'
OnClick = LazDirBrowseButtonClick
@ -172,16 +173,17 @@ object InitialSetupDialog: TInitialSetupDialog
ChildSizing.TopBottomSpacing = 6
ChildSizing.HorizontalSpacing = 6
ChildSizing.VerticalSpacing = 6
ClientHeight = 243
ClientHeight = 251
ClientWidth = 434
ParentFont = False
object CompilerLabel: TLabel
Left = 6
Height = 19
Height = 15
Top = 6
Width = 422
Align = alTop
Caption = 'CompilerLabel'
Color = clDefault
ParentColor = False
ParentFont = False
WordWrap = True
@ -193,8 +195,8 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideRight.Control = CompilerTabSheet
AnchorSideRight.Side = asrBottom
Left = 6
Height = 36
Top = 31
Height = 30
Top = 27
Width = 422
Anchors = [akTop, akLeft, akRight]
ItemHeight = 0
@ -208,9 +210,9 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideTop.Control = CompilerComboBox
AnchorSideTop.Side = asrBottom
Left = 6
Height = 35
Top = 73
Width = 172
Height = 31
Top = 63
Width = 145
AutoSize = True
Caption = 'CompilerBrowseButton'
OnClick = CompilerBrowseButtonClick
@ -226,8 +228,8 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideBottom.Control = CompilerTabSheet
AnchorSideBottom.Side = asrBottom
Left = 6
Height = 123
Top = 114
Height = 145
Top = 100
Width = 422
Anchors = [akTop, akLeft, akRight, akBottom]
Lines.Strings = (
@ -247,24 +249,25 @@ object InitialSetupDialog: TInitialSetupDialog
ChildSizing.TopBottomSpacing = 6
ChildSizing.HorizontalSpacing = 6
ChildSizing.VerticalSpacing = 6
ClientHeight = 243
ClientHeight = 251
ClientWidth = 434
ParentFont = False
object FPCSrcDirLabel: TLabel
Left = 6
Height = 19
Height = 15
Top = 6
Width = 422
Align = alTop
Caption = 'FPCSrcDirLabel'
Color = clDefault
ParentColor = False
ParentFont = False
WordWrap = True
end
object FPCSrcDirComboBox: TComboBox
Left = 6
Height = 36
Top = 31
Height = 30
Top = 27
Width = 422
Align = alTop
ItemHeight = 0
@ -278,9 +281,9 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideTop.Control = FPCSrcDirComboBox
AnchorSideTop.Side = asrBottom
Left = 6
Height = 35
Top = 73
Width = 182
Height = 31
Top = 63
Width = 151
AutoSize = True
Caption = 'FPCSrcDirBrowseButton'
OnClick = FPCSrcDirBrowseButtonClick
@ -291,8 +294,8 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideTop.Control = FPCSrcDirBrowseButton
AnchorSideTop.Side = asrBottom
Left = 6
Height = 123
Top = 114
Height = 145
Top = 100
Width = 422
Align = alBottom
Anchors = [akTop, akLeft, akRight, akBottom]
@ -311,12 +314,13 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = FPCSrcDirBrowseButton
AnchorSideTop.Side = asrCenter
Left = 200
Height = 19
Top = 81
Width = 60
Left = 169
Height = 15
Top = 71
Width = 49
BorderSpacing.Left = 12
Caption = 'Scanning'
Color = clDefault
ParentColor = False
ParentFont = False
end
@ -325,9 +329,9 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ScanLabel
AnchorSideTop.Side = asrCenter
Left = 266
Left = 224
Height = 20
Top = 80
Top = 68
Width = 102
BorderSpacing.Left = 6
ParentFont = False
@ -341,9 +345,9 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = ScanProgressBar
AnchorSideRight.Side = asrBottom
Left = 374
Left = 332
Height = 25
Top = 78
Top = 66
Width = 78
Caption = 'Stop'
OnClick = StopScanButtonClick
@ -353,13 +357,13 @@ object InitialSetupDialog: TInitialSetupDialog
end
object MakeExeTabSheet: TTabSheet
Caption = 'MakeExeTabSheet'
ClientHeight = 243
ClientHeight = 251
ClientWidth = 434
ParentFont = False
object MakeExeComboBox: TComboBox
Left = 6
Height = 36
Top = 31
Height = 30
Top = 27
Width = 422
Align = alTop
BorderSpacing.Around = 6
@ -371,12 +375,13 @@ object InitialSetupDialog: TInitialSetupDialog
end
object MakeExeLabel: TLabel
Left = 6
Height = 19
Height = 15
Top = 6
Width = 422
Align = alTop
BorderSpacing.Around = 6
Caption = 'MakeExeLabel'
Color = clDefault
ParentColor = False
ParentFont = False
WordWrap = True
@ -386,9 +391,9 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideTop.Control = MakeExeComboBox
AnchorSideTop.Side = asrBottom
Left = 6
Height = 35
Top = 73
Width = 171
Height = 31
Top = 63
Width = 145
AutoSize = True
BorderSpacing.Around = 6
Caption = 'MakeExeBrowseButton'
@ -400,8 +405,8 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideTop.Control = MakeExeBrowseButton
AnchorSideTop.Side = asrBottom
Left = 6
Height = 123
Top = 114
Height = 145
Top = 100
Width = 422
Align = alBottom
Anchors = [akTop, akLeft, akRight, akBottom]
@ -419,13 +424,13 @@ object InitialSetupDialog: TInitialSetupDialog
end
object DebuggerTabSheet: TTabSheet
Caption = 'DebuggerTabSheet'
ClientHeight = 243
ClientHeight = 251
ClientWidth = 434
ParentFont = False
object DebuggerComboBox: TComboBox
Left = 6
Height = 36
Top = 31
Height = 30
Top = 27
Width = 422
Align = alTop
BorderSpacing.Around = 6
@ -437,12 +442,13 @@ object InitialSetupDialog: TInitialSetupDialog
end
object DebuggerLabel: TLabel
Left = 6
Height = 19
Height = 15
Top = 6
Width = 422
Align = alTop
BorderSpacing.Around = 6
Caption = 'DebuggerLabel'
Color = clDefault
ParentColor = False
ParentFont = False
WordWrap = True
@ -452,9 +458,9 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideTop.Control = DebuggerComboBox
AnchorSideTop.Side = asrBottom
Left = 6
Height = 35
Top = 73
Width = 176
Height = 31
Top = 63
Width = 152
AutoSize = True
BorderSpacing.Around = 6
Caption = 'DebuggerBrowseButton'
@ -466,8 +472,8 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideTop.Control = DebuggerBrowseButton
AnchorSideTop.Side = asrBottom
Left = 6
Height = 123
Top = 114
Height = 145
Top = 100
Width = 422
Align = alBottom
Anchors = [akTop, akLeft, akRight, akBottom]
@ -485,12 +491,12 @@ object InitialSetupDialog: TInitialSetupDialog
end
object FppkgTabSheet: TTabSheet
Caption = 'FppkgTabSheet'
ClientHeight = 243
ClientHeight = 251
ClientWidth = 434
ParentFont = False
object FppkgComboBox: TComboBox
Left = 6
Height = 36
Height = 30
Top = 6
Width = 422
Align = alTop
@ -503,12 +509,13 @@ object InitialSetupDialog: TInitialSetupDialog
end
object FppkgLabel: TLabel
Left = 6
Height = 19
Top = 48
Height = 15
Top = 42
Width = 422
Align = alTop
BorderSpacing.Around = 6
Caption = 'FppkgLabel'
Color = clDefault
ParentColor = False
ParentFont = False
WordWrap = True
@ -518,9 +525,9 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideTop.Control = FppkgLabel
AnchorSideTop.Side = asrBottom
Left = 6
Height = 35
Top = 73
Width = 151
Height = 31
Top = 63
Width = 129
AutoSize = True
BorderSpacing.Around = 6
Caption = 'FppkgBrowseButton'
@ -532,8 +539,8 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideTop.Control = FppkgWriteConfigButton
AnchorSideTop.Side = asrBottom
Left = 6
Height = 123
Top = 114
Height = 145
Top = 100
Width = 422
Align = alBottom
Anchors = [akTop, akLeft, akRight, akBottom]
@ -552,10 +559,10 @@ object InitialSetupDialog: TInitialSetupDialog
AnchorSideLeft.Control = DebuggerTabSheet
AnchorSideTop.Control = FppkgLabel
AnchorSideTop.Side = asrBottom
Left = 247
Height = 35
Top = 73
Width = 181
Left = 273
Height = 31
Top = 63
Width = 155
Anchors = [akTop, akRight]
AutoSize = True
BorderSpacing.Around = 6

View File

@ -57,10 +57,7 @@ uses
// IDE
TransferMacros, LazarusIDEStrConsts, LazConf, EnvironmentOpts,
AboutFrm, IDETranslations, BaseBuildManager, InitialSetupProc,
{$IF FPC_FULLVERSION>30100}
GenerateFppkgConfigurationDlg,
{$ENDIF}
IDEProcs, IdeDebuggerOpts;
GenerateFppkgConfigurationDlg, IDEProcs, IdeDebuggerOpts;
type
TInitialSetupDialog = class;
@ -538,12 +535,9 @@ begin
TVNodeFPCSources:=PropertiesTreeView.Items.Add(nil,FPCSourcesTabSheet.Caption);
TVNodeMakeExe:=PropertiesTreeView.Items.Add(nil,MakeExeTabSheet.Caption);
TVNodeDebugger:=PropertiesTreeView.Items.Add(nil,DebuggerTabSheet.Caption);
{$IF FPC_FULLVERSION>30100}
TVNodeFppkg:=PropertiesTreeView.Items.Add(nil,FppkgTabSheet.Caption);
FppkgTabSheet.TabVisible := True;
{$ELSE}
FppkgTabSheet.TabVisible := False;
{$ENDIF FPC_FULLVERSION>30100}
FppkgTabSheet.TabVisible := EnvironmentOptions.FppkgCheck;
if FppkgTabSheet.TabVisible then
TVNodeFppkg:=PropertiesTreeView.Items.Add(nil,FppkgTabSheet.Caption);
ImgIDError := Imagelist1.AddResourceName(HInstance, 'state_error');
ImgIDWarning := Imagelist1.AddResourceName(HInstance, 'state_warning');
@ -868,9 +862,8 @@ begin
TVNodeFPCSources.Text:=FPCSourcesTabSheet.Caption;
TVNodeMakeExe.Text:=MakeExeTabSheet.Caption;
TVNodeDebugger.Text:=DebuggerTabSheet.Caption;
{$IF FPC_FULLVERSION>30100}
TVNodeFppkg.Text:=FppkgTabSheet.Caption;
{$ENDIF FPC_FULLVERSION>30100}
if TVNodeFppkg<>nil then
TVNodeFppkg.Text:=FppkgTabSheet.Caption;
LazDirBrowseButton.Caption:=lisPathEditBrowse;
LazDirLabel.Caption:=SimpleFormat(
@ -1163,8 +1156,10 @@ begin
TVNodeCompiler.ImageIndex:=ImageIndex;
TVNodeCompiler.SelectedIndex:=ImageIndex;
FFlags:=FFlags+[sdfFPCSrcDirNeedsUpdate,sdfFppkgConfigFileNeedsUpdate,
FFlags:=FFlags+[sdfFPCSrcDirNeedsUpdate,
sdfMakeExeFilenameNeedsUpdate,sdfDebuggerFilenameNeedsUpdate];
if FppkgTabSheet.TabVisible then
Include(FFlags,sdfFppkgConfigFileNeedsUpdate);
IdleConnected:=true;
end;
@ -1510,10 +1505,13 @@ begin
UpdateDebuggerNote;
// Fppkg
FppkgComboBox.Text := EnvironmentOptions.FppkgConfigFile;
fLastParsedFppkgConfigFile := ' ';
UpdateFppkgCandidates;
UpdateFppkgNote;
if FppkgTabSheet.TabVisible then
begin
FppkgComboBox.Text := EnvironmentOptions.FppkgConfigFile;
UpdateFppkgCandidates;
UpdateFppkgNote;
end;
// select first error
Node:=FirstErrorNode;
@ -1528,11 +1526,10 @@ var
FppkgMsg, Note: string;
Quality: TSDFilenameQuality;
ConfigFile: string;
{$IF FPC_FULLVERSION>30100}
ImageIndex: Integer;
{$ENDIF}
begin
if csDestroying in ComponentState then exit;
if not FppkgTabSheet.TabVisible then exit;
CurCaption:=FppkgComboBox.Text;
EnvironmentOptions.FppkgConfigFile:=CurCaption;
if fLastParsedFppkgConfigFile=EnvironmentOptions.GetParsedFppkgConfig then exit;
@ -1564,11 +1561,9 @@ begin
FppkgMemo.Text := lisFile2 + ConfigFile + LineEnding + LineEnding + Note;
{$IF FPC_FULLVERSION>30100}
ImageIndex:=QualityToImgIndex(Quality);
TVNodeFppkg.ImageIndex:=ImageIndex;
TVNodeFppkg.SelectedIndex:=ImageIndex;
{$ENDIF FPC_FULLVERSION>30100}
IdleConnected:=true;
end;
@ -1604,25 +1599,23 @@ procedure TInitialSetupDialog.UpdateFppkgCandidates;
begin
Result:=nil;
{$IF FPC_FULLVERSION>30100}
CheckFile(GetFppkgConfigFile(False, False), Result);
CheckFile(GetFppkgConfigFile(False, True), Result);
CheckFile(GetFppkgConfigFile(True, False), Result);
CheckFile(GetFppkgConfigFile(True, True), Result);
{$ENDIF}
end;
var
Files: TSDFileInfoList;
begin
Exclude(FFlags,sdfFppkgConfigFileNeedsUpdate);
if not FppkgTabSheet.TabVisible then exit;
Files:=SearchFppkgFpcPrefixCandidates;
FreeAndNil(FCandidates[sddtFppkgFpcPrefix]);
FCandidates[sddtFppkgFpcPrefix]:=Files;
FillComboboxWithFileInfoList(FppkgComboBox,Files,-1);
end;
procedure TInitialSetupDialog.FppkgBrowseButtonClick(Sender: TObject);
var
lExpandedName: string; // Expanded name before Dialog
@ -1632,6 +1625,7 @@ var
Dlg: TIDEOpenDialog;
Filter: String;
begin
if not FppkgTabSheet.TabVisible then exit;
Dlg:=IDEOpenDialogClass.Create(nil);
try
lTitle:='fppkg.cfg';
@ -1661,12 +1655,10 @@ begin
end;
procedure TInitialSetupDialog.FppkgWriteConfigButtonClick(Sender: TObject);
{$IF FPC_FULLVERSION>30100}
var
Dialog: TGenerateFppkgConfigurationDialog;
{$ENDIF}
begin
{$IF FPC_FULLVERSION>30100}
if not FppkgTabSheet.TabVisible then exit;
Dialog := TGenerateFppkgConfigurationDialog.Create(Self);
try
Dialog.Compiler := fLastParsedCompiler;
@ -1681,7 +1673,6 @@ begin
fLastParsedFppkgConfigFile := ' ';
UpdateFppkgNote;
{$ENDIF}
end;
end.

View File

@ -1625,6 +1625,8 @@ resourcestring
dlgProjectToOpenOrCreate = 'Project to Open or Create';
dlgQOpenLastPrj = 'Open last project and packages at start';
dlgNewProjectType = 'New Project Type';
lisQuickCheckFppkgConfigurationAtStart = 'Quick check fppkg configuration at'
+' start';
// open-dialog filters
dlgFilterAll = 'All files';

View File

@ -1492,6 +1492,7 @@ begin
if (not ShowSetupDialog)
and (not SkipAllTests)
and (not GetSkipCheck(skcFppkg))
and EnvironmentOptions.FppkgCheck
and (CheckFppkgConfiguration(ConfigFile, Note)<>sddqCompatible)
then begin
debugln('Warning: (lazarus) fppkg not properly configured.');