MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / drawNetwork

Method drawNetwork

3ds/source/SettingsScreen.cpp:432–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430}
431
432void SettingsScreen::drawNetwork(void) const
433{
434 Configuration& cfg = Configuration::getInstance();
435
436 // Row 0: the interactive FTP-server toggle.
437 const bool ftpOn = cfg.isFTPEnabled();
438 drawToggleRow(26, i18n::t("settings.network.ftp"), i18n::t("settings.network.ftp.sub"), ftpOn, contentFocus && contentCursor == 0);
439
440 int y = 68;
441 auto field = [&](const std::string& label, const std::string& value, u32 valColor) {
442 TextPool::get().draw(label, 20, y, 0.4f, COLOR_FAINT);
443 TextPool::get().draw(value, 20, y + 14, 0.46f, valColor);
444 y += 38;
445 };
446
447 std::string ftpAddress = FTPServer::getAddress();
448 field(i18n::t("settings.network.ftp_address"),
449 ftpOn ? (ftpAddress.empty() ? i18n::t("common.unavailable") : ftpAddress) : i18n::t("common.disabled"),
450 ftpOn && !ftpAddress.empty() ? COLOR_TEAL : COLOR_MUTED);
451
452 const bool transferOn = cfg.transferEnabled();
453 field(i18n::t("settings.network.transfer"), transferOn ? i18n::t("common.enabled") : i18n::t("common.disabled"),
454 transferOn ? COLOR_TEAL : COLOR_MUTED);
455
456 std::string address = Server::getAddress();
457 field(i18n::t("settings.network.memory_logs"), address.empty() ? i18n::t("common.unavailable") : address + "/logs/memory",
458 address.empty() ? COLOR_MUTED : COLOR_TEXT);
459 field(i18n::t("settings.network.file_logs"), address.empty() ? i18n::t("common.unavailable") : address + "/logs/file",
460 address.empty() ? COLOR_MUTED : COLOR_TEXT);
461
462 if (contentFocus) {
463 drawHints(320, 223, std::string(GLYPH_A) + " " + i18n::t("hint.toggle") + " " + GLYPH_B + " " + i18n::t("hint.back"));
464 }
465 else {
466 drawHints(320, 223, std::string(GLYPH_A) + " " + i18n::t("hint.edit"));
467 }
468}
469
470void SettingsScreen::drawAbout(void) const
471{

Callers

nothing calls this directly

Calls 7

getFunction · 0.85
drawHintsFunction · 0.85
stringFunction · 0.85
transferEnabledMethod · 0.80
isFTPEnabledMethod · 0.45
drawMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected