From 7a51a6f09bee138d620860d30c6d7daa1533213d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Zieli=C5=84ski?= Date: Fri, 10 Feb 2023 17:29:13 +0100 Subject: [PATCH] [MOS-357] Broken navigation around contact adding From now on, after cancelling or confirming a new contact creation initiated from the call log, the phone goes back to correct windows. --- .../windows/PhonebookNewContact.cpp | 13 ++++++++++++- pure_changelog.md | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/module-apps/application-phonebook/windows/PhonebookNewContact.cpp b/module-apps/application-phonebook/windows/PhonebookNewContact.cpp index 441ceb7428e3b85fffb4e88d13dd6555e3eac029..b2f1e7578b2b08e589b6c37e104271f1f2adca6f 100644 --- a/module-apps/application-phonebook/windows/PhonebookNewContact.cpp +++ b/module-apps/application-phonebook/windows/PhonebookNewContact.cpp @@ -5,6 +5,7 @@ #include "DialogMetadata.hpp" #include "application-phonebook/ApplicationPhonebook.hpp" +#include #include #include @@ -119,6 +120,16 @@ namespace gui auto PhonebookNewContact::onInput(const InputEvent &inputEvent) -> bool { + auto backToCallLogIfCameFromThere = [this]() { + // MOS-357: conditionally (@see ApplicationManagerCommon::handleSwitchBack) return to call log + return app::manager::Controller::switchBack( + application, std::make_unique("ApplicationCallLog")); + }; + + if (inputEvent.isShortRelease(gui::KeyCode::KEY_RF)) { + return backToCallLogIfCameFromThere(); + } + auto ret = AppWindow::onInput(inputEvent); setSaveButtonVisible(!newContactModel->emptyData()); @@ -132,7 +143,7 @@ namespace gui newContactModel->saveData(contact); verifyAndSave(); - return true; + return backToCallLogIfCameFromThere(); } return ret; diff --git a/pure_changelog.md b/pure_changelog.md index 0e9199ea7501161526c6ffb50aefb01d400532fd..f6b3774e4da7285062232ebe69642ce41698ea74 100644 --- a/pure_changelog.md +++ b/pure_changelog.md @@ -75,6 +75,7 @@ * Fixed invalid screen displayed after missed call * Fixed minor issues in the Calculator Application * Fixed displaying usual SMS template call rejection window when no templates were defined +* Fixed going back to wrong window after confirming or cancelling creation of new contact from call log ## [1.5.0 2022-12-20]