!7

module SendBackups > DynSingleFunction {
  S sendToMachines;
  
  visualize {
    setFunctionName("Send Backups");
    ret centerAndSouthWithMargins(super.visualize(),
      withLabel("Send to machines:", dm_fieldTextField('sendToMachines)));
  }
  
  void doIt enter {
    if (emptyAfterTrim(sendToMachines)) ret;
    dm_action("Sending backup to other machines", r {
      temp dm_tempDisableAllButtons();
      for (S computerID : possibleComputerIDs(javaTokC(sendToMachines))) pcall {
        dm_sendAllBackupFilesToOtherMachine(computerID);
      }
    });
  }
}