--- /dev/null
+#include "NoSwitchesModalPresenter.hpp"
+
+#include "AddSwitchPagePresenter.hpp"
+#include "AppContext.hpp"
+
+NoSwitchesModalPresenter::NoSwitchesModalPresenter()
+{
+ setTitle("Add switch?");
+ text_ = "To turn on Universal switch, tap ADD SWITCH and add at least one switch";
+
+ doneText_ = "IDS_ACCS_UNIVERSAL_SWITCH_POPUP_ADD";
+ doneCb_ = [this]() {
+ Singleton<AppContext>::instance().push(std::make_unique<AddSwitchPagePresenter>());
+ };
+
+ cancelCb_ = [this]() {
+ DEBUG("cancel cb");
+ };
+}
\ No newline at end of file
--- /dev/null
+#ifndef NO_SWITCHES_MODAL_PRESENTER_HPP
+#define NO_SWITCHES_MODAL_PRESENTER_HPP
+
+#include "ModalPresenter.hpp"
+
+class NoSwitchesModalPresenter : public ModalPresenter
+{
+ public:
+ NoSwitchesModalPresenter();
+};
+
+#endif
\ No newline at end of file
#include "UniversalSwitchPagePresenter.hpp"
+#include "NoSwitchesModalPresenter.hpp"
#include "UniversalSwitchSettingsPagePresenter.hpp"
UniversalSwitchPagePresenter::UniversalSwitchPagePresenter()
else {
item->widgetState_ = false;
DEBUG("No switch configured");
- //There should be created popup which inform that user should configure at least one switch
+ Singleton<AppContext>::instance().pushModal(std::make_unique<NoSwitchesModalPresenter>());
}
},
ListItem::WidgetType::toggle,
c();
nf->removeChild(p);
},
- "IDS_ACCS_DELETE",
+ presenter->getDoneText(),
"bottom");
popup->setPartContent("button2", doneBtn);
}
\ No newline at end of file