~ubuntu-branches/ubuntu/saucy/lazarus/saucy

« back to all changes in this revision

Viewing changes to ide/frames/files_options.pas

  • Committer: Package Import Robot
  • Author(s): Paul Gevers, Abou Al Montacir, Bart Martens, Paul Gevers
  • Date: 2013-06-08 14:12:17 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20130608141217-7k0cy9id8ifcnutc
Tags: 1.0.8+dfsg-1
[ Abou Al Montacir ]
* New upstream major release and multiple maintenace release offering many
  fixes and new features marking a new milestone for the Lazarus development
  and its stability level.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_fixes_branch
* LCL changes:
  - LCL is now a normal package.
      + Platform independent parts of the LCL are now in the package LCLBase
      + LCL is automatically recompiled when switching the target platform,
        unless pre-compiled binaries for this target are already installed.
      + No impact on existing projects.
      + Linker options needed by LCL are no more added to projects that do
        not use the LCL package.
  - Minor changes in LCL basic classes behaviour
      + TCustomForm.Create raises an exception if a form resource is not
        found.
      + TNotebook and TPage: a new implementation of these classes was added.
      + TDBNavigator: It is now possible to have focusable buttons by setting
        Options = [navFocusableButtons] and TabStop = True, useful for
        accessibility and for devices with neither mouse nor touch screen.
      + Names of TControlBorderSpacing.GetSideSpace and GetSpace were swapped
        and are now consistent. GetSideSpace = Around + GetSpace.
      + TForm.WindowState=wsFullscreen was added
      + TCanvas.TextFitInfo was added to calculate how many characters will
        fit into a specified Width. Useful for word-wrapping calculations.
      + TControl.GetColorResolvingParent and
        TControl.GetRGBColorResolvingParent were added, simplifying the work
        to obtain the final color of the control while resolving clDefault
        and the ParentColor.
      + LCLIntf.GetTextExtentExPoint now has a good default implementation
        which works in any platform not providing a specific implementation.
        However, Widgetset specific implementation is better, when available.
      + TTabControl was reorganized. Now it has the correct class hierarchy
        and inherits from TCustomTabControl as it should.
  - New unit in the LCL:
      + lazdialogs.pas: adds non-native versions of various native dialogs,
        for example TLazOpenDialog, TLazSaveDialog, TLazSelectDirectoryDialog.
        It is used by widgetsets which either do not have a native dialog, or
        do not wish to use it because it is limited. These dialogs can also be
        used by user applications directly.
      + lazdeviceapis.pas: offers an interface to more hardware devices such
        as the accelerometer, GPS, etc. See LazDeviceAPIs
      + lazcanvas.pas: provides a TFPImageCanvas descendent implementing
        drawing in a LCL-compatible way, but 100% in Pascal.
      + lazregions.pas. LazRegions is a wholly Pascal implementation of
        regions for canvas clipping, event clipping, finding in which control
        of a region tree one an event should reach, for drawing polygons, etc.
      + customdrawncontrols.pas, customdrawndrawers.pas,
        customdrawn_common.pas, customdrawn_android.pas and
        customdrawn_winxp.pas: are the Lazarus Custom Drawn Controls -controls
        which imitate the standard LCL ones, but with the difference that they
        are non-native and support skinning.
  - New APIs added to the LCL to improve support of accessibility software
    such as screen readers.
* IDE changes:
  - Many improvments.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/New_IDE_features_since#v1.0_.282012-08-29.29
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes#IDE_Changes
* Debugger / Editor changes:
  - Added pascal sources and breakpoints to the disassembler
  - Added threads dialog.
* Components changes:
  - TAChart: many fixes and new features
  - CodeTool: support Delphi style generics and new syntax extensions.
  - AggPas: removed to honor free licencing. (Closes: Bug#708695)
[Bart Martens]
* New debian/watch file fixing issues with upstream RC release.
[Abou Al Montacir]
* Avoid changing files in .pc hidden directory, these are used by quilt for
  internal purpose and could lead to surprises during build.
[Paul Gevers]
* Updated get-orig-source target and it compinion script orig-tar.sh so that they
  repack the source file, allowing bug 708695 to be fixed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.        *
18
18
 *                                                                         *
19
19
 ***************************************************************************
 
20
 
 
21
  Abtract:
 
22
    Frame for environment options for main paths, like
 
23
    Lazarus directory, compiler path.
20
24
}
21
25
unit files_options;
22
26
 
