!7 module BurnDVD { S directory, tempISOFile, dvdDrive; bool add; start { if (empty(tempISOFile)) setField(tempISOFile := f2s(javaxCaches("temp.iso")); if (empty(dvdDrive)) setField(dvdDrive := "/dev/dvd"); } visualize { ret makeForm3( "Directory:", dm_fieldTextField('directory), "Temp ISO file:", dm_fieldTextField('tempISOFile), "DVD drive:", dm_fieldTextField('dvdDrive), "", dm_fieldCheckBox("Add to DVD if there is data on it", 'add), "", jbutton("Step 1 (Make ISO)", rThread step1), "", jbutton("Step 2 (Burn to DVD)", rThread step2)); } void step1 enter { assertLinux(); assertNempty(directory); assertAbsolutePath(directory); backtickToConsole("mkisofs -r -o " + bashQuote2(tempISOFile) + " " + bashQuote2(addSlash(directory) + "*")); infoBox("ISO made! " + fileInfo(tempISOFile)); } void step2 enter { assertLinux(); if (!fileExists(tempISOFile)) ret with infoBox("ISO doesn't exist: " + tempISOFile); if (contains(loadTextFile(backtickToConsole("growisofs " + (add ? "-M" : "-Z") + " " + bashQuote2("/dev/dvd=" + tempISOFile))), "FATAL")) infoBox("Error!"); else infoBox("DVD made!"); } }