Warning: session_start(): open(/var/lib/php/sessions/sess_g9o49e0a180r9pcl84uee4pgu5, 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
cmodule ConfirmAction > DynModule {
S text;
transient Runnable action;
Pt minimumSize() { ret pt(400, 200); }
start {
dm_onUserUtterance(s -> { if "yes" yes(); if "no" reset(); });
}
visual withCenteredButtons(
withMargin(fontSizePlus(10, dm_centeredLabel text())),
"Yes", rThread yes, "No", rThread reset);
void reset enter {
setFields(text := "", action := null);
dm_disableAllButtons();
dm_popInModule();
dm_hideModule();
}
void yes enter {
if (action == null) ret;
if (!dm_moduleIsPoppedOut()) ret with reset();
print("Running action: " + text);
Runnable r = action;
reset();
callF(r);
}
// API
void showAction(S text, Runnable action) {
setFields(+text, +action);
dm_enableAllButtons();
dm_popOutModule_alwaysOnTop();
}
}