25
29
interface
26
30
 
27
31
uses
28
 
  Classes, SysUtils, LCLProc, FileUtil, Forms, StdCtrls, Dialogs, Controls,
29
 
  EnvironmentOpts, MacroIntf, LazarusIDEStrConsts, InputHistory, LazConf,
30
 
  IDEProcs, IDEOptionsIntf;
 
32
  Classes, SysUtils, LCLProc, FileUtil, CodeToolManager, DefineTemplates, Forms,
 
33
  StdCtrls, Dialogs, Controls, EnvironmentOpts, MacroIntf, LazarusIDEStrConsts,
 
34
  InputHistory, LazConf, IDEProcs, IDEOptionsIntf, IDEDialogs, InitialSetupDlgs;
31
35
 
32
36
type
33
37
 
36
40
  TFilesOptionsFrame = class(TAbstractIDEOptionsEditor)
37
41
    AutoCloseCompileDialogCheckBox: TCheckBox;
38
42
    CompilerMessagesButton:TButton;
 
43
    CompilerMessagesComboBox:TComboBox;
 
44
    CompilerMessagesLabel:TLabel;
39
45
    CompilerPathButton:TButton;
40
46
    CompilerPathComboBox:TComboBox;
 
47
    CompilerPathLabel:TLabel;
41
48
    FPCSourceDirButton:TButton;
42
49
    FPCSourceDirComboBox:TComboBox;
43
 
    CompilerPathLabel:TLabel;
44
50
    FPCSourceDirLabel:TLabel;
45
 
    CompilerMessagesLabel:TLabel;
 
51
    LazarusDirButton:TButton;
 
52
    LazarusDirComboBox:TComboBox;
 
53
    LazarusDirLabel:TLabel;
46
54
    MakePathButton:TButton;
47
55
    MakePathComboBox:TComboBox;
48
 
    TestBuildDirButton:TButton;
49
 
    TestBuildDirComboBox:TComboBox;
50
 
    CompilerMessagesComboBox:TComboBox;
51
 
    TestBuildDirLabel:TLabel;
52
56
    MakePathLabel:TLabel;
53
 
    LazarusDirButton:TButton;
54
 
    LazarusDirComboBox:TComboBox;
55
 
    LazarusDirLabel:TLabel;
56
57
    MaxRecentOpenFilesComboBox: TComboBox;
57
58
    MaxRecentOpenFilesLabel: TLabel;
58
59
    MaxRecentProjectFilesComboBox: TComboBox;
59
60
    MaxRecentProjectFilesLabel: TLabel;
60
61
    OpenLastProjectAtStartCheckBox: TCheckBox;
61
62
    ShowCompileDialogCheckBox: TCheckBox;
 
63
    TestBuildDirButton:TButton;
 
64
    TestBuildDirComboBox:TComboBox;
 
65
    TestBuildDirLabel:TLabel;
62
66
    procedure CompilerMessagesButtonClick(Sender:TObject);
63
67
    procedure FilesButtonClick(Sender: TObject);
64
68
    procedure DirectoriesButtonClick(Sender: TObject);
65
69
    procedure ShowCompileDialogCheckBoxChange(Sender: TObject);
66
70
  private
67
71
    FOldLazarusDir: string;
 
72
    FOldRealLazarusDir: string;
68
73
    FOldCompilerFilename: string;
 
74
    FOldRealCompilerFilename: string;
69
75
    FOldFPCSourceDir: string;
 
76
    FOldRealFPCSourceDir: string;
70
77
    FOldMakeFilename: string;
 
78
    FOldRealMakeFilename: string;
71
79
    FOldTestDir: string;
72
 
    function CheckLazarusDir: boolean;
73
 
    function IsFPCSourceDir: boolean;
 
80
    FOldRealTestDir: string;
 
81
    fOldCompilerMessagesFilename: string;
 
82
    fOldRealCompilerMessagesFilename: string;
 
83
    fOldMaxRecentOpenFiles: integer;
 
