implement check for missing locations

This commit is contained in:
itwrx
2023-07-01 13:16:45 -05:00
parent a1b2743960
commit eee7038808
3 changed files with 43 additions and 6 deletions

View File

@@ -212,7 +212,20 @@ method view(list: RoutineListState): Widget {.locks: "unknown".} =
xAlign = 0
useMarkup = true
proc clicked() =
createThread(thread, rsyncThread, list)
#check that every source and destination exists for each routine or don't run bkup and show dialog.
#locations not found will be logged. see shared.nim
var allLocationsExist: seq[bool]
for routine in list.routineModel.routineSeq():
if routine.id in list.selected:
if locationsExist(routine) == true:
allLocationsExist.add(true)
else:
allLocationsExist.add(false)
if false in allLocationsExist:
#show error status.
list.runStatus = "<span color=\"#ff6b6b\" size=\"large\">Missing Source(s)/Destination(s) in selected Routine(s).</span>"
else:
createThread(thread, rsyncThread, list)
else:
Box {.expand: false.}:
orient = OrientY