Warning: session_start(): open(/var/lib/php/sessions/sess_9pprif8ac7vod17vs6lc5oun54, 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
concept Profile {
S name, options;
S computerID; // to send clipboard (optional)
S passwordID; // global ID to send to #1029670
}
cmodule2 VNCViewerTrayIcon > DynCRUD {
transient TrayIcon trayIcon;
switchable bool inProcess; // don't think true works yet
transient ReliableSingleThread rstMakeTrayIcon = dm_rst(this, r makeTrayIcon);
start {
db();
onConceptsChangeAndNow(r { doLater(2.0, rstMakeTrayIcon) });
}
void makeTrayIcon enter {
disposeTrayIcon(trayIcon);
new L menuItems; // no left-click action
for (Profile p : sortConceptsByID(list(Profile)))
if (nemptyAfterTrim(p.options))
addAll(menuItems, "VNC to " + p.name, rThread { launch(p) });
add(menuItems, "---");
L withComputerID = whereFieldNempty computerID(list(Profile));
if (nempty(withComputerID)) {
for (Profile p : withComputerID)
addAll(menuItems, "Send clipboard to " + p.name, rThread { dm_sendClipboardTo_verbose(p.computerID) });
add(menuItems, "---");
}
addAll(menuItems, "VNC Viewer Connection Dialog", rThread { if (inProcess) launchVNCViewer_inProcess(); else launchVNCViewer() });
addAll(menuItems, "Edit Profiles...", rThread dm_activateOSAndModule);
trayIcon = installTrayIcon(#1101468, "Start VNC Viewer", menuItems);
}
afterVisualize {
// TODO: disable when at beginning/end of list
addSelectionDependentButton("Move Up", r {
Profile a = selected(), b = itemBefore(list(), a);
if (a != null && b != null)
swapConceptIDs(a, b);
});
addSelectionDependentButton("Move Down", r {
Profile a = selected(), b = itemAfter(list(), a);
if (a != null && b != null)
swapConceptIDs(a, b);
});
addSelectionDependentButton("Connect", rThread {
launch(selected());
});
}
void cleanMeUp {
disposeTrayIcon(trayIcon);
}
void launch(Profile p) {
if (p == null) ret;
if (nempty(p.passwordID))
dm_copyPasswordForGlobalIDToClipboard(p.passwordID);
if (inProcess) launchVNCViewer_inProcess(p.options); else launchVNCViewer(p.options);
}
}