Browse Source

Update dialog can be displayed by clicking update notification even when the Login dialog is opened

Source commit: fffa845a4a27758ae70cfd887c116c35cbc2f941
Martin Prikryl 8 years ago
parent
commit
778a7ac9ee

+ 7 - 1
source/forms/CustomScpExplorer.cpp

@@ -7805,7 +7805,13 @@ void __fastcall TCustomScpExplorerForm::UpdatesNoteClicked(TObject * /*Sender*/)
 {
   RestoreApp();
 
-  if (!NonVisualDataModule->Busy)
+  bool CanDisplay = !NonVisualDataModule->Busy;
+  if (!CanDisplay && (Screen->ActiveForm != NULL))
+  {
+    CanDisplay = (Screen->ActiveForm->Perform(WM_CAN_DISPLAY_UPDATES, 0, 0) != 0);
+  }
+
+  if (CanDisplay)
   {
     Configuration->Usage->Inc(L"UpdateNotificationsClicked");
     CheckForUpdates(true);

+ 4 - 0
source/forms/Login.cpp

@@ -1550,6 +1550,10 @@ void __fastcall TLoginDialog::Dispatch(void * Message)
   {
     M->Result = 1;
   }
+  else if (M->Msg == WM_CAN_DISPLAY_UPDATES)
+  {
+    M->Result = 1;
+  }
   else if (M->Msg == CM_ACTIVATE)
   {
     // Called from TCustomForm.ShowModal

+ 1 - 0
source/windows/CustomWinConfiguration.h

@@ -11,6 +11,7 @@
 // WM_LOG_UPDATE = WM_WINSCP_USER + 6 (components/LogMemo.cpp)
 #define WM_MANAGES_CAPTION (WM_WINSCP_USER + 7)
 #define WM_WANTS_MOUSEWHEEL (WM_WINSCP_USER + 8)
+#define WM_CAN_DISPLAY_UPDATES (WM_WINSCP_USER + 9)
 //---------------------------------------------------------------------------
 #define C(Property) (Property != rhc.Property) ||
 struct TSynchronizeChecklistConfiguration