From e7b6218129e92eb9d45c506b47f2575859c51aac Mon Sep 17 00:00:00 2001 From: Jaex Date: Thu, 20 Apr 2017 23:50:31 +0300 Subject: [PATCH] Refresh combo box texts on name change, disable transfer mode panel on SFTP protocol --- ShareX.HelpersLib/Extensions/Extensions.cs | 6 + ShareX.UploadersLib/FileUploaders/SFTP.cs | 2 +- .../Forms/UploadersConfigForm.cs | 1 + .../Forms/UploadersConfigForm.resx | 1425 ++++++++++------- .../Forms/UploadersConfigFormHelper.cs | 27 +- 5 files changed, 905 insertions(+), 556 deletions(-) diff --git a/ShareX.HelpersLib/Extensions/Extensions.cs b/ShareX.HelpersLib/Extensions/Extensions.cs index af4d056a5..0a27b6bca 100644 --- a/ShareX.HelpersLib/Extensions/Extensions.cs +++ b/ShareX.HelpersLib/Extensions/Extensions.cs @@ -32,6 +32,7 @@ using System.Globalization; using System.IO; using System.Linq; +using System.Reflection; using System.Text; using System.Windows.Forms; using Encoder = System.Drawing.Imaging.Encoder; @@ -575,5 +576,10 @@ public static Point Center(this Rectangle rect) { return new Point(rect.X + rect.Width / 2, rect.Y + rect.Height / 2); } + + public static void RefreshItems(this ComboBox cb) + { + typeof(ComboBox).InvokeMember("RefreshItems", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.InvokeMethod, null, cb, new object[] { }); + } } } \ No newline at end of file diff --git a/ShareX.UploadersLib/FileUploaders/SFTP.cs b/ShareX.UploadersLib/FileUploaders/SFTP.cs index 0da22a5e7..f4abe83be 100644 --- a/ShareX.UploadersLib/FileUploaders/SFTP.cs +++ b/ShareX.UploadersLib/FileUploaders/SFTP.cs @@ -104,7 +104,7 @@ public bool Connect() { if (!File.Exists(Account.Keypath)) { - throw new FileNotFoundException("Key path is invalid.", Account.Keypath); + throw new FileNotFoundException("Key file not exists.", Account.Keypath); } PrivateKeyFile keyFile; diff --git a/ShareX.UploadersLib/Forms/UploadersConfigForm.cs b/ShareX.UploadersLib/Forms/UploadersConfigForm.cs index 0c4583671..b6cfdf156 100644 --- a/ShareX.UploadersLib/Forms/UploadersConfigForm.cs +++ b/ShareX.UploadersLib/Forms/UploadersConfigForm.cs @@ -1341,6 +1341,7 @@ private void txtFTPName_TextChanged(object sender, EventArgs e) if (account != null) { account.Name = txtFTPName.Text; + FTPRefreshNames(); } } diff --git a/ShareX.UploadersLib/Forms/UploadersConfigForm.resx b/ShareX.UploadersLib/Forms/UploadersConfigForm.resx index d9d115932..26aa5f7ac 100644 --- a/ShareX.UploadersLib/Forms/UploadersConfigForm.resx +++ b/ShareX.UploadersLib/Forms/UploadersConfigForm.resx @@ -5023,21 +5023,6 @@ store.book[0].title 5 - - True - - - 16, 216 - - - 202, 17 - - - 39 - - - Append remote directory to URL path - cbFTPAppendRemoteDirectory @@ -5050,18 +5035,6 @@ store.book[0].title 0 - - 16, 376 - - - 96, 24 - - - 42 - - - Test - btnFTPTest @@ -5074,21 +5047,6 @@ store.book[0].title 1 - - True - - - 13, 48 - - - 49, 13 - - - 9 - - - Protocol: - lblFTPProtocol @@ -5101,21 +5059,6 @@ store.book[0].title 2 - - True - - - 13, 24 - - - 38, 13 - - - 13 - - - Name: - lblFTPName @@ -5128,21 +5071,6 @@ store.book[0].title 3 - - True - - - 16, 240 - - - 202, 17 - - - 40 - - - Remove file extension from URL path - cbFTPRemoveFileExtension @@ -5155,15 +5083,6 @@ store.book[0].title 4 - - 160, 20 - - - 288, 20 - - - 14 - txtFTPName @@ -5176,21 +5095,6 @@ store.book[0].title 5 - - True - - - 13, 72 - - - 32, 13 - - - 15 - - - Host: - lblFTPHost @@ -5203,15 +5107,6 @@ store.book[0].title 6 - - 224, 376 - - - 192, 24 - - - 8 - eiFTP @@ -5224,45 +5119,6 @@ store.book[0].title 7 - - True - - - GrowAndShrink - - - rbFTPTransferModeActive - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pFTPTransferMode - - - 0 - - - rbFTPTransferModePassive - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pFTPTransferMode - - - 1 - - - 160, 140 - - - 138, 20 - - - 38 - pFTPTransferMode @@ -5275,21 +5131,6 @@ store.book[0].title 8 - - NoControl - - - 120, 376 - - - 96, 24 - - - 7 - - - Client... - btnFTPClient @@ -5302,15 +5143,6 @@ store.book[0].title 9 - - 160, 68 - - - 288, 20 - - - 16 - txtFTPHost @@ -5323,57 +5155,6 @@ store.book[0].title 10 - - True - - - GrowAndShrink - - - rbFTPProtocolFTP - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pFTPProtocol - - - 0 - - - rbFTPProtocolFTPS - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pFTPProtocol - - - 1 - - - rbFTPProtocolSFTP - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pFTPProtocol - - - 2 - - - 160, 44 - - - 175, 20 - - - 37 - pFTPProtocol @@ -5386,21 +5167,6 @@ store.book[0].title 11 - - True - - - 456, 72 - - - 29, 13 - - - 17 - - - Port: - lblFTPPort @@ -5413,21 +5179,6 @@ store.book[0].title 12 - - True - - - 13, 144 - - - 78, 13 - - - 34 - - - Transfer mode: - lblFTPTransferMode @@ -5440,18 +5191,6 @@ store.book[0].title 13 - - 496, 68 - - - 72, 20 - - - 18 - - - Center - nudFTPPort @@ -5464,21 +5203,6 @@ store.book[0].title 14 - - True - - - 157, 264 - - - 178, 13 - - - 33 - - - http://example.com/screenshot.png - lblFTPURLPreviewValue @@ -5491,21 +5215,6 @@ store.book[0].title 15 - - True - - - 13, 96 - - - 58, 13 - - - 19 - - - Username: - lblFTPUsername @@ -5518,21 +5227,6 @@ store.book[0].title 16 - - True - - - 13, 264 - - - 72, 13 - - - 32 - - - URL preview: - lblFTPURLPreview @@ -5545,15 +5239,6 @@ store.book[0].title 17 - - 160, 92 - - - 288, 20 - - - 20 - txtFTPUsername @@ -5566,15 +5251,6 @@ store.book[0].title 18 - - 160, 188 - - - 72, 21 - - - 31 - cbFTPURLPathProtocol @@ -5587,21 +5263,6 @@ store.book[0].title 19 - - True - - - 13, 120 - - - 56, 13 - - - 21 - - - Password: - lblFTPPassword @@ -5614,15 +5275,6 @@ store.book[0].title 20 - - 240, 188 - - - 368, 20 - - - 30 - txtFTPURLPath @@ -5635,15 +5287,6 @@ store.book[0].title 21 - - 160, 116 - - - 288, 20 - - - 22 - txtFTPPassword @@ -5656,21 +5299,6 @@ store.book[0].title 22 - - True - - - 13, 192 - - - 56, 13 - - - 29 - - - URL path: - lblFTPURLPath @@ -5683,21 +5311,6 @@ store.book[0].title 23 - - True - - - 13, 168 - - - 90, 13 - - - 27 - - - Remote directory: - lblFTPRemoteDirectory @@ -5710,15 +5323,6 @@ store.book[0].title 24 - - 160, 164 - - - 448, 20 - - - 28 - txtFTPRemoteDirectory @@ -5731,78 +5335,6 @@ store.book[0].title 25 - - txtSFTPKeyPassphrase - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbSFTP - - - 0 - - - btnSFTPKeyLocationBrowse - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbSFTP - - - 1 - - - lblSFTPKeyPassphrase - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbSFTP - - - 2 - - - txtSFTPKeyLocation - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbSFTP - - - 3 - - - lblSFTPKeyLocation - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbSFTP - - - 4 - - - 16, 288 - - - 744, 76 - - - 5 - - - SFTP - gbSFTP @@ -5815,78 +5347,6 @@ store.book[0].title 26 - - btnFTPSCertificateLocationBrowse - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFTPS - - - 0 - - - txtFTPSCertificateLocation - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFTPS - - - 1 - - - lblFTPSCertificateLocation - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFTPS - - - 2 - - - cbFTPSEncryption - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFTPS - - - 3 - - - lblFTPSEncryption - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFTPS - - - 4 - - - 16, 288 - - - 744, 76 - - - 43 - - - FTPS - gbFTPS @@ -5927,10 +5387,10 @@ store.book[0].title NoControl - 336, 10 + 336, 11 - 96, 24 + 96, 23 41 @@ -5951,10 +5411,10 @@ store.book[0].title 1 - 232, 10 + 232, 11 - 96, 24 + 96, 23 26 @@ -5975,10 +5435,10 @@ store.book[0].title 2 - 128, 10 + 128, 11 - 96, 24 + 96, 23 25 @@ -9325,6 +8785,258 @@ store.book[0].title 2 + + True + + + 16, 216 + + + 202, 17 + + + 39 + + + Append remote directory to URL path + + + cbFTPAppendRemoteDirectory + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 0 + + + 16, 376 + + + 96, 24 + + + 42 + + + Test + + + btnFTPTest + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 1 + + + True + + + 13, 48 + + + 49, 13 + + + 9 + + + Protocol: + + + lblFTPProtocol + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 2 + + + True + + + 13, 24 + + + 38, 13 + + + 13 + + + Name: + + + lblFTPName + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 3 + + + True + + + 16, 240 + + + 202, 17 + + + 40 + + + Remove file extension from URL path + + + cbFTPRemoveFileExtension + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 4 + + + 160, 20 + + + 288, 20 + + + 14 + + + txtFTPName + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 5 + + + True + + + 13, 72 + + + 32, 13 + + + 15 + + + Host: + + + lblFTPHost + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 6 + + + 224, 376 + + + 192, 24 + + + 8 + + + eiFTP + + + ShareX.HelpersLib.ExportImportControl, ShareX.HelpersLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + gbFTPAccount + + + 7 + + + True + + + GrowAndShrink + + + rbFTPTransferModeActive + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pFTPTransferMode + + + 0 + + + rbFTPTransferModePassive + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pFTPTransferMode + + + 1 + + + 160, 140 + + + 138, 20 + + + 38 + + + pFTPTransferMode + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 8 + True @@ -9379,6 +9091,117 @@ store.book[0].title 1 + + NoControl + + + 120, 376 + + + 96, 24 + + + 7 + + + Client... + + + btnFTPClient + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 9 + + + 160, 68 + + + 288, 20 + + + 16 + + + txtFTPHost + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 10 + + + True + + + GrowAndShrink + + + rbFTPProtocolFTP + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pFTPProtocol + + + 0 + + + rbFTPProtocolFTPS + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pFTPProtocol + + + 1 + + + rbFTPProtocolSFTP + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pFTPProtocol + + + 2 + + + 160, 44 + + + 175, 20 + + + 37 + + + pFTPProtocol + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 11 + True @@ -9466,6 +9289,348 @@ store.book[0].title 2 + + True + + + 456, 72 + + + 29, 13 + + + 17 + + + Port: + + + lblFTPPort + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 12 + + + True + + + 13, 144 + + + 78, 13 + + + 34 + + + Transfer mode: + + + lblFTPTransferMode + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 13 + + + 496, 68 + + + 72, 20 + + + 18 + + + Center + + + nudFTPPort + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 14 + + + True + + + 157, 264 + + + 0, 13 + + + 33 + + + lblFTPURLPreviewValue + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 15 + + + True + + + 13, 96 + + + 58, 13 + + + 19 + + + Username: + + + lblFTPUsername + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 16 + + + True + + + 13, 264 + + + 72, 13 + + + 32 + + + URL preview: + + + lblFTPURLPreview + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 17 + + + 160, 92 + + + 288, 20 + + + 20 + + + txtFTPUsername + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 18 + + + 160, 188 + + + 72, 21 + + + 31 + + + cbFTPURLPathProtocol + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 19 + + + True + + + 13, 120 + + + 56, 13 + + + 21 + + + Password: + + + lblFTPPassword + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 20 + + + 240, 188 + + + 368, 20 + + + 30 + + + txtFTPURLPath + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 21 + + + 160, 116 + + + 288, 20 + + + 22 + + + txtFTPPassword + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 22 + + + True + + + 13, 192 + + + 56, 13 + + + 29 + + + URL path: + + + lblFTPURLPath + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 23 + + + True + + + 13, 168 + + + 90, 13 + + + 27 + + + Remote directory: + + + lblFTPRemoteDirectory + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 24 + + + 160, 164 + + + 448, 20 + + + 28 + + + txtFTPRemoteDirectory + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 25 + True @@ -21955,6 +22120,90 @@ Using an encrypted library disables sharing. ShareX.UploadersLib.AccountTypeControl, ShareX.UploadersLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + btnFTPSCertificateLocationBrowse + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPS + + + 0 + + + txtFTPSCertificateLocation + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPS + + + 1 + + + lblFTPSCertificateLocation + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPS + + + 2 + + + cbFTPSEncryption + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPS + + + 3 + + + lblFTPSEncryption + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPS + + + 4 + + + 16, 288 + + + 744, 76 + + + 43 + + + FTPS + + + gbFTPS + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 27 + True @@ -22075,6 +22324,90 @@ Using an encrypted library disables sharing. 0 + + txtSFTPKeyPassphrase + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbSFTP + + + 0 + + + btnSFTPKeyLocationBrowse + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbSFTP + + + 1 + + + lblSFTPKeyPassphrase + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbSFTP + + + 2 + + + txtSFTPKeyLocation + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbSFTP + + + 3 + + + lblSFTPKeyLocation + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbSFTP + + + 4 + + + 16, 288 + + + 744, 76 + + + 5 + + + SFTP + + + gbSFTP + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFTPAccount + + + 26 + True diff --git a/ShareX.UploadersLib/Forms/UploadersConfigFormHelper.cs b/ShareX.UploadersLib/Forms/UploadersConfigFormHelper.cs index 59c951819..bf5bba670 100644 --- a/ShareX.UploadersLib/Forms/UploadersConfigFormHelper.cs +++ b/ShareX.UploadersLib/Forms/UploadersConfigFormHelper.cs @@ -945,12 +945,12 @@ private bool MinusHasFolder(string name) #region FTP - public bool FTPCheckAccount(int index) + private bool FTPCheckAccount(int index) { return Config.FTPAccountList.IsValidIndex(index); } - public FTPAccount FTPGetSelectedAccount() + private FTPAccount FTPGetSelectedAccount() { int index = cbFTPAccounts.SelectedIndex; @@ -962,7 +962,7 @@ public FTPAccount FTPGetSelectedAccount() return null; } - public void FTPAddAccount(FTPAccount account) + private void FTPAddAccount(FTPAccount account) { if (account != null) { @@ -1022,6 +1022,7 @@ private void FTPUpdateEnabledStates() { gbFTPS.Visible = account.Protocol == FTPProtocol.FTPS; gbSFTP.Visible = account.Protocol == FTPProtocol.SFTP; + pFTPTransferMode.Enabled = account.Protocol == FTPProtocol.FTP || account.Protocol == FTPProtocol.FTPS; } else { @@ -1029,7 +1030,15 @@ private void FTPUpdateEnabledStates() } } - public void FTPLoadSelectedAccount() + private void FTPRefreshNames() + { + cbFTPAccounts.RefreshItems(); + cbFTPImage.RefreshItems(); + cbFTPText.RefreshItems(); + cbFTPFile.RefreshItems(); + } + + private void FTPLoadSelectedAccount() { FTPAccount account = FTPGetSelectedAccount(); @@ -1039,7 +1048,7 @@ public void FTPLoadSelectedAccount() } } - public void FTPLoadAccount(FTPAccount account) + private void FTPLoadAccount(FTPAccount account) { txtFTPName.Text = account.Name; @@ -1086,7 +1095,7 @@ public void FTPLoadAccount(FTPAccount account) FTPUpdateEnabledStates(); } - public void FTPClearFields() + private void FTPClearFields() { FTPAccount account = new FTPAccount() { @@ -1097,7 +1106,7 @@ public void FTPClearFields() FTPLoadAccount(account); } - public void FTPUpdateURLPreview() + private void FTPUpdateURLPreview() { FTPAccount account = FTPGetSelectedAccount(); @@ -1107,7 +1116,7 @@ public void FTPUpdateURLPreview() } } - public void FTPTestAccountAsync(FTPAccount account) + private void FTPTestAccountAsync(FTPAccount account) { if (account != null) { @@ -1124,7 +1133,7 @@ public void FTPTestAccountAsync(FTPAccount account) } } - public static void FTPTestAccount(FTPAccount account) + private void FTPTestAccount(FTPAccount account) { string msg = ""; string remotePath = account.GetSubFolderPath();