Add number-up and print-scaling format-dependent settings
This commit is contained in:
parent
68b7afff5e
commit
c0fdb31483
13 changed files with 281 additions and 2 deletions
|
@ -50,6 +50,7 @@ SOURCES += src/harbour-seaprint.cpp \
|
|||
src/svgprovider.cpp
|
||||
|
||||
DISTFILES += qml/harbour-seaprint.qml \
|
||||
qml/components/DependentOn.qml \
|
||||
qml/cover/CoverPage.qml \
|
||||
qml/components/*qml \
|
||||
qml/pages/*.qml \
|
||||
|
|
|
@ -19,7 +19,7 @@ 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 != undefined ? choice : default_choice, choices: limited_choices,
|
||||
preferred_choices: preferred_choices, preferred_choice_suffix: preferred_choice_suffix})
|
||||
dialog.accepted.connect(function() {
|
||||
choice = dialog.choice
|
||||
|
|
40
qml/components/DependentOn.qml
Normal file
40
qml/components/DependentOn.qml
Normal file
|
@ -0,0 +1,40 @@
|
|||
import QtQuick 2.6
|
||||
|
||||
Item {
|
||||
property alias target: targetConnection.target
|
||||
property var values
|
||||
property var overlap: []
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
for(var i in values)
|
||||
{
|
||||
if(target.limited_choices.indexOf(values[i]) != -1)
|
||||
{
|
||||
overlap.push(values[i])
|
||||
}
|
||||
}
|
||||
parent.valid = parent.valid && overlap != []
|
||||
}
|
||||
|
||||
Connections {
|
||||
id: targetConnection
|
||||
onChoiceChanged:
|
||||
{
|
||||
if(overlap.indexOf(target.choice) == -1)
|
||||
{
|
||||
parent.reset()
|
||||
}
|
||||
}
|
||||
}
|
||||
Connections {
|
||||
target: parent
|
||||
onChoiceChanged:
|
||||
{
|
||||
if(parent.choice != undefined)
|
||||
{
|
||||
targetConnection.target.choice = overlap[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -46,12 +46,17 @@ Item {
|
|||
property var menu
|
||||
property bool hasMenu: true
|
||||
|
||||
function reset()
|
||||
{
|
||||
choice = undefined
|
||||
}
|
||||
|
||||
ContextMenu {
|
||||
id: resetMenu
|
||||
|
||||
MenuItem {
|
||||
text: qsTr("Reset")
|
||||
onClicked: choice = undefined
|
||||
onClicked: reset()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -121,6 +121,16 @@ Page {
|
|||
property var pdfpages: ConvertChecker.pdfPages(selectedFile)
|
||||
high: pdfpages == 0 ? 65535 : pdfpages
|
||||
}
|
||||
ChoiceSetting {
|
||||
tag: IppMsg.Integer
|
||||
name: "number-up"
|
||||
prettyName: qsTr("Pages per page")
|
||||
valid: !Mimer.isImage(selectedFileType)
|
||||
DependentOn {
|
||||
target: transferFormatSetting
|
||||
values: [Mimer.PDF, Mimer.Postscript]
|
||||
}
|
||||
}
|
||||
ChoiceSetting {
|
||||
tag: IppMsg.Keyword
|
||||
name: "print-color-mode"
|
||||
|
@ -137,6 +147,17 @@ Page {
|
|||
prettyName: qsTr("Resolution")
|
||||
}
|
||||
ChoiceSetting {
|
||||
tag: IppMsg.Keyword
|
||||
name: "print-scaling"
|
||||
prettyName: qsTr("Scaling")
|
||||
valid: _valid && selectedFileType == Mimer.JPEG
|
||||
DependentOn {
|
||||
target: transferFormatSetting
|
||||
values: [Mimer.JPEG]
|
||||
}
|
||||
}
|
||||
ChoiceSetting {
|
||||
id: transferFormatSetting
|
||||
tag: IppMsg.MimeMediaType
|
||||
name: "document-format"
|
||||
prettyName: qsTr("Transfer format")
|
||||
|
|
|
@ -211,6 +211,22 @@ function ippName(name, value)
|
|||
default:
|
||||
return value
|
||||
}
|
||||
case "print-scaling":
|
||||
switch(value) {
|
||||
case "auto":
|
||||
return qsTr("auto");
|
||||
case "auto-fit":
|
||||
return qsTr("auto (fit)");
|
||||
case "fill":
|
||||
return qsTr("fill");
|
||||
case "fit":
|
||||
return qsTr("fit");
|
||||
case "none":
|
||||
return qsTr("none");
|
||||
default:
|
||||
return value;
|
||||
}
|
||||
|
||||
case "document-format":
|
||||
switch(value) {
|
||||
case Mimer.OctetStream:
|
||||
|
|
|
@ -503,6 +503,14 @@
|
|||
<source>Margins</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Pages per page</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Scaling</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RangeSetting</name>
|
||||
|
@ -873,5 +881,25 @@
|
|||
<source>my mailbox</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>auto</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>auto (fit)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>fill</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>fit</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>none</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
|
@ -503,6 +503,14 @@
|
|||
<source>Margins</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Pages per page</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Scaling</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RangeSetting</name>
|
||||
|
@ -873,5 +881,25 @@
|
|||
<source>my mailbox</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>auto</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>auto (fit)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>fill</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>fit</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>none</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
|
@ -503,6 +503,14 @@
|
|||
<source>Margins</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Pages per page</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Scaling</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RangeSetting</name>
|
||||
|
@ -873,5 +881,25 @@
|
|||
<source>my mailbox</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>auto</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>auto (fit)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>fill</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>fit</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>none</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
|
@ -503,6 +503,14 @@
|
|||
<source>Margins</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Pages per page</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Scaling</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RangeSetting</name>
|
||||
|
@ -873,5 +881,25 @@
|
|||
<source>my mailbox</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>auto</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>auto (fit)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>fill</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>fit</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>none</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
|
@ -503,6 +503,14 @@
|
|||
<source>Margins</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Pages per page</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Scaling</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RangeSetting</name>
|
||||
|
@ -873,5 +881,25 @@
|
|||
<source>my mailbox</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>auto</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>auto (fit)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>fill</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>fit</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>none</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
|
@ -503,6 +503,14 @@
|
|||
<source>Margins</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Pages per page</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Scaling</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RangeSetting</name>
|
||||
|
@ -873,5 +881,25 @@
|
|||
<source>my mailbox</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>auto</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>auto (fit)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>fill</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>fit</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>none</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
|
@ -503,6 +503,14 @@
|
|||
<source>Margins</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Pages per page</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Scaling</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RangeSetting</name>
|
||||
|
@ -873,5 +881,25 @@
|
|||
<source>my mailbox</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>auto</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>auto (fit)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>fill</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>fit</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>none</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
Loading…
Reference in a new issue