Explorar o código

Prevent switching to local-local mode temporarily while session is opening

Source commit: 2e9702650a47ce7ef0df88b2634d0028a5748735
Martin Prikryl %!s(int64=5) %!d(string=hai) anos
pai
achega
bd34fc5351
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      source/forms/ScpCommander.cpp

+ 4 - 1
source/forms/ScpCommander.cpp

@@ -969,7 +969,10 @@ void __fastcall TScpCommanderForm::UpdateControls()
   // otherwise it shines too much on the toolbar.
   RemoteNewSubmenuItem->Enabled = DirViewEnabled(osRemote);
 
-  bool HasTerminal = (Terminal != NULL);
+  // When implicitly connecting a not-yet-connected session by switching to its tab opened with workspace,
+  // Terminal property is still NULL, but ActiveTerminal is already set.
+  // Had we used Terminal for the test, the window would switch to local-local mode temporarily while session is opening.
+  bool HasTerminal = (TTerminalManager::Instance()->ActiveTerminal != NULL);
   RemoteDirView->Visible = HasTerminal;
   RemoteDriveView->Visible = HasTerminal;
   OtherLocalDirView->Visible = !HasTerminal;