فهرست منبع

Middle mouse click closes session without activating its tab

Source commit: 846173b090dc26c7ba2ed3fa2aa8ad8a3a4ab63f
Martin Prikryl 7 سال پیش
والد
کامیت
f37d395cca
2فایلهای تغییر یافته به همراه8 افزوده شده و 7 حذف شده
  1. 7 7
      source/forms/CustomScpExplorer.cpp
  2. 1 0
      source/forms/CustomScpExplorer.h

+ 7 - 7
source/forms/CustomScpExplorer.cpp

@@ -9399,12 +9399,7 @@ void __fastcall TCustomScpExplorerForm::SessionsPageControlMouseDown(
       TTerminal * Terminal = GetSessionTabTerminal(SessionsPageControl->Pages[Index]);
       if (Terminal != NULL)
       {
-        SessionsPageControl->ActivePageIndex = Index;
-        // Switch to session tab (has to be session tab, due to previous check)
-        if (DebugAlwaysTrue(SessionTabSwitched()))
-        {
-          CloseSession();
-        }
+        CloseSessionTab(Index);
       }
     }
   }
@@ -9977,7 +9972,7 @@ void __fastcall TCustomScpExplorerForm::ReloadDirectory(TOperationSide Side)
   DirView(Side)->ReloadDirectory();
 }
 //---------------------------------------------------------------------------
-void __fastcall TCustomScpExplorerForm::SessionsPageControlCloseButtonClick(TPageControl * /*Sender*/, int Index)
+void __fastcall TCustomScpExplorerForm::CloseSessionTab(int Index)
 {
   if (Index == SessionsPageControl->TabIndex)
   {
@@ -10003,6 +9998,11 @@ void __fastcall TCustomScpExplorerForm::SessionsPageControlCloseButtonClick(TPag
   }
 }
 //---------------------------------------------------------------------------
+void __fastcall TCustomScpExplorerForm::SessionsPageControlCloseButtonClick(TPageControl * /*Sender*/, int Index)
+{
+  CloseSessionTab(Index);
+}
+//---------------------------------------------------------------------------
 void __fastcall TCustomScpExplorerForm::CopyFilesToClipboard(TOperationSide Side)
 {
   if (DebugAlwaysTrue(GetSide(Side) == osRemote))

+ 1 - 0
source/forms/CustomScpExplorer.h

@@ -639,6 +639,7 @@ protected:
   void __fastcall ClipboardDownload(const UnicodeString & TargetDirectory, bool NoConfirmation, bool DragDrop);
   bool __fastcall DoesClipboardContainOurFiles();
   bool __fastcall CanPasteToDirViewFromClipBoard();
+  void __fastcall CloseSessionTab(int Index);
 
 public:
   virtual __fastcall ~TCustomScpExplorerForm();