M image/assets/lang/English.json => image/assets/lang/English.json +1 -0
@@ 23,6 23,7 @@
"common_stop": "STOP",
"common_resume": "RESUME",
"common_pause": "PAUSE",
+ "common_retry": "TRY AGAIN",
"common_mo": "MO",
"common_tu": "TU",
"common_we": "WE",
M module-apps/application-settings-new/ApplicationSettings.cpp => module-apps/application-settings-new/ApplicationSettings.cpp +3 -0
@@ 322,6 322,9 @@ namespace app
windowsFactory.attach(gui::window::name::change_date_and_time, [](Application *app, const std::string &name) {
return std::make_unique<gui::ChangeDateAndTimeWindow>(app);
});
+ windowsFactory.attach(gui::window::name::dialog_retry, [](Application *app, const std::string &name) {
+ return std::make_unique<gui::DialogRetry>(app, name);
+ });
}
void ApplicationSettingsNew::destroyUserInterface()
M module-apps/windows/Dialog.cpp => module-apps/windows/Dialog.cpp +15 -0
@@ 168,3 168,18 @@ void DialogYesNoIconTxt::onBeforeShow(ShowMode mode, SwitchData *data)
setFocusItem(no);
}
}
+
+DialogRetry::DialogRetry(app::Application *app, const std::string &name) : Dialog(app, name)
+{
+ bottomBar->setText(BottomBar::Side::CENTER, utils::localize.get(style::strings::common::retry));
+ setFocusItem(bottomBar);
+}
+
+void DialogRetry::onBeforeShow(ShowMode mode, SwitchData *data)
+{
+ if (auto metadata = dynamic_cast<DialogMetadataMessage *>(data); metadata != nullptr) {
+ Dialog::onBeforeShow(mode, metadata);
+ auto foo = metadata->get().action;
+ bottomBar->activatedCallback = [foo](Item &) -> bool { return foo(); };
+ }
+}
M module-apps/windows/Dialog.hpp => module-apps/windows/Dialog.hpp +12 -0
@@ 11,6 11,7 @@
namespace gui::window::name
{
inline constexpr auto dialog_confirm = "DialogConfirm";
+ inline constexpr auto dialog_retry = "DialogRetry";
}; // namespace gui::window::name
namespace gui
@@ 70,4 71,15 @@ namespace gui
void onBeforeShow(ShowMode mode, SwitchData *data) override;
};
+ /// @brief Retry Dialog class
+ ///
+ /// Contain same items as Dialog but instead of OK there is a TRY AGAIN button
+ class DialogRetry : public Dialog
+ {
+ public:
+ DialogRetry(app::Application *app, const std::string &name);
+
+ void onBeforeShow(ShowMode mode, SwitchData *data) override;
+ };
+
}; // namespace gui
M module-gui/gui/widgets/Style.hpp => module-gui/gui/widgets/Style.hpp +2 -0
@@ 152,6 152,8 @@ namespace style
inline constexpr auto resume = "common_resume";
inline constexpr auto pause = "common_pause";
inline constexpr auto accept = "common_accept";
+ inline constexpr auto retry = "common_retry";
+
// days
inline constexpr auto Monday = "common_monday";
inline constexpr auto Tuesday = "common_tuesday";