From ab81e701fa657e296b82fe2fb008ff4c06898be8 Mon Sep 17 00:00:00 2001 From: Anton Thomasson Date: Mon, 21 Jun 2021 21:31:36 +0200 Subject: [PATCH] Add support for media-ready --- qml/components/ChoiceSetting.qml | 6 +++++- qml/components/LargeChoiceDialog.qml | 3 +++ 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 ++++ 10 files changed, 38 insertions(+), 1 deletion(-) diff --git a/qml/components/ChoiceSetting.qml b/qml/components/ChoiceSetting.qml index a1a890a..f08161f 100644 --- a/qml/components/ChoiceSetting.qml +++ b/qml/components/ChoiceSetting.qml @@ -7,6 +7,8 @@ import "../pages/utils.js" as Utils Setting { property var choices: parent.getChoices(name) property string mime_type + property var preferred_choices: [] + property string preferred_choice_suffix: "" property var limited_choices: Utils.limitChoices(name, choices, mime_type, ConvertChecker) @@ -18,7 +20,8 @@ Setting { if(limited_choices.length>num_large_choices) { var dialog = pageStack.push("LargeChoiceDialog.qml", - {name:name, choice: choice ? choice : default_choice, choices: limited_choices}) + {name:name, choice: choice ? choice : default_choice, choices: limited_choices, + preferred_choices: preferred_choices, preferred_choice_suffix: preferred_choice_suffix}) dialog.accepted.connect(function() { choice = dialog.choice }) @@ -34,6 +37,7 @@ Setting { model: limited_choices.length>num_large_choices ? 0 : limited_choices MenuItem { text: Utils.ippName(name, limited_choices[index]) + + (Utils.has(preferred_choices, limited_choices[index]) ? " "+preferred_choice_suffix : "") onClicked: { choice = limited_choices[index]; diff --git a/qml/components/LargeChoiceDialog.qml b/qml/components/LargeChoiceDialog.qml index b99253a..932fe78 100644 --- a/qml/components/LargeChoiceDialog.qml +++ b/qml/components/LargeChoiceDialog.qml @@ -11,6 +11,8 @@ Dialog { property string choice property string new_choice: choice property var choices + property var preferred_choices + property string preferred_choice_suffix canAccept: false SilicaListView @@ -30,6 +32,7 @@ Dialog { anchors.verticalCenter: parent.verticalCenter highlighted: choices[index]==new_choice text: Utils.ippName(name, choices[index]) + + (Utils.has(preferred_choices, choices[index]) ? " "+preferred_choice_suffix : "") } } } diff --git a/qml/pages/PrinterPage.qml b/qml/pages/PrinterPage.qml index 936e183..2ae48da 100644 --- a/qml/pages/PrinterPage.qml +++ b/qml/pages/PrinterPage.qml @@ -91,6 +91,8 @@ Page { name: "media" prettyName: qsTr("Print media") mime_type: selectedFileType + preferred_choices: printer.attrs.hasOwnProperty("media-ready") ? printer.attrs["media-ready"].value : [] + preferred_choice_suffix: qsTr("(loaded)") } IntegerSetting { tag: IppMsg.Integer diff --git a/translations/harbour-seaprint-de.ts b/translations/harbour-seaprint-de.ts index 9754dc4..283d265 100644 --- a/translations/harbour-seaprint-de.ts +++ b/translations/harbour-seaprint-de.ts @@ -470,6 +470,10 @@ Default settings for %1 on this printer + + (loaded) + + RangeSetting diff --git a/translations/harbour-seaprint-es.ts b/translations/harbour-seaprint-es.ts index f01126c..d0bf2c1 100644 --- a/translations/harbour-seaprint-es.ts +++ b/translations/harbour-seaprint-es.ts @@ -470,6 +470,10 @@ Default settings for %1 on this printer + + (loaded) + + RangeSetting diff --git a/translations/harbour-seaprint-fr.ts b/translations/harbour-seaprint-fr.ts index 09f3236..8f24b08 100644 --- a/translations/harbour-seaprint-fr.ts +++ b/translations/harbour-seaprint-fr.ts @@ -470,6 +470,10 @@ Default settings for %1 on this printer + + (loaded) + + RangeSetting diff --git a/translations/harbour-seaprint-nl.ts b/translations/harbour-seaprint-nl.ts index f7a92ab..84c3929 100644 --- a/translations/harbour-seaprint-nl.ts +++ b/translations/harbour-seaprint-nl.ts @@ -470,6 +470,10 @@ Default settings for %1 on this printer + + (loaded) + + RangeSetting diff --git a/translations/harbour-seaprint-pl.ts b/translations/harbour-seaprint-pl.ts index 456d373..e8eb2db 100644 --- a/translations/harbour-seaprint-pl.ts +++ b/translations/harbour-seaprint-pl.ts @@ -470,6 +470,10 @@ Default settings for %1 on this printer + + (loaded) + + RangeSetting diff --git a/translations/harbour-seaprint-zh_CN.ts b/translations/harbour-seaprint-zh_CN.ts index 8b5d318..a68e46e 100644 --- a/translations/harbour-seaprint-zh_CN.ts +++ b/translations/harbour-seaprint-zh_CN.ts @@ -470,6 +470,10 @@ Default settings for %1 on this printer 此打印机上的 %1 默认设置。 + + (loaded) + + RangeSetting diff --git a/translations/harbour-seaprint.ts b/translations/harbour-seaprint.ts index dcba8e6..862299d 100644 --- a/translations/harbour-seaprint.ts +++ b/translations/harbour-seaprint.ts @@ -470,6 +470,10 @@ Default settings for %1 on this printer + + (loaded) + + RangeSetting