mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2026-01-05 00:13:39 +01:00
IDE: Remove the File > 'Close All' feature. It was neither intuitive nor very useful.
This commit is contained in:
parent
4a4e67f531
commit
e969070031
@ -170,7 +170,6 @@ const
|
||||
ecSaveAs = ecFirstLazarus + 208;
|
||||
ecSaveAll = ecFirstLazarus + 209;
|
||||
ecClose = ecFirstLazarus + 210;
|
||||
ecCloseAll = ecFirstLazarus + 211;
|
||||
ecCleanDirectory = ecFirstLazarus + 212;
|
||||
ecRestart = ecFirstLazarus + 213;
|
||||
ecQuit = ecFirstLazarus + 214;
|
||||
@ -1985,7 +1984,7 @@ begin
|
||||
end;
|
||||
|
||||
const
|
||||
IDEEditorCommandStrs: array[0..337] of TIdentMapEntry = ( // DRB reduced elements from 323
|
||||
IDEEditorCommandStrs: array[0..336] of TIdentMapEntry = ( // DRB reduced elements from 323
|
||||
// search
|
||||
(Value: ecFind; Name: 'ecFind'),
|
||||
(Value: ecFindAgain; Name: 'ecFindAgain'),
|
||||
@ -2099,7 +2098,6 @@ const
|
||||
(Value: ecSaveAs; Name: 'ecSaveAs'),
|
||||
(Value: ecSaveAll; Name: 'ecSaveAll'),
|
||||
(Value: ecClose; Name: 'ecClose'),
|
||||
(Value: ecCloseAll; Name: 'ecCloseAll'),
|
||||
(Value: ecCleanDirectory; Name: 'ecCleanDirectory'),
|
||||
(Value: ecRestart; Name: 'ecRestart'),
|
||||
(Value: ecQuit; Name: 'ecQuit'),
|
||||
|
||||
@ -620,7 +620,7 @@ begin
|
||||
FTabLabelMenu.Images := IDEImages.Images_16;
|
||||
FTabLabelMenu.OnPopup := @TabLabelMenuPopup;
|
||||
FTabLabelMenuCloseAllGroup := TMenuItem.Create(Self);
|
||||
FTabLabelMenuCloseAllGroup.Caption := IDECommandList.FindIDECommand(ecCloseAll).LocalizedName;
|
||||
FTabLabelMenuCloseAllGroup.Caption := sCloseAll;
|
||||
FTabLabelMenuCloseAllGroup.OnClick := @TabLabelCloseAllGroupClick;
|
||||
FTabLabelMenuCloseAllGroup.ImageIndex := IDEImages.LoadImage('menu_close_all');
|
||||
FTabLabelMenu.Items.Add(FTabLabelMenuCloseAllGroup);
|
||||
|
||||
@ -9,6 +9,7 @@ resourcestring
|
||||
sMoveTo = 'Move To';
|
||||
sNewWindow = 'New Window';
|
||||
sCloneTo = 'Clone To';
|
||||
sCloseAll = 'Close All';
|
||||
sFindInOtherWindow = 'Find In Other Window';
|
||||
sOther = 'Other';
|
||||
sAddToProject = 'Add To Project';
|
||||
|
||||
@ -648,7 +648,6 @@ begin
|
||||
ecSaveAs : Result:= lisMenuSaveAs;
|
||||
ecSaveAll : Result:= lisSaveAll;
|
||||
ecClose : Result:= lisClose;
|
||||
ecCloseAll : Result:= lisMenuCloseAll;
|
||||
ecCloseOtherTabs : Result:= uemCloseOtherPages;
|
||||
ecCloseRightTabs : Result:= uemCloseOtherPagesRight;
|
||||
ecCleanDirectory : Result:= lisMenuCleanDirectory;
|
||||
@ -1451,7 +1450,6 @@ begin
|
||||
ecSaveAs: SetSingle(VK_UNKNOWN,[]);
|
||||
ecSaveAll: SetSingle(VK_S,[XCtrl,ssShift]);
|
||||
ecClose: SetSingle(VK_F4,[XCtrl]);
|
||||
ecCloseAll: SetSingle(VK_UNKNOWN,[]);
|
||||
ecCloseOtherTabs: SetSingle(VK_UNKNOWN,[]);
|
||||
ecCloseRightTabs: SetSingle(VK_UNKNOWN,[]);
|
||||
ecCleanDirectory: SetSingle(VK_UNKNOWN,[]);
|
||||
@ -1913,7 +1911,6 @@ begin
|
||||
ecSaveAs: SetSingle(VK_UNKNOWN,[]);
|
||||
ecSaveAll: SetSingle(VK_F2,[ssShift]);
|
||||
ecClose: SetSingle(VK_F3,[ssAlt]);
|
||||
ecCloseAll: SetSingle(VK_UNKNOWN,[]);
|
||||
ecCloseOtherTabs: SetSingle(VK_UNKNOWN,[]);
|
||||
ecCloseRightTabs: SetSingle(VK_UNKNOWN,[]);
|
||||
ecCleanDirectory: SetSingle(VK_UNKNOWN,[]);
|
||||
@ -2565,7 +2562,6 @@ begin
|
||||
ecSaveAs: SetSingle(VK_S,[ssMeta,ssShift]);
|
||||
ecSaveAll: SetSingle(VK_S,[ssMeta,ssAlt]);
|
||||
ecClose: SetSingle(VK_W,[ssMeta],VK_W,[ssMeta,ssShift]);
|
||||
ecCloseAll: SetSingle(VK_UNKNOWN,[]);
|
||||
ecCloseOtherTabs: SetSingle(VK_UNKNOWN,[]);
|
||||
ecCloseRightTabs: SetSingle(VK_UNKNOWN,[]);
|
||||
ecCleanDirectory: SetSingle(VK_UNKNOWN,[]);
|
||||
@ -3310,7 +3306,6 @@ begin
|
||||
AddDefault(C, 'SaveAs', lisKMSaveAs, ecSaveAs);
|
||||
AddDefault(C, 'SaveAll', lisKMSaveAll, ecSaveAll);
|
||||
AddDefault(C, 'Close', lisClose, ecClose);
|
||||
AddDefault(C, 'CloseAll', lisCloseAll, ecCloseAll);
|
||||
AddDefault(C, 'CloseAllOther', uemCloseOtherPagesPlain, ecCloseOtherTabs);
|
||||
AddDefault(C, 'CloseAllRight', uemCloseOtherPagesRightPlain, ecCloseRightTabs);
|
||||
AddDefault(C, 'Clean Directory', lisClDirCleanDirectory, ecCleanDirectory);
|
||||
|
||||
@ -60,7 +60,6 @@ resourcestring
|
||||
lisOpen = 'Open';
|
||||
lisSave = 'Save';
|
||||
lisSaveAll = 'Save All';
|
||||
lisCloseAll = 'Close All';
|
||||
lisFile = 'File';
|
||||
lisNew = 'New';
|
||||
lisClose = 'Close';
|
||||
@ -290,7 +289,6 @@ resourcestring
|
||||
lrsPLDLpkFileValid = 'lpk file valid (%s)';
|
||||
lrsPLDLpkFileInvalid = 'lpk file invalid (%s)';
|
||||
lisCTDefDefineTemplates = 'Define templates';
|
||||
lisMenuCloseAll = 'Close A&ll';
|
||||
lisMenuCloseEditorFile = '&Close Editor File';
|
||||
lisMenuCleanDirectory = 'Clean Directory ...';
|
||||
|
||||
|
||||
11
ide/main.pp
11
ide/main.pp
@ -218,7 +218,6 @@ type
|
||||
procedure mnuSaveAllClicked(Sender: TObject);
|
||||
procedure mnuExportHtml(Sender: TObject);
|
||||
procedure mnuCloseClicked(Sender: TObject);
|
||||
procedure mnuCloseAllClicked(Sender: TObject);
|
||||
procedure mnuCleanDirectoryClicked(Sender: TObject);
|
||||
procedure mnuRestartClicked(Sender: TObject);
|
||||
procedure mnuQuitClicked(Sender: TObject);
|
||||
@ -2693,8 +2692,6 @@ begin
|
||||
itmFileExportHtml.OnClick := @mnuExportHtml;
|
||||
itmFileClose.Enabled := False;
|
||||
itmFileClose.OnClick := @mnuCloseClicked;
|
||||
itmFileCloseAll.Enabled := False;
|
||||
itmFileCloseAll.OnClick := @mnuCloseAllClicked;
|
||||
itmFileCleanDirectory.OnClick := @mnuCleanDirectoryClicked;
|
||||
itmFileRestart.OnClick := @mnuRestartClicked;
|
||||
itmFileQuit.OnClick := @mnuQuitClicked;
|
||||
@ -2934,7 +2931,6 @@ begin
|
||||
itmFileSaveAs.Command:=GetIdeCmdRegToolBtn(ecSaveAs);
|
||||
itmFileSaveAll.Command:=GetIdeCmdRegToolBtn(ecSaveAll);
|
||||
itmFileClose.Command:=GetIdeCmdRegToolBtn(ecClose);
|
||||
itmFileCloseAll.Command:=GetIdeCmdRegToolBtn(ecCloseAll);
|
||||
itmFileCleanDirectory.Command:=GetIdeCmdRegToolBtn(ecCleanDirectory);
|
||||
itmFileQuit.Command:=GetIdeCmdRegToolBtn(ecQuit);
|
||||
|
||||
@ -3431,11 +3427,6 @@ begin
|
||||
DoCloseEditorFile(NB.FindSourceEditorWithPageIndex(PageIndex), [cfSaveFirst]);
|
||||
end;
|
||||
|
||||
procedure TMainIDE.mnuCloseAllClicked(Sender: TObject);
|
||||
begin
|
||||
CloseAll;
|
||||
end;
|
||||
|
||||
procedure TMainIDE.mnuCleanDirectoryClicked(Sender: TObject);
|
||||
begin
|
||||
if Project1=nil then exit;
|
||||
@ -3968,9 +3959,7 @@ begin
|
||||
GetCurrentUnit(ASrcEdit,AnUnitInfo);
|
||||
if not UpdateFileCommandsStamp.Changed(ASrcEdit) then
|
||||
Exit;
|
||||
|
||||
IDECommandList.FindIDECommand(ecClose).Enabled := ASrcEdit<>nil;
|
||||
IDECommandList.FindIDECommand(ecCloseAll).Enabled := ASrcEdit<>nil;
|
||||
end;
|
||||
|
||||
procedure TMainIDE.UpdateMainIDECommands(Sender: TObject);
|
||||
|
||||
@ -102,7 +102,6 @@ type
|
||||
itmFileSaveAll: TIDEMenuCommand;
|
||||
itmFileExportHtml: TIDEMenuCommand;
|
||||
itmFileClose: TIDEMenuCommand;
|
||||
itmFileCloseAll: TIDEMenuCommand;
|
||||
//itmFileDirectories: TIDEMenuSection;
|
||||
itmFileCleanDirectory: TIDEMenuCommand;
|
||||
//itmFileIDEStart: TIDEMenuSection;
|
||||
|
||||
@ -974,7 +974,6 @@ begin
|
||||
CreateMenuItem(ParentMI,itmFileSaveAll,'itmFileSaveAll',lisSaveAll,'menu_save_all');
|
||||
CreateMenuItem(ParentMI,itmFileExportHtml,'itmFileExportHtml',lisExportHtml, 'menu_exporthtml');
|
||||
CreateMenuItem(ParentMI,itmFileClose,'itmFileClose',lisMenuCloseEditorFile,'menu_close',false);
|
||||
CreateMenuItem(ParentMI,itmFileCloseAll,'itmFileCloseAll',lisMenuCloseAll,'menu_close_all',false);
|
||||
|
||||
CreateMenuSeparatorSection(mnuFile,itmFileDirectories,'itmFileDirectories');
|
||||
ParentMI:=itmFileDirectories;
|
||||
|
||||
@ -247,7 +247,6 @@ function SaveProjectIfChanged: TModalResult;
|
||||
function CloseProject: TModalResult;
|
||||
procedure OpenProject(aMenuItem: TIDEMenuItem);
|
||||
function CompleteLoadingProjectInfo: TModalResult;
|
||||
procedure CloseAll;
|
||||
procedure InvertedFileClose(PageIndex: LongInt; SrcNoteBook: TSourceNotebook; CloseOnRightSideOnly: Boolean = False);
|
||||
function UpdateAppTitleInSource: Boolean;
|
||||
function UpdateAppScaledInSource: Boolean;
|
||||
@ -611,7 +610,6 @@ begin
|
||||
AnUnitInfo.Source, False, AShareEditor);
|
||||
NewSrcEdit.EditorComponent.BeginUpdate;
|
||||
MainIDEBar.itmFileClose.Enabled:=True;
|
||||
MainIDEBar.itmFileCloseAll.Enabled:=True;
|
||||
NewCaretXY := AnEditorInfo.CursorPos;
|
||||
NewTopLine := AnEditorInfo.TopLine;
|
||||
FoldState := AnEditorInfo.FoldState;
|
||||
@ -2263,7 +2261,6 @@ begin
|
||||
CreateSrcEditPageName(NewUnitInfo.Unit_Name, NewUnitInfo.Filename, AShareEditor),
|
||||
NewUnitInfo.Source, True, AShareEditor);
|
||||
MainIDEBar.itmFileClose.Enabled:=True;
|
||||
MainIDEBar.itmFileCloseAll.Enabled:=True;
|
||||
NewSrcEdit.SyntaxHighlighterId:=NewUnitInfo.EditorInfo[0].SyntaxHighlighter;
|
||||
NewUnitInfo.GetClosedOrNewEditorInfo.EditorComponent := NewSrcEdit;
|
||||
NewSrcEdit.EditorComponent.CaretXY := Point(1,1);
|
||||
@ -2790,7 +2787,6 @@ begin
|
||||
// close source editor
|
||||
SourceEditorManager.CloseFile(AnEditorInfo.EditorComponent);
|
||||
MainIDEBar.itmFileClose.Enabled:=SourceEditorManager.SourceEditorCount > 0;
|
||||
MainIDEBar.itmFileCloseAll.Enabled:=MainIDEBar.itmFileClose.Enabled;
|
||||
|
||||
// free sources, forget changes
|
||||
if AnUnitInfo.Source<>nil then
|
||||
@ -4377,40 +4373,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure CloseAll;
|
||||
// Close editor files
|
||||
var
|
||||
Ed: TSourceEditor;
|
||||
EditorList: TList;
|
||||
i: Integer;
|
||||
begin
|
||||
EditorList := TList.Create;
|
||||
try
|
||||
// Collect changed editors into a list and save them after asking from user.
|
||||
for i := 0 to SourceEditorManager.UniqueSourceEditorCount - 1 do
|
||||
begin
|
||||
Ed := TSourceEditor(SourceEditorManager.UniqueSourceEditors[i]);
|
||||
if CheckEditorNeedsSave(Ed, False) then
|
||||
EditorList.Add(Ed);
|
||||
end;
|
||||
if AskToSaveEditors(EditorList) <> mrOK then Exit;
|
||||
finally
|
||||
EditorList.Free;
|
||||
end;
|
||||
// Now close them all.
|
||||
SourceEditorManager.IncUpdateLock;
|
||||
try
|
||||
while (SourceEditorManager.SourceEditorCount > 0) and
|
||||
(CloseEditorFile(SourceEditorManager.SourceEditors[0], []) = mrOk)
|
||||
do ;
|
||||
finally
|
||||
SourceEditorManager.DecUpdateLock;
|
||||
end;
|
||||
|
||||
// Close packages
|
||||
PkgBoss.DoCloseAllPackageEditors;
|
||||
end;
|
||||
|
||||
procedure InvertedFileClose(PageIndex: LongInt; SrcNoteBook: TSourceNotebook;
|
||||
CloseOnRightSideOnly: Boolean);
|
||||
// close all source editors except the clicked
|
||||
|
||||
Loading…
Reference in New Issue
Block a user