84
    fOldMaxRecentProjectFiles: integer;
 
85
    fOldOpenLastProjectAtStart: boolean;
 
86
    fOldShowCompileDialog: boolean;
 
87
    fOldAutoCloseCompileDialog: boolean;
 
88
    function CheckLazarusDir(Buttons: TMsgDlgButtons): boolean;
 
89
    function CheckCompiler(Buttons: TMsgDlgButtons): boolean;
 
90
    function CheckFPCSourceDir(Buttons: TMsgDlgButtons): boolean;
74
91
    function CheckTestDir: boolean;
 
92
    function CheckMake: boolean;
75
93
  public
76
94
    function Check: Boolean; override;
77
95
    function GetTitle: String; override;
78
96
    procedure Setup(ADialog: TAbstractOptionsEditorDialog); override;
79
97
    procedure ReadSettings(AOptions: TAbstractIDEOptions); override;
80
98
    procedure WriteSettings(AOptions: TAbstractIDEOptions); override;
 
99
    procedure RestoreSettings(AOptions: TAbstractIDEOptions); override;
81
100
    class function SupportedOptionsClass: TAbstractIDEOptionsClass; override;
82
101
  end;
83
102
 
110
129
 
111
130
      if Sender=CompilerPathButton then begin
112
131
        // check compiler filename
113
 
        SetComboBoxText(CompilerPathComboBox,AFilename);
114
 
        CheckExecutable(FOldCompilerFilename,CompilerPathComboBox.Text,
115
 
          lisEnvOptDlgInvalidCompilerFilename,
116
 
          lisEnvOptDlgInvalidCompilerFilenameMsg);
 
132
        SetComboBoxText(CompilerPathComboBox,AFilename,cstFilename);
 
133
        CheckCompiler([mbOk]);
117
134
      end else if Sender=MakePathButton then begin
118
135
        // check make filename
119
 
        SetComboBoxText(MakePathComboBox,AFilename);
120
 
        CheckExecutable(FOldMakeFilename,MakePathComboBox.Text,
121
 
          lisEnvOptDlgInvalidMakeFilename,
122
 
          lisEnvOptDlgInvalidMakeFilenameMsg);
 
136
        SetComboBoxText(MakePathComboBox,AFilename,cstFilename);
 
137
        CheckMake;
123
138
      end;
124
139
    end;
125
140
    InputHistories.StoreFileDialogSettings(OpenDialog);
138
153
    InputHistories.ApplyFileDialogSettings(OpenDialog);
139
154
    OpenDialog.Options:=OpenDialog.Options+[ofPathMustExist];
140
155
    OpenDialog.Title:=lisChooseCompilerMessages;
141
 
    OpenDialog.Filter:='FPC message file (*.msg)|*.msg|Any file|'+AllFilesMask;
 
156
    OpenDialog.Filter:=lisFPCMessageFile+' (*.msg)|*.msg|'+dlgAllFiles+'|'+
 
157
      GetAllFilesMask;
142
158
    if OpenDialog.Execute then begin
143
159
      AFilename:=CleanAndExpandFilename(OpenDialog.Filename);
144
 
      SetComboBoxText(CompilerMessagesComboBox,AFilename);
 
160
      SetComboBoxText(CompilerMessagesComboBox,AFilename,cstFilename);
145
161
    end;
146
162
    InputHistories.StoreFileDialogSettings(OpenDialog);
147
163
  finally
173
189
 
174
190
      if Sender=LazarusDirButton then begin
175
191
        // check lazarus directory
176
 
        SetComboBoxText(LazarusDirComboBox,ADirectoryName);
177
 
        CheckLazarusDir;
 
192
        SetComboBoxText(LazarusDirComboBox,ADirectoryName,cstFilename);
 
193
        CheckLazarusDir([mbOk]);
178
194
      end else if Sender=FPCSourceDirButton then begin
179
195
        // check fpc source directory
180
 
        SetComboBoxText(FPCSourceDirComboBox,ADirectoryName);
181
 
        IsFPCSourceDir;
 
196
        SetComboBoxText(FPCSourceDirComboBox,ADirectoryName,cstFilename);
 
197
        CheckFPCSourceDir([mbOK]);
