M module-apps/application-phonebook/windows/PhonebookNewContact.cpp => module-apps/application-phonebook/windows/PhonebookNewContact.cpp +11 -6
@@ 8,8 8,8 @@
#include "application-phonebook/ApplicationPhonebook.hpp"
#include <Dialog.hpp>
+#include <service-appmgr/Controller.hpp>
#include <service-db/DBServiceAPI.hpp>
-#include <messages/DialogMetadataMessage.hpp>
namespace gui
{
@@ 55,6 55,8 @@ namespace gui
void PhonebookNewContact::onBeforeShow(ShowMode mode, SwitchData *data)
{
+ saveInfoAboutPreviousAppForProperSwitchBack(data);
+
if (mode == ShowMode::GUI_SHOW_INIT && data != nullptr) {
newContactModel->loadData(contact, data);
list->rebuildList();
@@ 120,8 122,6 @@ namespace gui
auto PhonebookNewContact::onInput(const InputEvent &inputEvent) -> bool
{
- auto ret = AppWindow::onInput(inputEvent);
-
setSaveButtonVisible(!newContactModel->emptyData());
if (inputEvent.isShortRelease(gui::KeyCode::KEY_ENTER) && !newContactModel->emptyData() &&
@@ 132,11 132,16 @@ namespace gui
newContactModel->saveData(contact);
verifyAndSave();
-
- return true;
+ }
+ else if (!inputEvent.isShortRelease(KeyCode::KEY_RF) || !shouldCurrentAppBeIgnoredOnSwitchBack()) {
+ return AppWindow::onInput(inputEvent);
}
- return ret;
+ return shouldCurrentAppBeIgnoredOnSwitchBack()
+ ? app::manager::Controller::switchBack(
+ application,
+ std::make_unique<app::manager::SwitchBackRequest>(nameOfPreviousApplication.value()))
+ : true;
}
auto PhonebookNewContact::verifyAndSave() -> bool
M module-apps/application-phonebook/windows/PhonebookNewContact.hpp => module-apps/application-phonebook/windows/PhonebookNewContact.hpp +1 -1
@@ 12,7 12,7 @@
namespace gui
{
- class PhonebookNewContact : public AppWindow
+ class PhonebookNewContact : public AppWindow, public InfoAboutPreviousAppWhereWeComeFrom
{
public:
explicit PhonebookNewContact(app::ApplicationCommon *app);
M module-apps/apps-common/options/type/OptionContact.cpp => module-apps/apps-common/options/type/OptionContact.cpp +1 -0
@@ 47,6 47,7 @@ namespace gui::option
switch (contactOperation) {
case ContactOperation::Add: {
+ data->nameOfSenderApplication = app->GetName();
data->ignoreCurrentWindowOnStack = true;
return app::manager::Controller::sendAction(app,
app::manager::actions::AddContact,
M pure_changelog.md => pure_changelog.md +1 -0
@@ 74,6 74,7 @@
* Fixed unnecessary deep refresh when pressing up arrow in empty list view
* Fixed going back to Messages instead of Contacts in case message thread was previously opened from Contacts
* Fixed autoconnecting other BT devices when another one is already connected
+* Fixed going to Calls instead of Contacts after aborted or confirmed attempt to create contact from Calls
## [1.6.0 2023-02-27]