Browse Source

Bug fix: Command to Install public key into server was enabled, even when no hostname was specified

Source commit: 3b20db382bce22bb146ffbd881868185b5220897
Martin Prikryl 9 months ago
parent
commit
7a5ab110f0
1 changed files with 2 additions and 1 deletions
  1. 2 1
      source/forms/SiteAdvanced.cpp

+ 2 - 1
source/forms/SiteAdvanced.cpp

@@ -1673,7 +1673,8 @@ void __fastcall TSiteAdvancedDialog::PrivateKeyToolsButtonClick(TObject * /*Send
 {
   UnicodeString Dummy;
   PrivateKeyGenerateItem->Enabled = FindTool(PuttygenTool, Dummy);
-  PrivateKeyUploadItem->Enabled = (NormalizeFSProtocol(FSessionData->FSProtocol) == fsSFTP);
+  PrivateKeyUploadItem->Enabled =
+    FSessionData->CanLogin && (NormalizeFSProtocol(FSessionData->FSProtocol) == fsSFTP);
   MenuPopup(PrivateKeyMenu, PrivateKeyToolsButton);
 }
 //---------------------------------------------------------------------------