Browse Source

Bug fix: Host key prompt did not have the default button

(identified thanks to fixed assertion from 3fd70f41)

Source commit: 93ae375219314c5d4562f89492c47f188b923392
Martin Prikryl 3 months ago
parent
commit
4705d456ba
1 changed files with 7 additions and 4 deletions
  1. 7 4
      source/forms/MessageDlg.cpp

+ 7 - 4
source/forms/MessageDlg.cpp

@@ -789,13 +789,16 @@ TForm * __fastcall TMessageForm::Create(const UnicodeString & Msg,
   TSize MoreMessagesSize, const UnicodeString & CustomCaption)
 {
   unsigned int DefaultAnswer;
-  if (FLAGSET(Answers, qaOK))
+  // In general, we should not have Yes and OK on the same query.
+  // But we do for "hostkey" prompt, where they are aliased and OK is groupped with Yes.
+  // There we need Yes to be the default.
+  if (FLAGSET(Answers, qaYes))
   {
-    DefaultAnswer = qaOK;
+    DefaultAnswer = qaYes;
   }
-  else if (FLAGSET(Answers, qaYes))
+  else if (FLAGSET(Answers, qaOK))
   {
-    DefaultAnswer = qaYes;
+    DefaultAnswer = qaOK;
   }
   else
   {