G4C;(c) SendStuff by Richard Kapp 2001 ; MUST BE IN THE FIRST(!) LINE

WINBIG 1062 440 40 35 "Send"
wintype 01000000
WINFONT XHelvetica.font 11 000



;----------------------------- Init ------------------------------

xOnLoad

extract SendStuff guipath SendStuffpath
        ifexists assign SendStuff:  ;try to self-locate
        else
        assign SendStuff: $SendStuffpath
        endif

assign SendStuff: $SendStuffpath

;----------------------- Default Variablen -----------------------

sendepfad = RAM:
cyc = 0
;--------------------------- IMAGES -----------------------------

loadimage SendStuff:Images/send.iff sendimage Workbench
loadimage SendStuff:Images/prefs.iff prefsimage Workbench
loadimage SendStuff:Images/req.iff reqimage Workbench
;-------------------------- Lade Config --------------------------

ifexists file ENVARC:SendStuffconfig
        guiload ENVARC:SendStuffconfig
        else
        ezreq "Cannot find user-path config" "Shut up!" shush
        endif

;----------------------------- InitII ----------------------------

guiopen SendStuff
;-----------------------------------------------------------------

IMAGE 0 0 sendimage

xAPPWINDOW *whatever
update SENDEWAHL 1000 $User1
update SENDEWAHL 1001 $User2
update SENDEWAHL 1002 $User3
update SENDEWAHL 1003 $User4
update SENDEWAHL 1004 $User5
update SENDEWAHL 1005 $User6
if $cyc = 0
*modus = move
update SENDWAHL 1 0
elseif $cyc = 1
*modus = copy
update SENDEWAHL 1 1
endif
guiopen SENDEWAHL



xRoutine Ende
freeimage sendimage
freeimage prefsimage
guiquit SendStuff
guiquit SENDEWAHL
guiquit DO

xMenu 'SendStuff' 'About' '' ''
ezreq "SendStuff v.0.6 - (c) by Richard Kapp, images by Martin Merz." "Nice!" nice

xMenu 'SendStuff' 'Quit' '' 'q'
gosub SendStuff Ende

xMenu 'Config' 'User paths' '' ''
update DO 1 $patha
update DO 3 $pathb
update DO 5 $pathc
update DO 7 $pathd
update DO 9 $pathe
update DO 11 $pathf
update DO 2 $User1
update DO 4 $User2
update DO 6 $User3
update DO 8 $User4
update DO 10 $User5
update DO 12 $User6
guiopen DO

xMenu 'Config' 'Save Config' '' ''
gosub SendStuff SaveConfig

xMenu 'Config' 'Snapshot window' '' ''
ezreq "To snapshot SendStuff-window, activate the window and press CTRL+G." "Will do!" ok

xMenu '?' 'Rules of the game' '' ''
CLI 'run >NIL: SYS:Utilities/Multiview SendStuff:Docs/readme.txt'

xROUTINE SaveConfig

Varpath DO

.SendStuffconfig = 'G4C\n\nxOnLoad\n'

appvar .SendStuffconfig '\nSendStuff/patha = "$patha"'
appvar .SendStuffconfig '\nSendStuff/pathb = "$pathb"'
appvar .SendStuffconfig '\nSendStuff/pathc = "$pathc"'
appvar .SendStuffconfig '\nSendStuff/pathd = "$pathd"'
appvar .SendStuffconfig '\nSendStuff/pathe = "$pathe"'
appvar .SendStuffconfig '\nSendStuff/pathf = "$pathf"'
appvar .SendStuffconfig '\nSendStuff/User1 = "$User1"'
appvar .SendStuffconfig '\nSendStuff/User2 = "$User2"'
appvar .SendStuffconfig '\nSendStuff/User3 = "$User3"'
appvar .SendStuffconfig '\nSendStuff/User4 = "$User4"'
appvar .SendStuffconfig '\nSendStuff/User5 = "$User5"'
appvar .SendStuffconfig '\nSendStuff/User6 = "$User6"'
appvar .SendStuffconfig '\nSendStuff/cyc = "$cyc"'
appvar .SendStuffconfig '\nSendStuff/quick = "$quick"'
appvar .SendStuffconfig '\nSendStuff/saveprefs = "$saveprefs"'
appvar .SendStuffconfig '\nGuiQuit #This'

