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 | |
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.
-rw-r--r-- | accounts/maildir/qml/AccountSettings.qml | 24 | ||||
-rw-r--r-- | views/composer/qml/View.qml | 26 | ||||
-rw-r--r-- | views/people/qml/PersonComposer.qml | 21 |
3 files changed, 31 insertions, 40 deletions
diff --git a/accounts/maildir/qml/AccountSettings.qml b/accounts/maildir/qml/AccountSettings.qml index 9553135b..44713b00 100644 --- a/accounts/maildir/qml/AccountSettings.qml +++ b/accounts/maildir/qml/AccountSettings.qml | |||
@@ -82,22 +82,18 @@ Item { | |||
82 | iconName: Kube.Icons.folder | 82 | iconName: Kube.Icons.folder |
83 | 83 | ||
84 | onClicked: { | 84 | onClicked: { |
85 | fileDialogComponent.createObject(parent) | 85 | fileDialog.open() |
86 | } | 86 | } |
87 | 87 | ||
88 | Component { | 88 | Dialogs.FileDialog { |
89 | id: fileDialogComponent | 89 | id: fileDialog |
90 | Dialogs.FileDialog { | 90 | title: qsTr("Choose a maildir folder") |
91 | id: fileDialog | 91 | folder: shortcuts.home |
92 | 92 | selectFolder: true | |
93 | visible: true | 93 | selectExisting: true |
94 | title: "Choose the maildir folder" | 94 | selectMultiple: false |
95 | 95 | onAccepted: { | |
96 | selectFolder: true | 96 | maildirSettings.path = fileDialog.fileUrl |
97 | |||
98 | onAccepted: { | ||
99 | maildirSettings.path = fileDialog.fileUrl | ||
100 | } | ||
101 | } | 97 | } |
102 | } | 98 | } |
103 | } | 99 | } |
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 | } |
diff --git a/views/people/qml/PersonComposer.qml b/views/people/qml/PersonComposer.qml index ff24a456..19e8c56b 100644 --- a/views/people/qml/PersonComposer.qml +++ b/views/people/qml/PersonComposer.qml | |||
@@ -90,19 +90,18 @@ Flickable { | |||
90 | color: "#00000000" | 90 | color: "#00000000" |
91 | 91 | ||
92 | onClicked: { | 92 | onClicked: { |
93 | fileDialogComponent.createObject(parent) | 93 | fileDialog.open() |
94 | } | 94 | } |
95 | 95 | ||
96 | Component { | 96 | Dialogs.FileDialog { |
97 | id: fileDialogComponent | 97 | id: fileDialog |
98 | Dialogs.FileDialog { | 98 | title: qsTr("Choose an Avatar") |
99 | id: fileDialog | 99 | folder: shortcuts.home |
100 | visible: true | 100 | selectFolder: false |
101 | title: "Choose an Avatar" | 101 | selectExisting: true |
102 | selectFolder: false | 102 | selectMultiple: false |
103 | onAccepted: { | 103 | onAccepted: { |
104 | //TODO | 104 | //TODO |
105 | } | ||
106 | } | 105 | } |
107 | } | 106 | } |
108 | } | 107 | } |