Kaynağa Gözat

Bug fix: Command-line toolbar was not disabled for WebDAV sessions

Source commit: 6905997e05fd2dab82de22b594bc65822cdfbd97
Martin Prikryl 9 yıl önce
ebeveyn
işleme
d8f06d22c5

+ 5 - 0
source/forms/CustomScpExplorer.cpp

@@ -466,6 +466,11 @@ void __fastcall TCustomScpExplorerForm::CreateHiddenWindow()
   }
 }
 //---------------------------------------------------------------------------
+bool __fastcall TCustomScpExplorerForm::CanConsole()
+{
+  return (Terminal != NULL) && (Terminal->IsCapable[fcAnyCommand] || Terminal->IsCapable[fcSecondaryShell]);
+}
+//---------------------------------------------------------------------------
 bool __fastcall TCustomScpExplorerForm::CanCommandLineFromAnotherInstance()
 {
   bool Result = !NonVisualDataModule->Busy;

+ 1 - 0
source/forms/CustomScpExplorer.h

@@ -678,6 +678,7 @@ public:
   void __fastcall UpdateTaskbarList(ITaskbarList3 * TaskbarList);
   virtual void __fastcall DisplaySystemContextMenu();
   virtual void __fastcall GoToAddress() = 0;
+  bool __fastcall CanConsole();
 
   __property bool ComponentVisible[Byte Component] = { read = GetComponentVisible, write = SetComponentVisible };
   __property bool EnableFocusedOperation[TOperationSide Side] = { read = GetEnableFocusedOperation, index = 0 };

+ 1 - 1
source/forms/NonVisual.cpp

@@ -435,7 +435,7 @@ void __fastcall TNonVisualDataModule::ExplorerActionsUpdate(
   UPD(CompareDirectoriesAction, HasTerminal)
   UPD(SynchronizeAction, HasTerminal)
   UPD(FullSynchronizeAction, HasTerminal)
-  UPD(ConsoleAction, HasTerminal && (ScpExplorer->Terminal->IsCapable[fcAnyCommand] || ScpExplorer->Terminal->IsCapable[fcSecondaryShell]))
+  UPD(ConsoleAction, ScpExplorer->CanConsole())
   UPD(PuttyAction, HasTerminal && TTerminalManager::Instance()->CanOpenInPutty())
   UPD(SynchronizeBrowsingAction, HasTerminal)
   UPD(CloseApplicationAction, true)

+ 1 - 1
source/forms/ScpCommander.cpp

@@ -818,7 +818,7 @@ void __fastcall TScpCommanderForm::UpdateControls()
     UpdateToolbar2ItemCaption(CurrentMoveToolbar2Item);
   }
 
-  CommandLineCombo->Enabled = (Terminal != NULL);
+  CommandLineCombo->Enabled = CanConsole();
   CommandLinePromptLabel->Enabled = CommandLineCombo->Enabled;
 }
 //---------------------------------------------------------------------------