copy env:.SendStuffconfig ENVARC:SendStuffconfig
ezreq "Config saved!" "Fine!" gut


;------------------------------- SENDEWAHL --------------------------------

NewFile SENDEWAHL
WINBIG -1 -1 270 370 "To which location?"
Wintype 11010000
WINFONT XHelvetica.font 11 000

IMAGE 6 5 reqimage

LINE 2 72 269 72 1

LINE 2 73 267 73 2

BOX 140 82 125 109 IN RIDGE
BOX 140 200 125 160 IN RIDGE
BOX 6 177 125 86 IN RIDGE
BOX 6 272 125 88 IN RIDGE
BOX 6 81 125 86 IN RIDGE

varpath SendStuff/DO

CTEXT 104 26 "SEND MODE" xHelvetica.font 11 2 -1 00000

XCYCLER 77 43 108 20 '' cyc
CSTR "move" 0
CSTR "copy" 1
gadid 1

if $cyc = 0
*modus = move
elseif $cyc = 1
*modus = copy
endif

XBUTTON 148 115 110 20 "RAM:"
if $*modus = copy
CLI 'C:copy $*whatever RAM: all QUIET'
ezreq "Data has been copied to RAM:" "_Ok" ok
elseif $*modus = move
CLI 'C:Copy $*whatever RAM: all QUIET'
CLI 'delete $*whatever all QUIET'
ezreq "Data has been moved to RAM:" "_Ok" ok
endif
guiclose SENDEWAHL

XBUTTON 14 331 110 20 "RAM:T"
if $*modus = copy
CLI 'C:copy $*whatever RAM:T/ all QUIET'
ezreq "Data has been copied to RAM:T:" "_Ok" ok
elseif $*modus = move
CLI 'C:Copy $*whatever RAM:T/ all QUIET'
CLI 'delete $*whatever all QUIET'
ezreq "Data has been moved to RAM:T" "_Ok" ok
endif
guiclose SENDEWAHL


XBUTTON 14 91 110 20 "C:"
if $*modus = copy
CLI 'C:copy $*whatever C: all QUIET'
ezreq "Data has been copied to C:" "_Ok" ok
elseif $*modus = move
CLI 'C:Copy $*whatever C: all QUIET'
CLI 'delete $*whatever all QUIET'
ezreq "Data has been moved to C:" "_Ok" ok
endif
guiclose SENDEWAHL

XBUTTON 14 115 110 20 "LIBS:"
if $*modus = copy
CLI 'C:copy $*whatever LIBS: all QUIET'
ezreq "Data has been copied to LIBS:" "_Ok" ok
elseif $*modus = move
CLI 'C:Copy $*whatever LIBS: all QUIET'
CLI 'delete $*whatever all QUIET'
ezreq "Data has been moved to LIBS:" "_Ok" ok
endif
guiclose SENDEWAHL

XBUTTON 14 139 110 20 "S:"
if $*modus = copy
CLI 'C:copy $*whatever S: all QUIET'
ezreq "Data has been copied to S:" "_Ok" ok
elseif $*modus = move
CLI 'C:Copy $*whatever S: all QUIET'
CLI 'delete $*whatever all QUIET'
ezreq "Data has been moved to S:" "_Ok" ok
endif
guiclose SENDEWAHL