182
198
      end else if Sender=TestBuildDirButton then begin
183
199
        // check test directory
184
 
        SetComboBoxText(TestBuildDirComboBox,ADirectoryName);
 
200
        SetComboBoxText(TestBuildDirComboBox,ADirectoryName,cstFilename);
185
201
        CheckTestDir;
186
202
      end;
187
203
 
247
263
function TFilesOptionsFrame.Check: Boolean;
248
264
begin
249
265
  Result := False;
 
266
  with EnvironmentOptions do
 
267
  begin
 
268
    LazarusDirectory:=LazarusDirComboBox.Text;
 
269
    CompilerFilename:=CompilerPathComboBox.Text;
 
270
    FPCSourceDirectory:=FPCSourceDirComboBox.Text;
 
271
    MakeFilename:=MakePathComboBox.Text;
 
272
    TestBuildDirectory:=TestBuildDirComboBox.Text;
 
273
    CompilerMessagesFilename:=CompilerMessagesComboBox.Text;
 
274
  end;
250
275
  // check lazarus directory
251
 
  if not CheckLazarusDir then
252
 
    Exit;
 
276
  if not CheckLazarusDir([mbIgnore,mbCancel]) then exit;
253
277
  // check compiler filename
254
 
  if not CheckExecutable(FOldCompilerFilename,CompilerPathComboBox.Text,
255
 
    lisEnvOptDlgInvalidCompilerFilename,lisEnvOptDlgInvalidCompilerFilenameMsg) then 
256
 
    Exit;
 
278
  if not CheckCompiler([mbIgnore,mbCancel]) then exit;
257
279
  // check fpc source directory
258
 
  if not IsFPCSourceDir then 
259
 
    Exit;
 
280
  if not CheckFPCSourceDir([mbIgnore,mbCancel]) then exit;
260
281
  // check make filename
261
 
  if not CheckExecutable(FOldMakeFilename,MakePathComboBox.Text,
262
 
    lisEnvOptDlgInvalidMakeFilename,lisEnvOptDlgInvalidMakeFilenameMsg,true)
263
 
  then
264
 
    Exit;
 
282
  if not CheckMake then exit;
265
283
  // check test directory
266
 
  if not CheckTestDir then 
267
 
    Exit;
 
284
  if not CheckTestDir then exit;
268
285
  Result := True;
269
286
end;
270
287
 
272
289
begin
273
290
  with AOptions as TEnvironmentOptions do
274
291
  begin
 
292
    // Lazarus dir
 
293
    FOldLazarusDir:=LazarusDirectory;
 
294
    FOldRealLazarusDir:=GetParsedLazarusDirectory;
275
295
    LazarusDirComboBox.Items.Assign(LazarusDirHistory);
276
 
    FOldLazarusDir:=LazarusDirectory;
277
 
    SetComboBoxText(LazarusDirComboBox,LazarusDirectory,MaxComboBoxCount);
 
296
    SetComboBoxText(LazarusDirComboBox,LazarusDirectory,cstFilename,MaxComboBoxCount);
278
297
    with CompilerPathComboBox do
279
298
    begin
280
299
      Items.BeginUpdate;
284
303
      Items.EndUpdate;
285
304
    end;
286
305
 
 
306
    // compiler filename
287
307
    FOldCompilerFilename:=CompilerFilename;
288
 
    SetComboBoxText(CompilerPathComboBox,CompilerFilename,MaxComboBoxCount);
 
308
    FOldRealCompilerFilename:=GetParsedCompilerFilename;
 
309
    SetComboBoxText(CompilerPathComboBox,CompilerFilename,cstFilename,MaxComboBoxCount);
 
310
 
 
311
    // FPC src dir
 
312
    FOldFPCSourceDir:=FPCSourceDirectory;
 
313
    FOldRealFPCSourceDir:=GetParsedFPCSourceDirectory;
289
314
    FPCSourceDirComboBox.Items.Assign(FPCSourceDirHistory);
290
 
    FOldFPCSourceDir:=FPCSourceDirectory;
291
 
    SetComboBoxText(FPCSourceDirComboBox,FPCSourceDirectory,MaxComboBoxCount);
 
