From 2433a23a778a9daec731adf9537b0800c3b5f131 Mon Sep 17 00:00:00 2001 From: Mateusz Piesta Date: Fri, 26 Aug 2022 07:29:03 +0200 Subject: [PATCH 01/31] [BH-1555] Prepare release branch Remove swedish from the list of supported languages. --- image/system_a/data/lang/Svenska.json | 551 -------------------------- 1 file changed, 551 deletions(-) delete mode 100644 image/system_a/data/lang/Svenska.json diff --git a/image/system_a/data/lang/Svenska.json b/image/system_a/data/lang/Svenska.json deleted file mode 100644 index dc946d51e0..0000000000 --- a/image/system_a/data/lang/Svenska.json +++ /dev/null @@ -1,551 +0,0 @@ -{ - "metadata": { - "display_name": "Svenska" - }, - "common_add": "LÄGG TILL", - "common_open": "ÖPPNA", - "common_call": "RING", - "common_save": "SPARA", - "common_edit": "REDIGERA", - "common_send": "SKICKA", - "common_reply": "SVARA", - "common_confirm": "BEKRÄFTA", - "common_select": "VÄLJ", - "common_use": "ANVÄND", - "common_ok": "OK", - "common_back": "TILLBAKA", - "common_contacts": "KONTAKTER", - "common_set": "VÄLJ", - "common_show": "VISA", - "common_yes": "Ja", - "common_no": "Nej", - "common_switch": "VÄXLA", - "common_options": "ALTERNATIV", - "common_options_title": "Alternativ", - "common_information": "Information", - "common_check": "MARKERA", - "common_uncheck": "AVMARKERA", - "common_emoji": "EMOJI", - "common_special_characters": "SPECIAL", - "common_start": "STARTA", - "common_stop": "STOPPA", - "common_resume": "FORTSÄTT", - "common_pause": "PAUSA", - "common_play": "SPELA", - "common_replace": "ERSÄTT", - "common_mo": "MÅ", - "common_tu": "TI", - "common_we": "ON", - "common_th": "TO", - "common_fr": "FR", - "common_sa": "LÖ", - "common_su": "SÖ", - "common_mon": "Mån", - "common_tue": "Tis", - "common_wed": "Ons", - "common_thu": "Tor", - "common_fri": "Fre", - "common_sat": "Lör", - "common_sun": "Sön", - "common_monday": "Måndag", - "common_tuesday": "Tisdag", - "common_wednesday": "Onsdag", - "common_thursday": "Torsdag", - "common_friday": "Fredag", - "common_saturday": "Lördag", - "common_sunday": "Söndag", - "common_january": "Januari", - "common_february": "Februari", - "common_march": "Mars", - "common_april": "April", - "common_may": "Maj", - "common_june": "Juni", - "common_july": "Juli", - "common_august": "Augusti", - "common_september": "September", - "common_october": "Oktober", - "common_november": "November", - "common_december": "December", - "common_yesterday": "Igår", - "common_today": "Idag", - "common_results_prefix": "Resultat: ", - "common_search": "SÖK", - "common_text_copy": "Kopiera text", - "common_text_paste": "Klistra in text", - "locale_12hour_min": "%I:%M %p", - "locale_12hour_min_short": "%I:%M", - "locale_24hour_min": "%H:%M", - "locale_date_DD_MM_YYYY": "%d.%m.%Y", - "locale_date_MM_DD_YYYY": "%m.%d.%Y", - "locale_date_DD_MM_YY": "%d.%m.%y", - "locale_date_MM_DD_YY": "%m.%d.%y", - "locale_date_DD_MM": "%d.%m", - "locale_date_MM_DD": "%m.%d", - "locale_date_Day_DD_Mon": "%A, %d %b", - "locale_date_Day_Mon_DD": "%A, %b %d", - "common_AM": "AM", - "common_PM": "PM", - "duration_min_0sec": "%M:%0S", - "duration_0min_0sec": "%0M:%0S", - "duration_0hmin_0sec": "%0N:%0S", - "duration_hour_0min_0sec": "%H:%0M:%0S", - "brightness_text": "LJUSSTYRKA", - "volume_text": "LJUDVOLYM", - "home_modes_connected": "ANSLUTEN", - "home_modes_notdisturb": "STÖR EJ", - "home_modes_offline": "FRÅNKOPPLAD", - "app_alarm_clock_title_main": "Väckarklocka", - "app_alarm_clock_repeat_never": "Aldrig", - "app_alarm_clock_repeat_everyday": "Varje dag", - "app_alarm_clock_repeat_week_days": "Vardagar", - "app_alarm_clock_repeat_custom": "Eget val", - "app_alarm_clock_no_alarms_information": "Inga larmtider än.

Tryck vänsterpil för att lägga till en.

", - "app_alarm_clock_options_edit": "Redigera", - "app_alarm_clock_options_delete": "Radera", - "app_alarm_clock_options_turn_off_all_alarms": "Stäng av alla larm", - "app_alarm_clock_delete_confirmation": "Radera det här larmet?", - "app_alarm_clock_new_alarm_title": "Ny larmtid", - "app_alarm_clock_edit_alarm_title": "Redigera larmtid", - "app_alarm_clock_sound": "Ljud", - "app_alarm_clock_snooze": "Snooze", - "app_alarm_clock_repeat": "Upprepa", - "app_alarm_clock_snooze_5_min": "5 min", - "app_alarm_clock_snooze_10_min": "10 min", - "app_alarm_clock_snooze_15_min": "15 min", - "app_alarm_clock_snooze_30_min": "30 min", - "app_alarm_clock_play_pause": "SPELA/PAUSA", - "app_alarm_clock_custom_repeat_title": "Välj veckodagar", - "app_calendar_title_main": "Kalender", - "app_calendar_all_day": "Hela dagen", - "app_calculator_title_main": "Miniräknare", - "app_calculator_equals": "RESULTAT", - "app_calculator_decimal_separator": ",", - "app_calculator_error": "Fel", - "app_options_invalid_option": " ", - "app_options_contact_details": "Kontaktuppgifter", - "app_options_contact_add": "Lägg till i kontakter", - "app_options_contact_edit": "Redigera kontakt", - "app_notes_title_main": "Anteckningar", - "app_notes_edit_note": "Redigera anteckning", - "app_notes_new_note": "Skapa anteckning", - "app_notes_edit": "REDIGERA", - "app_notes_edited": "Redigerad", - "app_notes_delete_note": "Radera", - "app_notes_note_delete_confirmation": "Vill du radera den här anteckningen?", - "app_notes_no_notes": "Inga anteckningar än.

Tryck vänsterpil för att lägga till en.

", - "app_notes_search_no_results": "Inga anteckningar hittade.", - "app_calllog_title_main": "Samtal", - "app_calllog_type": "Samtal", - "app_calllog_duration": "Längd", - "app_calllog_incoming_call": "Inkommande samtal", - "app_calllog_outgoing_call": "Utgående samtal", - "app_calllog_missed_call": "Missat samtal", - "app_calllog_rejected_call": "Avvisat samtal", - "app_calllog_date": "Datum", - "app_calllog_options_delete_call": "Radera samtal", - "app_calllog_delete_call_confirmation": "Ta bort det här samtalet från listan?", - "app_calllog_delete_all_calls": "Ta bort alla samtal", - "app_calllog_delete_all_calls_confirmation": "Ta bort alla samtal från listan?", - "app_calllog_no_calls": "Inga samtal ännu.", - "app_phonebook_no_contacts": "Inga kontakter ännu.

Tryck på vänsterpil för att lägga till nya.

", - "app_phonebook_no_contacts_yet": "Inga kontakter ännu.", - "app_music_player_artists": "Artister", - "app_music_player_albums": "Album", - "app_music_player_playlists": "Spellistor", - "app_music_player_uknown_title": "Okänd titel", - "app_music_player_uknown_artist": "Okänd artist", - "app_music_player_music_library_window_name": "Musikbibliotek", - "app_music_player_empty_track_notification": "Välj en låt från biblioteket", - "app_music_player_start_window_notification": "Tryck på nedåtpil för att välja

en låt från biblioteket
", - "app_desktop_unlock": "LÅS UPP", - "app_desktop_menu": "MENY", - "app_desktop_emergency": "NÖDSAMTAL", - "app_desktop_info": "Info", - "app_desktop_info_mmi_none_specified_failed": "Misslyckades", - "app_desktop_info_mmi_none_specified_success": "Lyckades", - "app_desktop_info_mmi_common_failed": "misslyckat", - "app_desktop_info_mmi_common_no_message": "inte", - "app_desktop_info_mmi_common_mmi_not_supported": "stöds inte", - "app_desktop_info_mmi_common_enabled": "påslaget", - "app_desktop_info_mmi_common_disabled": "frånkopplat", - "app_desktop_info_mmi_common_voice": "röst", - "app_desktop_info_mmi_common_data": "data", - "app_desktop_info_mmi_common_fax": "FAX", - "app_desktop_info_mmi_common_sync": "sync", - "app_desktop_info_mmi_common_async": "async", - "app_desktop_info_mmi_common_all_disabled": "alla frånkopplade", - "app_desktop_info_mmi_common_deactivated": "avstängd", - "app_desktop_info_mmi_common_activated": "aktiverad", - "app_desktop_info_mmi_common_query": "sökning", - "app_desktop_info_mmi_clir_according_to_subscription": "Abonnemang avgör om dolt nummer", - "app_desktop_info_mmi_clir_enabled": "Dolt nummer på", - "app_desktop_info_mmi_clir_disabled": "Dolt nummer av", - "app_desktop_info_mmi_clir_not_provisioned": "Dolt nummer inte beställt", - "app_desktop_info_mmi_clir_permanent_provisioned": "Permanent dolt nummer", - "app_desktop_info_mmi_clir_unknown": "Okänt om numret är dolt", - "app_desktop_info_mmi_clir_temporary_restricted": "Dolt nummer tillfälligt begränsat", - "app_desktop_info_mmi_clir_temporary_allowed": "Dolt nummer tillfälligt godkänt", - "app_desktop_info_mmi_registration_failed": "Registrering misslyckades", - "app_desktop_info_mmi_registration_success": "Registrering lyckades", - "app_desktop_info_mmi_erasure_failed": "Borttagning misslyckades", - "app_desktop_info_mmi_erasure_success": "Borttagning lyckades", - "app_desktop_info_mmi_disabling_failed": "Tjänstbortkoppling misslyckades", - "app_desktop_info_mmi_disabling_success": "Tjänsten har kopplats bort", - "app_desktop_info_mmi_enabling_failed": "Tjänstkoppling misslyckades", - "app_desktop_info_mmi_enabling_success": "Tjänsten har slagits på", - "app_desktop_info_mmi_call_forwarding_disabled": "Vidarebefordring frånkopplat", - "app_desktop_info_mmi_call_barring_activated": "Samtalsblockering påslaget", - "app_desktop_info_mmi_call_barring_deactivated": "Samtalsblockering borttagen", - "app_desktop_info_mmi_clip_activated": "Nummerpresentation påslagen", - "app_desktop_info_mmi_clip_deactivated": "Nummerpresentation avstängd", - "app_desktop_info_mmi_clip_not_provisioned": "Nummerpresentation inte beställd", - "app_desktop_info_mmi_clip_provisioned": "Nummerpresentation beställd", - "app_desktop_info_mmi_clip_unknown": "Nummerpresentationsläge avstängt", - "app_desktop_info_mmi_call_waiting_activated": " Samtal väntar påslaget", - "app_desktop_info_mmi_call_waiting_deactivated": "Samtal väntar avstängt", - "app_desktop_info_mmi_call_forwarding": "Vidarebefordring", - "app_desktop_info_mmi_call_barring": "Samtalsblockering", - "app_desktop_info_mmi_call_waiting": "Samtal väntar", - "app_desktop_info_mmi_clip": "Nummerpresentation", - "app_desktop_info_mmi_clir": "Dolt nummer", - "app_desktop_info_mmi_imei": "IMEI-nummer (MEID)", - "app_desktop_info_mmi_result_success": "Lyckades", - "app_desktop_info_mmi_result_failed": "Misslyckades", - "sim_header_setup": "$SIM-inställningar", - "sim_enter_pin_unlock": "Den förra PIN-koden:", - "sim_change_pin": "Ändra PIN-koden", - "sim_enter_new_pin": "Den nya PIN-koden:", - "sim_confirm_new_pin": "Bekräfta ny PIN-kod:", - "sim_setup_wrong_pin_last_attempt": "Fel PIN-kod. Du har

1 försök kvar.
", - "sim_setup_wrong_pin": "Fel PIN-kod. Du har

$ATTEMPTS försök kvar.
", - "sim_wrong_pin_confirmation": "Fel PIN-kod.", - "sim_cme_error": "SIM-kort

CME error:$CMECODE
", - "sim_puk_blocked": "SIM-kortet är låst.

Var god kontakta operatör.
", - "sim_setup_enter_puk": "SIM-kortet är låst.

För att låsa upp det, skriv in PUK-koden:
", - "sim_setup_wrong_puk": "Fel PUK-kod.

Du har $ATTEMPTS försök kvar.
", - "sim_setup_wrong_puk_last_attempt": "Fel PUK-kod.

Du har 1 försök kvar.
", - "sim_setup_wrong_puk_last_attempt_warning": "Om koden är fel den här gången

kommer SIM-kortet låsas och du kommer

behöva kontakta operatören.
", - "app_desktop_press_to_unlock": "Tryck Lås upp följt av #", - "app_desktop_press_to_complete_unlock": "Tryck på # för att låsa upp", - "app_desktop_unread_messages": "Olästa meddelanden", - "app_desktop_missed_calls": "Missade samtal", - "app_desktop_menu_phone": "SAMTAL", - "app_desktop_menu_contacts": "KONTAKTER", - "app_desktop_menu_messages": "MEDDELANDEN", - "app_desktop_menu_calendar": "KALENDER", - "app_desktop_menu_alarm": "VÄCKARKLOCKA", - "app_desktop_menu_meditation": "MEDITATION", - "app_desktop_menu_music": "MUSIK", - "app_desktop_menu_tools": "VERKTYG", - "app_desktop_menu_settings": "INSTÄLLNINGAR", - "app_desktop_menu_title": "Meny", - "app_desktop_tools_title": "Verktyg", - "app_desktop_tools_notes": "ANTECKNINGAR", - "app_desktop_tools_calculator": "MINIRÄKNARE", - "app_desktop_tools_antenna": "ANTENNTEST", - "app_desktop_poweroff_title": "Stäng av", - "app_desktop_poweroff_question": "Välj Ja för att stänga av", - "app_desktop_show": "VISA", - "app_desktop_calls": "SAMTAL", - "app_desktop_clear": "RADERA", - "app_desktop_clear_all": "RENSA ALLA", - "app_desktop_replay": "SVARA", - "app_call_call": "RING", - "app_call_clear": "RADERA", - "app_call_reject": "AVVISA", - "app_call_answer": "SVARA", - "app_call_message": "MEDDELANDE", - "app_call_end_call": "LÄGG PÅ", - "app_call_emergency": "Nödsamtal", - "app_call_is_calling": "ringer", - "app_call_calling": "ringer...", - "app_call_call_ended": "samtalet avslutat", - "app_call_call_rejected": "samtalet avvisad", - "app_call_contact": "KONTAKT", - "app_call_mute": "STUM", - "app_call_muted": "MIC. AV", - "app_call_speaker": "HÖGT.", - "app_call_speaker_on": "HÖGT. PÅ", - "app_call_bluetooth": "BLUETOOTH", - "app_call_no_sim": "För att ringa,\nsätt i ett SIM-kort.", - "app_call_no_network_connection": "Ingen nätverksanslutning.", - "app_call_call_request_failed": "Något gick fel.", - "app_call_offline": "Du är frånkopplad.\n\nByt till \"ansluten\"\nför att ringa.", - "app_call_emergency_text": "Nödsamtal", - "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", - "app_messages_message": "Meddelande", - "app_messages_templates": "Mallar", - "app_messages_no_sim": "För att skicka ett SMS,\nsätt i ett SIM-kort.", - "app_messages_thread_draft": "Utkast: ", - "app_messages_thread_not_sent": "Ej skickat: ", - "app_messages_thread_you": "Du: ", - "app_onboarding_title_configuration": "Konfiguration", - "app_onboarding_title_update_info": "MuditaOS-uppdatering", - "app_onboarding_skip_confirm": " SIM-installation krävs för
nätverksanslutning. Hoppar du ändå över installationen?
", - "app_onboarding_configuration_successful": " Din Mudita Pure
är klar att använda.
", - "app_onboarding_no_configuration": " Din Mudita Pure har inte
konfigurerats. Du kan gå till
Inställningar för att konfigurera den.
", - "app_onboarding_update_info": "Den nuvarande versionen av MuditaOS
är $VERSION.
Uppdateringar med nya funktioner och korrigeringar visas ofta.
För att uppdatera din telefon vänligen besök:
www.mudita.com/updateos
och följ instruktionerna.
", - "app_onboarding_eula_license": "Licensavtal (EULA)", - "app_settings_title_main": "Inställningar", - "app_settings_advanced": "Avancerad", - "app_settings_bt": "Bluetooth", - "app_settings_bluetooth_add_device": "Lägg till enhet", - "app_settings_bluetooth_all_devices": "Alla enheter", - "app_settings_bluetooth_searching_devices": "Söker efter enheter... \nDet kan ta en liten stund.", - "app_settings_bluetooth_main": "Bluetooth", - "app_settings_bluetooth_phone_name": "Telefonens namn", - "app_settings_bluetooth_phone_visibility": "Telefonens synlighetsläge", - "bluetooth_popup": "Bluetooth", - "bluetooth_popup_pin": "Ange PIN:", - "bluetooth_popup_passkey": "Ange nyckel:", - "bluetooth_popup_pair_cancel_code": "Enheten $DEVICE skulle vilja para
ihop med din Pure.
Bekräfta koden: $CODE
", - "bluetooth_popup_pair_cancel_no_code": "Enheten $DEVICE skulle vilja para
ihop med din Pure.
", - "bluetooth_popup_confirm": "Bekräfta", - "bluetooth_popup_cancel": "Avbryt", - "bluetooth_info_popup_success": "Din telefon är ihopparad med:

$DEVICE", - "bluetooth_info_popup_error": "Kopplingsprocess med $DEVICE

misslyckades. Felkod: $ERROR", - "app_settings_net": "Nätverk", - "app_settings_disp_key": "Skärm och knappar", - "app_settings_display_display_light": "Skärmbelysning", - "app_settings_display_dark_mode": "Mörkt läge (Beta)", - "app_settings_display_light_main": "Skärmbelysning", - "app_settings_display_light_auto": "Automatisk", - "app_settings_display_light_brightness": "Ljusstyrka", - "app_settings_display_font_size": "Teckenstorlek", - "app_settings_display_locked_screen": "Låst telefon", - "app_settings_display_keypad_light": "Knappbelysning", - "app_settings_display_keypad_light_on": "Alltid på", - "app_settings_display_keypad_light_active": "På vid användning", - "app_settings_display_keypad_light_off": "Av", - "app_settings_display_input_language": "Språk för att skriva", - "app_settings_display_wallpaper": "Bakgrundsbild", - "app_settings_display_wallpaper_logo": "Mudita-logotyp", - "app_settings_display_wallpaper_clock": "Klocka", - "app_settings_display_wallpaper_quotes": "Citat", - "app_settings_display_wallpaper_edit_quotes": "Redigera citat", - "app_settings_display_wallpaper_edit_custom_quotes": "Redigera citat", - "app_settings_display_wallpaper_quotes_edit": "Redigera citat", - "app_settings_display_wallpaper_quotes_delete": "Radera citat", - "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": " Endast ett SIM-kort kan vara aktivt
i taget.
Du kan välja det nu och växla in
Inställningarna när det behövs.
", - "app_settings_system": "System", - "app_settings_apps_tools": "Appar och verktyg", - "app_settings_apps_messages": "Meddelanden", - "app_settings_show_unread_first": "Visa olästa först", - "app_settings_Templates": "Mallar", - "app_settings_title_torch": "Ficklampa", - "app_settings_torch_sunset_red_light_option": "Rödtonat ljus", - "app_settings_torch_nightshift_time_option": "Nattljustid", - "app_settings_torch_description": "Under nattljustiden kommer ficklampan\nanvända rödtonat ljus för att inte störa\nsömnen för dig och andra kring dig.", - "app_settings_title_nightshift": "Nattljustid", - "app_settings_nightshift_from": "Från", - "app_settings_nightshift_to": "Till", - "app_settings_date_and_time": "Tid och datum", - "app_settings_date_and_time_automatic_date_and_time": "Automatisk tidsinställning", - "app_settings_date_and_time_change_date_and_time": "Ställ in tid och datum", - "app_settings_date_and_time_automatic_time_zone": "Automatisk tidszon", - "app_settings_date_and_time_change_time_zone": "Byt tidszon", - "app_settings_date_and_time_time_format": "Tidsformat", - "app_settings_date_and_time_date_format": "Datumformat", - "app_settings_date_and_time_time_zone": "Tidszon", - "app_settings_title_day": "Dag", - "app_settings_title_month": "Månad", - "app_settings_title_year": "År", - "app_settings_title_time": "Tid", - "app_settings_cellular_passthrough": "Telefonnätverk <-> USB", - "app_settings_display": "Skärm", - "app_settings_phone_modes": "Telefonlägen", - "app_settings_security": "Säkerhet", - "app_settings_language": "Språk", - "app_settings_factory_reset": "Fabriksinställningar", - "app_settings_display_factory_reset_confirmation": "Din Pure stängs av. Sätt på den manuellt för att fortsätta.\nStäng av telefonen nu?", - "app_settings_factory_reset_in_progress": "Fabriksåterställningen är inte klar än. Sätt på din Pure för att fortsätta.", - "app_settings_about_your_pure": "Om din Pure", - "app_settings_technical_information": "Teknisk information", - "app_settings_tech_info_model": "Model", - "app_settings_tech_info_serial_number": "Serial number", - "app_settings_tech_info_os_version": "OS Version", - "app_settings_tech_info_imei": "IMEI", - "app_settings_certification": "Certifiering", - "app_settings_us_fcc_id": "US FCC ID", - "app_settings_canada_ic": "Canada IC", - "app_settings_europe": "Europe", - "app_settings_sar": "SAR", - "app_settings_about": "Om Mudita Pure", - "app_settings_title_languages": "Språkval", - "app_settings_network_sim_cards": "SIM-kort", - "app_settings_network_volte_not_available": "inte tillgängligt", - "app_settings_network_active_card": "Aktivt slot", - "app_settings_network_unblock_card": "Avblockera kort", - "app_settings_network_not_connected": "inget kort", - "app_settings_network_operator_auto_select": "Välj operatör automatiskt", - "app_settings_network_all_operators": "Alla operatörer", - "app_settings_network_import_contacts_from_sim_card": "Importera kontakter från SIM", - "app_settings_network_import_contacts": "Importera kontakter", - "app_settings_network_import_contacts_duplicates": "Dubbletter från SIM", - "app_settings_network_import_contacts_from_sim_card_reading": "Importerar pågår...

Vänta en stund.
", - "app_settings_network_import_contacts_from_sim_card_no_contacts": "Det finns inga kontakter

på detta SIM-kort.
", - "app_settings_network_import_contacts_from_sim_card_duplicates": "Vi hittade $DUPLICATES dubbletter. Vill du

importera dubblerade kontakter

och ersätta befintliga?
", - "app_settings_network_import_contacts_from_sim_card_success": "Kontakter har importerats.", - "app_settings_network_sim1": "SIM1", - "app_settings_network_sim2": "SIM2", - "app_settings_network_sim_none": "Inget SIM", - "app_settings_network_voice_over_lte": "VoLTE", - "app_settings_network_apn_settings": "APN-inställningar", - "app_settings_option_connected_audio": "ANSLUTAD LJUD", - "app_settings_option_connected_voice": "ANSLUTAD RÖST", - "app_settings_option_connected_both": "ANSLUTAD RÖST, LJUD", - "app_settings_option_connecting": "ANSLUTAR", - "app_settings_option_pairing": "PAIRING", - "app_settings_title_do_not_disturb": "Stör inte", - "app_settings_title_offline": "Offline", - "app_settings_title_connection_frequency": "Anslutningsfrekvens", - "app_settings_connected": "Ansluten", - "app_settings_notifications_when_locked": "Meddelanden när de är låsta", - "app_settings_calls_from_favorites": "Samtal från favoriter", - "app_settings_allow": "Tillåt", - "app_settings_no_network_connection_flight_mode": "Flygläge", - "app_settings_messages_only": "Endast meddelanden", - "app_settings_info_dnd": "Ta emot alla aviseringar tyst. Du kan tillåta fullständiga aviseringar från favoritkontakter.", - "app_settings_info_offline_flight_mode": "Helt frånkopplad. Samtal, meddelanden och internetdelning är inte tillgängliga.", - "app_settings_info_offline_messages_only": "Skicka och ladda ner meddelanden baserat på anslutningsintervall. Inga samtal eller internetdelning.", - "app_settings_toggle_transiting": "kontrollerar...", - "app_settings_toggle_on": "PÅ", - "app_settings_toggle_off": "AV", - "app_settings_apps_alarm_clock_manual_volume": "Manuell ljudvolym", - "app_settings_apn_settings_no_apns": "Inga APN-inställningar än.

Tryck vänsterpil för att lägga till.

", - "app_settings_apn_options_delete": "Radera", - "app_settings_apn_options_edit": "Redigera", - "app_settings_apn_options_set_as_default": "Välj som förval", - "app_settings_new_edit_apn": "Skapa/Redigera APN", - "app_settings_apn_name": "Namn", - "app_settings_apn_APN": "APN", - "app_settings_apn_username": "Användarnamn", - "app_settings_apn_password": "Lösenord", - "app_settings_apn_authtype": "Autentiseringstyp", - "app_settings_apn_apntype": "APN-typ", - "app_settings_apn_apnprotocol": "APN-protokoll", - "app_settings_title_color_test": "Visa tillgängliga färger:", - "app_settings_toolbar_reset": "ÅTERSTÄLL", - "app_phonebook_title_main": "Kontakter", - "common_search_uc": "Sök", - "common_search_results": "Resultat", - "app_phonebook_search_no_results": "Inga kontakter funna.", - "app_phonebook_contact_title": "Lägg till kontakt", - "app_phonebook_contact_no_name": "inget namn", - "app_phonebook_contact_information": "Information", - "app_phonebook_contact_flag_fav": "FAVORITER", - "app_phonebook_contact_flag_speed_dial": "KORTNUMMER", - "app_phonebook_contact_flag_ice": "NÖDSITUATION", - "app_phonebook_contact_flag_blocked": "BLOCKERAD", - "app_phonebook_ice_contacts_title": "ICE-kontakter vid olycka", - "app_phonebook_favourite_contacts_title": "Favoritkontakter", - "app_phonebook_duplicate_speed_dial": "Nummer $CONTACT_SPEED_DIAL$ är inställt att ringa \n $CONTACT_FORMATTED_NAME$. Vill du ändra det?", - "app_phonebook_duplicate_speed_dial_title": "Förvalsnummer ($CONTACT_SPEED_DIAL$)", - "app_phonebook_options_edit": "Redigera kontakt", - "app_phonebook_options_block": "Blockera", - "app_phonebook_options_block_confirm": "Blockera den här kontakten?", - "app_phonebook_options_block_notification": "Kontakten blockerad.", - "app_phonebook_options_unblock": "Avblockera", - "app_phonebook_options_unblock_confirm": "Avblockera den här kontakten?", - "app_phonebook_options_unblock_notification": "Kontakten avblockerad.", - "app_phonebook_options_delete": "Radera", - "app_phonebook_options_delete_confirm": "Vill du radera den\nhär kontakten?", - "app_phonebook_options_delete_notification": "Kontakten raderad.", - "app_phonebook_options_forward_namecard": "Vidarebefordra kontaktuppgifter", - "app_phonebook_options_send_sms": "Skicka över SMS", - "app_phonebook_new_contact_first_name": "Förnamn", - "app_phonebook_new_contact_last_name": "Efternamn", - "app_phonebook_new_contact_number": "Nummer", - "app_phonebook_new_contact_second_number": "Alternativnummer", - "app_phonebook_new_contact_email": "Mail", - "app_phonebook_new_contact_address": "Adress", - "app_phonebook_new_contact_note": "Anteckning", - "app_phonebook_new_speed_dial_key": "Förvalsnummer", - "app_phonebook_new_contact_invalid_number": "Det går inte att spara den här kontakten.

Telefonnumret du angav

är i ett ogiltigt format.
", - "app_phonebook_new_add_to_fav": "Lägg till bland favoriter", - "app_phonebook_new_add_to_ice": "Lägg till bland ICE (kontakter i fall av olycka)", - "app_phonebook_check": "MARKERA", - "app_phonebook_uncheck": "AVMARKERA", - "app_phonebook_multiple_numbers_first": "Nummer", - "app_phonebook_multiple_numbers_second": "Alternativnummer", - "app_phonebook_contact_deleted": "Kontakten är raderad;

den kan inte redigeras.
", - "app_meditation_title_main": "Meditationsklocka", - "app_meditation_preparation_time": "Förbered dig", - "app_meditation_put_down_phone_and_wait": "Sätt ner telefonen
och vänta på klockslaget.
", - "app_meditation_thank_you_for_session": "Tack för den här
meditationsstunden.
", - "app_meditation_option_show_counter": "Visa mediationsräknare", - "app_meditation_interval_chime": "Klinga då och då", - "app_meditation_interval_none": "Av", - "app_meditation_interval_every_x_minutes": "Var %0:e minut", - "app_meditation_minute": "MINUT", - "app_meditation_minutes": "MINUTER", - "app_music_player_all_songs": "Alla låtar", - "app_music_player_play": "SPELA", - "app_music_player_music_library": "MUSIKSAMLING", - "app_music_player_quit": "AVSLUTA", - "app_music_player_music_empty_window_notification": "Tryck Musiksamling för att\nvälja en låt från samlingen", - "app_special_input_window": "Specialtecken", - "app_emoji_input_window": "Emoji", - "sms_add_rec_num": "Lägg till mottagare eller skriv ett nummer", - "sms_title_message": "Nytt meddelande", - "sms_call_text": "Ring ", - "sms_resend_failed": "Skicka igen", - "sms_delete_conversation": "Radera logg", - "sms_forward_message": "Vidarebefordra", - "sms_copy": "Kopiera", - "sms_delete_message": "Radera meddelande", - "sms_use_template": "Använd mall", - "sms_paste": "Klistra in", - "sms_mark_read": "Markera som läst", - "sms_mark_unread": "Markera som oläst", - "app_desktop_update": "Uppdatera", - "app_desktop_update_to": "Uppdatera till", - "app_desktop_update_apply": "Installera uppdatering?", - "app_desktop_update_current": "Aktuell", - "app_desktop_update_start": "Uppdatering börjar", - "app_desktop_update_size": "storlek", - "app_desktop_update_bytes": "bytes", - "app_desktop_update_unpacking": "Packar upp", - "app_call_private_number": "Dolt nummer", - "app_call_ending_call": "Avslutar samtalet", - "statusbar_tethering": "INTERNETDELNING", - "tethering": "Internetdelning", - "tethering_turn_off_question": "Stänga av Internetdelning?", - "tethering_enable_question": "Du är ansluten till datorn.
Slå på Internetdelning?
(vissa funktioner kan vara inaktiverade)
", - "tethering_phone_mode_change_prohibited": "Internetdelning är på.

Andra lägen (ansluten, DND,
offline) åsidosätts av detta
läge och fungerar inte.
", - "tethering_menu_access_decline": "Internetdelning är på.

För att öppna menyn,
stäng av internetdelning.
", - "app_settings_security_phone_lock": "Lösenord för låsskärm", - "app_settings_display_security_autolock": "Autolås", - "app_settings_security_change_phone_lock": "Ändra lösenord", - "phone_lock_unlock": " Ange lösenordet

för att låsa upp:
", - "phone_lock_blocked_information": "Fel lösenord.

Försök igen om $TIME.
", - "phone_lock_blocked_information_seconds": " sekunder", - "phone_lock_blocked_information_minute": "en minut", - "phone_lock_blocked_information_minutes": " minuter", - "phone_lock_notification": "Lösenordskod för $TIME", - "phone_lock_unlock_invalid": " Fel lösenord.

Försök igen.
", - "phone_lock_blocked": "Tyvärr, telefonen är blockerad", - "phone_lock_current": "Skriv nuvarande lösenord", - "phone_lock_enter_new": "Ange nytt lösenord", - "phone_lock_confirm_new": "Bekräfta nytt lösenord", - "phone_lock_invalid": "Fel lösenord!", - "phone_lock_changed_successfully": "Lösenordet har ändrats!", - "phone_lock_disabled": "Lösenord inaktiverat!", - "phone_lock_set": " Ange lösenord som låser upp

telefonen
", - "phone_lock_confirm": "Bekräfta lösenordet", - "phone_lock_invalid_retry": " Fel lösenord.

Konfigurera lösenord igen.
", - "phone_lock_configure": "Konfigurera lösenord", - "app_settings_security_usb_passcode": "USB-säkerhet" -} From 7b70370fcb1f66c19796833a2a31405d8b21d234 Mon Sep 17 00:00:00 2001 From: Mateusz Piesta Date: Fri, 31 Mar 2023 09:38:09 +0200 Subject: [PATCH 02/31] [MOS-000] Fixed minor issue in db migration script * Removed doubled copyright header from 'up/down/devel.sql' when committing databases. * During installing, 'devel.sql' was created even if specific revisions didn't contain one. * Removed unnecessary product-specific .lua scripts. --- .../db/databases/migration/sms/0/devel.sql | 1 + .../products/BellHybrid/update_product.lua | 17 ------------ .../lua/products/PurePhone/update_product.lua | 22 ---------------- tools/db_migration.py | 26 ++++++++++++------- 4 files changed, 17 insertions(+), 49 deletions(-) delete mode 100644 scripts/lua/products/BellHybrid/update_product.lua delete mode 100644 scripts/lua/products/PurePhone/update_product.lua diff --git a/products/PurePhone/services/db/databases/migration/sms/0/devel.sql b/products/PurePhone/services/db/databases/migration/sms/0/devel.sql index 77f627459e..3b6bf116c2 100644 --- a/products/PurePhone/services/db/databases/migration/sms/0/devel.sql +++ b/products/PurePhone/services/db/databases/migration/sms/0/devel.sql @@ -1,5 +1,6 @@ -- Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved. -- For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md + BEGIN TRANSACTION; INSERT OR REPLACE INTO "sms" ("_id","thread_id","contact_id","date","error_code","body","type") VALUES (1,2,2,1547492320,0,'Thank you for today!' || CHAR(10) || 'You chose a fantastic place :)',8); INSERT OR REPLACE INTO "sms" ("_id","thread_id","contact_id","date","error_code","body","type") VALUES (2,2,2,1547492321,0,'It was great seeing you too :*',4); diff --git a/scripts/lua/products/BellHybrid/update_product.lua b/scripts/lua/products/BellHybrid/update_product.lua deleted file mode 100644 index f3ad6b493c..0000000000 --- a/scripts/lua/products/BellHybrid/update_product.lua +++ /dev/null @@ -1,17 +0,0 @@ -local paths = require('paths') -local consts = require('consts') -local helpers = require('helpers') -local recovery = require('recovery') - -local update_product = {} - -function update_product.execute() - local old_music_dir = recovery.sys.user() .. "/music" - local new_music_dir = recovery.sys.user() .. "/media/app/relaxation" - - assert(helpers.mkdirp(new_music_dir)) - helpers.move_dir(old_music_dir, new_music_dir) - helpers.rmdir(old_music_dir) -end - -return update_product diff --git a/scripts/lua/products/PurePhone/update_product.lua b/scripts/lua/products/PurePhone/update_product.lua deleted file mode 100644 index 18cb18df1e..0000000000 --- a/scripts/lua/products/PurePhone/update_product.lua +++ /dev/null @@ -1,22 +0,0 @@ -local paths = require('paths') -local consts = require('consts') -local helpers = require('helpers') -local recovery = require('recovery') - -local update_product = {} - -function update_product.execute() - local old_music_dir = recovery.sys.user() .. "/music" - local new_music_dir = recovery.sys.user() .. "/media/app/music_player" - local old_battery_config = recovery.sys.user() .. "/batteryFuelGaugeConfig.cfg" - local new_battery_config = paths.target.var_dir .. "/batteryFuelGaugeConfig.cfg" - - assert(helpers.mkdirp(new_music_dir)) - helpers.move_dir(old_music_dir, new_music_dir) - helpers.rmdir(old_music_dir) - if helpers.exists(old_battery_config) then - helpers.copy_file(old_battery_config, new_battery_config) - end -end - -return update_product diff --git a/tools/db_migration.py b/tools/db_migration.py index 9e450b8f5a..28335c5df1 100644 --- a/tools/db_migration.py +++ b/tools/db_migration.py @@ -79,13 +79,15 @@ def __init__(self, dir: Path): self.metadata = RevisionMetadata.from_file(dir / RevisionMetadata.file_name) def read_sql(self): + lines_to_skip = license_header.count('\n') + with open(self.dir / up_script) as f: - up = f.read() + up = ''.join(f.readlines()[lines_to_skip:]) with open(self.dir / down_script) as f: - down = f.read() + down = ''.join(f.readlines()[lines_to_skip:]) try: with open(self.dir / devel_script) as f: - devel = f.read() + devel = ''.join(f.readlines()[lines_to_skip:]) except OSError: devel = None return up, down, devel @@ -109,13 +111,13 @@ def spawn(self): def _build_sql_template(self): with (self.dir / up_script).open('w') as file: - file.write(self._sql_header()) + file.write(license_header + self._sql_header()) with (self.dir / down_script).open('w') as file: - file.write(self._sql_header()) + file.write(license_header + self._sql_header()) with (self.dir / devel_script).open('w') as file: - file.write(self._sql_header()) + file.write(license_header + self._sql_header()) def _sql_header(self): return f'-- Message: {self.message}\n' \ @@ -336,18 +338,22 @@ def merge_sql_from_dir(directory: Path, out: Path): revisions = build_revision_entries(directory) # Merge up/down.sql - with open(out / up_script, 'w') as up_file, open(out / down_script, 'w') as down_file, open(out / devel_script, - 'w') as devel_file: + with open(out / up_script, 'w') as up_file, open(out / down_script, 'w') as down_file: up_file.write(license_header) down_file.write(license_header) - devel_file.write(license_header) + for rev in revisions: print(f"->Merging revision: {rev.metadata.id()}") sql_up, _, sql_devel = rev.read_sql() up_file.write(sql_up + '\n') if sql_devel: - devel_file.write(sql_devel + '\n') + if not (out / devel_script).exists(): + with open(out / devel_script, 'w') as devel_file: + devel_file.write(license_header) + + with open(out / devel_script, 'a+') as devel_file: + devel_file.write(sql_devel + '\n') # Down scripts need to be merged in reversed order for rev in reversed(revisions): From 42e5d1e15fa81a4ad03c3b8993847493abfb064e Mon Sep 17 00:00:00 2001 From: Lukasz Mastalerz Date: Fri, 10 Mar 2023 10:11:45 +0100 Subject: [PATCH 03/31] [CP-1852] Too many user files removes default relaxation audio from the list Changed order in which files in Relaxation are displayed Added error message when files limit is exceeded --- harmony_changelog.md | 2 + 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 + .../tests/MockSongsRepository.hpp | 6 +- .../apps-common/models/SongsRepository.cpp | 66 ++++++++++++------- .../apps-common/models/SongsRepository.hpp | 29 +++++--- .../CMakeLists.txt | 1 + .../data/RelaxationErrorData.hpp | 30 +++++++++ .../RelaxationMainWindowPresenter.cpp | 15 +++-- .../RelaxationMainWindowPresenter.hpp | 3 +- .../windows/RelaxationErrorWindow.cpp | 39 +++++++---- .../windows/RelaxationErrorWindow.hpp | 4 ++ .../windows/RelaxationMainWindow.cpp | 8 ++- .../windows/RelaxationMainWindow.hpp | 4 +- .../windows/RelaxationRunningLoopWindow.cpp | 4 +- .../RelaxationRunningProgressWindow.cpp | 4 +- 19 files changed, 163 insertions(+), 57 deletions(-) create mode 100644 products/BellHybrid/apps/application-bell-relaxation/data/RelaxationErrorData.hpp diff --git a/harmony_changelog.md b/harmony_changelog.md index a3b7267b21..43aec140b6 100644 --- a/harmony_changelog.md +++ b/harmony_changelog.md @@ -17,10 +17,12 @@ ### Added * Added error handling for incorrect audio formats and corrupted files inside Relaxation app +* Added error message when files limit is exceeded in Relaxation app ### Changed * Added new field to deviceInfo endpoint +* Changed order in which files are displayed in Relaxation ## [1.9.0 2023-04-03] diff --git a/image/system_a/data/lang/Deutsch.json b/image/system_a/data/lang/Deutsch.json index 42da3ceb24..6466cfc69c 100644 --- a/image/system_a/data/lang/Deutsch.json +++ b/image/system_a/data/lang/Deutsch.json @@ -666,6 +666,7 @@ "app_bell_relaxation_looped": "geschlungen", "app_bell_relaxation_loop_description": "der Titel wird abgespielt, bis Sie ihn ausschalten", "app_bell_relaxation_error_message": "Nicht unterstütztes Dateiformat", + "app_bell_relaxation_limit_error_message": "Datenlimit überschritten.
Es könnte zu Fehlern kommen.
", "app_bell_onboarding_info_rotate": "Drehen um auszuwählen", "app_bell_onboarding_info_light_click": "Leichter Klick um fortzufahren", "app_bell_onboarding_info_deep_click_warning": "Sie haben tief gedrückt", diff --git a/image/system_a/data/lang/English.json b/image/system_a/data/lang/English.json index 60632e3074..b0dfc56ecb 100644 --- a/image/system_a/data/lang/English.json +++ b/image/system_a/data/lang/English.json @@ -715,6 +715,7 @@ "app_bell_relaxation_looped": "looped", "app_bell_relaxation_loop_description": "the song will play until you turn it off", "app_bell_relaxation_error_message": "Unsupported media type", + "app_bell_relaxation_limit_error_message": "File limit exceeded.
Not all files may be displayed
correctly
", "app_bell_turn_off_question": "Turn off Mudita Harmony?", "app_bell_goodbye": "Goodbye", "app_bell_reset_message": "Resetting Mudita
Harmony
", diff --git a/image/system_a/data/lang/Espanol.json b/image/system_a/data/lang/Espanol.json index 1cdf78e736..1401644d04 100644 --- a/image/system_a/data/lang/Espanol.json +++ b/image/system_a/data/lang/Espanol.json @@ -682,6 +682,7 @@ "app_bell_relaxation_looped": "en bucle", "app_bell_relaxation_loop_description": "la canción se reproducirá hasta que la apagues", "app_bell_relaxation_error_message": "Formato de archivo no admitido", + "app_bell_relaxation_limit_error_message": "Límite de archivos alcanzado,
pueden producirse errores.
", "app_bell_settings_home_view": "Vista de inicio", "app_bell_settings_alarm_settings": "Ajustes de alarma", "app_bell_settings_alarm_settings_title": "Ajustes de alarma", diff --git a/image/system_a/data/lang/Francais.json b/image/system_a/data/lang/Francais.json index 7964135872..d60905ea05 100644 --- a/image/system_a/data/lang/Francais.json +++ b/image/system_a/data/lang/Francais.json @@ -653,6 +653,7 @@ "app_bell_relaxation_looped": "en boucle", "app_bell_relaxation_loop_description": "le morceau sera lu jusqu'à ce que vous l'éteigniez", "app_bell_relaxation_error_message": "Format de fichier non pris en

charge
", + "app_bell_relaxation_limit_error_message": "Limite de fichiers excédée.
Risque de problèmes
d'affichage
", "app_bell_settings_home_view": "Écran d'accueil", "app_bell_settings_alarm_settings": "Alarme", "app_bell_settings_alarm_settings_title": "Alarme", diff --git a/image/system_a/data/lang/Polski.json b/image/system_a/data/lang/Polski.json index aeb0af1b61..690b09d0ab 100644 --- a/image/system_a/data/lang/Polski.json +++ b/image/system_a/data/lang/Polski.json @@ -705,6 +705,7 @@ "app_bell_relaxation_looped": "zapętlony", "app_bell_relaxation_loop_description": "utwór będzie odtwarzany do momentu wyłączenia go", "app_bell_relaxation_error_message": "Nieobsługiwany format pliku", + "app_bell_relaxation_limit_error_message": "Przekroczono limit plików.
Nie wszystkie pliki mogą być
wyświetlone poprawnie
", "app_bell_settings_alarm_settings_prewake_up": "Wstępne budzenie", "app_bell_settings_alarm_settings_prewake_up_chime_top_description": "Wstępne budzenie", "app_bell_settings_alarm_settings_prewake_up_chime_bottom_description": "przed alarmem", diff --git a/module-apps/application-music-player/tests/MockSongsRepository.hpp b/module-apps/application-music-player/tests/MockSongsRepository.hpp index 80b73a0149..ea4a17fd64 100644 --- a/module-apps/application-music-player/tests/MockSongsRepository.hpp +++ b/module-apps/application-music-player/tests/MockSongsRepository.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, 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 #pragma once @@ -21,6 +21,10 @@ namespace testing::app::music getMusicFilesList, (std::uint32_t offset, std::uint32_t limit, const OnGetMusicFilesListCallback &callback), (override)); + MOCK_METHOD(void, + getMusicFilesListByPaths, + (std::uint32_t offset, std::uint32_t limit, const OnGetMusicFilesListCallback &callback), + (override)); MOCK_METHOD(void, initCache, (), (override)); MOCK_METHOD(std::size_t, getFileIndex, (const std::string &filePath), (const override)); MOCK_METHOD(std::string, getNextFilePath, (const std::string &filePath), (const override)); diff --git a/module-apps/apps-common/models/SongsRepository.cpp b/module-apps/apps-common/models/SongsRepository.cpp index 73eb139b24..edf4733793 100644 --- a/module-apps/apps-common/models/SongsRepository.cpp +++ b/module-apps/apps-common/models/SongsRepository.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, 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 "SongsRepository.hpp" @@ -56,33 +56,23 @@ namespace app::music task->execute(application, this); } - void SongsRepository::getMusicFilesList(std::uint32_t offset, - std::uint32_t limit, + void SongsRepository::getMusicFilesList(const std::uint32_t offset, + const std::uint32_t limit, const OnGetMusicFilesListCallback &callback) { - auto query = std::make_unique(pathPrefixes, offset, limit); - auto task = app::AsyncQuery::createFromQuery(std::move(query), db::Interface::Name::MultimediaFiles); - - task->setCallback([this, callback, offset](auto response) { - auto result = dynamic_cast(response); - musicFilesViewCache.records.clear(); - - if (result == nullptr) { - return false; - } + musicFilesViewCache.records.clear(); + getMusicFilesList(pathPrefixes, offset, limit, callback); + } - for (auto &record : result->getResult()) { - musicFilesViewCache.records.push_back(record); - } - musicFilesViewCache.recordsOffset = offset; - musicFilesViewCache.recordsCount = result->getCount(); + void SongsRepository::getMusicFilesListByPaths(const std::uint32_t offset, + const std::uint32_t limit, + const OnGetMusicFilesListCallback &callback) + { - if (callback) { - callback(musicFilesViewCache.records, musicFilesViewCache.recordsCount); - } - return true; - }); - task->execute(application, this); + musicFilesViewCache.records.clear(); + for (const auto &pathPrefix : pathPrefixes) { + getMusicFilesList({pathPrefix}, offset, limit, callback); + } } std::size_t SongsRepository::getCachedFileIndex(const std::string &filePath) const @@ -270,4 +260,32 @@ namespace app::music return getCachedViewEntryByFilePath(filePath); } + void SongsRepository::getMusicFilesList(const std::vector &paths, + const std::uint32_t offset, + const std::uint32_t limit, + const OnGetMusicFilesListCallback &callback) + { + + auto taskCallback = [this, callback, offset](auto response) { + auto result = dynamic_cast(response); + if (result == nullptr) { + return false; + } + for (auto &record : result->getResult()) { + musicFilesViewCache.records.push_back(record); + } + musicFilesViewCache.recordsOffset = offset; + musicFilesViewCache.recordsCount = result->getCount(); + + if (callback) { + callback(musicFilesViewCache.records, musicFilesViewCache.recordsCount); + } + return true; + }; + auto query = std::make_unique( + std::vector{paths}, offset, limit); + auto task = app::AsyncQuery::createFromQuery(std::move(query), db::Interface::Name::MultimediaFiles); + task->setCallback(taskCallback); + task->execute(application, this); + } } // namespace app::music diff --git a/module-apps/apps-common/models/SongsRepository.hpp b/module-apps/apps-common/models/SongsRepository.hpp index 3083b78070..a14510a239 100644 --- a/module-apps/apps-common/models/SongsRepository.hpp +++ b/module-apps/apps-common/models/SongsRepository.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, 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 #pragma once @@ -50,12 +50,15 @@ namespace app::music virtual ~AbstractSongsRepository() noexcept = default; - virtual void initCache() = 0; - virtual void getMusicFilesList(std::uint32_t offset, - std::uint32_t limit, - const OnGetMusicFilesListCallback &callback) = 0; - virtual std::string getNextFilePath(const std::string &filePath) const = 0; - virtual std::string getPreviousFilePath(const std::string &filePath) const = 0; + virtual void initCache() = 0; + virtual void getMusicFilesList(uint32_t offset, + uint32_t limit, + const OnGetMusicFilesListCallback &callback) = 0; + virtual void getMusicFilesListByPaths(std::uint32_t offset, + std::uint32_t limit, + const OnGetMusicFilesListCallback &callback) = 0; + virtual std::string getNextFilePath(const std::string &filePath) const = 0; + virtual std::string getPreviousFilePath(const std::string &filePath) const = 0; virtual std::optional getRecord( const std::string &filePath) const = 0; virtual void updateRepository(const std::string &filePath) = 0; @@ -68,8 +71,11 @@ namespace app::music std::unique_ptr tagsFetcher, const std::vector &pathPrefixes); - void initCache(); - void getMusicFilesList(std::uint32_t offset, std::uint32_t limit, const OnGetMusicFilesListCallback &callback); + void initCache() override; + void getMusicFilesList(uint32_t offset, uint32_t limit, const OnGetMusicFilesListCallback &callback) override; + void getMusicFilesListByPaths(std::uint32_t offset, + std::uint32_t limit, + const OnGetMusicFilesListCallback &callback) override; std::string getNextFilePath(const std::string &filePath) const override; std::string getPreviousFilePath(const std::string &filePath) const override; std::optional getRecord( @@ -124,5 +130,10 @@ namespace app::music bool newFrontDataCallback(const std::vector &records, unsigned int repoRecordsCount, std::uint32_t offset); + + void getMusicFilesList(const std::vector &paths, + std::uint32_t offset, + std::uint32_t limit, + const OnGetMusicFilesListCallback &callback); }; } // namespace app::music diff --git a/products/BellHybrid/apps/application-bell-relaxation/CMakeLists.txt b/products/BellHybrid/apps/application-bell-relaxation/CMakeLists.txt index 36e2f434b7..48593c825d 100644 --- a/products/BellHybrid/apps/application-bell-relaxation/CMakeLists.txt +++ b/products/BellHybrid/apps/application-bell-relaxation/CMakeLists.txt @@ -37,6 +37,7 @@ target_sources(application-bell-relaxation data/RelaxationStyle.hpp data/RelaxationAudioData.hpp data/RelaxationSwitchData.hpp + data/RelaxationErrorData.hpp widgets/RelaxationPlayer.hpp windows/RelaxationMainWindow.hpp presenter/RelaxationMainWindowPresenter.hpp diff --git a/products/BellHybrid/apps/application-bell-relaxation/data/RelaxationErrorData.hpp b/products/BellHybrid/apps/application-bell-relaxation/data/RelaxationErrorData.hpp new file mode 100644 index 0000000000..9914d31a39 --- /dev/null +++ b/products/BellHybrid/apps/application-bell-relaxation/data/RelaxationErrorData.hpp @@ -0,0 +1,30 @@ +// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved. +// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md + +#pragma once +#include + +namespace gui +{ + + enum class RelaxationErrorType + { + UnsupportedMediaType, + FilesLimitExceeded + + }; + + class RelaxationErrorData : public SwitchData + { + RelaxationErrorType errorType; + + public: + explicit RelaxationErrorData(const RelaxationErrorType &relaxationErrorType) : errorType{relaxationErrorType} + {} + + [[nodiscard]] RelaxationErrorType getErrorType() + { + return errorType; + } + }; +} // namespace gui diff --git a/products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationMainWindowPresenter.cpp b/products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationMainWindowPresenter.cpp index c6065b69c2..1a794ec749 100644 --- a/products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationMainWindowPresenter.cpp +++ b/products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationMainWindowPresenter.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 "RelaxationMainWindowPresenter.hpp" @@ -6,8 +6,8 @@ namespace { - constexpr auto soundsRepoOffset = 0; - constexpr auto soundsRepoLimit = 100; + constexpr auto offset = 0; + constexpr auto filesLimitPerPath = 100; } // namespace namespace app::relaxation @@ -19,12 +19,15 @@ namespace app::relaxation void RelaxationMainWindowPresenter::loadAudioRecords() { - soundsRepository->getMusicFilesList( - soundsRepoOffset, - soundsRepoLimit, + soundsRepository->getMusicFilesListByPaths( + offset, + filesLimitPerPath, [this](const std::vector &records, unsigned int repoRecordsCount) { getView()->setSoundsList(records); + if (repoRecordsCount > filesLimitPerPath) { + getView()->handleError(); + } return true; }); } diff --git a/products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationMainWindowPresenter.hpp b/products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationMainWindowPresenter.hpp index 0c3aa28c46..dca53e7a45 100644 --- a/products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationMainWindowPresenter.hpp +++ b/products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationMainWindowPresenter.hpp @@ -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 #pragma once @@ -22,6 +22,7 @@ namespace app::relaxation virtual ~View() = default; virtual void setSoundsList(std::vector songs) = 0; + virtual void handleError() = 0; }; class Presenter : public BasePresenter diff --git a/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationErrorWindow.cpp b/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationErrorWindow.cpp index f3eb9cd0a6..93a358f6c7 100644 --- a/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationErrorWindow.cpp +++ b/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationErrorWindow.cpp @@ -2,13 +2,18 @@ // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include "RelaxationErrorWindow.hpp" -#include +#include #include #include -#include #include +namespace +{ + constexpr auto unsupportedMediaMessage = "app_bell_relaxation_error_message"; + constexpr auto exceededFilesLimitMessage = "app_bell_relaxation_limit_error_message"; +} // namespace + namespace gui { RelaxationErrorWindow::RelaxationErrorWindow( @@ -30,14 +35,8 @@ namespace gui { statusBar->setVisible(false); - auto icon = new Icon(this, - 0, - 0, - style::window_width, - style::window_height, - "big_information", - utils::translate("app_bell_relaxation_error_message"), - ImageTypeSpecifier::W_G); + icon = new Icon( + this, 0, 0, style::window_width, style::window_height, "big_information", "", ImageTypeSpecifier::W_G); icon->image->setMargins({0, gui::relaxationStyle::error::imageMarginTop, 0, 0}); icon->text->setFont(style::window::font::verybiglight); const auto textPadding = icon->text->getPadding(); @@ -45,7 +44,6 @@ namespace gui {textPadding.left, gui::relaxationStyle::error::textPaddingTop, textPadding.right, textPadding.bottom}); icon->text->setAlignment(Alignment(Alignment::Horizontal::Center, Alignment::Vertical::Center)); icon->setAlignment(Alignment(Alignment::Horizontal::Center, Alignment::Vertical::Top)); - icon->resizeItems(); } @@ -57,6 +55,25 @@ namespace gui }; } + void RelaxationErrorWindow::onBeforeShow(ShowMode mode, SwitchData *data) + { + if (data && typeid(*data) == typeid(RelaxationErrorData)) { + auto *errorData = static_cast(data); + switch (errorData->getErrorType()) { + case RelaxationErrorType::UnsupportedMediaType: { + icon->text->setRichText(utils::translate(unsupportedMediaMessage)); + break; + } + + case RelaxationErrorType::FilesLimitExceeded: { + icon->text->setRichText(utils::translate(exceededFilesLimitMessage)); + break; + } + } + } + WindowWithTimer::onBeforeShow(mode, data); + } + bool RelaxationErrorWindow::onInput(const InputEvent &inputEvent) { if (inputEvent.isShortRelease(KeyCode::KEY_ENTER) || inputEvent.isShortRelease(KeyCode::KEY_RF)) { diff --git a/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationErrorWindow.hpp b/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationErrorWindow.hpp index 37198f7a75..35d8f4ccb0 100644 --- a/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationErrorWindow.hpp +++ b/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationErrorWindow.hpp @@ -5,6 +5,7 @@ #include "presenter/RelaxationErrorPresenter.hpp" #include +#include #include namespace gui @@ -19,10 +20,13 @@ namespace gui private: std::unique_ptr presenter; + std::string errorText; + gui::Icon *icon = nullptr; void buildInterface() override; bool onInput(const gui::InputEvent &inputEvent) override; void registerCallbacks(); void buildLayout(); + void onBeforeShow(ShowMode mode, SwitchData *data) override; }; } // namespace gui diff --git a/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationMainWindow.cpp b/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationMainWindow.cpp index e28237e476..a3e3114d7c 100644 --- a/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationMainWindow.cpp +++ b/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationMainWindow.cpp @@ -3,6 +3,7 @@ #include "RelaxationMainWindow.hpp" #include +#include #include #include @@ -41,7 +42,6 @@ namespace gui for (const auto &sound : sounds) { addRecord(sound); } - addOptions(std::move(menuOptionList)); } @@ -58,4 +58,10 @@ namespace gui application->switchWindow(gui::window::name::relaxationTimerSelect, std::move(switchData)); } + void RelaxationMainWindow::handleError() + { + auto switchData = std::make_unique(RelaxationErrorType::FilesLimitExceeded); + application->switchWindow(gui::window::name::relaxationError, std::move(switchData)); + } + } // namespace gui diff --git a/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationMainWindow.hpp b/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationMainWindow.hpp index 58be9ad5b0..0be569c7bc 100644 --- a/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationMainWindow.hpp +++ b/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationMainWindow.hpp @@ -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 #pragma once @@ -19,7 +19,7 @@ namespace gui std::unique_ptr presenter; void buildInterface() override; - + void handleError() override; void setSoundsList(std::vector soundsTags); void onActivated(const db::multimedia_files::MultimediaFilesRecord &selectedSound); }; diff --git a/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningLoopWindow.cpp b/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningLoopWindow.cpp index 5b0acf721f..ffd10d1973 100644 --- a/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningLoopWindow.cpp +++ b/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningLoopWindow.cpp @@ -4,6 +4,7 @@ #include "RelaxationRunningLoopWindow.hpp" #include #include +#include #include #include @@ -224,6 +225,7 @@ namespace gui } void RelaxationRunningLoopWindow::handleError() { - application->switchWindow(gui::window::name::relaxationError); + auto switchData = std::make_unique(RelaxationErrorType::UnsupportedMediaType); + application->switchWindow(gui::window::name::relaxationError, std::move(switchData)); } } // namespace gui diff --git a/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningProgressWindow.cpp b/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningProgressWindow.cpp index 222dc4265a..7caa72f638 100644 --- a/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningProgressWindow.cpp +++ b/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningProgressWindow.cpp @@ -4,6 +4,7 @@ #include "RelaxationRunningProgressWindow.hpp" #include #include +#include #include #include