From a78e2c4449b82bf4e7a8be3eff10b2072cb05663 Mon Sep 17 00:00:00 2001 From: Anton Thomasson Date: Tue, 4 Jan 2022 19:29:03 +0100 Subject: [PATCH] Handle empty printer name in more places --- qml/pages/DebugPage.qml | 3 ++- qml/pages/DetailsPage.qml | 2 +- qml/pages/FirstPage.qml | 2 +- qml/pages/JobsPage.qml | 2 +- qml/pages/PrinterPage.qml | 2 +- translations/harbour-seaprint-de.ts | 4 ---- translations/harbour-seaprint-es.ts | 4 ---- translations/harbour-seaprint-fr.ts | 4 ---- translations/harbour-seaprint-nl.ts | 4 ---- translations/harbour-seaprint-pl.ts | 4 ---- translations/harbour-seaprint-zh_CN.ts | 4 ---- translations/harbour-seaprint.ts | 4 ---- 12 files changed, 6 insertions(+), 33 deletions(-) diff --git a/qml/pages/DebugPage.qml b/qml/pages/DebugPage.qml index f334f9d..41e65a0 100644 --- a/qml/pages/DebugPage.qml +++ b/qml/pages/DebugPage.qml @@ -1,5 +1,6 @@ import QtQuick 2.6 import Sailfish.Silica 1.0 +import "utils.js" as Utils Page { @@ -17,7 +18,7 @@ Page { PageHeader { id: header - title: printer.attrs["printer-name"].value + title: Utils.unknownForEmptyString(printer.attrs["printer-name"].value) } TextArea { diff --git a/qml/pages/DetailsPage.qml b/qml/pages/DetailsPage.qml index a76ebfb..ac4d0a1 100644 --- a/qml/pages/DetailsPage.qml +++ b/qml/pages/DetailsPage.qml @@ -19,7 +19,7 @@ Page { width: Math.min(Screen.width, detailsFlickable.width)-2*Theme.paddingLarge PageHeader { title: qsTr("Details") - description: printer.attrs["printer-name"].value + description: Utils.unknownForEmptyString(printer.attrs["printer-name"].value) } // TODO: diff --git a/qml/pages/FirstPage.qml b/qml/pages/FirstPage.qml index dfe9a4f..1fb19ca 100644 --- a/qml/pages/FirstPage.qml +++ b/qml/pages/FirstPage.qml @@ -146,7 +146,7 @@ Page { visible: Object.keys(printer.attrs).length !== 0 - property string name: printer.attrs["printer-name"].value != "" ? printer.attrs["printer-name"].value : qsTr("Unknown") + property string name: Utils.unknownForEmptyString(printer.attrs["printer-name"].value) property var supported_formats: Utils.supported_formats(printer, considerAdditionalFormatsSetting.value) property bool canPrint: supported_formats.mimetypes.indexOf(selectedFileType) != -1 diff --git a/qml/pages/JobsPage.qml b/qml/pages/JobsPage.qml index fc1ca07..ee5f450 100644 --- a/qml/pages/JobsPage.qml +++ b/qml/pages/JobsPage.qml @@ -51,7 +51,7 @@ Page { header: PageHeader { id: pageHeader - title: printer.attrs["printer-name"].value + title: Utils.unknownForEmptyString(printer.attrs["printer-name"].value) description: printer.jobs.length==1 ? printer.jobs.length+" "+qsTr("job") : printer.jobs.length+" "+qsTr("jobs") } diff --git a/qml/pages/PrinterPage.qml b/qml/pages/PrinterPage.qml index fea0610..7d7986b 100644 --- a/qml/pages/PrinterPage.qml +++ b/qml/pages/PrinterPage.qml @@ -85,7 +85,7 @@ Page { PageHeader { id: pageHeader - title: printer.attrs["printer-name"].value + title: Utils.unknownForEmptyString(printer.attrs["printer-name"].value) description: Utils.basename(selectedFile) } diff --git a/translations/harbour-seaprint-de.ts b/translations/harbour-seaprint-de.ts index b730ced..d4af5f2 100644 --- a/translations/harbour-seaprint-de.ts +++ b/translations/harbour-seaprint-de.ts @@ -283,10 +283,6 @@ About SeaPrint Über SeaPrint - - Unknown - Unbekannt - No compatible formats supported Keine kompatiblen Formate unterstützt diff --git a/translations/harbour-seaprint-es.ts b/translations/harbour-seaprint-es.ts index 01f9139..4d9ff1f 100644 --- a/translations/harbour-seaprint-es.ts +++ b/translations/harbour-seaprint-es.ts @@ -283,10 +283,6 @@ About SeaPrint Acerca de SeaPrint - - Unknown - Desconocido - No compatible formats supported No admite formatos compatibles diff --git a/translations/harbour-seaprint-fr.ts b/translations/harbour-seaprint-fr.ts index 421e9a7..9c9e986 100644 --- a/translations/harbour-seaprint-fr.ts +++ b/translations/harbour-seaprint-fr.ts @@ -283,10 +283,6 @@ About SeaPrint À propos de SeaPrint - - Unknown - Inconnu - No compatible formats supported Aucun format compatible supporté diff --git a/translations/harbour-seaprint-nl.ts b/translations/harbour-seaprint-nl.ts index ca35961..a549aa8 100644 --- a/translations/harbour-seaprint-nl.ts +++ b/translations/harbour-seaprint-nl.ts @@ -283,10 +283,6 @@ About SeaPrint Over SeaPrint - - Unknown - Onbekend - No compatible formats supported Geen ondersteunde formaten beschikbaar diff --git a/translations/harbour-seaprint-pl.ts b/translations/harbour-seaprint-pl.ts index 5838201..8a87098 100644 --- a/translations/harbour-seaprint-pl.ts +++ b/translations/harbour-seaprint-pl.ts @@ -283,10 +283,6 @@ About SeaPrint O SeaPrint - - Unknown - Nieznany - No compatible formats supported Brak obsługiwanych kompatybilnych formatów diff --git a/translations/harbour-seaprint-zh_CN.ts b/translations/harbour-seaprint-zh_CN.ts index b91d2b3..0643c5d 100644 --- a/translations/harbour-seaprint-zh_CN.ts +++ b/translations/harbour-seaprint-zh_CN.ts @@ -283,10 +283,6 @@ About SeaPrint 关于 SeaPrint(海印) - - Unknown - 未知 - No compatible formats supported 不支持相关格式 diff --git a/translations/harbour-seaprint.ts b/translations/harbour-seaprint.ts index 66a66c6..d007276 100644 --- a/translations/harbour-seaprint.ts +++ b/translations/harbour-seaprint.ts @@ -283,10 +283,6 @@ About SeaPrint - - Unknown - - No compatible formats supported