Warning: session_start(): open(/var/lib/php/sessions/sess_iij29br167jkto9rhqv3qeg015, 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
// manage an "unclear" list (one that varies by context),
// e.g. the list of known first names
srecord Entry(S name, S comment) {}
cmodule UnclearList > DynObjectTable {
S description = "First names"; // plural of what we are storing
// mech list that may contain useful items for us
L> possibleMechLists = syncList();
visual
jhsplit(jCenteredSection("Current items", super),
withCenteredButtons(
jCenteredSection("Possible lists", dm_calculatedTextArea(() ->
lines(possibleMechLists))),
"Add...", rThreadEnter {
dm_selectMechList("Mech list of " + description, voidfunc(S name) {
addPossibleMechList(name, "") // TODO: comment
});
}));
// API
void addItem(S name, S comment) {
add(new Entry(name, comment));
}
void removeItem(S name) {
remove(objectWhere(list(), +name));
}
void addPossibleMechList(S name, S comment) {
possibleMechLists.add(WithComment(comment, name));
change();
}
Set itemsSet() {
ret collectAsCISet name(list());
}
void loadAllPossibleLists {
Set known = itemsSet();
for (S listName : possibleMechLists)
addAll(mapNonNulls(mL(listName), x -> known.contains(x) ? null
: new Entry(x, "from " + quote(listName))));
}
}