XBUTTON 148 91 110 20 "SYS:"
if $*modus = copy
CLI 'C:copy $*whatever SYS: all QUIET'
ezreq "Data has been copied to SYS:" "_Ok" ok
elseif $*modus = move
CLI 'C:Copy $*whatever SYS: all QUIET'
CLI 'delete $*whatever all QUIET'
ezreq "Data has been moved to SYS:" "_Ok" ok
endif
guiclose SENDEWAHL

XBUTTON 14 283 110 20 "SYS:T"
if $*modus = copy
CLI 'C:copy $*whatever SYS:T all QUIET'
ezreq "Data has been copied to SYS:T" "_Ok" ok
elseif $*modus = move
CLI 'C:Copy $*whatever SYS:T all QUIET'
CLI 'delete $*whatever all QUIET'
ezreq "Data has been moved to SYS:T" "_Ok" ok
endif
guiclose SENDEWAHL

XBUTTON 14 307 110 20 "SYS:Temp"
if $*modus = copy
CLI 'C:copy $*whatever SYS:Temp/ all QUIET'
ezreq "Data has been copied to SYS:Temp" "_Ok" ok
elseif $*modus = move
CLI 'C:Copy $*whatever SYS:Temp/ all QUIET'
CLI 'delete $*whatever all QUIET'
ezreq "Data has been moved to SYS:Temp" "_Ok" ok
endif
guiclose SENDEWAHL

XBUTTON 14 187 110 20 "WBStartup"
if $*modus = copy
CLI 'C:copy $*whatever SYS:WBStartup/ all QUIET'
ezreq "Data has been copied to WBStartup" "_Ok" ok
elseif $*modus = move
CLI 'C:Copy $*whatever SYS:WBStartup/ all QUIET'
CLI 'delete $*whatever all QUIET'
ezreq "Data has been moved to SYS:WBStartup" "_Ok" ok
endif
guiclose SENDEWAHL

XBUTTON 14 211 110 20 "WBStartup Enabled"
if $*modus = copy
CLI 'C:copy $*whatever SYS:WBStartup/Enabled/ all QUIET'
ezreq "Data has been copied to WBStartup/Enabled" "_Ok" ok
elseif $*modus = move
CLI 'C:Copy $*whatever SYS:WBStartup/Enabled/ all QUIET'
CLI 'delete $*whatever all QUIET'
ezreq "Data has been moved to WBStartup/Enabled" "_Ok" ok
endif
guiclose SENDEWAHL

XBUTTON 14 235 110 20 "WBStartup Disabled"
if $*modus = copy
CLI 'C:copy $*whatever SYS:WBStartup/Disabled/ all QUIET'
ezreq "Data has been copied to WBStartup/Disabled" "_Ok" ok
elseif $*modus = move
CLI 'C:Copy $*whatever SYS:WBStartup/Disabled/ all QUIET'
CLI 'delete $*whatever all QUIET'
ezreq "Data has been moved to WBStartup/Disabled:" "_Ok" ok
endif
guiclose SENDEWAHL


XBUTTON 148 139 110 20 "DF0:"
if $*modus = copy
CLI 'C:copy $*whatever DF0: all QUIET'
ezreq "Data has been copied to DF0:" "_Ok" ok
elseif $*modus = move
CLI 'C:Copy $*whatever DF0: all QUIET'
CLI 'delete $*whatever all QUIET'
ezreq "Datas has been moved to DF0:" "_Ok" ok
endif
guiclose SENDEWAHL

XBUTTON 148 163 110 20 "DF1:"
if $*modus = copy
CLI 'C:copy $*whatever DF1: all QUIET'
ezreq "Data has been copied to DF1:" "_Ok" ok
elseif $*modus = move
CLI 'C:Copy $*whatever DF1: all QUIET'
CLI 'delete $*whatever all QUIET'
ezreq "Datas has been moved to DF1:" "_Ok" ok
endif
guiclose SENDEWAHL

TEXT 170 210 90 20 "" 40 Box
gadid 1000

TEXT 170 235 90 20 "" 40 Box
gadid 1001

