From 9a281dfe68edffa42a8208476eb3bb1183c1865e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Zieli=C5=84ski?= Date: Mon, 6 Feb 2023 19:07:42 +0100 Subject: [PATCH] [MOS-663] Replacement for empty templates screen Now there's information displayed that there are no templates and in order to add some, the user needs to use Mudita Center. Also, given no templates, the screen doesn't show the 'USE' button. --- image/system_a/data/lang/Deutsch.json | 1 + image/system_a/data/lang/English.json | 1 + image/system_a/data/lang/Espanol.json | 1 + image/system_a/data/lang/Francais.json | 1 + image/system_a/data/lang/Polski.json | 1 + image/system_a/data/lang/Svenska.json | 1 + .../models/SMSTemplateModel.cpp | 6 +++++- .../windows/SMSTemplatesWindow.cpp | 15 +++++++++++++++ .../windows/SMSTemplatesWindow.hpp | 3 +++ pure_changelog.md | 2 ++ 10 files changed, 31 insertions(+), 1 deletion(-) diff --git a/image/system_a/data/lang/Deutsch.json b/image/system_a/data/lang/Deutsch.json index d662d067a3c8ec25cea914cd2eda3fcf7856438f..7cda6f1a3f0dba5616044791ad62dbf758876358 100644 --- a/image/system_a/data/lang/Deutsch.json +++ b/image/system_a/data/lang/Deutsch.json @@ -338,6 +338,7 @@ "app_call_wrong_emergency": "Anruf nicht möglich.\n$NUMBER ist keine Notrufnummer.", "app_messages_title_main": "Nachrichten", "app_messages_no_messages": "Noch keine Nachrichten.

Zum Hinzufügen linken Pfeil drücken.

", + "app_messages_no_templates": "Noch keine Vorlagen.

Erstellen Sie eine neue Vorlage

im Mudita Center, um sie in Ihrem

Pure zu verwenden.

", "app_messages_thread_delete_confirmation": "Dieses Gespräch löschen?", "app_messages_message_delete_confirmation": "

Diese Nachricht wirklich löschen

?
", "app_messages_thread_no_result": "Keine Ergebnisse", diff --git a/image/system_a/data/lang/English.json b/image/system_a/data/lang/English.json index 6f5c1e1790e048ce07bb79a7df356b653e33a3ba..55568b9ed8db1de20ba0d1f70e8f88aaf4bc3a44 100644 --- a/image/system_a/data/lang/English.json +++ b/image/system_a/data/lang/English.json @@ -309,6 +309,7 @@ "app_call_wrong_emergency": "Can't make a call.\n$NUMBER is not an emergency number.", "app_messages_title_main": "Messages", "app_messages_no_messages": "No messages yet.

Press left arrow to add new.

", + "app_messages_no_templates": "No templates yet.

Create a new template in Mudita

Center to use in your Pure.

", "app_messages_thread_delete_confirmation": "Delete this conversation?", "app_messages_message_delete_confirmation": "Delete this message?", "app_messages_thread_no_result": "There are no results", diff --git a/image/system_a/data/lang/Espanol.json b/image/system_a/data/lang/Espanol.json index 70316c7c9f7b2254c21289d40257e6937f65e5f1..6d3f725577302343190f84b83e0df9053ecd2a15 100644 --- a/image/system_a/data/lang/Espanol.json +++ b/image/system_a/data/lang/Espanol.json @@ -338,6 +338,7 @@ "app_call_wrong_emergency": "No es posible realizar la llamada.\n$NUMBER no es un número de emergencias.", "app_messages_title_main": "Mensajes", "app_messages_no_messages": "No hay mensajes.

Pulsa la flecha izquierda para añadir uno.

", + "app_messages_no_templates": "Aún no hay plantillas.

Crea una nueva plantilla en Mudita

Center para usar en tu Pure.

", "app_messages_thread_delete_confirmation": "¿Eliminar esta conversación?", "app_messages_message_delete_confirmation": "

¿Seguro que quieres eliminar

este mensaje?
", "app_messages_thread_no_result": "No hay resultados", diff --git a/image/system_a/data/lang/Francais.json b/image/system_a/data/lang/Francais.json index 3bb1e39ff2a4aabbc4508bb7e96628f32b10e452..98db783acb1ff8bfce9ed612414f4e6657fd6af1 100644 --- a/image/system_a/data/lang/Francais.json +++ b/image/system_a/data/lang/Francais.json @@ -307,6 +307,7 @@ "app_call_wrong_emergency": "Impossible de faire un appel.\n$NUMBER n'est pas un numéro d'urgence.", "app_messages_title_main": "Messages", "app_messages_no_messages": "Aucun message.

Appuyez sur la flèche gauche pour en composer un nouveau.

", + "app_messages_no_templates": "Pas encore de modèles.

Créez un nouveau modèle sur Mudita

Center à utiliser dans votre Pure.

", "app_messages_thread_delete_confirmation": "Supprimer cette conversation ?", "app_messages_message_delete_confirmation": "

Do you really want to delete

this message?
", "app_messages_thread_no_result": "Aucun résultat", diff --git a/image/system_a/data/lang/Polski.json b/image/system_a/data/lang/Polski.json index 4d71c8dd09324e293c597e889d8c0236d7652288..b7a1fc29baedfd972e53a92a8bb839fe098ca9cd 100644 --- a/image/system_a/data/lang/Polski.json +++ b/image/system_a/data/lang/Polski.json @@ -330,6 +330,7 @@ "app_call_wrong_emergency": "Nie można wykonać połączenia.\n$NUMBER nie jest numerem alarmowym.", "app_messages_title_main": "Wiadomości", "app_messages_no_messages": "Nie ma jeszcze żadnych wiadomości.

