Change to DocumentPickerPage
This commit is contained in:
parent
12db0ac4ad
commit
234e11c256
8 changed files with 44 additions and 8 deletions
|
@ -332,9 +332,9 @@ Page {
|
|||
anchors.bottomMargin: Theme.paddingLarge
|
||||
IconButton {
|
||||
id: folderButton
|
||||
icon.source: "image://theme/icon-m-file-folder"
|
||||
icon.source: "image://theme/icon-m-file-document"
|
||||
width: parent.width/2
|
||||
onClicked: pageStack.push(filePickerPage)
|
||||
onClicked: pageStack.push(documentPickerPage)
|
||||
}
|
||||
IconButton {
|
||||
icon.source: "image://theme/icon-m-file-image"
|
||||
|
@ -344,17 +344,25 @@ Page {
|
|||
|
||||
}
|
||||
Component {
|
||||
id: filePickerPage
|
||||
FilePickerPage {
|
||||
id: documentPickerPage
|
||||
DocumentPickerPage {
|
||||
allowedOrientations: Orientation.All
|
||||
|
||||
title: qsTr("Choose file")
|
||||
showSystemFiles: false
|
||||
nameFilters: ["*.pdf", "*.jpg", "*.jpeg", "*.ps"]
|
||||
|
||||
onSelectedContentPropertiesChanged: {
|
||||
var mimeType = Mimer.get_type(selectedContentProperties.filePath)
|
||||
if(mimeType == "application/pdf" || mimeType == "application/postscript")
|
||||
{
|
||||
page.selectedFile = selectedContentProperties.filePath
|
||||
page.selectedFileType = Mimer.get_type(selectedContentProperties.filePath)
|
||||
page.selectedFileType = mimeType
|
||||
}
|
||||
else
|
||||
{
|
||||
notifier.notify(qsTr("Unsupported document format"))
|
||||
page.selectedFile = ""
|
||||
page.selectedFileType = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -271,6 +271,10 @@
|
|||
<source>Not on WiFi</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unsupported document format</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>IppPrinter</name>
|
||||
|
|
|
@ -271,6 +271,10 @@
|
|||
<source>Not on WiFi</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unsupported document format</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>IppPrinter</name>
|
||||
|
|
|
@ -271,6 +271,10 @@
|
|||
<source>Not on WiFi</source>
|
||||
<translation>Pas en WiFi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unsupported document format</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>IppPrinter</name>
|
||||
|
|
|
@ -271,6 +271,10 @@
|
|||
<source>Not on WiFi</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unsupported document format</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>IppPrinter</name>
|
||||
|
|
|
@ -271,6 +271,10 @@
|
|||
<source>Not on WiFi</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unsupported document format</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>IppPrinter</name>
|
||||
|
|
|
@ -271,6 +271,10 @@
|
|||
<source>Not on WiFi</source>
|
||||
<translation>未连接WiFi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unsupported document format</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>IppPrinter</name>
|
||||
|
|
|
@ -271,6 +271,10 @@
|
|||
<source>Not on WiFi</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unsupported document format</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>IppPrinter</name>
|
||||
|
|
Loading…
Reference in a new issue