sclass SavedSessions extends Module { SS sessions = synchroMap(); // TODO: notifyingMap(rSetVarToTrue(changed)); transient JTable table; transient new Var changed; JComponent visualize() { table = sexyTable(); changed.set(true); ret centerAndSouthWithMargins(table, jbutton("Save session", r { fS text = struct(ll(programID(), localDateWithMilliseconds())) + "\n" + mainConcepts.xfullgrab(); inputText("Save session as", voidfunc(S name) { sessions.put(or2(trim(name), "Unnamed Session") + " [" + localDateWithSeconds() + ", " + computerID() + ", OS: " + programID() + "]", text); changed.set(true); }); })); } void unvisualize2() { table = null; } void update() { if (atomicFlipVarToFalse(changed)) dataToTable_uneditable(table, listToMapsWithSingleKey("Session Name", sortedKeys(sessions))); } }