Skip to content

Commit e1c8c23

Browse files
committed
2.4.2.2 - File Transfer Settings includes new option "Connecting to a Linux server" to determine how the filepath should be handled on the SFTP server when splitting the path for sub-folder creation.
1 parent 5d2b5a3 commit e1c8c23

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

Gavin.Kendall.SFTP/SftpClient.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
// You should have received a copy of the GNU General Public License
1919
// along with this program. If not, see <https://www.gnu.org/licenses/>.
2020
//-----------------------------------------------------------------------
21-
using System;
2221
using System.IO;
2322

2423
namespace Gavin.Kendall.SFTP
@@ -88,7 +87,7 @@ public void Disconnect()
8887
/// <param name="destinationFilename">The remote filename to write to on the server.</param>
8988
/// <param name="isLinux">Determines if we are connecting to a Linux server (if so then backslashes in the destination folder path are replaced with forward slashes).</param>
9089
/// <returns>True if the upload was successful otherwise false if the upload failed.</returns>
91-
public bool UploadFile(string sourcePath, string destinationFolderPath, string destinationFilename, bool isLinux = true)
90+
public bool UploadFile(string sourcePath, string destinationFolderPath, string destinationFilename, bool isLinux)
9291
{
9392
try
9493
{

changelog.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Auto Screen Capture by Gavin Kendall
22

33

4-
2.4.2.2 Application settings AllowUserToConfigureEmailSettings and AllowUserToConfigureFileTransferSettings disable respective menu items instead of hiding menu items. Default triggers added (and disabled) "Email Screenshots" and "Upload With SFTP". "New Region" added to Region Select system tray icon menu so you can perform a region selection and have the Add Region form open based on the provided region selection. Fixed the -show command line option so that any triggers using the ShowSystemTrayIcon action are enabled. Fixed the -hide command line option so that any triggers using the ShowSystemTrayIcon action are disabled.
4+
2.4.2.2 Application settings AllowUserToConfigureEmailSettings and AllowUserToConfigureFileTransferSettings disable respective menu items instead of hiding menu items. Default triggers added (and disabled) "Email Screenshots" and "Upload With SFTP". "New Region" added to Region Select system tray icon menu so you can perform a region selection and have the Add Region form open based on the provided region selection. Fixed the -show command line option so that any triggers using the ShowSystemTrayIcon action are enabled. Fixed the -hide command line option so that any triggers using the ShowSystemTrayIcon action are disabled. File Transfer Settings includes new option "Connecting to a Linux server" to determine how the filepath should be handled on the SFTP server when splitting the path for sub-folder creation.
55
2.4.2.1 Fixed triggering of After Screenshot Taken condition when using Optimize Screen Capture so it no longer triggers on that condition when a duplicate hash is encountered. Count added to status bar and status bar re-designed. Optimize Screen Capture includes hash dictionary grid view, Refresh Hash Dictionary button, and Clear Hash Dictionary button. Removed constraint on filepaths needing to be unique when adding screenshots to screenshot collection. Fixed bug with saving image and keeping a record of the image's hash value when using "Compare with last image" option in Optimize Screen Capture to resolve exception error "An item with the same key has already been added".
66
2.4.2.0 Optimize Screen Capture now has options for comparing with any previous image and comparing with the last image. File Transfer Settings now has options for deleting the local file upon successful upload and keeping failed uploads in queue and retrying until a successful upload has been achieved.
77
2.4.1.9 Screenshots count is reset when screenshots limit is reached to avoid falling into an infinite loop. New trigger actions Restart Screen Capture, Delete Screenshots By Cycle Count, and Delete Screenshots From Oldest Capture Cycle. New command "-restart". New macro tag "%capturenow%". Screenshots that fail to upload to an SFTP server will try to upload to the same SFTP server in the next capture cycle until the upload is successful.

help/help-2.rtf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7699,7 +7699,7 @@ ad7bbdad7bbda57bbda57bbda57b000000040000002701ffff030000000000
76997699
I love the Blade movies and I don't care what anyone says but the music in the "Bloodbath" nightclub scene of the first movie is still cool.\par
77007700
The biggest feature implemented in 2.4 was the ability to encrypt and decrypt screenshots. The interface was cleaned up and more user-friendly notes were included. This version introduces the "Auto Adapt" feature for screens so that the position and size of each screen is automatically adjusted based on changes made to the display setup.\par
77017701
Here's every change in the 2.4 "Blade" series (starting with the most recent change):\par
7702-
\cf1\f1\fs19\lang1033 2.4.2.2 Application settings AllowUserToConfigureEmailSettings and AllowUserToConfigureFileTransferSettings disable respective menu items instead of hiding menu items. Default triggers added (and disabled) "Email Screenshots" and "Upload With SFTP". \f2 "New Region" added to Region Select system tray icon menu so you can perform a region selection and have the \f1 Add \f2 Region form open based on the provided region selection\f1 .\f2 Fixed the -show command line option so that any triggers using the ShowSystemTrayIcon action are enabled. Fixed the -hide command line option so that any triggers using the ShowSystemTrayIcon action are disabled.\f1\par
7702+
\cf1\f1\fs19\lang1033 2.4.2.2 Application settings AllowUserToConfigureEmailSettings and AllowUserToConfigureFileTransferSettings disable respective menu items instead of hiding menu items. Default triggers added (and disabled) "Email Screenshots" and "Upload With SFTP". \f2 "New Region" added to Region Select system tray icon menu so you can perform a region selection and have the \f1 Add \f2 Region form open based on the provided region selection\f1 .\f2 Fixed the -show command line option so that any triggers using the ShowSystemTrayIcon action are enabled. Fixed the -hide command line option so that any triggers using the ShowSystemTrayIcon action are disabled.\f1 \f2 File Transfer Settings includes new option "Connecting to a Linux server" to determine how the filepath should be handled on the SFTP server when splitting the path for sub-folder creation\f1 .\par
77037703
2.4.2.1 \f2 Fixed triggering of After Screenshot Taken condition when using Optimize Screen Capture so it no longer triggers on that condition when a duplicate hash is encountered. Count added to status bar and status bar re-designed. Optimize Screen Capture includes hash dictionary grid view, Refresh Hash Dictionary button, and Clear Hash Dictionary button. Removed constraint on filepaths needing to be unique when adding screenshots to screenshot collection.\f1 Fixed bug with saving image and keeping a record of the image's hash value when using "Compare with last image" option in Optimize Screen Capture to resolve exception error "An item with the same key has already been added".\par
77047704
2.4.2.0 Optimize Screen Capture now has options for comparing with any previous image and comparing with the last image. File Transfer Settings now has options for deleting the local file upon successful upload and keeping failed uploads in queue and retrying until a successful upload has been achieved.\par
77057705
2.4.1.9 Screenshots count is reset when screenshots limit is reached to avoid falling into an infinite loop. New trigger actions Restart Screen Capture, \f2 Delete Screenshots By Cycle Count, and Delete Screenshots From Oldest Capture Cycle\f1 . New command "-restart". \f2 New macro tag "%capturenow%".\f1 \f2 Screenshots that fail to upload to an SFTP server will try to upload to the same SFTP server \f1 in the next capture cycle\f2 \f1 until\f2 \f1 the upload is successful.\par

interface/main/FormMain-Screenshots.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,12 +1203,15 @@ private bool UploadScreenshot(string host, string path, string macroPath)
12031203
string destinationFolder = Path.GetDirectoryName(macroPath);
12041204
string destinationFilename = Path.GetFileName(macroPath);
12051205

1206+
bool isLinuxServer = Convert.ToBoolean(_config.Settings.SFTP.GetByKey("FileTransferIsLinuxServer", _config.Settings.DefaultSettings.FileTransferIsLinuxServer).Value);
1207+
12061208
_log.WriteDebugMessage("Attempting to upload screenshot to file server");
12071209
_log.WriteDebugMessage("Source (Local) Path: " + path);
12081210
_log.WriteDebugMessage("Destination (Remote) Folder Path: " + destinationFolder);
12091211
_log.WriteDebugMessage("Destination (Remote) Filename: " + destinationFilename);
1212+
_log.WriteDebugMessage("Is Linux Server: " + isLinuxServer.ToString());
12101213

1211-
if (_sftpClient.UploadFile(path, destinationFolder, destinationFilename))
1214+
if (_sftpClient.UploadFile(path, destinationFolder, destinationFilename, isLinuxServer))
12121215
{
12131216
_log.WriteDebugMessage("Successfully uploaded screenshot");
12141217

interface/settings/FormFileTransferSettings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ private void buttonOK_Click(object sender, EventArgs e)
6767
_config.Settings.SFTP.GetByKey("FileTransferServerPort", _config.Settings.DefaultSettings.FileTransferServerPort).Value = numericUpDownPort.Value;
6868
_config.Settings.SFTP.GetByKey("FileTransferClientUsername", _config.Settings.DefaultSettings.FileTransferClientUsername).Value = textBoxUsername.Text;
6969
_config.Settings.SFTP.GetByKey("FileTransferClientPassword", _config.Settings.DefaultSettings.FileTransferClientPassword).Value = textBoxPassword.Text;
70+
_config.Settings.SFTP.GetByKey("FileTransferIsLinuxServer", _config.Settings.DefaultSettings.FileTransferIsLinuxServer).Value = checkBoxIsLinux.Checked;
7071

7172
_config.Settings.SFTP.Save(_config.Settings, _fileSystem);
7273

0 commit comments

Comments
 (0)