Skip to content

Commit

Permalink
Fix advanced page range input
Browse files Browse the repository at this point in the history
  • Loading branch information
attah committed Nov 17, 2022
1 parent 3d8ade0 commit 6f4d602
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
4 changes: 1 addition & 3 deletions harbour-seaprint.pro
Expand Up @@ -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 \
Expand Down
30 changes: 30 additions & 0 deletions qml/components/RangeListInputDialog.qml
@@ -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) }
}
}

}
2 changes: 1 addition & 1 deletion qml/components/RangeSetting.qml
Expand Up @@ -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;
})
Expand Down

0 comments on commit 6f4d602

Please sign in to comment.