M image/assets/lang/Deutsch.json => image/assets/lang/Deutsch.json +4 -3
@@ 376,11 376,12 @@
"app_settings_display_wallpaper_clock": "Uhr",
"app_settings_display_wallpaper_quotes": "Sprüche",
"app_settings_apps_alarm_clock_manual_volume": "Manuelle Lautstärke",
- "app_settings_display_wallpaper_edit_quotes": "Sprüche ändern",
- "app_settings_display_wallpaper_quotes_edit": "Spruch ändern",
- "app_settings_display_wallpaper_quotes_delete": "Spruch löschen",
+ "app_settings_display_wallpaper_edit_custom_quotes": "Benutzerdefinierte Sprüche ändern",
+ "app_settings_display_wallpaper_quotes_edit": "Ändern",
+ "app_settings_display_wallpaper_quotes_delete": "Löschen",
"app_settings_display_wallpaper_quotes_new": "Neuer Spruch",
"app_settings_display_wallpaper_quotes_delete_confirmation": "Spruch löschen?",
+ "app_settings_display_wallpaper_quotes_delete_success": "Spruch wurde gelöscht.",
"app_settings_display_wallpaper_quotes_note": "Notiz",
"app_settings_display_wallpaper_quotes_author": "Autor",
"app_settings_display_wallpaper_quotes_our_favourites": "Unsere Favoriten",
M image/assets/lang/English.json => image/assets/lang/English.json +6 -4
@@ 343,15 343,17 @@
"app_settings_display_wallpaper_clock": "Clock",
"app_settings_display_wallpaper_quotes": "Quotes",
"app_settings_display_wallpaper_edit_quotes": "Edit quotes",
- "app_settings_display_wallpaper_quotes_edit": "Edit quote",
- "app_settings_display_wallpaper_quotes_delete": "Delete quote",
+ "app_settings_display_wallpaper_edit_custom_quotes": "Edit custom quotes",
+ "app_settings_display_wallpaper_quotes_edit": "Edit",
+ "app_settings_display_wallpaper_quotes_delete": "Delete",
"app_settings_display_wallpaper_quotes_new": "New quote",
- "app_settings_display_wallpaper_quotes_delete_confirmation": "Delete quote?",
+ "app_settings_display_wallpaper_quotes_delete_confirmation": "Delete this quote?",
+ "app_settings_display_wallpaper_quotes_delete_success": "Quote deleted.",
"app_settings_display_wallpaper_quotes_note": "Note",
"app_settings_display_wallpaper_quotes_author": "Author",
"app_settings_display_wallpaper_quotes_our_favourites": "Our favourites",
"app_settings_display_wallpaper_quotes_custom": "Custom",
- "app_settings_display_wallpaper_quotes_categories": "Categories",
+ "app_settings_display_wallpaper_quotes_categories": "Select categories",
"app_settings_system": "System",
"app_settings_apps": "Apps",
"app_settings_apps_phone": "Phone",
M image/assets/lang/Espanol.json => image/assets/lang/Espanol.json +4 -3
@@ 376,11 376,12 @@
"app_settings_display_wallpaper_clock": "Reloj",
"app_settings_apps_alarm_clock_manual_volume": "Volumen de sonido manual",
"app_settings_display_wallpaper_quotes": "Citas",
- "app_settings_display_wallpaper_edit_quotes": "Editar citas",
- "app_settings_display_wallpaper_quotes_edit": "Editar cita",
- "app_settings_display_wallpaper_quotes_delete": "Eliminar cita",
+ "app_settings_display_wallpaper_edit_custom_quotes": "Editar citas personalizadas",
+ "app_settings_display_wallpaper_quotes_edit": "Editar",
+ "app_settings_display_wallpaper_quotes_delete": "Eliminar",
"app_settings_display_wallpaper_quotes_new": "Nueva cita",
"app_settings_display_wallpaper_quotes_delete_confirmation": "¿Eliminar cita?",
+ "app_settings_display_wallpaper_quotes_delete_success": "Cita eliminada.",
"app_settings_display_wallpaper_quotes_note": "Nota",
"app_settings_display_wallpaper_quotes_author": "Autor",
"app_settings_display_wallpaper_quotes_our_favourites": "Nuestras favoritas",
M image/assets/lang/Francais.json => image/assets/lang/Francais.json +4 -3
@@ 344,11 344,12 @@
"app_settings_display_wallpaper_logo": "Logo de Mudita",
"app_settings_display_wallpaper_clock": "Horloge",
"app_settings_display_wallpaper_quotes": "Citations",
- "app_settings_display_wallpaper_edit_quotes": "Modifier les citations",
- "app_settings_display_wallpaper_quotes_edit": "Modifier la citation",
- "app_settings_display_wallpaper_quotes_delete": "Supprimer la citation",
+ "app_settings_display_wallpaper_edit_custom_quotes": "Modifier les citations personnalisée",
+ "app_settings_display_wallpaper_quotes_edit": "Modifier",
+ "app_settings_display_wallpaper_quotes_delete": "Supprimer",
"app_settings_display_wallpaper_quotes_new": "Nouvelle citation",
"app_settings_display_wallpaper_quotes_delete_confirmation": "Supprimer la citation ?",
+ "app_settings_display_wallpaper_quotes_delete_success": "Citation supprimée.",
"app_settings_display_wallpaper_quotes_note": "Note",
"app_settings_display_wallpaper_quotes_author": "Auteur",
"app_settings_display_wallpaper_quotes_our_favourites": "Nos favourites",
M image/assets/lang/Polski.json => image/assets/lang/Polski.json +5 -3
@@ 381,15 381,17 @@
"app_settings_display_wallpaper_clock": "Zegar",
"app_settings_display_wallpaper_quotes": "Cytaty",
"app_settings_display_wallpaper_edit_quotes": "Edytuj cytaty",
- "app_settings_display_wallpaper_quotes_edit": "Edytuj cytat",
- "app_settings_display_wallpaper_quotes_delete": "Usuń cytat",
+ "app_settings_display_wallpaper_edit_custom_quotes": "Edytuj własne cytaty",
+ "app_settings_display_wallpaper_quotes_edit": "Edytuj",
+ "app_settings_display_wallpaper_quotes_delete": "Usuń",
"app_settings_display_wallpaper_quotes_new": "Nowy cytat",
"app_settings_display_wallpaper_quotes_delete_confirmation": "Usunąć cytat?",
+ "app_settings_display_wallpaper_quotes_delete_success": "Cytat usunięty.",
"app_settings_display_wallpaper_quotes_note": "Notatka",
"app_settings_display_wallpaper_quotes_author": "Autor",
"app_settings_display_wallpaper_quotes_our_favourites": "Nasze ulubione",
"app_settings_display_wallpaper_quotes_custom": "Własne",
- "app_settings_display_wallpaper_quotes_categories": "Kategorie",
+ "app_settings_display_wallpaper_quotes_categories": "Wybierz kategorie",
"app_settings_system": "System",
"app_settings_apps": "Aplikacje",
"app_settings_apps_phone": "Telefon",
M image/assets/lang/Svenska.json => image/assets/lang/Svenska.json +5 -2
@@ 305,11 305,14 @@
"app_settings_display_wallpaper_logo": "Mudita-logotyp",
"app_settings_display_wallpaper_clock": "Klocka",
"app_settings_display_wallpaper_quotes": "Citat",
- "app_settings_display_wallpaper_quotes_edit": "Redigera citat",
- "app_settings_display_wallpaper_quotes_delete": "Radera citat",
+ "app_settings_display_wallpaper_edit_custom_quotes": "Redigera citat",
+ "app_settings_display_wallpaper_quotes_edit": "Redigera",
+ "app_settings_display_wallpaper_quotes_delete": "Radera",
"app_settings_display_wallpaper_quotes_new": "Nytt citat",
"app_settings_display_wallpaper_quotes_delete_confirmation": "Radera citatet?",
+ "app_settings_display_wallpaper_quotes_delete_success": "Citat raderat.",
"app_settings_display_wallpaper_quotes_author": "Författare",
+ "app_settings_display_wallpaper_quotes_categories": "Kategorier",
"app_onboarding_select_sim": "Välj aktivt SIM-kort",
"app_onboarding_select_sim_description": "<text> Endast ett SIM-kort kan vara aktivt i taget. <br> </br> Du kan välja det nu och växla in <br> </br> Inställningarna när det behövs. </text> ",
"app_settings_system": "System",
M module-apps/application-settings/widgets/display-keypad/QuoteWidget.cpp => module-apps/application-settings/widgets/display-keypad/QuoteWidget.cpp +3 -2
@@ 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 "QuoteWidget.hpp"
@@ 21,7 21,7 @@ namespace style::quotes
inline constexpr int32_t description_label_right_margin = 40;
inline constexpr int32_t tick_image_left_margin = -64;
- inline constexpr int32_t tick_image_right_margin = 32;
+ inline constexpr int32_t tick_image_right_margin = 21;
} // namespace widget
@@ 51,6 51,7 @@ namespace gui
tickImage = new ImageBox(
hBox, 0, 0, style::widgets::iconsSize, style::widgets::iconsSize, new Image("small_tick_32px_W_M"));
tickImage->setVisible(true);
+ tickImage->setMargins(gui::Margins(0, 0, style::quotes::widget::tick_image_right_margin, 0));
tickImage->showImage(quote.enabled);
tickImage->setEdges(RectangleEdge::Bottom);
M module-apps/application-settings/windows/display-keypad/EditQuotesWindow.cpp => module-apps/application-settings/windows/display-keypad/EditQuotesWindow.cpp +30 -66
@@ 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 "EditQuotesWindow.hpp"
@@ 18,73 18,37 @@ namespace gui
{
std::list<gui::Option> optionsList;
- auto addCheckOption = [&](UTF8 text, bool &switcher) {
- optionsList.emplace_back(std::make_unique<gui::option::OptionSettings>(
- text,
- [&](gui::Item &item) mutable {
- switchHandler(switcher);
- return true;
- },
- [=](gui::Item &item) {
- if (item.focus) {
- this->setNavBarText(utils::translate(style::strings::common::Switch), nav_bar::Side::Center);
- }
- return true;
- },
- this,
- switcher ? gui::option::SettingRightItem::Checked : gui::option::SettingRightItem::Disabled));
- };
-
- addCheckOption(utils::translate("app_settings_display_wallpaper_quotes_our_favourites"),
- isOurFavouritesSwitchOn);
-
- if (isOurFavouritesSwitchOn) {
- optionsList.emplace_back(std::make_unique<gui::option::OptionSettings>(
- utils::translate("app_settings_display_wallpaper_quotes_categories"),
- [=](gui::Item &item) {
- application->switchWindow(gui::window::name::quote_categories, nullptr);
- return true;
- },
- [=](gui::Item &item) {
- if (item.focus) {
- this->setNavBarText(utils::translate(style::strings::common::select), nav_bar::Side::Center);
- }
- return true;
- },
- this,
- gui::option::SettingRightItem::ArrowWhite));
- }
-
- addCheckOption(utils::translate("app_settings_display_wallpaper_quotes_custom"), isCustomSwitchOn);
-
- if (isCustomSwitchOn) {
- optionsList.emplace_back(std::make_unique<gui::option::OptionSettings>(
- utils::translate("app_settings_display_wallpaper_edit_quotes"),
- [=](gui::Item &item) {
- application->switchWindow(gui::window::name::quotes, nullptr);
- return true;
- },
- [=](gui::Item &item) {
- if (item.focus) {
- this->setNavBarText(utils::translate(style::strings::common::select), nav_bar::Side::Center);
- }
- return true;
- },
- this,
- gui::option::SettingRightItem::ArrowWhite));
- }
+ optionsList.emplace_back(std::make_unique<gui::option::OptionSettings>(
+ utils::translate("app_settings_display_wallpaper_quotes_categories"),
+ [=](gui::Item &item) {
+ application->switchWindow(gui::window::name::quote_categories, nullptr);
+ return true;
+ },
+ [=](gui::Item &item) {
+ if (item.focus) {
+ this->setNavBarText(utils::translate(style::strings::common::select), nav_bar::Side::Center);
+ }
+ return true;
+ },
+ this,
+ gui::option::SettingRightItem::ArrowWhite));
+
+ optionsList.emplace_back(std::make_unique<gui::option::OptionSettings>(
+ utils::translate("app_settings_display_wallpaper_edit_custom_quotes"),
+ [=](gui::Item &item) {
+ application->switchWindow(gui::window::name::quotes, nullptr);
+ return true;
+ },
+ [=](gui::Item &item) {
+ if (item.focus) {
+ this->setNavBarText(utils::translate(style::strings::common::select), nav_bar::Side::Center);
+ }
+ return true;
+ },
+ this,
+ gui::option::SettingRightItem::ArrowWhite));
return optionsList;
}
- void EditQuotesWindow::switchHandler(bool &optionSwitch)
- {
- isOurFavouritesSwitchOn = false;
- isCustomSwitchOn = false;
-
- optionSwitch = !optionSwitch;
-
- refreshOptionsList();
- }
-
} // namespace gui
M module-apps/application-settings/windows/display-keypad/EditQuotesWindow.hpp => module-apps/application-settings/windows/display-keypad/EditQuotesWindow.hpp +0 -3
@@ 18,9 18,6 @@ namespace gui
void switchHandler(bool &optionSwitch);
auto buildOptionsList() -> std::list<Option> override;
- bool isOurFavouritesSwitchOn = false;
- bool isCustomSwitchOn = false;
-
Item *quotes;
OptionWindowDestroyer rai_destroyer = OptionWindowDestroyer(*this);
};
M module-apps/application-settings/windows/display-keypad/QuotesAddWindow.cpp => module-apps/application-settings/windows/display-keypad/QuotesAddWindow.cpp +22 -15
@@ 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 "QuotesAddWindow.hpp"
@@ 17,8 17,8 @@ namespace gui
{
namespace
{
- constexpr auto maxQuoteCharactersCount = 150U;
- constexpr auto maxQuoteLinesCount = 4;
+ constexpr auto maxQuoteCharactersCount = 170U;
+ constexpr auto maxQuoteLinesCount = 8U;
constexpr auto maxAuthorCharactersCount = 30U;
auto formatCounterText(uint32_t counter, uint32_t maxValue) -> std::string
@@ 53,27 53,27 @@ namespace gui
vBox->setPenWidth(::style::window::default_border_rect_no_focus);
auto authorHeader = new HBox(vBox, 0, 0, 0, 0);
- authorHeader->setMinimumSize(style::window::default_body_width, style::window::label::default_h);
+ authorHeader->setMinimumSize(style::window::default_body_width, style::window::label::small_h);
authorHeader->setEdges(gui::RectangleEdge::None);
authorHeader->activeItem = false;
auto authorLabel = new Label(authorHeader, 0, 0, 0, 0);
- authorLabel->setMinimumSize(style::headerWidth, style::window::label::default_h);
+ authorLabel->setMinimumSize(style::headerWidth, style::window::label::small_h);
authorLabel->setEdges(RectangleEdge::None);
authorLabel->setAlignment(gui::Alignment{gui::Alignment::Horizontal::Left});
authorLabel->setText(utils::translate("app_settings_display_wallpaper_quotes_author"));
authorLabel->setPenFocusWidth(::style::window::default_border_focus_w);
- authorLabel->setFont(::style::window::font::verysmall);
+ authorLabel->setFont(::style::window::font::small);
authorLabel->setPadding(gui::Padding(0, 0, 0, 0));
authorLabel->activeItem = false;
authorText = new gui::Text(vBox, 0, 0, 0, 0);
- authorText->setMinimumSize(style::window::default_body_width, style::window::label::default_h);
+ authorText->setMinimumSize(style::window::default_body_width, style::window::label::small_h);
authorText->setAlignment(gui::Alignment{gui::Alignment::Vertical::Top});
authorText->setPenFocusWidth(::style::window::default_border_focus_w);
authorText->setPenWidth(::style::window::default_border_rect_no_focus);
authorText->setEdges(gui::RectangleEdge::Bottom);
- authorText->setFont(::style::window::font::medium);
+ authorText->setFont(::style::window::font::mediumbold);
authorText->setInputMode(new InputMode(
{InputMode::ABC, InputMode::abc, InputMode::digit},
[=](const UTF8 &text) { navBarTemporaryMode(text); },
@@ 82,23 82,23 @@ namespace gui
authorText->setTextLimitType(gui::TextLimitType::MaxSignsCount, maxAuthorCharactersCount);
auto quoteHeader = new HBox(vBox, 0, 0, 0, 0);
- quoteHeader->setMinimumSize(style::window::default_body_width, style::window::label::default_h);
+ quoteHeader->setMinimumSize(style::window::default_body_width, style::window::label::small_h);
quoteHeader->activeItem = false;
quoteHeader->setEdges(gui::RectangleEdge::None);
+ quoteHeader->setMargins({0, ::style::margins::huge, 0, 0});
auto quoteLabel = new Label(quoteHeader, 0, 0, 0, 0);
- quoteLabel->setMinimumSize(style::headerWidth, style::window::label::default_h);
+ quoteLabel->setMinimumSize(style::headerWidth, style::window::label::small_h);
quoteLabel->setEdges(RectangleEdge::None);
quoteLabel->setPenFocusWidth(::style::window::default_border_focus_w);
quoteLabel->setText(utils::translate("app_settings_display_wallpaper_quotes_note"));
- quoteLabel->setFont(::style::window::font::verysmall);
+ quoteLabel->setFont(::style::window::font::small);
quoteLabel->setAlignment(gui::Alignment{gui::Alignment::Horizontal::Left});
quoteLabel->activeItem = false;
quoteText = new gui::Text(vBox, 0, 0, 0, 0);
quoteText->setAlignment(gui::Alignment{gui::Alignment::Vertical::Top});
- quoteText->setMinimumSize(style::window::default_body_width,
- style::window::label::default_h * maxQuoteLinesCount);
+ quoteText->setMaximumSize(vBox->getWidth(), style::window::label::small_h * maxQuoteLinesCount);
quoteText->setPenFocusWidth(::style::window::default_border_focus_w);
quoteText->setPenWidth(::style::window::default_border_rect_no_focus);
quoteText->setEdges(gui::RectangleEdge::Bottom);
@@ 119,7 119,7 @@ namespace gui
setTitle(utils::translate("app_settings_display_wallpaper_quotes_new"));
vBox->resizeItems();
- setFocusItem(quoteText);
+ setFocusItem(authorText);
}
void QuoteAddEditWindow::onBeforeShow(ShowMode mode, SwitchData *data)
@@ 151,6 151,14 @@ namespace gui
quoteData.quote = quoteText->getText();
quoteData.author = authorText->getText();
+ if (quoteData.quote.empty()) {
+ return true;
+ }
+
+ if (quoteData.author.empty()) {
+ quoteData.author = "Anonymous";
+ }
+
if (quoteAction == QuoteAction::Add) {
quoteModel->add(quoteData);
}
@@ 171,5 179,4 @@ namespace gui
{
quoteCharCounter->setText(formatCounterText(count, maxQuoteCharactersCount));
}
-
} // namespace gui
M module-apps/application-settings/windows/display-keypad/QuotesMainWindow.cpp => module-apps/application-settings/windows/display-keypad/QuotesMainWindow.cpp +2 -2
@@ 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 "QuotesMainWindow.hpp"
@@ 32,7 32,7 @@ namespace gui
{
AppWindow::buildInterface();
- setTitle(utils::translate("app_settings_display_wallpaper_quotes"));
+ setTitle(utils::translate("app_settings_display_wallpaper_edit_custom_quotes"));
header->navigationIndicatorAdd(new gui::header::AddElementAction(), gui::header::BoxSelection::Left);
navBar->setText(nav_bar::Side::Center, utils::translate(style::strings::common::check));
M module-apps/application-settings/windows/display-keypad/QuotesOptionsWindow.cpp => module-apps/application-settings/windows/display-keypad/QuotesOptionsWindow.cpp +26 -6
@@ 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 "QuotesOptionsWindow.hpp"
@@ 7,8 7,10 @@
#include <application-settings/windows/WindowNames.hpp>
#include <DialogMetadataMessage.hpp>
+#include <Dialog.hpp>
#include <OptionSetting.hpp>
#include <Text.hpp>
+#include <service-appmgr/Controller.hpp>
namespace gui
{
@@ 41,15 43,15 @@ namespace gui
optionsList.emplace_back(std::make_unique<gui::option::OptionSettings>(
utils::translate("app_settings_display_wallpaper_quotes_delete"),
[=](gui::Item &item) {
- auto metaData = std::make_unique<gui::DialogMetadataMessage>(
- gui::DialogMetadata{quote.quote,
+ auto quoteText = quote.quote;
+ auto metaData = std::make_unique<gui::DialogMetadataMessage>(
+ gui::DialogMetadata{quoteText,
"delete_128px_W_G",
utils::translate("app_settings_display_wallpaper_quotes_delete_confirmation"),
"",
- [this]() {
+ [this, quoteText]() {
quotesModel->remove(quote);
- application->switchWindow(gui::name::window::main_window);
- return true;
+ return showDeleteNotification(quoteText);
}});
application->switchWindow(
gui::window::name::quotes_dialog_yes_no, gui::ShowMode::GUI_SHOW_INIT, std::move(metaData));
@@ 75,4 77,22 @@ namespace gui
BaseSettingsWindow::onBeforeShow(mode, data);
}
+
+ bool QuotesOptionsWindow::showDeleteNotification(std::string titleText)
+ {
+ auto metaData = std::make_unique<gui::DialogMetadataMessage>(
+ gui::DialogMetadata{titleText,
+ "success_128px_W_G",
+ utils::translate("app_settings_display_wallpaper_quotes_delete_success"),
+ "",
+ [=]() -> bool {
+ auto data = std::make_unique<SwitchData>();
+ data->ignoreCurrentWindowOnStack = true;
+ this->application->switchWindow(gui::window::name::quotes, std::move(data));
+ return true;
+ }});
+ metaData->ignoreCurrentWindowOnStack = true;
+ application->switchWindow(gui::window::name::dialog_confirm, std::move(metaData));
+ return true;
+ }
} // namespace gui
M module-apps/application-settings/windows/display-keypad/QuotesOptionsWindow.hpp => module-apps/application-settings/windows/display-keypad/QuotesOptionsWindow.hpp +1 -0
@@ 16,6 16,7 @@ namespace gui
private:
std::list<Option> buildOptionsList() override;
void onBeforeShow(ShowMode mode, SwitchData *data) override;
+ bool showDeleteNotification(std::string titleText);
std::shared_ptr<Quotes::QuotesModel> quotesModel;
Quotes::QuoteRecord quote;
M module-apps/application-settings/windows/display-keypad/WallpaperWindow.cpp => module-apps/application-settings/windows/display-keypad/WallpaperWindow.cpp +3 -2
@@ 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 "WallpaperWindow.hpp"
@@ 62,7 62,8 @@ namespace gui
return true;
},
this,
- gui::option::SettingRightItem::ArrowWhite));
+ gui::option::SettingRightItem::ArrowWhite,
+ true));
}
return optionsList;