TEXT 170 260 90 20 "" 40 Box
gadid 1002

TEXT 170 285 90 20 "" 40 Box
gadid 1003

TEXT 170 310 90 20 "" 40 Box
gadid 1004

TEXT 170 334 90 20 "" 40 Box
gadid 1005

XBUTTON 150 210 20 20 ""
ifexists DIR $patha
and $patha > ''
gosub SENDEWAHL pathacopy
else
gosub SENDEWAHL userwählen
endif

xROUTINE pathacopy
if $*modus = copy
CLI 'C:copy $*whatever $patha all QUIET'
ezreq "Data has been copied to $patha" "_Ok" ok
elseif $*modus = move
CLI 'C:Copy $*whatever $patha all QUIET'
CLI 'delete $*whatever all QUIET'
ezreq "Data has been moved to $patha" "_Ok" ok
endif
guiclose SENDEWAHL

XBUTTON 150 235 20 20 ""
ifexists DIR $pathb
and $pathb > ''
gosub SENDEWAHL pathbcopy
else
gosub SENDEWAHL userwählen
endif

xROUTINE pathbcopy
if $*modus = copy
CLI 'C:copy $*whatever $pathb all QUIET'
ezreq "Data has been copied to $pathb" "_Ok" ok
elseif $*modus = move
CLI 'C:Copy $*whatever $pathb all QUIET'
CLI 'delete $*whatever all QUIET'
ezreq "Data has been moved to $pathb" "_Ok" ok
endif
guiclose SENDEWAHL

XBUTTON 150 260 20 20 ""
ifexists DIR $pathc
and $pathc > ''
gosub SENDEWAHL pathccopy
else
gosub SENDEWAHL userwählen
endif

xROUTINE pathccopy
if $*modus = copy
CLI 'C:copy $*whatever $pathc all QUIET'
ezreq "Data has been copied to $pathc" "_Ok" ok
elseif $*modus = move
CLI 'C:Copy $*whatever $pathc all QUIET'
CLI 'delete $*whatever all QUIET'
ezreq "Data has been moved to $pathc" "_Ok" ok
endif
guiclose SENDEWAHL

XBUTTON 150 285 20 20 ""
ifexists DIR $pathd
and $pathd > ''
gosub SENDEWAHL pathdcopy
else
gosub SENDEWAHL userwählen
endif

xROUTINE pathdcopy
if $*modus = copy
CLI 'C:copy $*whatever $pathd all QUIET'
ezreq "Data has been copied to $pathd" "_Ok" ok
elseif $*modus = move
CLI 'C:Copy $*whatever $pathd all QUIET'
CLI 'delete $*whatever all QUIET'
ezreq "Data has been moved to $pathd" "_Ok" ok
endif
guiclose SENDEWAHL

XBUTTON 150 310 20 20 ""
ifexists DIR $pathe
and $pathe > ''
gosub SENDEWAHL pathecopy
else
gosub SENDEWAHL userwählen
endif

xROUTINE pathecopy
if $*modus = copy
CLI 'C:copy $*whatever $pathe all QUIET'
ezreq "Data has been copied to $pathe" "_Ok" ok
elseif $*modus = move
CLI 'C:Copy $*whatever $pathe all QUIET'
CLI 'delete $*whatever all QUIET'
ezreq "Data has been moved to $pathe" "_Ok" ok
endif
guiclose SENDEWAHL

XBUTTON 150 334 20 20 ""
ifexists DIR $pathf
and $pathf > ''
gosub SENDEWAHL pathfcopy
else
gosub SENDEWAHL userwählen
endif

xROUTINE pathfcopy
if $*modus = copy
CLI 'C:copy $*whatever $pathf all QUIET'
ezreq "Data has been copied to $pathf" "_Ok" ok
elseif $*modus = move
CLI 'C:Copy $*whatever $pathf all QUIET'
CLI 'delete $*whatever all QUIET'
ezreq "Data has been moved to $pathf" "_Ok" ok
endif
guiclose SENDEWAHL