315
    SetComboBoxText(FPCSourceDirComboBox,FPCSourceDirectory,cstFilename,MaxComboBoxCount);
 
316
 
 
317
    // "make"
 
318
    FOldMakeFilename:=MakeFilename;
 
319
    FOldRealMakeFilename:=GetParsedMakeFilename;
292
320
    MakePathComboBox.Items.Assign(MakeFileHistory);
293
 
    FOldMakeFilename:=MakeFilename;
294
 
    SetComboBoxText(MakePathComboBox,MakeFilename,MaxComboBoxCount);
 
321
    SetComboBoxText(MakePathComboBox,MakeFilename,cstFilename,MaxComboBoxCount);
 
322
 
 
323
    // test build dir
 
324
    FOldTestDir:=TestBuildDirectory;
 
325
    FOldRealTestDir:=GetParsedTestBuildDirectory;
295
326
    TestBuildDirComboBox.Items.Assign(TestBuildDirHistory);
296
 
    FOldTestDir:=TestBuildDirectory;
297
 
    SetComboBoxText(TestBuildDirComboBox,TestBuildDirectory,MaxComboBoxCount);
 
327
    SetComboBoxText(TestBuildDirComboBox,TestBuildDirectory,cstFilename,MaxComboBoxCount);
 
328
 
 
329
    // compiler messages file
 
330
    fOldCompilerMessagesFilename:=CompilerMessagesFilename;
 
331
    fOldRealCompilerMessagesFilename:=GetParsedCompilerMessagesFilename;
298
332
    CompilerMessagesComboBox.Items.Assign(CompilerMessagesFileHistory);
299
 
    SetComboBoxText(CompilerMessagesComboBox,CompilerMessagesFilename,MaxComboBoxCount);
 
333
    SetComboBoxText(CompilerMessagesComboBox,CompilerMessagesFilename,cstFilename,MaxComboBoxCount);
300
334
 
301
335
    // recent files and directories
302
 
    SetComboBoxText(MaxRecentOpenFilesComboBox,IntToStr(MaxRecentOpenFiles));
303
 
    SetComboBoxText(MaxRecentProjectFilesComboBox,IntToStr(MaxRecentProjectFiles));
 
336
    fOldMaxRecentOpenFiles:=MaxRecentOpenFiles;
 
337
    SetComboBoxText(MaxRecentOpenFilesComboBox,IntToStr(MaxRecentOpenFiles),cstCaseInsensitive);
 
338
    fOldMaxRecentProjectFiles:=MaxRecentProjectFiles;
 
339
    SetComboBoxText(MaxRecentProjectFilesComboBox,IntToStr(MaxRecentProjectFiles),cstCaseInsensitive);
 
340
    fOldOpenLastProjectAtStart:=OpenLastProjectAtStart;
 
341
 
 
342
    // open last project at start
304
343
    OpenLastProjectAtStartCheckBox.Checked:=OpenLastProjectAtStart;
 
344
 
 
345
    // compile dialog
 
346
    fOldShowCompileDialog:=ShowCompileDialog;
305
347
    ShowCompileDialogCheckBox.Checked:=ShowCompileDialog;
 
348
    fOldAutoCloseCompileDialog:=AutoCloseCompileDialog;
306
349
    AutoCloseCompileDialogCheckBox.Checked:=AutoCloseCompileDialog;
307
350
    AutoCloseCompileDialogCheckBox.Enabled:=ShowCompileDialogCheckBox.Checked;
308
351
  end;
336
379
  end;
337
380
end;
338
381
 
339
 
function TFilesOptionsFrame.CheckLazarusDir: boolean;
 
382
procedure TFilesOptionsFrame.RestoreSettings(AOptions: TAbstractIDEOptions);
 
383
begin
 
384
  inherited RestoreSettings(AOptions);
 
385
  with AOptions as TEnvironmentOptions do
 
386
  begin
 
387
    LazarusDirectory:=FOldLazarusDir;
 
388
    CompilerFilename:=FOldCompilerFilename;
 
389
    FPCSourceDirectory:=FOldFPCSourceDir;
 
390
    MakeFilename:=FOldMakeFilename;
 
391
    TestBuildDirectory:=FOldTestDir;
 
