Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Lipkau, Oliver Mark (Atos) committed Jun 17, 2015
1 parent dff8d85 commit 4d51660
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 42 deletions.
12 changes: 4 additions & 8 deletions Actions/FTPUpload.ahk
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
;~ #include %A_ScriptDir%\Lib\FTP.ahk
#include %A_ScriptDir%\Lib\WinSCP.ahk
Class CFTPUploadAction Extends CAction
{
Expand Down Expand Up @@ -246,14 +245,13 @@ Class CFTPUploadAction Extends CAction
FileGetSize, size, % Data.File
WorkerThread.CurrentFile.FileSize := size
if(!this.HasKey("tmpNotificationWindow"))
this.tmpNotificationWindow := Notify("Uploading " this.tmpNumFiles " file" (this.tmpNumFiles = 1 ? "":"s") " to " WorkerThread.Task.Parameters[4], Data.RemoteName " - " FormatFileSize(0) " / " FormatFileSize(size), "", NotifyIcons.Internet, "", {min : 0, max : 100, value : 0})
this.tmpNotificationWindow := Notify("Uploading " this.tmpNumFiles " file" (this.tmpNumFiles = 1 ? "":"s") " to " WorkerThread.Task.Parameters[4], Data.RemoteName " - " FormatFileSize(size), "", NotifyIcons.Internet, "", {min : 0, max : 100, value : 0})
else
{
this.tmpNumFiles--
this.tmpNotificationWindow.Title := "Uploading " this.tmpNumFiles " file" (this.tmpNumFiles = 1 ? "":"s") " to " WorkerThread.Task.Parameters[4]
this.tmpNotificationWindow.Text := Data.RemoteName " - " FormatFileSize(0) " / " FormatFileSize(size)
;~ ; Toggle for single file progress
;~ this.tmpNotificationWindow.Progress := 0
this.tmpNotificationWindow.Text := Data.RemoteName " - " FormatFileSize(size)
this.tmpNotificationWindow.Progress := 0
}
}
}
Expand Down Expand Up @@ -399,9 +397,7 @@ session_FileTransferProgress(sender, e)
OverallProgress := Round(e.OverallProgress * 100)

;Report progress
FTP.WorkerThread.Progress := OverallProgress
;~ ; Toggle for single file progress
;~ FTP.WorkerThread.Progress := FileProgress
FTP.WorkerThread.Progress := FileProgress
}
Action_Upload_Placeholders_SourceFiles:
GetCurrentSubEvent().GuiShow("", "Placeholders_SourceFiles")
Expand Down
6 changes: 1 addition & 5 deletions CSettingsWindow.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -1819,15 +1819,12 @@ Finally, here are some settings that you're likely to change at the beginning:
Try
{
;Open Connection
a := FTPSession.OpenConnection()
FTPSession.OpenConnection()
;~ FTPSession.Dispose()
MsgBox % "Connection to " Settings.Hostname " successfully established!"
} catch e
MsgBox % "Could not connect to " Settings.HostName "!"




;~ try
;~ FTPSession.Dispose()
}
Expand Down Expand Up @@ -2435,7 +2432,6 @@ PrepareFolderBand:
PrepareFolderBand()
return


Settings_EditEvent:
SettingsWindow.EditEvent(0)
return
Expand Down
1 change: 0 additions & 1 deletion Globals.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ global WIN_XP64 := 5.2
global WIN_VISTA := 6.0
global WIN_7 := 6.1
global WIN_8 := 6.2

global WinSCPEnum:= {FtpMode:{Passive:0,Active:1},FtpSecure:{None:0,Implicit:1,ExplicitTls:2,ExplicitSsl:3},FtpProtocol:{Sftp:0,Scp:1,Ftp:2},TransferMode:{Binary:0,Ascii:1,Automatic:2},SynchronizationMode:{Local:0,Remote:1,Both:2},SynchronizationCriteria:{None:0,Time:1,Size:2,Either:3}}

;~ global Vista7 := IsVista7()
Expand Down
43 changes: 15 additions & 28 deletions Lib/WinSCP.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -36,32 +36,32 @@ Scope
Description
Example on how to zse the FileTransferred Event
*/
session_FileTransferred(sender, e)
{
;~ MsgBox % e.FileName " => " e.Destination
}
;~ session_FileTransferred(sender, e)
;~ {
;~ ;MsgBox % e.FileName " => " e.Destination
;~ }

/*
Description
Example on how to zse the Failed Event
*/
session_Failed(sender, e)
{
;~ MsgBox % e.FileName " => " e.Destination
}
;~ session_Failed(sender, e)
;~ {
;~ ;MsgBox % e.FileName " => " e.Destination
;~ }

/*
Description
Example on how to zse the RemovalEventArgs Event
http://winscp.net/eng/docs/library_removaleventargs
*/
session_RemovalEventArgs(sender, e)
{
;~ if (e.Error)
;~ MsgBox % "Failed to remove " e.FileName " => " e.Error
;~ else
;~ MsgBox % "Removed " e.FileName
}
;~ session_RemovalEventArgs(sender, e)
;~ {
;~ ;if (e.Error)
;~ ;MsgBox % "Failed to remove " e.FileName " => " e.Error
;~ ;else
;~ ;MsgBox % "Removed " e.FileName
;~ }

/*
Description
Expand All @@ -75,15 +75,6 @@ Description
;~ FileProgress := Round(e.FileProgress * 100)
;~ OverallProgress := Round(e.OverallProgress * 100)
;~ action := (e.Side==0) ? "Uploading" : "Downloading"

;~ GuiControl,, txtTitle, % action " @ " CPS " kbps"
;~ GuiControl,, edtFileName, % FileName
;~ GuiControl,, proFileName, % FileProgress
;~ GuiControl,, proOverall, % OverallProgress
;~ if (OverallProgress==100)
;~ GuiControl, Enable, btnClose

;~ Gui, Show, , File Transfere
;~ }

;~ -----------------------------------------------------
Expand Down Expand Up @@ -355,8 +346,6 @@ class WinSCP extends CFTPUploadAction
*/
GetFiles(remotePath, localPath, remove=false)
{
global WinSCPEnum ; WinSCP Enums

;~ Check
;remove
if remove not in 0,1
Expand Down Expand Up @@ -392,8 +381,6 @@ class WinSCP extends CFTPUploadAction
*/
PutFiles(localPath, remotePath, remove:=false)
{
global WinSCPEnum ; WinSCP Enums

;~ Checks
;localPath
if (!FileExist(localPath))
Expand Down

0 comments on commit 4d51660

Please sign in to comment.