1
0
Эх сурвалжийг харах

Bug 1408: Link background confirmations options from the generic options

https://winscp.net/tracker/1408

Source commit: 09af0b789a1491f553c4a3c0ffbf8ce3f4f118d7
Martin Prikryl 9 жил өмнө
parent
commit
7313ce3dbd

+ 9 - 0
source/forms/Preferences.cpp

@@ -117,6 +117,7 @@ __fastcall TPreferencesDialog::TPreferencesDialog(
   LoadDialogImage(ExplorerInterfacePicture, L"Explorer");
 
   LinkLabel(UpdatesLink);
+  LinkAppLabel(BackgroundConfirmationsLink);
 
   HideComponentsPanel(this);
 }
@@ -2646,3 +2647,11 @@ void __fastcall TPreferencesDialog::CustomCommandsViewMouseMove(TObject * /*Send
   }
 }
 //---------------------------------------------------------------------------
+void __fastcall TPreferencesDialog::BackgroundConfirmationsLinkClick(TObject * /*Sender*/)
+{
+  PageControl->ActivePage = QueueSheet;
+  PageControlChange(NULL);
+  QueueNoConfirmationCheck->SetFocus();
+  QueueNoConfirmationCheck->Perform(WM_CHANGEUISTATE, MAKEWPARAM(UIS_CLEAR, UISF_HIDEFOCUS), 0);
+}
+//---------------------------------------------------------------------------

+ 31 - 19
source/forms/Preferences.dfm

@@ -76,13 +76,13 @@ object PreferencesDialog: TPreferencesDialog
           Left = 8
           Top = 8
           Width = 389
-          Height = 256
+          Height = 272
           Anchors = [akLeft, akTop, akRight]
           Caption = 'Confirmations'
           TabOrder = 0
           DesignSize = (
             389
-            256)
+            272)
           object ConfirmOverwritingCheck: TCheckBox
             Left = 16
             Top = 44
@@ -95,82 +95,82 @@ object PreferencesDialog: TPreferencesDialog
           end
           object ConfirmDeletingCheck: TCheckBox
             Left = 16
-            Top = 67
+            Top = 106
             Width = 357
             Height = 17
             Anchors = [akLeft, akTop, akRight]
             Caption = '&Deleting of files (recommended)'
-            TabOrder = 2
+            TabOrder = 4
             OnClick = ControlChange
           end
           object ConfirmClosingSessionCheck2: TCheckBox
             Left = 16
-            Top = 136
+            Top = 152
             Width = 357
             Height = 17
             Anchors = [akLeft, akTop, akRight]
             Caption = 'Closing sessions when exiting appli&cation'
-            TabOrder = 5
+            TabOrder = 6
             OnClick = ControlChange
           end
           object DDTransferConfirmationCheck: TCheckBox
             Left = 16
-            Top = 182
+            Top = 198
             Width = 357
             Height = 17
             Anchors = [akLeft, akTop, akRight]
             Caption = 'D&rag && drop operations'
-            TabOrder = 7
+            TabOrder = 8
             OnClick = ControlChange
           end
           object ContinueOnErrorCheck: TCheckBox
             Left = 16
-            Top = 228
+            Top = 244
             Width = 357
             Height = 17
             Anchors = [akLeft, akTop, akRight]
             Caption = 'Continue on &error (advanced users)'
-            TabOrder = 9
+            TabOrder = 10
             OnClick = ControlChange
           end
           object ConfirmExitOnCompletionCheck: TCheckBox
             Left = 16
-            Top = 159
+            Top = 175
             Width = 357
             Height = 17
             Anchors = [akLeft, akTop, akRight]
             Caption = 'Exiting application on o&peration completion'
-            TabOrder = 6
+            TabOrder = 7
             OnClick = ControlChange
           end
           object ConfirmResumeCheck: TCheckBox
             Left = 16
-            Top = 113
+            Top = 67
             Width = 357
             Height = 17
             Anchors = [akLeft, akTop, akRight]
             Caption = 'Trans&fer resuming'
-            TabOrder = 4
+            TabOrder = 2
             OnClick = ControlChange
           end
           object ConfirmCommandSessionCheck: TCheckBox
             Left = 16
-            Top = 205
+            Top = 221
             Width = 357
             Height = 17
             Anchors = [akLeft, akTop, akRight]
             Caption = 'Opening separate &shell session'
-            TabOrder = 8
+            TabOrder = 9
             OnClick = ControlChange
           end
           object ConfirmRecyclingCheck: TCheckBox
             Left = 16
-            Top = 90
+            Top = 129
             Width = 357
             Height = 17
             Anchors = [akLeft, akTop, akRight]
             Caption = '&Moving files to Recycle bin'
