!7 cmodule PreferredShutDownMethod { transient LS entries = ll("Power Off", "Suspend to RAM", "Suspend to disk", "Never shut down"); visualize { ButtonGroup buttons = jUnselectedRadioButtons(entries); selectRadioButton(buttons, indexOfIC(entries, trim(loadTextFile(preferredShutDownMethodFile())))); onRadioButtonChange(buttons, voidfunc(int i) { S method = _get(entries, i); saveTextFile(preferredShutDownMethodFile(), method); infoBox("Preferred shutdown method changed to: " + method); }); ret centerAndSouthWithMargins(jSection("PREFERRED WAY", jfullcenter(vstackWithSpacing(buttonsInGroup(buttons)))), vstackWithSpacing( jbutton("Do it now", rThread doPreferredComputerShutDown), jPopDownButton("Do something else once", position := 'center, "Power Off", rThread cleanPowerOff, "Reboot", rThread cleanReboot, "Suspend to RAM", rThread suspendToRAM, "Suspend to disk", rThread suspendToDisk, "Log out", rThread os_logOut))); } }