mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-22 12:24:58 +02:00
IDE: initial setup dialog: reset resourcestrings on error
git-svn-id: trunk@47013 -
This commit is contained in:
parent
a5164be292
commit
bcadd50b76
@ -189,6 +189,8 @@ function CheckDebuggerQuality(AFilename: string; out Note: string): TSDFilenameQ
|
|||||||
// Search debugger candidates and add them to list, including quality level
|
// Search debugger candidates and add them to list, including quality level
|
||||||
function SearchDebuggerCandidates(StopIfFits: boolean): TSDFileInfoList;
|
function SearchDebuggerCandidates(StopIfFits: boolean): TSDFileInfoList;
|
||||||
|
|
||||||
|
function SafeFormat(const Fmt: String; const Args: Array of const): String;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
const
|
const
|
||||||
@ -319,6 +321,21 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function SafeFormat(const Fmt: String; const Args: array of const): String;
|
||||||
|
begin
|
||||||
|
// try with translated resourcestring
|
||||||
|
try
|
||||||
|
Result:=Format(Fmt,Args);
|
||||||
|
exit;
|
||||||
|
except
|
||||||
|
end;
|
||||||
|
// translation didn't work
|
||||||
|
// there is no official way to get the default English value
|
||||||
|
//-> reset all resourcestrings
|
||||||
|
ResetResourceTables;
|
||||||
|
Result:=Format(Fmt,Args);
|
||||||
|
end;
|
||||||
|
|
||||||
function ShowInitialSetupDialog: TModalResult;
|
function ShowInitialSetupDialog: TModalResult;
|
||||||
var
|
var
|
||||||
InitialSetupDialog: TInitialSetupDialog;
|
InitialSetupDialog: TInitialSetupDialog;
|
||||||
@ -505,7 +522,7 @@ begin
|
|||||||
Dlg:=TOpenDialog.Create(nil);
|
Dlg:=TOpenDialog.Create(nil);
|
||||||
try
|
try
|
||||||
Filename:='gdb'+GetExecutableExt;
|
Filename:='gdb'+GetExecutableExt;
|
||||||
Dlg.Title:=Format(lisSelectPathTo, [Filename]);
|
Dlg.Title:=SafeFormat(lisSelectPathTo, [Filename]);
|
||||||
Dlg.Options:=Dlg.Options+[ofFileMustExist];
|
Dlg.Options:=Dlg.Options+[ofFileMustExist];
|
||||||
Filter:=dlgAllFiles+'|'+GetAllFilesMask;
|
Filter:=dlgAllFiles+'|'+GetAllFilesMask;
|
||||||
if ExtractFileExt(Filename)<>'' then
|
if ExtractFileExt(Filename)<>'' then
|
||||||
@ -534,7 +551,7 @@ begin
|
|||||||
Dlg:=TOpenDialog.Create(nil);
|
Dlg:=TOpenDialog.Create(nil);
|
||||||
try
|
try
|
||||||
Filename:='fpc'+GetExecutableExt;
|
Filename:='fpc'+GetExecutableExt;
|
||||||
Dlg.Title:=Format(lisSelectPathTo, [Filename]);
|
Dlg.Title:=SafeFormat(lisSelectPathTo, [Filename]);
|
||||||
Dlg.Options:=Dlg.Options+[ofFileMustExist];
|
Dlg.Options:=Dlg.Options+[ofFileMustExist];
|
||||||
Filter:=dlgAllFiles+'|'+GetAllFilesMask;
|
Filter:=dlgAllFiles+'|'+GetAllFilesMask;
|
||||||
if ExtractFileExt(Filename)<>'' then
|
if ExtractFileExt(Filename)<>'' then
|
||||||
@ -602,7 +619,7 @@ begin
|
|||||||
Dlg:=TOpenDialog.Create(nil);
|
Dlg:=TOpenDialog.Create(nil);
|
||||||
try
|
try
|
||||||
Filename:='make'+GetExecutableExt;
|
Filename:='make'+GetExecutableExt;
|
||||||
Dlg.Title:=Format(lisSelectPathTo, [Filename]);
|
Dlg.Title:=SafeFormat(lisSelectPathTo, [Filename]);
|
||||||
Dlg.Options:=Dlg.Options+[ofFileMustExist];
|
Dlg.Options:=Dlg.Options+[ofFileMustExist];
|
||||||
Filter:=dlgAllFiles+'|'+GetAllFilesMask;
|
Filter:=dlgAllFiles+'|'+GetAllFilesMask;
|
||||||
if ExtractFileExt(Filename)<>'' then
|
if ExtractFileExt(Filename)<>'' then
|
||||||
@ -733,7 +750,7 @@ procedure TInitialSetupDialog.UpdateCaptions;
|
|||||||
var
|
var
|
||||||
s: String;
|
s: String;
|
||||||
begin
|
begin
|
||||||
Caption:=Format(lisWelcomeToLazarusIDE, [GetLazarusVersionString]);
|
Caption:=SafeFormat(lisWelcomeToLazarusIDE, [GetLazarusVersionString]);
|
||||||
|
|
||||||
StartIDEBitBtn.Caption:=lisStartIDE;
|
StartIDEBitBtn.Caption:=lisStartIDE;
|
||||||
|
|
||||||
@ -750,26 +767,26 @@ begin
|
|||||||
TVNodeDebugger.Text:=DebuggerTabSheet.Caption;
|
TVNodeDebugger.Text:=DebuggerTabSheet.Caption;
|
||||||
|
|
||||||
LazDirBrowseButton.Caption:=lisPathEditBrowse;
|
LazDirBrowseButton.Caption:=lisPathEditBrowse;
|
||||||
LazDirLabel.Caption:=Format(
|
LazDirLabel.Caption:=SafeFormat(
|
||||||
lisTheLazarusDirectoryContainsTheSourcesOfTheIDEAndTh, [PathDelim]);
|
lisTheLazarusDirectoryContainsTheSourcesOfTheIDEAndTh, [PathDelim]);
|
||||||
|
|
||||||
CompilerBrowseButton.Caption:=lisPathEditBrowse;
|
CompilerBrowseButton.Caption:=lisPathEditBrowse;
|
||||||
CompilerLabel.Caption:=Format(lisTheFreePascalCompilerExecutableTypicallyHasTheName,
|
CompilerLabel.Caption:=SafeFormat(lisTheFreePascalCompilerExecutableTypicallyHasTheName,
|
||||||
[DefineTemplates.GetDefaultCompilerFilename,
|
[DefineTemplates.GetDefaultCompilerFilename,
|
||||||
DefineTemplates.GetDefaultCompilerFilename(GetCompiledTargetCPU)]);
|
DefineTemplates.GetDefaultCompilerFilename(GetCompiledTargetCPU)]);
|
||||||
|
|
||||||
FPCSrcDirBrowseButton.Caption:=lisPathEditBrowse;
|
FPCSrcDirBrowseButton.Caption:=lisPathEditBrowse;
|
||||||
FPCSrcDirLabel.Caption:=Format(lisTheSourcesOfTheFreePascalPackagesAreRequiredForBro,
|
FPCSrcDirLabel.Caption:=SafeFormat(lisTheSourcesOfTheFreePascalPackagesAreRequiredForBro,
|
||||||
[SetDirSeparators('rtl/linux/system.pp')]);
|
[SetDirSeparators('rtl/linux/system.pp')]);
|
||||||
ScanLabel.Caption := lisScanning;
|
ScanLabel.Caption := lisScanning;
|
||||||
StopScanButton.Caption:=lisStop;
|
StopScanButton.Caption:=lisStop;
|
||||||
|
|
||||||
MakeExeBrowseButton.Caption:=lisPathEditBrowse;
|
MakeExeBrowseButton.Caption:=lisPathEditBrowse;
|
||||||
MakeExeLabel.Caption:=Format(
|
MakeExeLabel.Caption:=SafeFormat(
|
||||||
lisTheMakeExecutableTypicallyHasTheName, ['make'+GetExecutableExt('')]);
|
lisTheMakeExecutableTypicallyHasTheName, ['make'+GetExecutableExt('')]);
|
||||||
|
|
||||||
DebuggerBrowseButton.Caption:=lisPathEditBrowse;
|
DebuggerBrowseButton.Caption:=lisPathEditBrowse;
|
||||||
s:=Format(lisTheDebuggerExecutableTypicallyHasTheNamePleaseGive, [
|
s:=SafeFormat(lisTheDebuggerExecutableTypicallyHasTheNamePleaseGive, [
|
||||||
'gdb'+GetExecutableExt]);
|
'gdb'+GetExecutableExt]);
|
||||||
{$IFDEF Windows}
|
{$IFDEF Windows}
|
||||||
s+=' '+lisAUsefulSettingOnWindowsSystemsIsLazarusDirMingwBin;
|
s+=' '+lisAUsefulSettingOnWindowsSystemsIsLazarusDirMingwBin;
|
||||||
|
Loading…
Reference in New Issue
Block a user