~aleteoryx/muditaos

e31e79657c327ce15a6ed6a0fed46edbdb1c0566 — Pawel.Paprocki 5 years ago 332aed9
[EGD-6182] Fix after ICE call full list of contacts is shown

Change way of calling ICE contacts
M module-apps/application-phonebook/models/PhonebookModel.cpp => module-apps/application-phonebook/models/PhonebookModel.cpp +5 -3
@@ 1,4 1,4 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <application-phonebook/ApplicationPhonebook.hpp>


@@ 150,8 150,10 @@ auto PhonebookModel::getItem(gui::Order order) -> gui::ListItem *
        if (event.keyCode == gui::KeyCode::KEY_LF) {
            if (item->contact && !item->contact->numbers.empty()) {
                const auto phoneNumber = item->contact->numbers.front().number;
                return app::manager::Controller::sendAction(
                    application, app::manager::actions::Dial, std::make_unique<app::ExecuteCallData>(phoneNumber));
                return app::manager::Controller::sendAction(application,
                                                            app::manager::actions::Dial,
                                                            std::make_unique<app::ExecuteCallData>(phoneNumber),
                                                            app::manager::OnSwitchBehaviour::RunInBackground);
            }
        }
        return false;

M module-apps/application-phonebook/windows/PhonebookIceContacts.cpp => module-apps/application-phonebook/windows/PhonebookIceContacts.cpp +11 -1
@@ 1,9 1,10 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "PhonebookIceContacts.hpp"
#include "application-phonebook/ApplicationPhonebook.hpp"
#include "application-phonebook/data/PhonebookStyle.hpp"
#include "service-appmgr/Controller.hpp"

#include <service-db/DBNotificationMessage.hpp>



@@ 55,6 56,15 @@ namespace gui

    bool PhonebookIceContacts::onInput(const InputEvent &inputEvent)
    {
        if (inputEvent.isShortPress()) {
            if (inputEvent.is(KeyCode::KEY_RF)) {
                app::manager::Controller::switchBack(application);
                return true;
            }
            else if (inputEvent.is(KeyCode::KEY_ENTER)) {
                return true;
            }
        }
        // check if any of the lower inheritance onInput methods catch the event
        return AppWindow::onInput(inputEvent);
    }