Uses 1113K of libraries. Click here for Pure Java version (14600L/76K).
!7 cm AllOnlineComputers > DynCalculatedList { transient LS computerIDs, data; transient StefansOS_ConnectToServer connector; transient JLabel trayIcon; LS calc() { ret data; } start { dm_addTrayIcon(trayIcon = jlabel()); updateList(); ownResource(connector = new StefansOS_ConnectToServer); connector.onLine = voidfunc(S line) { new Matches m; if (swic(line, "ComputerIDs = ", m)) { computerIDs = (LS) safeUnstruct($1); updateList(); vmBus_send('onlineComputerIDs, computerIDs); setModuleName(n2(computerIDs, "Online Computer")); } }; connector.startWithSubs("computerIDs"); } afterVisualize { listPopupMenuItemsThreaded(list, "Send clipboard there", rEnter { pcall-infobox { dm_sendClipboardTo_verbose(selectedComputerID()); } }, "Set name...", rEnter { setNameDialog(selectedComputerID()) }); } // API LS onlineComputerIDs() { ret computerIDs; } bool isComputerOnline(S computerID) { ret contains(computerIDs, computerID); } void updateList { O computerNames = dm_computerNames_opt(); if (setField(data := sortedIC(map(computerIDs, func(S id) -> S { S name = dm_callOpt(computerNames, "nameForID", id); ret (eq(id, computerID()) ? "[this one] " : "") + (nempty(name) ? name + " (" + id + ")" : id); })))); dm_q(r update); setTextAndToolTip(trayIcon, n2(data) + "c", nComputers(data) + " online"); } S selectedComputerID() { ret extractLastComputerID(selected()); } void setNameDialog(S computerID) { dm_call(dm_requireComputerNames(), 'openDialogForComputerID, computerID); } }
Began life as a copy of #1016576
download show line numbers debug dex old transpilations
Travelled to 17 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, hpgrupgrauku, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment