MCPcopy Create free account
hub / github.com/chrxh/alien / processStatusBar

Method processStatusBar

source/Gui/BrowserWindow.cpp:519–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517}
518
519void BrowserWindow::processStatusBar()
520{
521 std::vector<std::string> statusItems;
522
523 std::unordered_set<NetworkResourceRawTO> simulations;
524 std::unordered_set<NetworkResourceRawTO> genomes;
525 for (WorkspaceType workspaceType = 0; workspaceType < WorkspaceType_Count; ++workspaceType) {
526 auto const& simWorkspace = _workspaces.at(WorkspaceId{NetworkResourceType_Simulation, workspaceType});
527 auto const& genomeWorkspace = _workspaces.at(WorkspaceId{NetworkResourceType_Genome, workspaceType});
528 simulations.insert(simWorkspace.rawTOs.begin(), simWorkspace.rawTOs.end());
529 genomes.insert(genomeWorkspace.rawTOs.begin(), genomeWorkspace.rawTOs.end());
530 }
531
532 auto numSimulations = toInt(simulations.size());
533 auto numGenomes = toInt(genomes.size());
534
535 statusItems.emplace_back(std::to_string(numSimulations) + " simulations found");
536 statusItems.emplace_back(std::to_string(numGenomes) + " genomes found");
537 statusItems.emplace_back(std::to_string(_userTOs.size()) + " simulators found");
538
539 if (auto userName = NetworkService::get().getLoggedInUserName()) {
540 statusItems.emplace_back("Logged in as " + *userName + " @ " + NetworkService::get().getServerAddress());
541 } else {
542 statusItems.emplace_back("Not logged in to " + NetworkService::get().getServerAddress());
543 }
544
545 if (!NetworkService::get().getLoggedInUserName()) {
546 statusItems.emplace_back("In order to share and upvote simulations you need to log in.");
547 }
548
549 AlienImGui::StatusBar(statusItems);
550}
551
552void BrowserWindow::processSimulationList()
553{

Callers

nothing calls this directly

Calls 7

toIntFunction · 0.85
to_stringFunction · 0.85
beginMethod · 0.80
endMethod · 0.80
sizeMethod · 0.80
getLoggedInUserNameMethod · 0.80
getServerAddressMethod · 0.80

Tested by

no test coverage detected