Handle empty printer name in more places

This commit is contained in:
Anton Thomasson 2022-01-04 19:29:03 +01:00
parent 47fb9c8555
commit a78e2c4449
12 changed files with 6 additions and 33 deletions

View file

@ -1,5 +1,6 @@
import QtQuick 2.6 import QtQuick 2.6
import Sailfish.Silica 1.0 import Sailfish.Silica 1.0
import "utils.js" as Utils
Page { Page {
@ -17,7 +18,7 @@ Page {
PageHeader { PageHeader {
id: header id: header
title: printer.attrs["printer-name"].value title: Utils.unknownForEmptyString(printer.attrs["printer-name"].value)
} }
TextArea { TextArea {

View file

@ -19,7 +19,7 @@ Page {
width: Math.min(Screen.width, detailsFlickable.width)-2*Theme.paddingLarge width: Math.min(Screen.width, detailsFlickable.width)-2*Theme.paddingLarge
PageHeader { PageHeader {
title: qsTr("Details") title: qsTr("Details")
description: printer.attrs["printer-name"].value description: Utils.unknownForEmptyString(printer.attrs["printer-name"].value)
} }
// TODO: // TODO:

View file

@ -146,7 +146,7 @@ Page {
visible: Object.keys(printer.attrs).length !== 0 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 var supported_formats: Utils.supported_formats(printer, considerAdditionalFormatsSetting.value)
property bool canPrint: supported_formats.mimetypes.indexOf(selectedFileType) != -1 property bool canPrint: supported_formats.mimetypes.indexOf(selectedFileType) != -1

View file

@ -51,7 +51,7 @@ Page {
header: PageHeader { header: PageHeader {
id: 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") description: printer.jobs.length==1 ? printer.jobs.length+" "+qsTr("job") : printer.jobs.length+" "+qsTr("jobs")
} }

View file

@ -85,7 +85,7 @@ Page {
PageHeader { PageHeader {
id: pageHeader id: pageHeader
title: printer.attrs["printer-name"].value title: Utils.unknownForEmptyString(printer.attrs["printer-name"].value)
description: Utils.basename(selectedFile) description: Utils.basename(selectedFile)
} }

View file

@ -283,10 +283,6 @@
<source>About SeaPrint</source> <source>About SeaPrint</source>
<translation>Über SeaPrint</translation> <translation>Über SeaPrint</translation>
</message> </message>
<message>
<source>Unknown</source>
<translation>Unbekannt</translation>
</message>
<message> <message>
<source>No compatible formats supported</source> <source>No compatible formats supported</source>
<translation>Keine kompatiblen Formate unterstützt</translation> <translation>Keine kompatiblen Formate unterstützt</translation>

View file

@ -283,10 +283,6 @@
<source>About SeaPrint</source> <source>About SeaPrint</source>
<translation>Acerca de SeaPrint</translation> <translation>Acerca de SeaPrint</translation>
</message> </message>
<message>
<source>Unknown</source>
<translation>Desconocido</translation>
</message>
<message> <message>
<source>No compatible formats supported</source> <source>No compatible formats supported</source>
<translation>No admite formatos compatibles</translation> <translation>No admite formatos compatibles</translation>

View file

@ -283,10 +283,6 @@
<source>About SeaPrint</source> <source>About SeaPrint</source>
<translation>À propos de SeaPrint</translation> <translation>À propos de SeaPrint</translation>
</message> </message>
<message>
<source>Unknown</source>
<translation>Inconnu</translation>
</message>
<message> <message>
<source>No compatible formats supported</source> <source>No compatible formats supported</source>
<translation>Aucun format compatible supporté</translation> <translation>Aucun format compatible supporté</translation>

View file

@ -283,10 +283,6 @@
<source>About SeaPrint</source> <source>About SeaPrint</source>
<translation>Over SeaPrint</translation> <translation>Over SeaPrint</translation>
</message> </message>
<message>
<source>Unknown</source>
<translation>Onbekend</translation>
</message>
<message> <message>
<source>No compatible formats supported</source> <source>No compatible formats supported</source>
<translation>Geen ondersteunde formaten beschikbaar</translation> <translation>Geen ondersteunde formaten beschikbaar</translation>

View file

@ -283,10 +283,6 @@
<source>About SeaPrint</source> <source>About SeaPrint</source>
<translation>O SeaPrint</translation> <translation>O SeaPrint</translation>
</message> </message>
<message>
<source>Unknown</source>
<translation>Nieznany</translation>
</message>
<message> <message>
<source>No compatible formats supported</source> <source>No compatible formats supported</source>
<translation>Brak obsługiwanych kompatybilnych formatów</translation> <translation>Brak obsługiwanych kompatybilnych formatów</translation>

View file

@ -283,10 +283,6 @@
<source>About SeaPrint</source> <source>About SeaPrint</source>
<translation> SeaPrint</translation> <translation> SeaPrint</translation>
</message> </message>
<message>
<source>Unknown</source>
<translation></translation>
</message>
<message> <message>
<source>No compatible formats supported</source> <source>No compatible formats supported</source>
<translation></translation> <translation></translation>

View file

@ -283,10 +283,6 @@
<source>About SeaPrint</source> <source>About SeaPrint</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>No compatible formats supported</source> <source>No compatible formats supported</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>