-            TabOrder = 3
+            TabOrder = 5
             OnClick = ControlChange
           end
           object ConfirmTransferringCheck: TCheckBox
@@ -183,10 +183,22 @@ object PreferencesDialog: TPreferencesDialog
             TabOrder = 0
             OnClick = ControlChange
           end
+          object BackgroundConfirmationsLink: TStaticText
+            Left = 32
+            Top = 88
+            Width = 345
+            Height = 17
+            Alignment = taRightJustify
+            AutoSize = False
+            Caption = 'Change confirmations of background transfers'
+            TabOrder = 3
+            TabStop = True
+            OnClick = BackgroundConfirmationsLinkClick
+          end
         end
         object NotificationsGroup: TGroupBox
           Left = 8
-          Top = 271
+          Top = 286
           Width = 389
           Height = 73
           Anchors = [akLeft, akTop, akRight]

+ 2 - 0
source/forms/Preferences.h

@@ -312,6 +312,7 @@ __published:
   TPopupMenu *AddCommandMenu;
   TMenuItem *AddCustomCommandMenuItem;
   TMenuItem *AddExtensionMenuItem;
+  TStaticText *BackgroundConfirmationsLink;
   void __fastcall FormShow(TObject *Sender);
   void __fastcall ControlChange(TObject *Sender);
   void __fastcall EditorFontButtonClick(TObject *Sender);
@@ -398,6 +399,7 @@ __published:
   void __fastcall EditCommandButtonClick(TObject *Sender);
   void __fastcall AddCommandButtonDropDownClick(TObject *Sender);
   void __fastcall CustomCommandsViewMouseMove(TObject *Sender, TShiftState Shift, int X, int Y);
+  void __fastcall BackgroundConfirmationsLinkClick(TObject *Sender);
 
 private:
   TPreferencesMode FPreferencesMode;

+ 20 - 7
source/windows/VCLCommon.cpp

@@ -1792,15 +1792,26 @@ static void __fastcall LinkLabelContextMenuClick(void * Data, TObject * Sender)
   }
 }
 //---------------------------------------------------------------------------
-void __fastcall LinkLabel(TStaticText * StaticText, UnicodeString Url,
-  TNotifyEvent OnEnter)
+static void __fastcall DoLinkLabel(TStaticText * StaticText)
 {
   StaticText->Transparent = false;
   StaticText->ParentFont = true;
   StaticText->Font->Style = StaticText->Font->Style << fsUnderline;
-  StaticText->Font->Color = LinkColor;
   StaticText->Cursor = crHandPoint;
+
+  TWndMethod WindowProc;
+  ((TMethod*)&WindowProc)->Data = StaticText;
+  ((TMethod*)&WindowProc)->Code = LinkLabelWindowProc;
+  StaticText->WindowProc = WindowProc;
+}
+//---------------------------------------------------------------------------
+void __fastcall LinkLabel(TStaticText * StaticText, UnicodeString Url,
+  TNotifyEvent OnEnter)
+{
+  DoLinkLabel(StaticText);
+
   reinterpret_cast<TButton*>(StaticText)->OnEnter = OnEnter;
+
   if (!Url.IsEmpty())
   {
     StaticText->Caption = Url;
@@ -1841,10 +1852,12 @@ void __fastcall LinkLabel(TStaticText * StaticText, UnicodeString Url,
     }
   }
 
-  TWndMethod WindowProc;
-  ((TMethod*)&WindowProc)->Data = StaticText;
-  ((TMethod*)&WindowProc)->Code = LinkLabelWindowProc;
-  StaticText->WindowProc = WindowProc;
+  StaticText->Font->Color = LinkColor;
+}
+//---------------------------------------------------------------------------
+void __fastcall LinkAppLabel(TStaticText * StaticText)
+{
+  DoLinkLabel(StaticText);
 }
 //---------------------------------------------------------------------------
 static void __fastcall HotTrackLabelMouseEnter(void * /*Data*/, TObject * Sender)

+ 1 - 0
source/windows/VCLCommon.h

@@ -22,6 +22,7 @@ void __fastcall UseSystemSettings(TCustomForm * Control);
 void __fastcall ResetSystemSettings(TCustomForm * Control);
 void __fastcall LinkLabel(TStaticText * StaticText, UnicodeString Url = L"",
   TNotifyEvent OnEnter = NULL);
+void __fastcall LinkAppLabel(TStaticText * StaticText);
 void __fastcall HintLabel(TStaticText * StaticText, UnicodeString Hint = L"");
 void __fastcall HotTrackLabel(TLabel * Label);
 void __fastcall FixComboBoxResizeBug(TCustomComboBox * ComboBox);