Wciśnij lewą strzałkę, by dodać nową.

", + "app_messages_no_templates": "Nie ma jeszcze żadnych szablonów.

Stwórz nowy szablon w Mudita

Center, aby użyć go w swoim Pure.

", "app_messages_thread_delete_confirmation": "Usunąć tę rozmowę?", "app_messages_message_delete_confirmation": "

Czy na pewno chcesz usunąć

tę wiadomość?
", "app_messages_thread_no_result": "Brak wyników", diff --git a/image/system_a/data/lang/Svenska.json b/image/system_a/data/lang/Svenska.json index 4bb9995389f27ef24ea70eaf6b68cbc3bdccf0f3..2b826e6b5334d8ba1829d716277618cff6f9bef0 100644 --- a/image/system_a/data/lang/Svenska.json +++ b/image/system_a/data/lang/Svenska.json @@ -273,6 +273,7 @@ "app_call_wrong_emergency": "Kan inte ringa..\n$NUMBER är inte ett nödnummer.", "app_messages_title_main": "Meddelanden", "app_messages_no_messages": "Inga meddelanden än.

Tryck vänsterpil för att börja skriva ett.

", + "app_messages_no_templates": "Inga mallar ännu.

Skapa en ny mall i Mudita

Center som du kan använda i din Pure.

", "app_messages_thread_delete_confirmation": "Radera konversation?", "app_messages_message_delete_confirmation": "

Vill du radera

konversationen?
", "app_messages_thread_no_result": "Inga resultat", diff --git a/module-apps/application-messages/models/SMSTemplateModel.cpp b/module-apps/application-messages/models/SMSTemplateModel.cpp index cc7fd9b4ec4e3c5b681247fdcb15fd6bd0d2b340..a3459fe092ec95481df9ce1c40ee25835a35c028 100644 --- a/module-apps/application-messages/models/SMSTemplateModel.cpp +++ b/module-apps/application-messages/models/SMSTemplateModel.cpp @@ -10,7 +10,11 @@ #include SMSTemplateModel::SMSTemplateModel(app::ApplicationCommon *app) : DatabaseModel(app), app::AsyncCallbackReceiver{app} -{} +{ + /* In the base class DatabaseModel, this is initialised to maximal unsigned int value, but in fact should be 0. + Not wanting to tinker with the whole database handling framework, let's correct this here in a smaller scale. */ + recordsCount = 0; +} unsigned int SMSTemplateModel::requestRecordsCount() { diff --git a/module-apps/application-messages/windows/SMSTemplatesWindow.cpp b/module-apps/application-messages/windows/SMSTemplatesWindow.cpp index 3f2e169e77eef6cab74f7f98a228356061ea33d2..2d6c82bf895285b6462827c91894072a22d506f6 100644 --- a/module-apps/application-messages/windows/SMSTemplatesWindow.cpp +++ b/module-apps/application-messages/windows/SMSTemplatesWindow.cpp @@ -48,6 +48,16 @@ namespace gui this, style::x, style::y, style::w, style::h, smsTemplateModel, listview::ScrollBarType::Fixed); list->setBoundaries(Boundaries::Continuous); + using namespace ::style; + emptyListIcon = new Icon(this, + 0, + window::default_vertical_pos, + window_width, + window_height - window::default_vertical_pos - ::style::nav_bar::height, + "info_128px_W_G", + utils::translate("app_messages_no_templates")); + emptyListIcon->setVisible(false); + setFocusItem(list); } @@ -93,6 +103,11 @@ namespace gui preventsAutoLock = false; if (mode == ShowMode::GUI_SHOW_INIT) { list->rebuildList(); + if (list->isEmpty()) { + list->setVisible(false); + navBar->setActive(nav_bar::Side::Center, false); + emptyListIcon->setVisible(true); + } } if (auto switchData = dynamic_cast(data)) { diff --git a/module-apps/application-messages/windows/SMSTemplatesWindow.hpp b/module-apps/application-messages/windows/SMSTemplatesWindow.hpp index c4325108a23f3fa912231a4395a3b707224d4c3e..6af30f6701c9a29dda65f57b8adef02dd0067d3b 100644 --- a/module-apps/application-messages/windows/SMSTemplatesWindow.hpp +++ b/module-apps/application-messages/windows/SMSTemplatesWindow.hpp @@ -7,6 +7,8 @@ #include "SMSTemplateModel.hpp" #include + +#include #include #include @@ -19,6 +21,7 @@ namespace gui { std::shared_ptr smsTemplateModel; gui::ListView *list = nullptr; + gui::Icon *emptyListIcon = nullptr; void smsSendTemplateRequestHandler(const SMSSendTemplateRequest *const switchData); void smsTemplateRequestHandler(const SMSTemplateRequest *const switchData); diff --git a/pure_changelog.md b/pure_changelog.md index c592cf36b97e2b34ed251aef439f74454829054a..b7fbfe22305cf3f7423e5eb733df8a7952013a23 100644 --- a/pure_changelog.md +++ b/pure_changelog.md @@ -15,6 +15,7 @@ * Changed order of starting services, ServiceDesktop moved to the back * Shortened duration of phone modes pop-up from 3s to 1s * Changed responses in contacts and messages endpoints used to communicate with Center +* Added SMS template call rejection window for case when no templates are defined ### Fixed @@ -72,6 +73,7 @@ * Fixed incorrect loudspeaker icon in call window when headset was connected during a call * Fixed invalid screen displayed after missed call * Fixed minor issues in the Calculator Application +* Fixed displaying usual SMS template call rejection window when no templates were defined ## [1.5.0 2022-12-20]