From d2009428b65047ec26492f0ff2a1c21f39647a02 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 14 Mar 2024 01:00:31 +0100 Subject: workaround broken platform dialogs on macos See https://bugreports.qt.io/browse/QTBUG-102078 --- resources/qml/Root.qml | 4 +++- resources/qml/dialogs/ImagePackDeleteDialog.qml | 4 +++- resources/qml/dialogs/LeaveRoomDialog.qml | 5 ++++- resources/qml/dialogs/LogoutDialog.qml | 4 +++- resources/qml/dialogs/RoomSettingsDialog.qml | 7 +++++-- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/resources/qml/Root.qml b/resources/qml/Root.qml index 8145e5e5..f0a83a24 100644 --- a/resources/qml/Root.qml +++ b/resources/qml/Root.qml @@ -348,7 +348,9 @@ Pane { buttons: Platform.MessageDialog.Ok text: qsTr("Wait for the confirmation link to arrive, then continue.") - onAccepted: UIA.continue3pidReceived() + // Broken on macos, see https://bugreports.qt.io/browse/QTBUG-102078 + //onAccepted: UIA.continue3pidReceived() + onOkClicked: UIA.continue3pidReceived() } Connections { function onConfirm3pidToken() { diff --git a/resources/qml/dialogs/ImagePackDeleteDialog.qml b/resources/qml/dialogs/ImagePackDeleteDialog.qml index 91407a9e..d5035e89 100644 --- a/resources/qml/dialogs/ImagePackDeleteDialog.qml +++ b/resources/qml/dialogs/ImagePackDeleteDialog.qml @@ -16,7 +16,9 @@ P.MessageDialog { flags: Qt.Tool | Qt.WindowStaysOnTopHint | Qt.WindowCloseButtonHint | Qt.WindowTitleHint buttons: P.MessageDialog.Yes | P.MessageDialog.No - onAccepted: { + // Broken on macos, see https://bugreports.qt.io/browse/QTBUG-102078 + //onAccepted: { + onOkClicked: { console.info("deleting image pack " + imagePack.packname); imagePack.remove() } diff --git a/resources/qml/dialogs/LeaveRoomDialog.qml b/resources/qml/dialogs/LeaveRoomDialog.qml index c70a4ac0..ed66d784 100644 --- a/resources/qml/dialogs/LeaveRoomDialog.qml +++ b/resources/qml/dialogs/LeaveRoomDialog.qml @@ -16,7 +16,10 @@ P.MessageDialog { text: qsTr("Are you sure you want to leave?") modality: Qt.ApplicationModal buttons: P.MessageDialog.Ok | P.MessageDialog.Cancel - onAccepted: { + + // Broken on macos, see https://bugreports.qt.io/browse/QTBUG-102078 + //onAccepted: { + onOkClicked: { if (CallManager.haveCallInvite) { callManager.rejectInvite(); diff --git a/resources/qml/dialogs/LogoutDialog.qml b/resources/qml/dialogs/LogoutDialog.qml index e79a3e0d..fa5dd9c5 100644 --- a/resources/qml/dialogs/LogoutDialog.qml +++ b/resources/qml/dialogs/LogoutDialog.qml @@ -14,5 +14,7 @@ P.MessageDialog { modality: Qt.WindowModal flags: Qt.Tool | Qt.WindowStaysOnTopHint | Qt.WindowCloseButtonHint | Qt.WindowTitleHint buttons: P.MessageDialog.Ok | P.MessageDialog.Cancel - onAccepted: Nheko.logout() + // Broken on macos, see https://bugreports.qt.io/browse/QTBUG-102078 + //onAccepted: Nheko.logout() + onOkClicked: Nheko.logout() } diff --git a/resources/qml/dialogs/RoomSettingsDialog.qml b/resources/qml/dialogs/RoomSettingsDialog.qml index 8e127567..b435e55b 100644 --- a/resources/qml/dialogs/RoomSettingsDialog.qml +++ b/resources/qml/dialogs/RoomSettingsDialog.qml @@ -554,13 +554,16 @@ ApplicationWindow { text: qsTr(`Encryption is currently experimental and things might break unexpectedly.
Please take note that it can't be disabled afterwards.`) modality: Qt.NonModal - onAccepted: { + // Broken on macos, see https://bugreports.qt.io/browse/QTBUG-102078 + //onAccepted: { + onOkClicked: { if (roomSettings.isEncryptionEnabled) return ; roomSettings.enableEncryption(); } - onRejected: { + //onRejected: { + onCancelClicked: { encryptionToggle.checked = false; } buttons: Platform.MessageDialog.Ok | Platform.MessageDialog.Cancel -- cgit 1.4.1