392
    CompilerMessagesFilename:=fOldCompilerMessagesFilename;
 
393
 
 
394
    // recent files and directories
 
395
    MaxRecentOpenFiles:=fOldMaxRecentOpenFiles;
 
396
    MaxRecentProjectFiles:=fOldMaxRecentProjectFiles;
 
397
    OpenLastProjectAtStart:=fOldOpenLastProjectAtStart;
 
398
    ShowCompileDialog := fOldShowCompileDialog;
 
399
    AutoCloseCompileDialog := fOldAutoCloseCompileDialog;
 
400
  end;
 
401
end;
 
402
 
 
403
function TFilesOptionsFrame.CheckLazarusDir(Buttons: TMsgDlgButtons): boolean;
340
404
var
341
405
  NewLazarusDir: string;
342
 
  StopChecking: boolean;
 
406
  Quality: TSDFilenameQuality;
 
407
  Note: string;
343
408
begin
 
409
  if EnvironmentOptions.LazarusDirectory=FOldLazarusDir then exit(true);
344
410
  Result := False;
345
 
  NewLazarusDir := LazarusDirComboBox.Text;
346
 
  Result := SimpleDirectoryCheck(FOldLazarusDir,NewLazarusDir,
347
 
                              lisEnvOptDlgLazarusDirNotFoundMsg,StopChecking);
348
 
  if (not Result) or StopChecking then
349
 
    Exit;
350
 
 
351
 
  // lazarus directory specific tests
352
 
  NewLazarusDir := AppendPathDelim(NewLazarusDir);
353
 
  if not CheckLazarusDirectory(NewLazarusDir) then
 
411
  EnvironmentOptions.LazarusDirectory:=LazarusDirComboBox.Text;
 
412
  NewLazarusDir := EnvironmentOptions.GetParsedLazarusDirectory;
 
413
  Quality:=CheckLazarusDirectoryQuality(NewLazarusDir,Note);
 
414
  if Quality<>sddqCompatible then
354
415
  begin
355
 
    Result:=(MessageDlg(Format(lisEnvOptDlgInvalidLazarusDir,[NewLazarusDir]),
356
 
               mtWarning,[mbIgnore,mbCancel],0)=mrIgnore);
357
 
    exit;
 
416
    if IDEMessageDialog(lisCCOWarningCaption,
 
417
      Format(lisTheLazarusDirectoryDoesNotLookCorrect, [NewLazarusDir, #13, Note
 
418
        ]),
 
419
      mtWarning, Buttons)<>mrIgnore
 
420
    then
 
421
      exit;
358
422
  end;
359
423
  Result := true;
360
424
end;
361
425
 
362
 
function TFilesOptionsFrame.IsFPCSourceDir: boolean;
 
426
function TFilesOptionsFrame.CheckFPCSourceDir(Buttons: TMsgDlgButtons): boolean;
363
427
var
364
428
  NewFPCSrcDir: string;
365
 
  StopChecking: boolean;
 
429
  Note: string;
 
430
  Quality: TSDFilenameQuality;
 
431
  CfgCache: TFPCTargetConfigCache;
 
432
  FPCVer: String;
366
433
begin
367
 
  NewFPCSrcDir:=FPCSourceDirComboBox.Text;
368
 
  Result:=IDEMacros.SubstituteMacros(NewFPCSrcDir);
369
 
  if not Result then begin
370
 
    Result:=(MessageDlg(Format(lisEnvOptDlgInvalidFPCSrcDir,[NewFPCSrcDir]),
371
 
               mtWarning,[mbIgnore,mbCancel],0)=mrIgnore);
372
 
    exit;
 
434
  if EnvironmentOptions.FPCSourceDirectory=FOldFPCSourceDir then exit(true);
 
435
  Result:=false;
 
436
  CfgCache:=CodeToolBoss.FPCDefinesCache.ConfigCaches.Find(
 
437
    EnvironmentOptions.GetParsedCompilerFilename,'','','',true);
 
438
  FPCVer:=CfgCache.GetFPCVer;
 
439
  EnvironmentOptions.FPCSourceDirectory:=FPCSourceDirComboBox.Text;
 
