* IDE: add option to show full project path in window caption. Patch by Jarto Tarpio

git-svn-id: trunk@24875 -
This commit is contained in:
marc 2010-04-24 14:13:58 +00:00
parent 86d2a6e2bd
commit 835ac997bd
5 changed files with 42 additions and 6 deletions

View File

@ -144,6 +144,7 @@ type
FFileHasChangedOnDisk: boolean;
FIDESpeedButtonsVisible: boolean;
FIDETitleStartsWithProject: boolean;
FIDEProjectDirectoryInIdeTitle: boolean;
FShowButtonGlyphs: TApplicationShowGlyphs;
FShowMenuGlyphs: TApplicationShowGlyphs;
FXMLCfg: TXMLConfig;
@ -342,6 +343,8 @@ type
property HideMessagesIcons: boolean read fHideMessagesIcons write fHideMessagesIcons;
property IDETitleStartsWithProject: boolean read FIDETitleStartsWithProject
write FIDETitleStartsWithProject;
property IDEProjectDirectoryInIdeTitle: boolean read FIDEProjectDirectoryInIdeTitle
write FIDEProjectDirectoryInIdeTitle;
property ComponentPaletteVisible: boolean read FComponentPaletteVisible
write FComponentPaletteVisible;
property IDESpeedButtonsVisible: boolean read FIDESpeedButtonsVisible
@ -669,6 +672,7 @@ begin
FHideIDEOnRun:=false;
FHideMessagesIcons:=false;
FIDETitleStartsWithProject:=false;
FIDEProjectDirectoryInIdeTitle:=false;
FComponentPaletteVisible:=true;
FIDESpeedButtonsVisible:=true;
@ -925,6 +929,8 @@ begin
Path+'Desktop/HideMessagesIcons/Value',false);
FIDETitleStartsWithProject:=XMLConfig.GetValue(
Path+'Desktop/IDETitleStartsWithProject/Value',false);
IDEProjectDirectoryInIdeTitle:=XMLConfig.GetValue(
Path+'Desktop/IDEProjectDirectoryInIdeTitle/Value',false);
FComponentPaletteVisible:=XMLConfig.GetValue(
Path+'Desktop/ComponentPaletteVisible/Value',true);
FIDESpeedButtonsVisible:=XMLConfig.GetValue(
@ -1213,6 +1219,8 @@ begin
false);
XMLConfig.SetDeleteValue(Path+'Desktop/IDETitleStartsWithProject/Value',
FIDETitleStartsWithProject,false);
XMLConfig.SetDeleteValue(Path+'Desktop/IDEProjectDirectoryInIdeTitle/Value',
FIDEProjectDirectoryInIdeTitle,false);
XMLConfig.SetDeleteValue(Path+'Desktop/ComponentPaletteVisible/Value',
FComponentPaletteVisible,true);
XMLConfig.SetDeleteValue(Path+'Desktop/IDESpeedButtonsVisible/Value',

View File

@ -1,7 +1,7 @@
inherited WindowOptionsFrame: TWindowOptionsFrame
Height = 451
Height = 473
Width = 566
ClientHeight = 451
ClientHeight = 473
ClientWidth = 566
TabOrder = 0
Visible = False
@ -33,7 +33,7 @@ inherited WindowOptionsFrame: TWindowOptionsFrame
end
object WindowPositionsGroupBox: TGroupBox[2]
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = TitleStartsWithProjectCheckBox
AnchorSideTop.Control = ProjectDirInIdeTitleCheckBox
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
@ -41,7 +41,7 @@ inherited WindowOptionsFrame: TWindowOptionsFrame
AnchorSideBottom.Side = asrBottom
Left = 0
Height = 357
Top = 94
Top = 116
Width = 566
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Top = 6
@ -339,4 +339,17 @@ inherited WindowOptionsFrame: TWindowOptionsFrame
ShowHint = True
TabOrder = 4
end
object ProjectDirInIdeTitleCheckBox: TCheckBox[5]
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = TitleStartsWithProjectCheckBox
AnchorSideTop.Side = asrBottom
Left = 0
Height = 22
Top = 88
Width = 200
Caption = 'ProjectDirInIdeTitleCheckBox'
ParentShowHint = False
ShowHint = True
TabOrder = 5
end
end

View File

@ -50,6 +50,7 @@ type
SingleTaskBarButtonCheckBox: TCheckBox;
RestoreWindowGeometryRadioButton: TRadioButton;
TitleStartsWithProjectCheckBox: TCheckBox;
ProjectDirInIdeTitleCheckBox: TCheckBox;
TopEdit: TSpinEdit;
TopLabel: TLabel;
UseWindowManagerSettingRadioButton: TRadioButton;
@ -102,7 +103,9 @@ begin
TitleStartsWithProjectCheckBox.Caption:=lisIDETitleStartsWithProjectName;
TitleStartsWithProjectCheckBox.Hint:=
lisTitleInTaskbarShowsForExampleProject1LpiLazarus;
ProjectDirInIdeTitleCheckBox.Caption:=lisIDEProjectDirInIdeTitle;
ProjectDirInIdeTitleCheckBox.Hint:=
lisProjectDirectoryIsShowedInIdeTitleBar;
// Window Positions
WindowPositionsGroupBox.Caption := dlgWinPos;
with WindowPositionsListBox.Items do
@ -145,6 +148,7 @@ begin
HideIDEOnRunCheckBox.Checked := HideIDEOnRun;
HideMessagesIconsCheckBox.Checked := HideMessagesIcons;
TitleStartsWithProjectCheckBox.Checked:=IDETitleStartsWithProject;
ProjectDirInIdeTitleCheckBox.Checked:=IDEProjectDirectoryInIdeTitle;
end;
end;
@ -158,6 +162,7 @@ begin
HideIDEOnRun:=HideIDEOnRunCheckBox.Checked;
HideMessagesIcons:=HideMessagesIconsCheckBox.Checked;
IDETitleStartsWithProject:=TitleStartsWithProjectCheckBox.Checked;
IDEProjectDirectoryInIdeTitle:=ProjectDirInIdeTitleCheckBox.Checked;
end;
end;

View File

@ -1023,6 +1023,7 @@ resourcestring
dlgHideIDEOnRun = 'Hide IDE windows on run';
dlgHideMessagesIcons = 'Hide Messages Icons';
lisIDETitleStartsWithProjectName = 'IDE title starts with project name';
lisIDEProjectDirInIdeTitle = 'Show project directory in IDE title';
dlgDesktopHints = 'Hints';
dlgPalHints = 'Hints for component palette';
dlgSpBHints = 'Hints for main speed buttons (open, save, ...)';
@ -1038,6 +1039,9 @@ resourcestring
dlgWinPos = 'Window Positions';
lisTitleInTaskbarShowsForExampleProject1LpiLazarus = 'Title in taskbar '
+'shows for example: project1.lpi - Lazarus';
lisProjectDirectoryIsShowedInIdeTitleBar = 'Title in taskbar '
+'shows also directory path of the project';
dlgMainMenu = 'Main Menu';
dlgSrcEdit = 'Source Editor';
dlgMsgs = 'Messages';

View File

@ -12154,7 +12154,7 @@ end;
procedure TMainIDE.UpdateCaption;
var
NewCaption, NewTitle, ProjectName: String;
NewCaption, NewTitle, ProjectName, DirName: String;
begin
if MainIDEBar = nil then Exit;
if ToolStatus = itExiting then Exit;
@ -12174,6 +12174,12 @@ begin
ProjectName := ExtractFileName(Project1.ProjectInfoFile);
if ProjectName <> '' then
begin
if EnvironmentOptions.IDEProjectDirectoryInIdeTitle then
begin
DirName := ExtractFileDir(Project1.ProjectInfoFile);
if DirName <> '' then
ProjectName := ProjectName + ' ('+DirName+')';
end;
if EnvironmentOptions.IDETitleStartsWithProject then
NewCaption := ProjectName + ' - ' + NewCaption
else