#include "Info.hpp" #include "../ApplicationSettings.hpp" #include "Label.hpp" #include "Margins.hpp" #include "i18/i18.hpp" #include "service-appmgr/ApplicationManager.hpp" #include #include #include #include namespace gui { Info::Info(app::Application *app) : AppWindow(app, gui::window::hw_info) { buildInterface(); } void Info::rebuild() { destroyInterface(); buildInterface(); } void add_box_label(BoxLayout *layout, const std::string &text) { auto el = new gui::Label(layout, 0, 0, style::window_width, style::window::label::default_h); style::window::decorateOption(el); el->setText(text); } void Info::buildInterface() { AppWindow::buildInterface(); bottomBar->setActive(BottomBar::Side::CENTER, true); bottomBar->setActive(BottomBar::Side::RIGHT, true); bottomBar->setText(BottomBar::Side::CENTER, utils::localize.get(style::strings::common::select)); bottomBar->setText(BottomBar::Side::RIGHT, utils::localize.get(style::strings::common::back)); topBar->setActive(TopBar::Elements::SIGNAL, true); topBar->setActive(TopBar::Elements::BATTERY, true); setTitle("Info"); box = new gui::VBox(this, 0, title->offset_h(), style::window_width, 7 * style::window::label::default_h); box->setPenWidth(style::window::default_border_no_focus_w); add_box_label(box, "GIT revision: " + std::string(GIT_REV)); add_box_label(box, "GIT tag: " + std::string(GIT_TAG)); add_box_label(box, "GIT branch: " + std::string(GIT_BRANCH)); add_box_label(box, "Modem Firmware:"); std::string firmwareVersion; CellularServiceAPI::GetFirmwareVersion(getApplication(), firmwareVersion); add_box_label(box, firmwareVersion); LOG_DEBUG("Modem Firmware: %s", firmwareVersion.c_str()); /// TODO: make sure entire string is displayed. box->resizeItems(); // this->focusItem->setFocus(true); } void Info::destroyInterface() { erase(); } void Info::onBeforeShow(ShowMode mode, SwitchData *data) {} } // namespace gui