440
  NewFPCSrcDir:=EnvironmentOptions.GetParsedFPCSourceDirectory;
 
441
  Quality:=CheckFPCSrcDirQuality(NewFPCSrcDir,Note,FPCVer);
 
442
  if Quality<>sddqCompatible then
 
443
  begin
 
444
    if IDEMessageDialog(lisCCOWarningCaption,
 
445
      Format(lisTheFPCSourceDirectoryDoesNotLookCorrect, [NewFPCSrcDir, #13,
 
446
        Note]),
 
447
      mtWarning, Buttons)<>mrIgnore
 
448
    then
 
449
      exit;
373
450
  end;
374
 
  Result:=SimpleDirectoryCheck(FOldFPCSourceDir,NewFPCSrcDir,
375
 
                               lisEnvOptDlgFPCSrcDirNotFoundMsg,StopChecking);
376
 
  if (not Result) or StopChecking then exit;
 
451
  Result:=true;
 
452
end;
377
453
 
378
 
  // FPC source directory specific tests
379
 
  if not CheckFPCSourceDir(NewFPCSrcDir) then begin
380
 
    Result:=(MessageDlg(Format(lisEnvOptDlgInvalidFPCSrcDir,[NewFPCSrcDir]),
381
 
               mtWarning,[mbIgnore,mbCancel],0)=mrIgnore);
382
 
    exit;
 
454
function TFilesOptionsFrame.CheckCompiler(Buttons: TMsgDlgButtons): boolean;
 
455
var
 
456
  NewCompilerFilename: String;
 
457
  Note: string;
 
458
  Quality: TSDFilenameQuality;
 
459
begin
 
460
  if EnvironmentOptions.CompilerFilename=FOldCompilerFilename then exit(true);
 
461
  Result:=false;
 
462
  EnvironmentOptions.CompilerFilename:=CompilerPathComboBox.Text;
 
463
  NewCompilerFilename:=EnvironmentOptions.GetParsedCompilerFilename;
 
464
  Quality:=CheckCompilerQuality(NewCompilerFilename,Note,
 
465
                                CodeToolBoss.FPCDefinesCache.TestFilename);
 
466
  if Quality<>sddqCompatible then
 
467
  begin
 
468
    if IDEMessageDialog(lisCCOWarningCaption,
 
469
      Format(lisTheCompilerFileDoesNotLookCorrect, [NewCompilerFilename, #13,
 
470
        Note]),
 
471
      mtWarning, Buttons)<>mrIgnore
 
472
    then
 
473
      exit;
383
474
  end;
384
475
  Result:=true;
385
476
end;
389
480
  NewTestDir: string;
390
481
  StopChecking: boolean;
391
482
begin
392
 
  NewTestDir:=TestBuildDirComboBox.Text;
393
 
  Result:=SimpleDirectoryCheck(FOldTestDir,NewTestDir,
 
483
  if EnvironmentOptions.TestBuildDirectory=FOldTestDir then exit(true);
 
484
  EnvironmentOptions.TestBuildDirectory:=TestBuildDirComboBox.Text;
 
485
  NewTestDir:=EnvironmentOptions.GetParsedTestBuildDirectory;
 
486
  Result:=SimpleDirectoryCheck(FOldRealTestDir,NewTestDir,
394
487
                               lisEnvOptDlgTestDirNotFoundMsg,StopChecking);
395
 
  if (not Result) or StopChecking then exit;
 
488
end;
 
489
 
 
490
function TFilesOptionsFrame.CheckMake: boolean;
 
491
var
 
492
  NewMakeFilename: String;
 
493
begin
 
494
  if EnvironmentOptions.MakeFilename=FOldMakeFilename then exit(true);
 
495
  EnvironmentOptions.MakeFilename:=MakePathComboBox.Text;
 
496
  NewMakeFilename:=EnvironmentOptions.GetParsedMakeFilename;
 
497
  Result:=CheckExecutable(FOldRealMakeFilename,NewMakeFilename,
 
498
    lisCCOWarningCaption, Format(lisThePathOfMakeIsNotCorrect, [NewMakeFilename]));
396
499
end;
397
500
 
398
501
class function TFilesOptionsFrame.SupportedOptionsClass: TAbstractIDEOptionsClass;