~aleteoryx/muditaos

e1e4fa1f1fc764e8a42b485619352cbaff971ed6 — patrycja-paczkowska 2 years ago 70fe3a4
[MOS-201] Fix notes paste option

Check clipboard content before showing
paste option.
2 files changed, 16 insertions(+), 11 deletions(-)

M module-apps/application-notes/windows/NotesOptions.cpp
M pure_changelog.md
M module-apps/application-notes/windows/NotesOptions.cpp => module-apps/application-notes/windows/NotesOptions.cpp +15 -11
@@ 1,4 1,4 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "NotesOptions.hpp"


@@ 101,16 101,20 @@ namespace app::notes
                return true;
            },
            options);
        addOption(
            {"common_text_paste"},
            [application, textWidget](gui::Item &item) {
                if (textWidget != nullptr) {
                    textWidget->addText(Clipboard::getInstance().paste(), gui::AdditionType::perBlock);
                }
                application->returnToPreviousWindow();
                return true;
            },
            options);

        if (Clipboard::getInstance().gotData()) {
            addOption(
                {"common_text_paste"},
                [application, textWidget](gui::Item &item) {
                    if (textWidget != nullptr) {
                        textWidget->addText(Clipboard::getInstance().paste(), gui::AdditionType::perBlock);
                    }
                    application->returnToPreviousWindow();
                    return true;
                },
                options);
        }

        return options;
    }
} // namespace app::notes

M pure_changelog.md => pure_changelog.md +1 -0
@@ 47,6 47,7 @@
* Fixed selecting SIM during onboarding
* Fixed broken text in French and German on SIM selection screen during onboarding
* Fixed broken text in Spanish on the PIN input screen
* Fixed notes paste option showing for empty clipboard

### Added
* Added a popup for changing the SIM card