Fix advanced page range input
This commit is contained in:
parent
3d8ade0bef
commit
6f4d602456
3 changed files with 32 additions and 4 deletions
|
@ -51,10 +51,8 @@ SOURCES += src/harbour-seaprint.cpp \
|
|||
src/settings.cpp
|
||||
|
||||
DISTFILES += qml/harbour-seaprint.qml \
|
||||
qml/components/DependentOn.qml \
|
||||
qml/components/RangeListInputDialog.qml \
|
||||
qml/cover/CoverPage.qml \
|
||||
qml/components/*qml \
|
||||
qml/components/*.qml \
|
||||
qml/pages/*.qml \
|
||||
qml/pages/*.js \
|
||||
qml/pages/*svg \
|
||||
|
|
30
qml/components/RangeListInputDialog.qml
Normal file
30
qml/components/RangeListInputDialog.qml
Normal file
|
@ -0,0 +1,30 @@
|
|||
import QtQuick 2.6
|
||||
import Sailfish.Silica 1.0
|
||||
import seaprint.rangelistchecker 1.0
|
||||
|
||||
Dialog {
|
||||
id: dialog
|
||||
allowedOrientations: Orientation.All
|
||||
|
||||
property string title
|
||||
property var value
|
||||
canAccept: valueField.acceptableInput
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
|
||||
DialogHeader { }
|
||||
|
||||
TextField {
|
||||
id: valueField
|
||||
acceptableInput: Object.keys(value).length !== 0
|
||||
width: parent.width
|
||||
placeholderText: "1,2,17-42"
|
||||
label: title
|
||||
focus: true
|
||||
labelVisible: true
|
||||
onTextChanged: { dialog.value = RangeListChecker.parse(text) }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -146,7 +146,7 @@ Setting {
|
|||
visible: acceptRangeList
|
||||
text: qsTr("Advanced")
|
||||
onClicked: {var dialog = pageStack.push(Qt.resolvedUrl("RangeListInputDialog.qml"),
|
||||
{value: choice, title: prettyName});
|
||||
{title: prettyName});
|
||||
dialog.accepted.connect(function() {
|
||||
choice = dialog.value;
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue