浏览代码

Bug 1572: Failure when changing remote working directory using directory tree (2nd)

https://winscp.net/tracker/1572

Source commit: 1ed25a6d14ee23457d14f41c3ae3a0cae2e55bd4
Martin Prikryl 8 年之前
父节点
当前提交
32b5ea931c
共有 1 个文件被更改,包括 15 次插入0 次删除
  1. 15 0
      source/packages/filemng/CustomDriveView.pas

+ 15 - 0
source/packages/filemng/CustomDriveView.pas

@@ -88,6 +88,7 @@ type
     procedure WMLButtonUp(var Msg: TWMLButtonDown); message WM_LBUTTONUP;
     procedure WMRButtonDown(var Msg: TWMRButtonDown); message WM_RBUTTONDOWN;
     procedure WMContextMenu(var Msg: TWMContextMenu); message WM_CONTEXTMENU;
+    procedure WMKeyDown(var Message: TWMKeyDown); message WM_KEYDOWN;
     procedure CMDPIChanged(var Message: TMessage); message CM_DPICHANGED;
 
     procedure Delete(Node: TTreeNode); override;
@@ -149,6 +150,7 @@ type
     function DoBusy(Busy: Integer): Boolean;
     function StartBusy: Boolean;
     procedure EndBusy;
+    function IsBusy: Boolean;
 
     property ImageList: TImageList read FImageList;
 
@@ -962,6 +964,14 @@ begin
   inherited;
 end; {OnDelete}
 
+procedure TCustomDriveView.WMKeyDown(var Message: TWMKeyDown);
+begin
+  if not IsBusy then
+  begin
+    inherited;
+  end;
+end;
+
 procedure TCustomDriveView.KeyDown(var Key: Word; Shift: TShiftState);
 begin
   if (Key = VK_RETURN) and (ssAlt in Shift) and (not IsEditing) and
@@ -1243,6 +1253,11 @@ begin
   Result := DoBusy(1);
 end;
 
+function TCustomDriveView.IsBusy: Boolean;
+begin
+  Result := DoBusy(0);
+end;
+
 procedure TCustomDriveView.EndBusy;
 begin
   DoBusy(-1);