mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-20 09:17:23 +01:00
[poincare] Fix Warning message exit on special keys
We want the memory full warning to be exited only on OK, EXE, ... but Syntax warning (for instance) to be exited on any key pressed
This commit is contained in:
@@ -179,7 +179,7 @@ void AppsContainer::run() {
|
||||
if (!ExceptionRun(ecp)) {
|
||||
activeApp()->snapshot()->reset();
|
||||
switchTo(appSnapshotAtIndex(0));
|
||||
activeApp()->displayWarning(I18n::Message::AppMemoryFull);
|
||||
activeApp()->displayWarning(I18n::Message::AppMemoryFull, true);
|
||||
}
|
||||
Container::run();
|
||||
switchTo(nullptr);
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
void displayModalViewController(ViewController * vc, float verticalAlignment, float horizontalAlignment,
|
||||
KDCoordinate topMargin = 0, KDCoordinate leftMargin = 0, KDCoordinate bottomMargin = 0, KDCoordinate rightMargin = 0);
|
||||
void dismissModalViewController();
|
||||
void displayWarning(I18n::Message warningMessage);
|
||||
void displayWarning(I18n::Message warningMessage, bool specialExitKeys = false);
|
||||
const Container * container() const;
|
||||
uint8_t m_magic; // Poor man's RTTI
|
||||
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
class WarningController : public ViewController {
|
||||
public:
|
||||
WarningController(Responder * parentResponder, I18n::Message warningMessage);
|
||||
void setLabel(I18n::Message message);
|
||||
void setLabelAndSpecialExitKeys(I18n::Message message);
|
||||
void setLabel(I18n::Message message, bool specialExitKeys);
|
||||
const char * title() override;
|
||||
View * view() override;
|
||||
bool handleEvent(Ion::Events::Event event) override;
|
||||
|
||||
@@ -96,8 +96,8 @@ void App::dismissModalViewController() {
|
||||
m_modalViewController.dismissModalViewController();
|
||||
}
|
||||
|
||||
void App::displayWarning(I18n::Message warningMessage) {
|
||||
m_warningController.setLabelAndSpecialExitKeys(warningMessage);
|
||||
void App::displayWarning(I18n::Message warningMessage, bool specialExitKeys) {
|
||||
m_warningController.setLabel(warningMessage, specialExitKeys);
|
||||
m_modalViewController.displayModalViewController(&m_warningController, 0.5f, 0.5f);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,14 +36,9 @@ WarningController::WarningController(Responder * parentResponder, I18n::Message
|
||||
{
|
||||
}
|
||||
|
||||
void WarningController::setLabel(I18n::Message label) {
|
||||
void WarningController::setLabel(I18n::Message label, bool specialExitKeys) {
|
||||
m_contentView.setLabel(label);
|
||||
m_exitOnOKBackEXE = false;
|
||||
}
|
||||
|
||||
void WarningController::setLabelAndSpecialExitKeys(I18n::Message message) {
|
||||
setLabel(message);
|
||||
m_exitOnOKBackEXE = true;
|
||||
m_exitOnOKBackEXE = specialExitKeys;
|
||||
}
|
||||
|
||||
const char * WarningController::title() {
|
||||
|
||||
Reference in New Issue
Block a user