You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
907 B
44 lines
907 B
import QtQuick 2.10
|
|
import de.skycoder42.QtMvvm.Core 1.0
|
|
import de.skycoder42.QtMvvm.Quick 1.0
|
|
|
|
FileChooser {
|
|
id: _fileChooser
|
|
|
|
property var msgConfig
|
|
property MessageResult msgResult
|
|
|
|
signal closed()
|
|
|
|
title: msgConfig.title
|
|
folderUrl: msgConfig.defaultValue
|
|
type: {
|
|
if(msgConfig.subType == "open")
|
|
return FileChooser.OpenDocument;
|
|
else if(msgConfig.subType == "files")
|
|
return FileChooser.OpenMultipleDocuments;
|
|
else if(msgConfig.subType == "save")
|
|
return FileChooser.CreateDocument;
|
|
else if(msgConfig.subType == "get") //special value for android only
|
|
return FileChooser.GetContent;
|
|
else {
|
|
return FileChooser.OpenDocument;
|
|
}
|
|
}
|
|
|
|
onAccepted: {
|
|
if(msgResult) {
|
|
msgResult.complete(MessageConfig.Ok, result);
|
|
msgResult = null;
|
|
}
|
|
closed();
|
|
}
|
|
|
|
onRejected: {
|
|
if(msgResult) {
|
|
msgResult.complete(MessageConfig.Cancel);
|
|
msgResult = null;
|
|
}
|
|
closed();
|
|
}
|
|
}
|
|
|