XBUTTON 199 8 60 20 "_Select..."
reqfile -1 -1 400 200 "Choose copy path" DIR sendepfad RAM:
if $*modus = copy
CLI 'C:copy $*whatever $sendepfad all QUIET'
ezreq "Data has been copied to $sendepfad" "_Ok" ok
elseif $*modus = move
CLI 'C:Copy $*whatever $sendepfad all QUIET'
CLI 'delete $*whatever all QUIET'
ezreq "Data has been moved to $sendepfad" "_Ok" ok
endif
guiclose SENDEWAHL

xRoutine userwählen
ezreq "Your USER paths are empty or not correct!" "OK" ok
ezreq "Do you want to configure it now?" "Jep|Nope" frage
if $frage = 1
update DO 1 $patha
update DO 3 $pathb
update DO 5 $pathc
update DO 7 $pathd
update DO 9 $pathe
update DO 11 $pathf
update DO 2 $User1
update DO 4 $User2
update DO 6 $User3
update DO 8 $User4
update DO 10 $User5
update DO 12 $User6
guiopen DO
else
endif


XBUTTON 199 43 60 20 "_Cancel"
guiclose SENDEWAHL

;------------------------------------------------------------------------

Newfile DO

WINBIG -1 -1 360 300 "Please select your SEND paths"

WinType 11010000
WINFONT XHelvetica.font 11 000

IMAGE 10 6 prefsimage

Varpath SendStuff

CTEXT 75 29 "SEND PATHS" xHelvetica.font 11 2 -1 00000

BOX 5 77 351 177 IN Ridge


XBUTTON 183 98 21 20 "<"
reqfile -1 -1 200 300 "Please select USER path 1..." DIR patha RAM:
Update DO 1 $patha

XTEXTIN 53 98 130 20 "Path 1" patha "" 200
gadid 1

XTEXTIN 263 98 85 20 "Name 1" User1 "" 200
gadid 2

XBUTTON 183 122 20 20 "<"
reqfile -1 -1 200 300 "Please select USER path 2..." DIR pathb RAM:
Update DO 3 $pathb

XTEXTIN 53 122 130 20 "Path 2" pathb "" 200
gadid 3

XTEXTIN 263 122 85 20 "Name 2" User2 "" 200
gadid 4

XBUTTON 183 146 20 20 "<"
reqfile -1 -1 200 300 "Please select USER path 3..." DIR pathc RAM:
Update DO 5 $pathc

XTEXTIN 53 146 130 20 "Path 3" pathc "" 200
gadid 5

XTEXTIN 263 146 85 20 "Name 3" User3 "" 200
gadid 6

XBUTTON 183 170 20 20 "<"
reqfile -1 -1 200 300 "Please select USER path 4..." DIR pathd RAM:
Update DO 7 $pathd

XTEXTIN 53 170 130 20 "Path 4" pathd "" 200
gadid 7

XTEXTIN 263 170 85 20 "Name 4" User4 "" 200
gadid 8

XBUTTON 183 194 20 20 "<"
reqfile -1 -1 200 300 "Please select USER path 5..." DIR pathe RAM:
Update DO 9 $pathe

XTEXTIN 53 194 130 20 "Path 5" pathe "" 200
gadid 9

XTEXTIN 263 194 85 20 "Name 5" User5 "" 200
gadid 10

XBUTTON 183 218 20 20 "<"
reqfile -1 -1 200 300 "Please select USER path 6..." DIR pathf RAM:
Update DO 11 $pathf

XTEXTIN 53 218 130 20 "Path 6" pathf "" 200
gadid 11

XTEXTIN 263 218 85 20 "Name 6" User6 "" 200
gadid 12

XBUTTON 145 266 69 20 "Okay"
guiclose DO


