From 34e09abd5072e5a475b33d78416a1c3b4a1e308a Mon Sep 17 00:00:00 2001 From: Anton Thomasson Date: Sat, 13 Feb 2021 17:30:19 +0100 Subject: [PATCH] Add a default for make-and-model --- qml/pages/DetailsPage.qml | 2 +- qml/pages/FirstPage.qml | 2 +- qml/pages/utils.js | 12 ++++++++++++ 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 ++++ 10 files changed, 42 insertions(+), 2 deletions(-) diff --git a/qml/pages/DetailsPage.qml b/qml/pages/DetailsPage.qml index b7a8d82..cef676e 100644 --- a/qml/pages/DetailsPage.qml +++ b/qml/pages/DetailsPage.qml @@ -33,7 +33,7 @@ Page { } Label { - text: printer.attrs["printer-make-and-model"].value + text: Utils.unknownForEmptyString(printer.attrs["printer-make-and-model"].value) } SectionHeader { diff --git a/qml/pages/FirstPage.qml b/qml/pages/FirstPage.qml index 54c6883..3551657 100644 --- a/qml/pages/FirstPage.qml +++ b/qml/pages/FirstPage.qml @@ -242,7 +242,7 @@ Page { id: mm_label color: canPrint || selectedFile == "" ? Theme.primaryColor : Theme.secondaryColor font.pixelSize: Theme.fontSizeExtraSmall - text: printer.attrs["printer-make-and-model"].value + text: Utils.unknownForEmptyString(printer.attrs["printer-make-and-model"].value) } Label { diff --git a/qml/pages/utils.js b/qml/pages/utils.js index 8612c53..bfdbd4a 100644 --- a/qml/pages/utils.js +++ b/qml/pages/utils.js @@ -336,6 +336,18 @@ function isWaringState(printer) return false; } +function unknownForEmptyString(s) +{ + if(s === "") + { + return qsTr("Unknown"); + } + else + { + return s; + } +} + var media = {"asme_f_28x40in": "28 x 40″", "choice_iso_a4_210x297mm_na_letter_8.5x11in": "A4 or US Letter", diff --git a/translations/harbour-seaprint-de.ts b/translations/harbour-seaprint-de.ts index ba161e6..dabc171 100644 --- a/translations/harbour-seaprint-de.ts +++ b/translations/harbour-seaprint-de.ts @@ -710,5 +710,9 @@ single document (new sheet) + + Unknown + Unbekannt + diff --git a/translations/harbour-seaprint-es.ts b/translations/harbour-seaprint-es.ts index 3203ead..3233a34 100644 --- a/translations/harbour-seaprint-es.ts +++ b/translations/harbour-seaprint-es.ts @@ -710,5 +710,9 @@ single document (new sheet) + + Unknown + + diff --git a/translations/harbour-seaprint-fr.ts b/translations/harbour-seaprint-fr.ts index d06c6d1..3e185a1 100644 --- a/translations/harbour-seaprint-fr.ts +++ b/translations/harbour-seaprint-fr.ts @@ -710,5 +710,9 @@ single document (new sheet) + + Unknown + Inconnu + diff --git a/translations/harbour-seaprint-nl.ts b/translations/harbour-seaprint-nl.ts index 45c20e3..d890652 100644 --- a/translations/harbour-seaprint-nl.ts +++ b/translations/harbour-seaprint-nl.ts @@ -710,5 +710,9 @@ single document (new sheet) + + Unknown + Onbekend + diff --git a/translations/harbour-seaprint-pl.ts b/translations/harbour-seaprint-pl.ts index 29ce1f1..8ab1d5a 100644 --- a/translations/harbour-seaprint-pl.ts +++ b/translations/harbour-seaprint-pl.ts @@ -710,5 +710,9 @@ single document (new sheet) + + Unknown + + diff --git a/translations/harbour-seaprint-zh_CN.ts b/translations/harbour-seaprint-zh_CN.ts index aef16cf..d0446c6 100644 --- a/translations/harbour-seaprint-zh_CN.ts +++ b/translations/harbour-seaprint-zh_CN.ts @@ -710,5 +710,9 @@ single document (new sheet) 一份文件(新纸张) + + Unknown + 未知 + diff --git a/translations/harbour-seaprint.ts b/translations/harbour-seaprint.ts index a14e92b..c3b902f 100644 --- a/translations/harbour-seaprint.ts +++ b/translations/harbour-seaprint.ts @@ -710,5 +710,9 @@ single document (new sheet) + + Unknown + +