Warning: session_start(): open(/var/lib/php/sessions/sess_cfhgc376snq082fkjdm168acbc, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
module PreferredShutDownMethod > DynModule {
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(jfullcenter(vstackWithSpacing(buttonsInGroup(buttons))),
vstackWithSpacing(
jbutton("Do it now", rThread doPreferredComputerShutDown),
jPopDownButton("Do something else once",
"Power Off", rThread cleanPowerOff,
"Restart", rThread cleanReboot,
"Suspend to RAM", rThread suspendToRAM,
"Suspend to disk", rThread suspendToDisk,
"Log out", rThread os_logOut)));
}
}