Browse Source

Informing when drag&drop shell extension cannot work on the system on Preferences dialog

Source commit: 5897546be61e8495a0b2132fed57d3a446d7d65d
Martin Prikryl 7 years ago
parent
commit
02b9805cfc

+ 1 - 1
source/forms/CustomScpExplorer.cpp

@@ -7064,7 +7064,7 @@ void __fastcall TCustomScpExplorerForm::DDFakeFileInitDrag(TFileList * FileList,
 
   Created = true;
 
-  if (!WinConfiguration->IsDDExtRunning() || (GetWindowsBuild() >= 17134))
+  if (!WinConfiguration->IsDDExtRunning() || WinConfiguration->IsDDExtBroken())
   {
     FDragFakeMonitors = StartCreationDirectoryMonitorsOnEachDrive(FILE_NOTIFY_CHANGE_DIR_NAME, DDFakeCreated);
   }

+ 7 - 1
source/forms/Preferences.cpp

@@ -1215,7 +1215,13 @@ void __fastcall TPreferencesDialog::UpdateControls()
     }
     SetLabelHintPopup(CopyParamLabel, InfoStr);
 
-    if (!WinConfiguration->DDExtInstalled)
+    if (WinConfiguration->IsDDExtBroken())
+    {
+      DragExtStatusLabel->Caption = LoadStr(PREFERENCES_DRAGEXT_BROKEN);
+      DragExtStatusLabel->Enabled = false;
+      DragExtStatusLabel->Font->Color = clWindowText;
+    }
+    else if (!WinConfiguration->DDExtInstalled)
     {
       DragExtStatusLabel->Caption = LoadStr(PREFERENCES_DRAGEXT_NOT_INSTALLED);
       DragExtStatusLabel->Enabled = false;

+ 1 - 0
source/resource/TextsWin.h

@@ -612,6 +612,7 @@
 #define RENAME_SESSION_PROMPT   6015
 #define SYNCHRONIZE_COMPLETE    6016
 #define SYNCHRONIZE_SUMMARY     6017
+#define PREFERENCES_DRAGEXT_BROKEN 6018
 
 // 2xxx is reserved for TextsFileZilla.h
 

+ 1 - 0
source/resource/TextsWin1.rc

@@ -617,6 +617,7 @@ BEGIN
         RENAME_SESSION_PROMPT, "&New session name:"
         SYNCHRONIZE_COMPLETE, "Synchronization was completed."
         SYNCHRONIZE_SUMMARY, "Files uploaded: %s (%s)|Files downloaded: %s (%s)|Local files deleted: %s|Remote files deleted: %s|Comparison time: %s|Synchronization time: %s"
+        PREFERENCES_DRAGEXT_BROKEN, "Shell extension cannot work on this system."
 
         WIN_VARIABLE_STRINGS, "WIN_VARIABLE"
         WINSCP_COPYRIGHT, "Copyright © 2000-2018 Martin Prikryl"

+ 5 - 0
source/windows/WinConfiguration.cpp

@@ -1642,6 +1642,11 @@ bool __fastcall TWinConfiguration::IsDDExtRunning()
   return Result;
 }
 //---------------------------------------------------------------------------
+bool __fastcall TWinConfiguration::IsDDExtBroken()
+{
+  return (GetWindowsBuild() >= 17134);
+}
+//---------------------------------------------------------------------------
 RawByteString __fastcall TWinConfiguration::StronglyRecryptPassword(RawByteString Password, UnicodeString Key)
 {
   RawByteString Dummy;

+ 1 - 0
source/windows/WinConfiguration.h

@@ -614,6 +614,7 @@ public:
   UnicodeString __fastcall UniqueExtensionName(const UnicodeString & ExtensionName, int Counter);
   UnicodeString __fastcall GetProvisionaryExtensionId(const UnicodeString & FileName);
   bool __fastcall IsDDExtRunning();
+  bool __fastcall IsDDExtBroken();
 
   static void __fastcall RestoreFont(const TFontConfiguration & Configuration, TFont * Font);
   static void __fastcall StoreFont(TFont * Font, TFontConfiguration & Configuration);