Skip to content

Commit

Permalink
Add support for media-ready
Browse files Browse the repository at this point in the history
  • Loading branch information
attah committed Jun 21, 2021
1 parent 6ef8458 commit ab81e70
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 1 deletion.
6 changes: 5 additions & 1 deletion qml/components/ChoiceSetting.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
})
Expand All @@ -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];
Expand Down
3 changes: 3 additions & 0 deletions qml/components/LargeChoiceDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 : "")
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions qml/pages/PrinterPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions translations/harbour-seaprint-de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@
<source>Default settings for %1 on this printer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(loaded)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RangeSetting</name>
Expand Down
4 changes: 4 additions & 0 deletions translations/harbour-seaprint-es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@
<source>Default settings for %1 on this printer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(loaded)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RangeSetting</name>
Expand Down
4 changes: 4 additions & 0 deletions translations/harbour-seaprint-fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@
<source>Default settings for %1 on this printer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(loaded)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RangeSetting</name>
Expand Down
4 changes: 4 additions & 0 deletions translations/harbour-seaprint-nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@
<source>Default settings for %1 on this printer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(loaded)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RangeSetting</name>
Expand Down
4 changes: 4 additions & 0 deletions translations/harbour-seaprint-pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@
<source>Default settings for %1 on this printer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(loaded)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RangeSetting</name>
Expand Down
4 changes: 4 additions & 0 deletions translations/harbour-seaprint-zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@
<source>Default settings for %1 on this printer</source>
<translation>此打印机上的 %1 默认设置。</translation>
</message>
<message>
<source>(loaded)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RangeSetting</name>
Expand Down
4 changes: 4 additions & 0 deletions translations/harbour-seaprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@
<source>Default settings for %1 on this printer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(loaded)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RangeSetting</name>
Expand Down

0 comments on commit ab81e70

Please sign in to comment.