From 0afdf837811c848642baf25eeaa8c542b49c02f2 Mon Sep 17 00:00:00 2001 From: Thomas Maul Date: Wed, 27 Apr 2022 10:48:14 +0200 Subject: [PATCH] 1.0.1 - rewrite progress bar+stop button without using storage and project variable --- Documentation/Classes/FileTransfer_Dropbox.md | 13 + Documentation/Classes/FileTransfer_GDrive.md | 13 + Documentation/Classes/FileTransfer_curl.md | 85 ++-- Documentation/Readme_curl.MD | 13 +- .../Sources/Classes/FileTransfer_Dropbox.4dm | 5 +- .../Sources/Classes/FileTransfer_GDrive.4dm | 5 +- Project/Sources/Classes/FileTransfer_curl.4dm | 36 +- .../Classes/SystemWorkerProperties.4dm | 33 +- Project/Sources/Methods/ProgressCallback.4dm | 49 +- Project/Sources/Methods/test_GDrive.4dm | 20 +- Project/Sources/Methods/test_curl.4dm | 450 ++++++++---------- Project/Sources/Methods/test_dropbox.4dm | 18 +- Project/Sources/settings.4DSettings | 4 +- Release Notes.MD | 18 + Resources/en.lproj/syntaxEN.json | 226 +++++---- 15 files changed, 485 insertions(+), 503 deletions(-) create mode 100644 Release Notes.MD diff --git a/Documentation/Classes/FileTransfer_Dropbox.md b/Documentation/Classes/FileTransfer_Dropbox.md index b4bc8b7..d51982f 100644 --- a/Documentation/Classes/FileTransfer_Dropbox.md +++ b/Documentation/Classes/FileTransfer_Dropbox.md @@ -31,6 +31,7 @@ End if |[.executeCommand](#executecommand)

    Allows to pass any valid Dropbox command and directly execute it.| |[.version](#version)

    returns in result.data version information from Dropbox Command Line Interface Tool| |[.setPath](#setpath)

    Allows to use another dbxcli installation.| +|[.enableStopButton](#enablestopbutton)

    Display stop button in progress dialog.| |[.setAsyncMode](#setasyncmode)

    By default all commands are executed synchronously, meaning the command do not return till execution is completed or a timeout occurred. This allows all command to return the result or execution information..| |[.setTimeout](#settimeout)

    sets a maximum worker execution time, stopping everything.| |[.stop](#stop)

    Terminates the execution of a running operation, such as upload or download.| @@ -239,6 +240,18 @@ sets a maximum execution time for the worker. By default all operations are stop The timeout is not considered when asynchronous mode is enabled. +## enableStopButton + +### .enableStopButton(enable:Shared Object) +|Parameter|Type||Description| +|---------|--- |:---:|------| +|enable|Object|->|Shared Object with Attribut Stop| + +#### Description +Only useable if included or similar ProgressCallback method is used. +If passed it enables the stop button in progress bar, allowing the end user to abort the operation. If Stop button is clicked, attribut of shared object enable.stop is set to true + + ## setAsyncMode ### .setAsyncMode(async:Boolean) diff --git a/Documentation/Classes/FileTransfer_GDrive.md b/Documentation/Classes/FileTransfer_GDrive.md index 81ad574..459ce4c 100644 --- a/Documentation/Classes/FileTransfer_GDrive.md +++ b/Documentation/Classes/FileTransfer_GDrive.md @@ -37,6 +37,7 @@ End if |[.executeCommand](#executecommand)

    Allows to pass any valid GDrive command and directly execute it.| |[.version](#version)

    returns in result.data version information from Gdrive Command Line Interface Tool| |[.setPath](#setpath)

    Allows to specify the installation path.| +|[.enableStopButton](#enablestopbutton)

    Display stop button in progress dialog.| |[.setAsyncMode](#setasyncmode)

    By default all commands are executed synchronously, meaning the command do not return till execution is completed or a timeout occurred. This allows all command to return the result or execution information..| |[.setTimeout](#settimeout)

    sets a maximum worker execution time, stopping everything.| |[.stop](#stop)

    Terminates the execution of a running operation, such as upload or download.| @@ -350,6 +351,18 @@ Precompiled versions for Mac and Windows can be downloaded from: [gdrive](https://github.com/prasmussen/gdrive/releases) +## enableStopButton + +### .enableStopButton(enable:Shared Object) +|Parameter|Type||Description| +|---------|--- |:---:|------| +|enable|Object|->|Shared Object with Attribut Stop| + +#### Description +Only useable if included or similar ProgressCallback method is used. +If passed it enables the stop button in progress bar, allowing the end user to abort the operation. If Stop button is clicked, attribut of shared object enable.stop is set to true + + ## setAsyncMode ### .setAsyncMode(async:Boolean) diff --git a/Documentation/Classes/FileTransfer_curl.md b/Documentation/Classes/FileTransfer_curl.md index e181505..d80e6e9 100644 --- a/Documentation/Classes/FileTransfer_curl.md +++ b/Documentation/Classes/FileTransfer_curl.md @@ -43,6 +43,7 @@ For more examples see the method "test_curl". |[.setCurlPrefix](#setcurlprefix)

    Allows to use any additional cURL options.| |[.setPath](#setpath)

    Allows to use another cURL installation.| |[.enableProgressData](#enableprogressdata)

    If enabled, result.data will include progress information text.| +|[.enableStopButton](#enablestopbutton)

    Display stop button in progress dialog.| |[.setAsyncMode](#setasyncmode)

    By default all commands are executed synchronously, meaning the command do not return till execution is completed or a timeout occurred. This allows all command to return the result or execution information..| |[.setTimeout](#settimeout)

    sets a maximum worker execution time, stopping everything.| |[.stop](#stop)

    Terminates the execution of a running operation, such as upload or download.| @@ -400,6 +401,17 @@ If enabled, result.data will include progress information text, allowing to get Depending of total transfer time, the text will include additional lines with progress info. Automatically enabled if useCallback is enabled. +## enableStopButton + +### .enableStopButton(enable:Shared Object) +|Parameter|Type||Description| +|---------|--- |:---:|------| +|enable|Object|->|Shared Object with Attribut Stop| + +#### Description +Only useable if included or similar ProgressCallback method is used. +If passed it enables the stop button in progress bar, allowing the end user to abort the operation. If Stop button is clicked, attribut of shared object enable.stop is set to true + ## setAsyncMode ### .setAsyncMode(async:Boolean) @@ -470,7 +482,7 @@ The command returns after given wait time or before if execution is finished. |Parameter|Type||Description| |---------|--- |:---:|------| |callback|4D.Function|->|4d function to call during progress| -|ID|Text|->|unique text to pass to callback method to identify job| +|ID|Text|->|text to display in progress title, such as download file name| #### Description Allows to show a progress bar during long running operations or to get informed when command execution is complete. @@ -481,52 +493,63 @@ The callback method is called whenever a new progress message is available from ```4D $ftp.useCallback(Formula(ProgressCallback); "Download 4D.dmg") -$ftp.setAsyncMode(True) $result:=$ftp.download($source; $target) -Repeat - $ftp.wait(1) // needed while our process is running - // wait is not needed if a form would be open or if a worker would handle the job - $status:=$ftp.status() -Until (Bool($status.terminated)) +If ($checkstop.stop=True) // user clicked stop button +... +End if ``` Method ProgressCallback ```4D -#DECLARE($ID : Text; $message : Text; $value : Integer) +#DECLARE($ID : Text; $message : Text; $value : Integer; $sharedForProgressBar : Object) // called from cs.FileTransfer if callback is set via .useCallback() // $ID is set through code - $message comes from curl +// shared object to pass progress ID back/forth and to share stop button result -var ProgressBarID : Integer +$ProgressBarID:=$sharedForProgressBar.ID -If (ProgressBarID=0) - ProgressBarID:=Progress New - Progress SET MESSAGE(ProgressBarID; $ID) +If (($ProgressBarID=0) && ($value#100)) + $ProgressBarID:=Progress New + Use ($sharedForProgressBar) + $sharedForProgressBar.ID:=$ProgressBarID + End use + Progress SET TITLE($ProgressBarID; $ID) + + // check if we want stop, if yes, add stop button + If ($sharedForProgressBar.EnableButton#Null) + Progress SET BUTTON ENABLED($ProgressBarID; True) + End if End if -If ($value=100) - Progress QUIT(ProgressBarID) - ProgressBarID:=0 -Else - Progress SET PROGRESS(ProgressBarID; $value/100) +If ($ProgressBarID#0) + If (Progress Stopped($ProgressBarID)) // only if stop button is enabled + Use ($sharedForProgressBar) + $sharedForProgressBar.Stop:=True + Use ($sharedForProgressBar.EnableButton) + $sharedForProgressBar.EnableButton.stop:=True + End use + End use + End if + + Case of + : ($value=100) + Progress QUIT($ProgressBarID) + Use ($sharedForProgressBar) + $sharedForProgressBar.ID:=0 + End use + : ($value<0) + $message2:=Replace string($message; " "; "") // ignore totally empty messages, happens with gdrive + If ($message2#"") + Progress SET MESSAGE($ProgressBarID; $message) + End if + Else + Progress SET PROGRESS($ProgressBarID; $value/100) + End case End if -``` -To support the stop button in the progress bar, Storage needs to be used to share progress bar and worker IDs. See example in test_curl - download. -```4D - // enable stop button in progress bar - Use (Storage.FileTransfer_Progress) - Storage.FileTransfer_Progress[$progressid]:=New shared object() - End use - $ftp.useCallback(Formula(ProgressCallback); $progressid) ``` -After execution of download/upload/etc, check: -```4D - If (Bool(Storage.FileTransfer_Progress[$progressid].Stop)) // check stop button if it was set, remove from storage - // user canceled!! -``` -Don't forget to remove the object from storage when done. See test_curl - download for a full example \ No newline at end of file diff --git a/Documentation/Readme_curl.MD b/Documentation/Readme_curl.MD index f58e7ed..9180b5c 100644 --- a/Documentation/Readme_curl.MD +++ b/Documentation/Readme_curl.MD @@ -92,18 +92,7 @@ While FTPS is using standard TLS certificates (similar to HTTPS), SFTP is using [From Wikipedia](https://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol) This protocol assumes that it is run over a secure channel, such as SSH, that the server has already authenticated the client, and that the identity of the client user is available to the protocol. -While you normally do not simply provide credentials (user+password) to login, you need to estabilish upfront a SSH connection to store the ssh key from the SFTP Server in the local keyring. The benefit is that you do not need username+password for login, all goes through keys. But it is possible to use user+password similar as for FTPS, while you need to be aware that in this case you cannot trust that the connection really go to the right server, this is a possible security issue. - -Most easiest way to check, exchange and store client and server keys is to open a terminal window (using Terminal on Mac/Terminal or Console on Windows) and enter: -``` -ssh username@sftp.servername.com -``` - -This will request the password and display the ssh hash, asking if you accept to store it in your .ssh/authorized_keys file. -In a similar way you could exchange keys upfront to avoid using passwords at all to enhance security. -Google "ssh key authentication" for more help and examples. - -As soon the authentication was done once via ssh (or the key is stored in your authorized_keys file by another way), the class can be used without providing credentials, just the URL is enough. +Using SFTP you might either use username+password as you would do with FTPS, or exchange keys. To use SFTP via keys, establish upfront a SSH connection using Terminal, this setup will be reused from cURL. # Class Documentation diff --git a/Project/Sources/Classes/FileTransfer_Dropbox.4dm b/Project/Sources/Classes/FileTransfer_Dropbox.4dm index fc1cc8a..a7fd2e0 100644 --- a/Project/Sources/Classes/FileTransfer_Dropbox.4dm +++ b/Project/Sources/Classes/FileTransfer_Dropbox.4dm @@ -111,6 +111,9 @@ Function setTimeout($timeout : Integer) Function setAsyncMode($async : Boolean) This:C1470._async:=$async +Function enableStopButton($enable : Object) + This:C1470._enableStopButton:=$enable + Function stop() If (This:C1470._worker#Null:C1517) This:C1470._worker.terminate() @@ -155,7 +158,7 @@ Function _parseDirListing($success : Object) Function _runWorker($para : Text)->$result : Object If (This:C1470._Callback#Null:C1517) - $workerpara:=cs:C1710.SystemWorkerProperties.new("dropbox"; This:C1470.onData; This:C1470._Callback; This:C1470._CallbackID) + $workerpara:=cs:C1710.SystemWorkerProperties.new("dropbox"; This:C1470.onData; This:C1470._Callback; This:C1470._CallbackID; This:C1470._enableStopButton) Else $workerpara:=cs:C1710.SystemWorkerProperties.new("dropbox"; This:C1470.onData) End if diff --git a/Project/Sources/Classes/FileTransfer_GDrive.4dm b/Project/Sources/Classes/FileTransfer_GDrive.4dm index 8632e5a..d1b5b9c 100644 --- a/Project/Sources/Classes/FileTransfer_GDrive.4dm +++ b/Project/Sources/Classes/FileTransfer_GDrive.4dm @@ -318,6 +318,9 @@ Function useCallback($callback : 4D:C1709.Function; $ID : Text) Function setAsyncMode($async : Boolean) This:C1470._async:=$async +Function enableStopButton($enable : Object) + This:C1470._enableStopButton:=$enable + Function setTimeout($timeout : Integer) This:C1470._timeout:=$timeout @@ -373,7 +376,7 @@ Function _parseDirListing($success : Object) Function _runWorker($para : Text)->$result : Object If (This:C1470._Callback#Null:C1517) - $workerpara:=cs:C1710.SystemWorkerProperties.new("gdrive"; This:C1470.onData; This:C1470._Callback; This:C1470._CallbackID) + $workerpara:=cs:C1710.SystemWorkerProperties.new("gdrive"; This:C1470.onData; This:C1470._Callback; This:C1470._CallbackID; This:C1470._enableStopButton) Else $workerpara:=cs:C1710.SystemWorkerProperties.new("gdrive"; This:C1470.onData) End if diff --git a/Project/Sources/Classes/FileTransfer_curl.4dm b/Project/Sources/Classes/FileTransfer_curl.4dm index f5c0d63..b218668 100644 --- a/Project/Sources/Classes/FileTransfer_curl.4dm +++ b/Project/Sources/Classes/FileTransfer_curl.4dm @@ -17,6 +17,7 @@ Class constructor($hostname : Text; $username : Text; $password : Text; $protoco This:C1470._return:=Char:C90(10) //Char(13)+Char(10) End if This:C1470._timeout:=0 + This:C1470._enableStopButton:=False:C215 //MARK: Settings Function validate()->$success : Object @@ -75,6 +76,9 @@ Function setPath($path : Text) Function enableProgressData($enable : Boolean) This:C1470._noProgress:=Not:C34($enable) +Function enableStopButton($enable : Object) + This:C1470._enableStopButton:=$enable + Function useCallback($callback : 4D:C1709.Function; $ID : Text) ASSERT:C1129(Value type:C1509($callback)=Is object:K8:27; "Callback must be of type function") ASSERT:C1129(OB Instance of:C1731($callback; 4D:C1709.Function); "Callback must be of type function") @@ -303,7 +307,7 @@ Function _buildURL()->$url : Text Function _runWorker($para : Text)->$result : Object If (This:C1470._Callback#Null:C1517) - $workerpara:=cs:C1710.SystemWorkerProperties.new("curl"; This:C1470.onData; This:C1470._Callback; This:C1470._CallbackID) + $workerpara:=cs:C1710.SystemWorkerProperties.new("curl"; This:C1470.onData; This:C1470._Callback; This:C1470._CallbackID; This:C1470._enableStopButton) Else $workerpara:=cs:C1710.SystemWorkerProperties.new("curl"; This:C1470.onData) End if @@ -338,7 +342,6 @@ Function _runWorker($para : Text)->$result : Object $command:=$path+" "+$para $old:=Method called on error:C704 ON ERR CALL:C155(Formula:C1597(ErrorHandler).source) - $workerpara.variables:=New object:C1471("userCancel"; "false") This:C1470._worker:=4D:C1709.SystemWorker.new($command; $workerpara) $worker:=This:C1470._worker @@ -348,25 +351,22 @@ Function _runWorker($para : Text)->$result : Object Else $waittimeout:=(This:C1470._timeout=0) ? 60 : This:C1470._timeout $worker.wait($waittimeout) - If (Bool:C1537($worker.userCancel)) - $result:=New object:C1471("responseError"; "Cancel by user"; "success"; False:C215) - Else - If (($worker.responseError#Null:C1517) && ($worker.responseError#"")) - $result:=New object:C1471("responseError"; $worker.responseError; "success"; False:C215) - $pos:=Position:C15("curl: "; $worker.responseError; *) - If ($pos>0) - $result.error:=Replace string:C233(Substring:C12($worker.responseError; $pos+6); Char:C90(10); "") + + If (($worker.responseError#Null:C1517) && ($worker.responseError#"")) + $result:=New object:C1471("responseError"; $worker.responseError; "success"; False:C215) + $pos:=Position:C15("curl: "; $worker.responseError; *) + If ($pos>0) + $result.error:=Replace string:C233(Substring:C12($worker.responseError; $pos+6); Char:C90(10); "") + Else + // seems not to be an error, curl set's process bar in error and no result in response. + If ($worker.response#"") + $result:=New object:C1471("data"; $worker.response; "success"; True:C214) Else - // seems not to be an error, curl set's process bar in error and no result in response. - If ($worker.response#"") - $result:=New object:C1471("data"; $worker.response; "success"; True:C214) - Else - $result:=New object:C1471("data"; $worker.responseError; "success"; True:C214) - End if + $result:=New object:C1471("data"; $worker.responseError; "success"; True:C214) End if - Else - $result:=New object:C1471("data"; $worker.response; "success"; True:C214) End if + Else + $result:=New object:C1471("data"; $worker.response; "success"; True:C214) End if End if Else diff --git a/Project/Sources/Classes/SystemWorkerProperties.4dm b/Project/Sources/Classes/SystemWorkerProperties.4dm index 114f923..ee69c4e 100644 --- a/Project/Sources/Classes/SystemWorkerProperties.4dm +++ b/Project/Sources/Classes/SystemWorkerProperties.4dm @@ -1,4 +1,4 @@ -Class constructor($type : Text; $data : Object; $callback : 4D:C1709.Function; $callbackID : Text) +Class constructor($type : Text; $data : Object; $callback : 4D:C1709.Function; $callbackID : Text; $stopButton : Object) This:C1470.type:=$type This:C1470.encoding:="UTF-8" This:C1470.dataType:="text" @@ -17,28 +17,38 @@ Class constructor($type : Text; $data : Object; $callback : 4D:C1709.Function; $ Else This:C1470._return:=Char:C90(13) End if + // we need to share an object for stop button with progress worker. No need for Storage, only these two processes + // needs access + This:C1470.SharedForProgressBar:=New shared object:C1526("ID"; 0; "Stop"; False:C215; "EnableButton"; This:C1470.stopbutton) Function onData($systemworker : Object; $data : Object) + This:C1470.data.text+=$data.data + // not needed for Curl // in Gdrive or Dropbox used when asking for Authentication - This:C1470.data.text+=$data.data If ((This:C1470.type="gdrive") && (This:C1470.data.text="@Authentication@")) $systemworker.terminate() + return End if If ((This:C1470.type="dropbox") && (This:C1470.data.text="@authorization@")) $systemworker.terminate() + return + End if + + // check for stop button in progress bar + If (Bool:C1537(This:C1470.SharedForProgressBar.Stop)) + $systemworker.terminate() + return End if Function onDataError($systemworker : Object; $data : Object) // called when data is received from curl or dropbox to handle progress bar // check for stop button in progress bar - If ((This:C1470.callbackID#"") && (This:C1470.callback#Null:C1517)) - If (Bool:C1537(Storage:C1525.FileTransfer_Progress[This:C1470.callbackID].Stop)) - $systemworker.terminate() - return - End if + If (Bool:C1537(This:C1470.SharedForProgressBar.Stop)) + $systemworker.terminate() + return End if If (String:C10($data.data)#"") @@ -49,14 +59,14 @@ Function onDataError($systemworker : Object; $data : Object) : (This:C1470.type="gdrive") $pos:=Position:C15(Char:C90(13); This:C1470.data.text) If ($pos>0) - CALL WORKER:C1389("FileTransferProgress"; This:C1470.callback.source; This:C1470.callbackID; Substring:C12(This:C1470.data.text; 1; $pos-1); -1) + CALL WORKER:C1389("FileTransferProgress"; This:C1470.callback.source; This:C1470.callbackID; Substring:C12(This:C1470.data.text; 1; $pos-1); -1; This:C1470.SharedForProgressBar) This:C1470.data.text:=Substring:C12(This:C1470.data.text; $pos+1) End if : (This:C1470.type="dropbox") $pos:=Position:C15(This:C1470._return; This:C1470.data.text) If ($pos>0) If ($pos=Length:C16(This:C1470.data.text)) // Dropbox - CALL WORKER:C1389("FileTransferProgress"; This:C1470.callback.source; This:C1470.callbackID; This:C1470.data.text; -1) + CALL WORKER:C1389("FileTransferProgress"; This:C1470.callback.source; This:C1470.callbackID; This:C1470.data.text; -1; This:C1470.SharedForProgressBar) This:C1470.data.text:="" End if End if @@ -66,14 +76,14 @@ Function onDataError($systemworker : Object; $data : Object) This:C1470.data.text:=Substring:C12(This:C1470.data.text; $pos+1) $progress:=Num:C11(Substring:C12($message; 1; 3)) If ($progress#0) - CALL WORKER:C1389("FileTransferProgress"; This:C1470.callback.source; This:C1470.callbackID; $message; $progress) + CALL WORKER:C1389("FileTransferProgress"; This:C1470.callback.source; This:C1470.callbackID; $message; $progress; This:C1470.SharedForProgressBar) End if End case End if End if Function onTerminate($systemworker : Object; $data : Object) - CALL WORKER:C1389("FileTransferProgress"; This:C1470.callback.source; This:C1470.callbackID; ""; 100) + CALL WORKER:C1389("FileTransferProgress"; This:C1470.callback.source; This:C1470.callbackID; ""; 100; This:C1470.SharedForProgressBar) //This._createFile("onTerminate"; $data.data) @@ -81,3 +91,4 @@ Function onTerminate($systemworker : Object; $data : Object) Function _createFile($title : Text; $textBody : Text) // debug only TEXT TO DOCUMENT:C1237(Get 4D folder:C485(Current resources folder:K5:16)+$title+".txt"; $textBody) + \ No newline at end of file diff --git a/Project/Sources/Methods/ProgressCallback.4dm b/Project/Sources/Methods/ProgressCallback.4dm index c21d6a9..075af97 100644 --- a/Project/Sources/Methods/ProgressCallback.4dm +++ b/Project/Sources/Methods/ProgressCallback.4dm @@ -1,54 +1,41 @@ //%attributes = {} -#DECLARE($ID : Text; $message : Text; $value : Integer) +#DECLARE($ID : Text; $message : Text; $value : Integer; $sharedForProgressBar : Object) // called from cs.FileTransfer if callback is set via .useCallback() // $ID is set through code - $message comes from curl +// shared object to pass progress ID back/forth and to share stop button result -C_COLLECTION:C1488(FileTransfer_ProgressBarCol) -If (FileTransfer_ProgressBarCol=Null:C1517) - FileTransfer_ProgressBarCol:=New collection:C1472 -End if - -$currentProgress:=FileTransfer_ProgressBarCol.query("ID=:1"; $ID) -If ($currentProgress.length#0) - $ProgressBarID:=$currentProgress[0].progressID -Else - $ProgressBarID:=0 -End if +$ProgressBarID:=$sharedForProgressBar.ID If (($ProgressBarID=0) && ($value#100)) $ProgressBarID:=Progress New + Use ($sharedForProgressBar) + $sharedForProgressBar.ID:=$ProgressBarID + End use Progress SET TITLE($ProgressBarID; $ID) - FileTransfer_ProgressBarCol.push(New object:C1471("ID"; $ID; "progressID"; $ProgressBarID)) - // check if we want stop, if yes, add it to storage - If (Storage:C1525.FileTransfer_Progress[$id]#Null:C1517) - Use (Storage:C1525.FileTransfer_Progress[$id]) - Storage:C1525.FileTransfer_Progress[$id].ProgressID:=$ProgressBarID - Storage:C1525.FileTransfer_Progress[$id].Stop:=False:C215 - End use + // check if we want stop, if yes, add stop button + If ($sharedForProgressBar.EnableButton#Null:C1517) Progress SET BUTTON ENABLED($ProgressBarID; True:C214) End if End if If ($ProgressBarID#0) If (Progress Stopped($ProgressBarID)) // only if stop button is enabled - $col:=OB Keys:C1719(Storage:C1525.FileTransfer_Progress) - For each ($key; $col) - If ($key=$ID) - Use (Storage:C1525.FileTransfer_Progress[$key]) - Storage:C1525.FileTransfer_Progress[$key].Stop:=True:C214 - End use - End if - End for each + Use ($sharedForProgressBar) + $sharedForProgressBar.Stop:=True:C214 + Use ($sharedForProgressBar.EnableButton) + $sharedForProgressBar.EnableButton.stop:=True:C214 + End use + End use End if + Case of : ($value=100) Progress QUIT($ProgressBarID) - // aus Col entfernen - $index:=FileTransfer_ProgressBarCol.indexOf($currentProgress[0]) - FileTransfer_ProgressBarCol.remove($index) - $ProgressBarID:=0 + Use ($sharedForProgressBar) + $sharedForProgressBar.ID:=0 + End use : ($value<0) $message2:=Replace string:C233($message; " "; "") // ignore totally empty messages, happens with gdrive If ($message2#"") diff --git a/Project/Sources/Methods/test_GDrive.4dm b/Project/Sources/Methods/test_GDrive.4dm index f1d7cbf..f64e5e1 100644 --- a/Project/Sources/Methods/test_GDrive.4dm +++ b/Project/Sources/Methods/test_GDrive.4dm @@ -114,7 +114,7 @@ If (False:C215) // normally we are supposed to do something else and either // check from time to time or to use the callback method to inform us (percent=100) Repeat - $ftp.wait(1) // needed while our process is running + $ftp.wait(0.1) // needed while our process is running // wait is not needed if a form would be open or if a worker would handle the job $status:=$ftp.status() @@ -125,32 +125,20 @@ End if If (True:C214) // export $progressid:="export slide show" - If (Storage:C1525.FileTransfer_Progress=Null:C1517) - Use (Storage:C1525) - Storage:C1525.FileTransfer_Progress:=New shared object:C1526 - End use - End if - // enable stop button in progress bar - Use (Storage:C1525.FileTransfer_Progress) - Storage:C1525.FileTransfer_Progress[$progressid]:=New shared object:C1526() - End use - + $checkstop:=New shared object:C1526("stop"; False:C215) + $ftp.enableStopButton($checkstop) $ftp.useCallback(Formula:C1597(ProgressCallback); $progressid) $ftp.setAsyncMode(False:C215) $target:=System folder:C487(Desktop:K41:16)+"result.pdf" $target:=Convert path system to POSIX:C1106($target) $source:="TAM February 2022" $result:=$ftp.export($source; $target; ""; "application/vnd.openxmlformats-officedocument.presentationml.presentation") - If (Bool:C1537(Storage:C1525.FileTransfer_Progress[$progressid].Stop)) // check stop button if it was set, remove from storage - // user canceled!! + If ($checkstop.stop=True:C214) // user clicked stop button// user canceled!! Else If ($result.success) $answer:=$result.data End if End if - Use (Storage:C1525.FileTransfer_Progress) // clear storage - OB REMOVE:C1226(Storage:C1525.FileTransfer_Progress; $progressid) - End use End if diff --git a/Project/Sources/Methods/test_curl.4dm b/Project/Sources/Methods/test_curl.4dm index 0fa8765..587666f 100644 --- a/Project/Sources/Methods/test_curl.4dm +++ b/Project/Sources/Methods/test_curl.4dm @@ -1,246 +1,204 @@ -//%attributes = {} -// overwrite or modify this to get your own credentials! -// url like ftp.4D.com or ftp.4d.com:1234 -// if you use ftps or sftp, also modify the last parameter (protocol) in .new() below -// don't add the protocol to the hostname, don't use https://xxx or ftp://xxx -$credentialspath:=Get 4D folder:C485(Database folder:K5:14) -$folder:=Folder:C1567($credentialspath; fk platform path:K87:2) -$credentialsfile:=$folder.parent.file("credentials.txt").getText() -$credentials:=JSON Parse:C1218($credentialsfile) -If (True:C214) - $credentials.url:="192.168.10.54:3421" - // $credentials.user:="myself" - // $credentials.password:="notmypass" -End if - -var $ftp : cs:C1710.FileTransfer_curl -$ftp:=cs:C1710.FileTransfer_curl.new($credentials.url; $credentials.user; $credentials.pass; "ftp") -//$ftp.setPath("/opt/homebrew/opt/curl/bin/curl") -//$ftp.setPath("C:\\Users\\thomas.DE\\Documents\\4D\\Komponenten\\curl.exe") -$ftp.setConnectTimeout(5) - -If (False:C215) - $result:=$ftp.version() - If ($result.success) - $answer:=$result.data - End if -End if - -If (False:C215) - $result:=$ftp.validate() - If ($result.success) - - Else - $error:=$result.error - End if -End if - - - -If (False:C215) - $source:=System folder:C487(Desktop:K41:16)+"test2.txt" - $source:=Convert path system to POSIX:C1106($source) - $result:=$ftp.upload($source; "/test3.txt") - If ($result.success) - $answer:=$result.data - End if -End if - -If (False:C215) - $source:=System folder:C487(Desktop:K41:16)+"test2.txt" - $source:=Convert path system to POSIX:C1106($source) - $ftp.setAutoCreateRemoteDirectory(True:C214) - $ftp.setAutoCreateLocalDirectory(True:C214) - $result:=$ftp.upload($source; "/meinfolder/test3.txt") - If ($result.success) - $answer:=$result.data - End if -End if - -If (False:C215) - $result:=$ftp.getDirectoryListing("/") - If ($result.success) - $list:=$result.list - End if -End if - -If (False:C215) - //$ftp.useCallback(Formula(ProgressCallback); "ProgressCallback") - - $source:="/test2.txt" - $target:=System folder:C487(Desktop:K41:16)+"newtest2.txt" - $target:=Convert path system to POSIX:C1106($target) - $result:=$ftp.download($source; $target) - If ($result.success) - $answer:=$result.data - End if -End if - -If (False:C215) - $source:="/test[1-3].txt" - //$source:="/large/4D.dmg" - //$ftp.setRange("-100") - //$source:="/share/MD0_DATA/Archiv/Diverses_ohne_Backup/test/test[1-3].txt" - - $target:=System folder:C487(Desktop:K41:16)+"neu"+Folder separator:K24:12 - $target:=Convert path system to POSIX:C1106($target) - $result:=$ftp.download($source; $target) - If ($result.success) - $answer:=$result.data - End if -End if - -If (False:C215) - $source:="/large/4D.dmg" - $ftp.setCurlPrefix("--limit-rate 25M") - - $progressid:="Download 4D.dmg" - If (Storage:C1525.FileTransfer_Progress=Null:C1517) - Use (Storage:C1525) - Storage:C1525.FileTransfer_Progress:=New shared object:C1526 - End use - End if - // enable stop button in progress bar - Use (Storage:C1525.FileTransfer_Progress) - Storage:C1525.FileTransfer_Progress[$progressid]:=New shared object:C1526() - End use - $ftp.useCallback(Formula:C1597(ProgressCallback); $progressid) - $ftp.setAsyncMode(True:C214) - - $target:=System folder:C487(Desktop:K41:16)+"neu"+Folder separator:K24:12 - $target:=Convert path system to POSIX:C1106($target) - $result:=$ftp.download($source; $target) - // async, so we need to loop... - // normally we are supposed to do something else and either - // check from time to time or to use the callback method to inform us (percent=100) - Repeat - $ftp.wait(1) // needed while our process is running - // wait is not needed if a form would be open or if a worker would handle the job - $status:=$ftp.status() - - Until (Bool:C1537($status.terminated)) - - // did user canceled? - If (Bool:C1537(Storage:C1525.FileTransfer_Progress[$progressid].Stop)) // check stop button if it was set, remove from storage - // user canceled!! - Else - // now check for errors in $ftp.ResponseError - End if - // clear Storage - Use (Storage:C1525.FileTransfer_Progress) - OB REMOVE:C1226(Storage:C1525.FileTransfer_Progress; $progressid) - End use -End if - - -If (True:C214) // download two in parallel - $source:="/large/4D.dmg" - If (Storage:C1525.FileTransfer_Progress=Null:C1517) - Use (Storage:C1525) - Storage:C1525.FileTransfer_Progress:=New shared object:C1526 - End use - End if - - var $ftp2 : cs:C1710.FileTransfer_curl - $ftp2:=cs:C1710.FileTransfer_curl.new($credentials.url; $credentials.user; $credentials.pass; "ftp") - $ftp.setCurlPrefix("--limit-rate 25M") - $progressid2:="2-Download 4D.dmg" - $ftp2.setCurlPrefix("--limit-rate 25M") - $ftp.setAutoCreateRemoteDirectory(True:C214) - $ftp.setAutoCreateLocalDirectory(True:C214) - $ftp2.setAutoCreateRemoteDirectory(True:C214) - $ftp2.setAutoCreateLocalDirectory(True:C214) - Use (Storage:C1525.FileTransfer_Progress) - Storage:C1525.FileTransfer_Progress[$progressid2]:=New shared object:C1526() - End use - $ftp2.useCallback(Formula:C1597(ProgressCallback); $progressid2) - $ftp2.setAsyncMode(True:C214) - $target:=System folder:C487(Desktop:K41:16)+"neu2"+Folder separator:K24:12 - $target:=Convert path system to POSIX:C1106($target) - $result2:=$ftp2.download($source; $target) - - - $ftp.setCurlPrefix("--limit-rate 25M") - $progressid:="Download 4D.dmg" - - // enable stop button in progress bar - Use (Storage:C1525.FileTransfer_Progress) - Storage:C1525.FileTransfer_Progress[$progressid]:=New shared object:C1526() - End use - $ftp.useCallback(Formula:C1597(ProgressCallback); $progressid) - $ftp.setAsyncMode(True:C214) - - $target:=System folder:C487(Desktop:K41:16)+"neu"+Folder separator:K24:12 - $target:=Convert path system to POSIX:C1106($target) - $result:=$ftp.download($source; $target) - // async, so we need to loop... - // normally we are supposed to do something else and either - // check from time to time or to use the callback method to inform us (percent=100) - Repeat - $ftp.wait(1) // needed while our process is running - $ftp2.wait(1) // needed while our process is running - - // wait is not needed if a form would be open or if a worker would handle the job - $status:=$ftp.status() - $status2:=$ftp2.status() - - Until (Bool:C1537($status.terminated) & Bool:C1537($status2.terminated)) - - // did user canceled? - If (Bool:C1537(Storage:C1525.FileTransfer_Progress[$progressid].Stop)) // check stop button if it was set, remove from storage - // user canceled!! - Else - // now check for errors in $ftp.ResponseError - End if - // clear Storage - Use (Storage:C1525.FileTransfer_Progress) - OB REMOVE:C1226(Storage:C1525.FileTransfer_Progress; $progressid) - OB REMOVE:C1226(Storage:C1525.FileTransfer_Progress; $progressid2) - End use -End if - - - - - -If (False:C215) - $result:=$ftp.createDirectory("/folder2/") - If ($result.success) - - End if -End if - -If (False:C215) - $result:=$ftp.deleteDirectory("/folder2/") - If ($result.success) - $list:=$result.list - End if -End if - - - -If (False:C215) - $result:=$ftp.deleteFile("/test2.txt") - If ($result.success) - $list:=$result.list - End if -End if - -If (False:C215) - $result:=$ftp.renameFile("/test3.txt"; "/test2.txt") - If ($result.success) - $list:=$result.list - End if -End if - - -If (False:C215) - $source:=System folder:C487(Desktop:K41:16)+"neu"+Folder separator:K24:12+"test[1-3].txt" - $source:=Convert path system to POSIX:C1106($source) - $ftp.setAutoCreateRemoteDirectory(True:C214) - $ftp.setAutoCreateLocalDirectory(True:C214) - $result:=$ftp.upload($source; "/meinfolder/"; True:C214) - If ($result.success) - $answer:=$result.data - End if -End if +//%attributes = {} +// overwrite or modify this to get your own credentials! +// url like ftp.4D.com or ftp.4d.com:1234 +// if you use ftps or sftp, also modify the last parameter (protocol) in .new() below +// don't add the protocol to the hostname, don't use https://xxx or ftp://xxx +$credentialspath:=Get 4D folder:C485(Database folder:K5:14) +$folder:=Folder:C1567($credentialspath; fk platform path:K87:2) +$credentialsfile:=$folder.parent.file("credentials.txt").getText() +$credentials:=JSON Parse:C1218($credentialsfile) +If (True:C214) + $credentials.url:="192.168.10.54:3421" + // $credentials.user:="myself" + // $credentials.password:="notmypass" +End if + +var $ftp : cs:C1710.FileTransfer_curl +$ftp:=cs:C1710.FileTransfer_curl.new($credentials.url; $credentials.user; $credentials.pass; "ftp") +//$ftp.setPath("/opt/homebrew/opt/curl/bin/curl") +//$ftp.setPath("C:\\Users\\thomas.DE\\Documents\\4D\\Komponenten\\curl.exe") +$ftp.setConnectTimeout(5) + +If (False:C215) + $result:=$ftp.version() + If ($result.success) + $answer:=$result.data + End if +End if + +If (False:C215) + $result:=$ftp.validate() + If ($result.success) + + Else + $error:=$result.error + End if +End if + + + +If (False:C215) + $source:=System folder:C487(Desktop:K41:16)+"test2.txt" + $source:=Convert path system to POSIX:C1106($source) + $result:=$ftp.upload($source; "/test3.txt") + If ($result.success) + $answer:=$result.data + End if +End if + +If (False:C215) + $source:=System folder:C487(Desktop:K41:16)+"test2.txt" + $source:=Convert path system to POSIX:C1106($source) + $ftp.setAutoCreateRemoteDirectory(True:C214) + $ftp.setAutoCreateLocalDirectory(True:C214) + $result:=$ftp.upload($source; "/meinfolder/test3.txt") + If ($result.success) + $answer:=$result.data + End if +End if + +If (False:C215) + $result:=$ftp.getDirectoryListing("/") + If ($result.success) + $list:=$result.list + End if +End if + +If (False:C215) + //$ftp.useCallback(Formula(ProgressCallback); "ProgressCallback") + + $source:="/test2.txt" + $target:=System folder:C487(Desktop:K41:16)+"newtest2.txt" + $target:=Convert path system to POSIX:C1106($target) + $result:=$ftp.download($source; $target) + If ($result.success) + $answer:=$result.data + End if +End if + +If (False:C215) + $source:="/test[1-3].txt" + //$source:="/large/4D.dmg" + //$ftp.setRange("-100") + //$source:="/share/MD0_DATA/Archiv/Diverses_ohne_Backup/test/test[1-3].txt" + + $target:=System folder:C487(Desktop:K41:16)+"neu"+Folder separator:K24:12 + $target:=Convert path system to POSIX:C1106($target) + $result:=$ftp.download($source; $target) + If ($result.success) + $answer:=$result.data + End if +End if + +If (True:C214) + $source:="/large/4D.dmg" + //$ftp.setCurlPrefix("--limit-rate 25M") // make it slow for testing - limiting bandwidth + + $progressid:="Download 4D.dmg" + $ftp.useCallback(Formula:C1597(ProgressCallback); $progressid) + $ftp.setAsyncMode(False:C215) // default is false, no need to set + $checkstop:=New shared object:C1526("stop"; False:C215) + $ftp.enableStopButton($checkstop) + $target:=System folder:C487(Desktop:K41:16)+"neu"+Folder separator:K24:12 + $target:=Convert path system to POSIX:C1106($target) + $result:=$ftp.download($source; $target) + + If ($checkstop.stop=True:C214) // user clicked stop button + // user canceled!! + Else + // now check for errors in $status.ResponseError + End if + +End if + + +If (True:C214) // download two in parallel + $source:="/large/4D.dmg" + + var $ftp2 : cs:C1710.FileTransfer_curl + $ftp2:=cs:C1710.FileTransfer_curl.new($credentials.url; $credentials.user; $credentials.pass; "ftp") + //$ftp.setCurlPrefix("--limit-rate 25M") + $progressid2:="2-Download 4D.dmg" + //$ftp2.setCurlPrefix("--limit-rate 25M") + $ftp.setAutoCreateRemoteDirectory(True:C214) + $ftp.setAutoCreateLocalDirectory(True:C214) + $ftp2.setAutoCreateRemoteDirectory(True:C214) + $ftp2.setAutoCreateLocalDirectory(True:C214) + $ftp2.useCallback(Formula:C1597(ProgressCallback); $progressid2) + $ftp2.setAsyncMode(True:C214) + $checkstop:=New shared object:C1526("stop"; False:C215) + $ftp.enableStopButton($checkstop) + $checkstop2:=New shared object:C1526("stop"; False:C215) + $ftp2.enableStopButton($checkstop2) + $target:=System folder:C487(Desktop:K41:16)+"neu2"+Folder separator:K24:12 + $target:=Convert path system to POSIX:C1106($target) + $result2:=$ftp2.download($source; $target) + + $ftp.setCurlPrefix("--limit-rate 25M") + $progressid:="Download 4D.dmg" + $ftp.useCallback(Formula:C1597(ProgressCallback); $progressid) + $ftp.setAsyncMode(True:C214) + + $target:=System folder:C487(Desktop:K41:16)+"neu"+Folder separator:K24:12 + $target:=Convert path system to POSIX:C1106($target) + $result:=$ftp.download($source; $target) + // async, so we need to loop... + // normally we are supposed to do something else and either + // check from time to time or to use the callback method to inform us (percent=100) + Repeat + $ftp.wait(0.1) // needed while our process is running + $ftp2.wait(0.1) // needed while our process is running + + // wait is not needed if a form would be open or if a worker would handle the job + $status:=$ftp.status() + $status2:=$ftp2.status() + + Until (Bool:C1537($status.terminated) & Bool:C1537($status2.terminated)) + +End if + + + + + +If (False:C215) + $result:=$ftp.createDirectory("/folder2/") + If ($result.success) + + End if +End if + +If (False:C215) + $result:=$ftp.deleteDirectory("/folder2/") + If ($result.success) + $list:=$result.list + End if +End if + + + +If (False:C215) + $result:=$ftp.deleteFile("/test2.txt") + If ($result.success) + $list:=$result.list + End if +End if + +If (False:C215) + $result:=$ftp.renameFile("/test3.txt"; "/test2.txt") + If ($result.success) + $list:=$result.list + End if +End if + + +If (False:C215) + $source:=System folder:C487(Desktop:K41:16)+"neu"+Folder separator:K24:12+"test[1-3].txt" + $source:=Convert path system to POSIX:C1106($source) + $ftp.setAutoCreateRemoteDirectory(True:C214) + $ftp.setAutoCreateLocalDirectory(True:C214) + $result:=$ftp.upload($source; "/meinfolder/"; True:C214) + If ($result.success) + $answer:=$result.data + End if +End if diff --git a/Project/Sources/Methods/test_dropbox.4dm b/Project/Sources/Methods/test_dropbox.4dm index 83f073e..b955eee 100644 --- a/Project/Sources/Methods/test_dropbox.4dm +++ b/Project/Sources/Methods/test_dropbox.4dm @@ -58,7 +58,7 @@ If (False:C215) // normally we are supposed to do something else and either // check from time to time or to use the callback method to inform us (percent=100) Repeat - $ftp.wait(1) // needed while our process is running + $ftp.wait(0.1) // needed while our process is running // wait is not needed if a form would be open or if a worker would handle the job $status:=$ftp.status() @@ -68,31 +68,21 @@ End if If (True:C214) $progressid:="upload 4D.dmg" - If (Storage:C1525.FileTransfer_Progress=Null:C1517) - Use (Storage:C1525) - Storage:C1525.FileTransfer_Progress:=New shared object:C1526 - End use - End if - // enable stop button in progress bar - Use (Storage:C1525.FileTransfer_Progress) - Storage:C1525.FileTransfer_Progress[$progressid]:=New shared object:C1526() - End use + $checkstop:=New shared object:C1526("stop"; False:C215) + $ftp.enableStopButton($checkstop) $ftp.useCallback(Formula:C1597(ProgressCallback); $progressid) $ftp.setAsyncMode(False:C215) $source:=System folder:C487(Desktop:K41:16)+"4d.dmg" $source:=Convert path system to POSIX:C1106($source) $target:="/Firma/4d.dmg" $result:=$ftp.upload($source; $target) - If (Bool:C1537(Storage:C1525.FileTransfer_Progress[$progressid].Stop)) // check stop button if it was set, remove from storage + If ($checkstop.stop=True:C214) // user clicked stop button // user canceled!! Else If ($result.success) $answer:=$result.data End if End if - Use (Storage:C1525.FileTransfer_Progress) // clear storage - OB REMOVE:C1226(Storage:C1525.FileTransfer_Progress; $progressid) - End use End if If (False:C215) diff --git a/Project/Sources/settings.4DSettings b/Project/Sources/settings.4DSettings index c0dec60..e0e7de2 100644 --- a/Project/Sources/settings.4DSettings +++ b/Project/Sources/settings.4DSettings @@ -1,7 +1,7 @@ - + - + diff --git a/Release Notes.MD b/Release Notes.MD new file mode 100644 index 0000000..63446db --- /dev/null +++ b/Release Notes.MD @@ -0,0 +1,18 @@ +## Release Notes + + +### 1.0.1 - 2022-04-27 +Reworked progress bar. Removed usage of storage and process variable, now handled with shared object. + +When you migrate from 1.0 to 1.0.1 or newer, and you use a progress bar with stop button, you need to add: +```4D + $checkstop:=New shared object("stop"; False) + $ftp.enableStopButton($checkstop) +``` +Check if the user clicked the stop button after termination with: +```4D +If ($checkstop.stop=True) +``` + +### 1.0.0 - 2022-03-10 +Initial release \ No newline at end of file diff --git a/Resources/en.lproj/syntaxEN.json b/Resources/en.lproj/syntaxEN.json index ea8a662..fc16977 100644 --- a/Resources/en.lproj/syntaxEN.json +++ b/Resources/en.lproj/syntaxEN.json @@ -2,7 +2,7 @@ "_method_": {}, "SystemWorkerProperties": { "new()": { - "Syntax": "**.new**(*type* : Text; *data* : Object; *callback* : 4D.Function; *callbackID* : Text)", + "Syntax": "**.new**(*type* : Text; *data* : Object; *callback* : 4D.Function; *callbackID* : Text; *stopButton* : Object)", "Params": [ [ "type", @@ -23,6 +23,11 @@ "callbackID", "Text", "->" + ], + [ + "stopButton", + "Object", + "->" ] ], "Summary": "" @@ -220,63 +225,47 @@ ], "Summary": "" }, - "renameFile()": { - "Syntax": "**.renameFile**(*sourcepath* : Text; *targetpath* : Text)->success : Object", + "version()": { + "Syntax": "**.version**()->data : Object", "Params": [ [ - "sourcepath", - "Text", - "->" - ], - [ - "targetpath", - "Text", - "->" - ], - [ - "success", + "data", "Object", "<-" ] ], "Summary": "" }, - "enableProgressData()": { - "Syntax": "**.enableProgressData**(*enable* : Boolean)", + "setRange()": { + "Syntax": "**.setRange**(*range* : Text)", "Params": [ [ - "enable", - "Boolean", + "range", + "Text", "->" ] ], "Summary": "" }, - "setPath()": { - "Syntax": "**.setPath**(*path* : Text)", + "enableStopButton()": { + "Syntax": "**.enableStopButton**(*enable* : Object)", "Params": [ [ - "path", - "Text", + "enable", + "Object", "->" ] ], "Summary": "" }, - "setAutoCreateRemoteDirectory()": { - "Syntax": "**.setAutoCreateRemoteDirectory**(*auto* : Boolean)", + "renameFile()": { + "Syntax": "**.renameFile**(*sourcepath* : Text; *targetpath* : Text)->success : Object", "Params": [ [ - "auto", - "Boolean", + "sourcepath", + "Text", "->" - ] - ], - "Summary": "" - }, - "createDirectory()": { - "Syntax": "**.createDirectory**(*targetpath* : Text)->success : Object", - "Params": [ + ], [ "targetpath", "Text", @@ -290,43 +279,38 @@ ], "Summary": "" }, - "stop()": { - "Syntax": "**.stop**()", - "Params": [], - "Summary": "" - }, - "setActiveMode()": { - "Syntax": "**.setActiveMode**(*active* : Boolean; *IP* : Text)", + "enableProgressData()": { + "Syntax": "**.enableProgressData**(*enable* : Boolean)", "Params": [ [ - "active", + "enable", "Boolean", "->" - ], - [ - "IP", - "Text", - "->" ] ], "Summary": "" }, - "version()": { - "Syntax": "**.version**()->data : Object", + "setPath()": { + "Syntax": "**.setPath**(*path* : Text)", "Params": [ [ - "data", - "Object", - "<-" + "path", + "Text", + "->" ] ], "Summary": "" }, - "setRange()": { - "Syntax": "**.setRange**(*range* : Text)", + "setActiveMode()": { + "Syntax": "**.setActiveMode**(*active* : Boolean; *IP* : Text)", "Params": [ [ - "range", + "active", + "Boolean", + "->" + ], + [ + "IP", "Text", "->" ] @@ -441,6 +425,38 @@ ] ], "Summary": "" + }, + "stop()": { + "Syntax": "**.stop**()", + "Params": [], + "Summary": "" + }, + "createDirectory()": { + "Syntax": "**.createDirectory**(*targetpath* : Text)->success : Object", + "Params": [ + [ + "targetpath", + "Text", + "->" + ], + [ + "success", + "Object", + "<-" + ] + ], + "Summary": "" + }, + "setAutoCreateRemoteDirectory()": { + "Syntax": "**.setAutoCreateRemoteDirectory**(*auto* : Boolean)", + "Params": [ + [ + "auto", + "Boolean", + "->" + ] + ], + "Summary": "" } }, "FileTransfer_Dropbox": { @@ -465,6 +481,17 @@ "Params": [], "Summary": "" }, + "enableStopButton()": { + "Syntax": "**.enableStopButton**(*enable* : Object)", + "Params": [ + [ + "enable", + "Object", + "->" + ] + ], + "Summary": "" + }, "setAsyncMode()": { "Syntax": "**.setAsyncMode**(*async* : Boolean)", "Params": [ @@ -808,6 +835,17 @@ ], "Summary": "" }, + "enableStopButton()": { + "Syntax": "**.enableStopButton**(*enable* : Object)", + "Params": [ + [ + "enable", + "Object", + "->" + ] + ], + "Summary": "" + }, "version()": { "Syntax": "**.version**()->data : Object", "Params": [ @@ -1094,24 +1132,8 @@ "Params": [], "Summary": "" }, - "CommitAndPush()": { - "Syntax": "**.CommitAndPush**(*message* : Text)->error : Object", - "Params": [ - [ - "message", - "Text", - "->" - ], - [ - "error", - "Object", - "<-" - ] - ], - "Summary": "" - }, - "Staple()": { - "Syntax": "**.Staple**(*zipfilepath* : Text)->error : Object", + "Notarize()": { + "Syntax": "**.Notarize**(*zipfilepath* : Text)->error : Object", "Params": [ [ "zipfilepath", @@ -1126,14 +1148,9 @@ ], "Summary": "" }, - "Compile()": { - "Syntax": "**.Compile**(*options* : Object)->error : Object", + "Staple()": { + "Syntax": "**.Staple**()->error : Object", "Params": [ - [ - "options", - "Object", - "->" - ], [ "error", "Object", @@ -1142,16 +1159,11 @@ ], "Summary": "" }, - "CheckNotarizeResult()": { - "Syntax": "**.CheckNotarizeResult**(*uuid* : Text; *appleUserID* : Text)->error : Object", + "Build()": { + "Syntax": "**.Build**(*PathToSettings* : Text)->error : Object", "Params": [ [ - "uuid", - "Text", - "->" - ], - [ - "appleUserID", + "PathToSettings", "Text", "->" ], @@ -1163,24 +1175,19 @@ ], "Summary": "" }, - "Notarize()": { - "Syntax": "**.Notarize**(*zipfilepath* : Text; *appleUserID* : Text; *bundleID* : Variant)->error : Object", + "Zip()": { + "Syntax": "**.Zip**(*sourcepath* : Text; *targetpath* : Text)->error : Object", "Params": [ [ - "zipfilepath", + "sourcepath", "Text", "->" ], [ - "appleUserID", + "targetpath", "Text", "->" ], - [ - "bundleID", - "Variant", - "->" - ], [ "error", "Object", @@ -1189,33 +1196,12 @@ ], "Summary": "" }, - "Build()": { - "Syntax": "**.Build**(*PathToSettings* : Text)->error : Object", + "Compile()": { + "Syntax": "**.Compile**(*options* : Object)->error : Object", "Params": [ [ - "PathToSettings", - "Text", - "->" - ], - [ - "error", + "options", "Object", - "<-" - ] - ], - "Summary": "" - }, - "Zip()": { - "Syntax": "**.Zip**(*sourcepath* : Text; *targetpath* : Text)->error : Object", - "Params": [ - [ - "sourcepath", - "Text", - "->" - ], - [ - "targetpath", - "Text", "->" ], [