diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-08-18 08:11:48 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-08-18 08:11:48 +0200 |
commit | 894322a3a1d9c098a76cf2eec97a05f30a74dfe9 (patch) | |
tree | 7b62c28918f7827bf91dcb3e32e37720eeb3e291 /views/composer/qml/View.qml | |
parent | 438864fa0057a0fed91431b224429e80f619d06b (diff) | |
download | kube-894322a3a1d9c098a76cf2eec97a05f30a74dfe9.tar.gz kube-894322a3a1d9c098a76cf2eec97a05f30a74dfe9.zip |
Hopefully fixed file dialogs on mac.
There seems to be a problem with setting visible=true before the
component is completed.
The dialog doesn't have to wrapped in a component anyways, and we can
just show it using open.
Diffstat (limited to 'views/composer/qml/View.qml')
-rw-r--r-- | views/composer/qml/View.qml | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/views/composer/qml/View.qml b/views/composer/qml/View.qml index de3a6a5b..9e390156 100644 --- a/views/composer/qml/View.qml +++ b/views/composer/qml/View.qml | |||
@@ -348,23 +348,19 @@ Kube.View { | |||
348 | text: qsTr("Attach file") | 348 | text: qsTr("Attach file") |
349 | 349 | ||
350 | onClicked: { | 350 | onClicked: { |
351 | fileDialogComponent.createObject(parent) | 351 | fileDialog.open() |
352 | } | 352 | } |
353 | 353 | ||
354 | Component { | 354 | Dialogs.FileDialog { |
355 | id: fileDialogComponent | 355 | id: fileDialog |
356 | Dialogs.FileDialog { | 356 | title: qsTr("Choose a file to attach") |
357 | id: fileDialog | 357 | folder: shortcuts.home |
358 | visible: true | 358 | selectFolder: false |
359 | title: qsTr("Choose a file to attach") | 359 | selectExisting: true |
360 | folder: shortcuts.home | 360 | selectMultiple: true |
361 | selectFolder: false | 361 | onAccepted: { |
362 | selectExisting: true | 362 | for (var i = 0; i < fileDialog.fileUrls.length; ++i) { |
363 | selectMultiple: true | 363 | composerController.attachments.add({url: fileDialog.fileUrls[i]}) |
364 | onAccepted: { | ||
365 | for (var i = 0; i < fileDialog.fileUrls.length; ++i) { | ||
366 | composerController.attachments.add({url: fileDialog.fileUrls[i]}) | ||
367 | } | ||
368 | } | 364 | } |
369 | } | 365 | } |
370 | } | 366 | } |