From 40c628fc60c234b0bce60f28ffe068f8875a7ee9 Mon Sep 17 00:00:00 2001 From: Lefucjusz Date: Thu, 5 Jan 2023 15:15:50 +0100 Subject: [PATCH] [MOS-495] Fix deleting message content when changing phone mode Fix of the issue that moving mode slider on new message window caused the content of the message to be deleted. --- module-apps/application-messages/windows/NewMessage.cpp | 8 +++----- .../apps-common/ApplicationCommonPopupBlueprints.cpp | 8 +++++--- .../apps-common/locks/input/PhoneLockedKeysWhitelist.cpp | 3 +-- pure_changelog.md | 1 + 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/module-apps/application-messages/windows/NewMessage.cpp b/module-apps/application-messages/windows/NewMessage.cpp index 53db1693df5cb69aaff307430dd84ce6bdcbe3e8..a2598981322ff45e0da00990253c5c1e0b0c2ce5 100644 --- a/module-apps/application-messages/windows/NewMessage.cpp +++ b/module-apps/application-messages/windows/NewMessage.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include "ApplicationMessages.hpp" @@ -287,9 +287,6 @@ namespace gui if (event.isShortRelease(KeyCode::KEY_RF)) { onClose(CloseReason::WindowSwitch); } - if (event.isKeyRelease(KeyCode::KEY_VOLUP) || event.isKeyRelease(KeyCode::KEY_VOLDN)) { - memento->setState(message); - } return false; }; body->addWidget(message); @@ -309,11 +306,12 @@ namespace gui return; } - if (reason == CloseReason::PhoneLock) { + if ((reason == CloseReason::PhoneLock) || (reason == CloseReason::Popup)) { memento->setState(message); message->clear(); return; } + if (const auto handled = handleMessageText(); !handled) { message->clear(); } diff --git a/module-apps/apps-common/ApplicationCommonPopupBlueprints.cpp b/module-apps/apps-common/ApplicationCommonPopupBlueprints.cpp index 633d6117454da797ca2db150d1e2d68aa324c3d9..a3eb006c782e5dbd4760c63e65bc0bb3d3cdbfd5 100644 --- a/module-apps/apps-common/ApplicationCommonPopupBlueprints.cpp +++ b/module-apps/apps-common/ApplicationCommonPopupBlueprints.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include "AppWindow.hpp" @@ -32,7 +32,8 @@ namespace app else { switchWindowPopup(popupName, popupParams->getDisposition(), - std::make_unique(mode, flightMode)); + std::make_unique(mode, flightMode), + SwitchReason::Popup); } return true; }); @@ -56,7 +57,8 @@ namespace app updateCurrentWindow(std::move(popupData)); } else { - switchWindowPopup(popupName, volumeParams->getDisposition(), std::move(popupData)); + switchWindowPopup( + popupName, volumeParams->getDisposition(), std::move(popupData), SwitchReason::Popup); } return true; }); diff --git a/module-apps/apps-common/locks/input/PhoneLockedKeysWhitelist.cpp b/module-apps/apps-common/locks/input/PhoneLockedKeysWhitelist.cpp index 868b05182fc244e5d580158835c0c3991291164d..76e1bf69069e6e689111d86b161515b968790f13 100644 --- a/module-apps/apps-common/locks/input/PhoneLockedKeysWhitelist.cpp +++ b/module-apps/apps-common/locks/input/PhoneLockedKeysWhitelist.cpp @@ -1,8 +1,7 @@ -// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include "PhoneLockedKeysWhitelist.hpp" -#include namespace locks::PhoneLockedKeysWhitelist { diff --git a/pure_changelog.md b/pure_changelog.md index 2bad437d7857bca0981d60ea2758f76ad692da1f..84e66240c6383d26ba175764e6052c440b2469d6 100644 --- a/pure_changelog.md +++ b/pure_changelog.md @@ -19,6 +19,7 @@ * Fixed improper message text displaying after pasting from clipboard * Fixed USSD handling crash * Fixed calls to emergency contact when typed manually +* Fixed message content being deleted when phone mode changed on new message window ### Added