Change to DocumentPickerPage

This commit is contained in:
Anton Thomasson 2021-02-13 18:07:43 +01:00
parent 12db0ac4ad
commit 234e11c256
8 changed files with 44 additions and 8 deletions

View file

@ -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 = ""
}
}
}
}

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>