mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Bug [0000895] "Tab 'locked with directories opened in new tabs' can be switched to another directory via 'Target=Source' (Alt+Z) command" (based on patch by jkollss)
This commit is contained in:
parent
3647273b49
commit
809e682c2e
1 changed files with 21 additions and 6 deletions
|
|
@ -66,6 +66,7 @@ type
|
|||
procedure DoNewTab(Notebook: TFileViewNotebook);
|
||||
procedure DoRenameTab(Page: TFileViewPage);
|
||||
procedure DoContextMenu(Panel: TFileView; X, Y: Integer; Background: Boolean);
|
||||
procedure DoTransferPath(SourceFrame: TFileView; TargetNotebook: TFileViewNotebook); overload;
|
||||
procedure DoTransferPath(SourcePage: TFileViewPage; TargetPage: TFileViewPage; FromActivePanel: Boolean);
|
||||
procedure DoSortByFunctions(View: TFileView; FileFunctions: TFileFunctions);
|
||||
procedure DoShowMainMenu(bShow: Boolean);
|
||||
|
|
@ -551,6 +552,23 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TMainCommands.DoTransferPath(SourceFrame: TFileView;
|
||||
TargetNotebook: TFileViewNotebook);
|
||||
begin
|
||||
if TargetNotebook.ActivePage.LockState = tlsPathLocked then
|
||||
Exit;
|
||||
if TargetNotebook.ActivePage.LockState = tlsDirsInNewTab then
|
||||
begin
|
||||
TargetNotebook.NewPage(SourceFrame).MakeActive;
|
||||
TargetNotebook.ActivePage.LockState := tlsNormal;
|
||||
end
|
||||
else
|
||||
begin
|
||||
TargetNotebook.ActivePage.FileView := nil;
|
||||
SourceFrame.Clone(TargetNotebook.ActivePage);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainCommands.DoTransferPath(SourcePage: TFileViewPage; TargetPage: TFileViewPage; FromActivePanel: Boolean);
|
||||
var
|
||||
aFile: TFile;
|
||||
|
|
@ -839,8 +857,7 @@ procedure TMainCommands.cm_TargetEqualSource(const Params: array of string);
|
|||
begin
|
||||
with frmMain do
|
||||
begin
|
||||
NotActiveNotebook.ActivePage.FileView := nil;
|
||||
ActiveFrame.Clone(NotActiveNotebook.ActivePage);
|
||||
DoTransferPath(ActiveFrame, NotActiveNotebook);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -848,8 +865,7 @@ procedure TMainCommands.cm_LeftEqualRight(const Params: array of string);
|
|||
begin
|
||||
with frmMain do
|
||||
begin
|
||||
LeftTabs.ActivePage.FileView := nil;
|
||||
FrameRight.Clone(LeftTabs.ActivePage);
|
||||
DoTransferPath(FrameRight, LeftTabs);
|
||||
|
||||
// Destroying active view may have caused losing focus. Restore it if needed.
|
||||
if SelectedPanel = fpLeft then
|
||||
|
|
@ -861,8 +877,7 @@ procedure TMainCommands.cm_RightEqualLeft(const Params: array of string);
|
|||
begin
|
||||
with frmMain do
|
||||
begin
|
||||
RightTabs.ActivePage.FileView := nil;
|
||||
FrameLeft.Clone(RightTabs.ActivePage);
|
||||
DoTransferPath(FrameLeft, RightTabs);
|
||||
|
||||
// Destroying active view may have caused losing focus. Restore it if needed.
|
||||
if SelectedPanel = fpRight then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue