srecord noeq JG22ProjectSelector(G22Utils g22utils) is Swingable { transient JLabel lblDB; cachedVisualize { lblDB = toolTip("Currently selected project (" + f2s(g22utils.projectDir()) + ")", /*boldLabel*/(jSimpleLabel(fileName(g22utils.projectDir())))); onClick(lblDB, evt -> new PopupMenuMaker(evt, menu -> { addMenuItem(menu, "New project...", rThread { g22utils.projectActions().databasesPanel().newDatabase() }); addMenuItem(menu, "Projects..." /*"Manage or open projects..."*/, rThread { g22utils.showUIURL("Projects")}); LS recent = takeFirst(10, g22utils.dbNamesRecentlyOpened()); // List open projects /*for (File otherDB : g22utils.masterStuff().openConceptDirs()) { S name = fileName(otherDB); if (!eq(otherDB, g22utils.projectDir())) addMenuItem(menu, name + " [Open]", rThread { g22utils.masterStuff().openDatabase(otherDB) }); removeAll(recent, name, "*" + name); }*/ for (IG22LoadedDB otherDB : g22utils.masterStuff().openProjects()) { S name = otherDB.g22utils().projectName(); if (g22utils != otherDB.g22utils()) { S status = otherDB.hidden() ? "Hidden" : "Open"; addMenuItem(menu, name + " [" + status + "]", rThread { otherDB.activate() }); } removeAll(recent, name, "*" + name); } // List non-open recent projects for (name : recent) { S name2 = dropStarPrefix(name); File otherDB = newFile(g22utils.databasesMotherDir(), name2); if (isDirectory(otherDB)) addMenuItem(menu, name2, rThread { g22utils.masterStuff().openDatabase(otherDB, neq(name, name2)) }); } }).run()); ret lblDB; } }