IDE: Show correct data in IDE caption when building Lazarus. Improve behavior with IDETitleStartsWithProject setting.

git-svn-id: trunk@28184 -
This commit is contained in:
juha 2010-11-11 22:13:44 +00:00
parent 2e97e0d74b
commit c3bcaf4bd3
3 changed files with 22 additions and 10 deletions

View File

@ -48,7 +48,7 @@ uses
Graphics, GraphType, StdCtrls, ExtCtrls, Buttons, FileUtil, Dialogs, Types,
InterfaceBase, Themes, ComCtrls, CheckLst, Menus,
DefineTemplates, Laz_XMLCfg, DividerBevel,
LazarusIDEStrConsts, TransferMacros, LazConf, IDEProcs, DialogProcs,
LazarusIDEStrConsts, TransferMacros, LazIDEIntf, LazConf, IDEProcs, DialogProcs,
IDEMsgIntf, IDEContextHelpEdit, IDEImagesIntf, MainBar,
InputHistory, ExtToolDialog, ExtToolEditDlg, EnvironmentOpts,
{$IFDEF win32}
@ -238,6 +238,9 @@ begin
exit(mrOk); // only IDE, but skip both parts -> nothing to do
Options:=Profiles.Current;
if LazarusIDE<>nil then
LazarusIDE.MainBarSubTitle:=Options.Name;
Tool:=TExternalToolOptions.Create;
try
// setup external tool
@ -352,6 +355,8 @@ begin
Result:=mrOk;
finally
Tool.Free;
if LazarusIDE<>nil then
LazarusIDE.MainBarSubTitle:='';
end;
end;

View File

@ -677,7 +677,7 @@ resourcestring
+'found: %s%s%s%sThis file can be mistaken with %s%s%s%s%sDelete the '
+'ambiguous file?';
lisLazarusEditorV = 'Lazarus IDE v%s';
lisnewProject = '%s - (new project)';
lisnewProject = '(new project)';
liscompiling = '%s (compiling ...)';
lisdebugging = '%s (debugging ...)';
lisRunning = '%s (running ...)';

View File

@ -12505,14 +12505,25 @@ end;
procedure TMainIDE.UpdateCaption;
var
NewCaption, NewTitle, ProjectName, DirName: String;
NewCaption: String;
procedure AddToCaption(const CaptAddition: string);
begin
if EnvironmentOptions.IDETitleStartsWithProject then
NewCaption := CaptAddition + ' - ' + NewCaption
else
NewCaption := NewCaption + ' - ' + CaptAddition;
end;
var
NewTitle, ProjectName, DirName: String;
begin
if MainIDEBar = nil then Exit;
if ToolStatus = itExiting then Exit;
NewCaption := Format(lisLazarusEditorV, [GetLazarusVersionString]);
NewTitle := NewCaption;
if MainBarSubTitle <> '' then
NewCaption := NewCaption + ' - ' + MainBarSubTitle
AddToCaption(MainBarSubTitle)
else
begin
if Project1 <> nil then
@ -12531,18 +12542,14 @@ begin
if DirName <> '' then
ProjectName := ProjectName + ' ('+DirName+')';
end;
if EnvironmentOptions.IDETitleStartsWithProject then
NewCaption := ProjectName + ' - ' + NewCaption
else
NewCaption := NewCaption + ' - ' + ProjectName;
AddToCaption(ProjectName);
end
else
NewCaption := Format(lisnewProject, [NewCaption]);
AddToCaption(lisnewProject);
NewTitle := NewCaption;
end;
end;
case ToolStatus of
// Should show MiscellaneousOptions.BuildLazProfiles.Current.Name when buildding Lazarus
itBuilder: NewCaption := Format(liscompiling, [NewCaption]);
itDebugger:
begin