diff options
author | Alexis Menard <alexis.menard@openbossa.org> | 2012-06-21 10:05:53 -0300 |
---|---|---|
committer | Alexis Menard <alexis.menard@openbossa.org> | 2012-06-21 14:04:35 -0300 |
commit | dbeb77f0632bf3a43ab59c0c1970a981f856d05a (patch) | |
tree | 03838c9084e6a3f5f8515d1c7807173c5287db78 /src/desktop/qml/PageWidget.qml | |
parent | c199980cd1bd242f8ce6d4f61aed024fb07899b7 (diff) |
Implement filedialog upload support for Snowshoe desktop.
For now it uses QWidget but when Qt Components will provide an alternative
we can change it.
Reviewed-by: Caio Oliveira
Diffstat (limited to 'src/desktop/qml/PageWidget.qml')
-rw-r--r-- | src/desktop/qml/PageWidget.qml | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/desktop/qml/PageWidget.qml b/src/desktop/qml/PageWidget.qml index 5b84734..e652fe0 100644 --- a/src/desktop/qml/PageWidget.qml +++ b/src/desktop/qml/PageWidget.qml @@ -89,6 +89,21 @@ Item { maxHeight: 600 } + experimental.filePicker: Item { + id: picker + // We can't use the model directly in the Connection below. + property QtObject filePickerModel: model + Connections { + target: DialogRunner + onFileDialogAccepted: picker.filePickerModel.accept(selectedFiles) + onFileDialogRejected: picker.filePickerModel.reject() + } + + Component.onCompleted: { + DialogRunner.openFileDialog(filePickerModel) + } + } + experimental.onDownloadRequested: { downloadItem.destinationPath = BrowserWindow.decideDownloadPath(downloadItem.suggestedFilename) downloadItem.start() |