Changeset View
Changeset View
Standalone View
Standalone View
src/contents/ui/room-settings/RoomSettingsPage.qml
| Show First 20 Lines • Show All 167 Lines • ▼ Show 20 Lines | Button { | ||||
| text: l10n.get('room-invite-action') | text: l10n.get('room-invite-action') | ||||
| Layout.fillWidth: true | Layout.fillWidth: true | ||||
| onClicked: { | onClicked: { | ||||
| activateRoomInvitePage(roomSettingsPage.room); | activateRoomInvitePage(roomSettingsPage.room); | ||||
| } | } | ||||
| } | } | ||||
| Button { | Button { | ||||
| objectName: 'leaveRoomButton' | |||||
| text: l10n.get('room-leave-action') | text: l10n.get('room-leave-action') | ||||
| Layout.fillWidth: true | Layout.fillWidth: true | ||||
| onClicked: { | onClicked: { | ||||
| confirmLeaveOverlay.open(); | confirmLeaveOverlay.open(); | ||||
| } | } | ||||
| } | } | ||||
| Button { | Button { | ||||
| objectName: 'forgetRoomButton' | objectName: 'forgetRoomButton' | ||||
| text: l10n.get('room-forget-action') | text: l10n.get('room-forget-action') | ||||
| Layout.fillWidth: true | Layout.fillWidth: true | ||||
| visible: room.membership === MK.MatrixRoom.Leave | visible: room.membership === MK.MatrixRoom.Leave | ||||
| onClicked: { | onClicked: { | ||||
| confirmForgetOverlay.open(); | confirmForgetOverlay.open(); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| property var confirmLeaveOverlay: Kazv.ConfirmationOverlay { | property var confirmLeaveOverlay: Kazv.ConfirmationOverlay { | ||||
| objectName: 'confirmLeaveRoomPopup' | |||||
| parent: roomSettingsPage.overlay | parent: roomSettingsPage.overlay | ||||
| title: l10n.get('room-leave-confirm-popup-title') | title: l10n.get('room-leave-confirm-popup-title') | ||||
| message: l10n.get('room-leave-confirm-popup-message') | message: l10n.get('room-leave-confirm-popup-message') | ||||
| confirmActionText: l10n.get('room-leave-confirm-popup-confirm-action') | confirmActionText: l10n.get('room-leave-confirm-popup-confirm-action') | ||||
| cancelActionText: l10n.get('room-leave-confirm-popup-cancel-action') | cancelActionText: l10n.get('room-leave-confirm-popup-cancel-action') | ||||
| onAccepted: leaveRoomHandler.call() | onAccepted: leaveRoomHandler.call() | ||||
| } | } | ||||
| property var leaveRoomHandler: Kazv.AsyncHandler { | property var leaveRoomHandler: Kazv.AsyncHandler { | ||||
| trigger: () => room.leaveRoom() | trigger: () => room.leaveRoom() | ||||
| onResolved: { | onResolved: { | ||||
| if (success) { | if (success) { | ||||
| showPassiveNotification(l10n.get('leave-room-success-prompt', { room: roomId })); | showPassiveNotification(l10n.get('leave-room-success-prompt', { room: room.roomId })); | ||||
| inviteOverlay.close(); | inviteOverlay.close(); | ||||
| } else { | } else { | ||||
| showPassiveNotification(l10n.get('leave-room-failed-prompt', { room: roomId, errorCode: data.errorCode, errorMsg: data.error })); | showPassiveNotification(l10n.get('leave-room-failed-prompt', { room: room.roomId, errorCode: data.errorCode, errorMsg: data.error })); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| property var confirmForgetOverlay: Kazv.ConfirmationOverlay { | property var confirmForgetOverlay: Kazv.ConfirmationOverlay { | ||||
| objectName: 'confirmForgetRoomPopup' | objectName: 'confirmForgetRoomPopup' | ||||
| parent: roomSettingsPage.overlay | parent: roomSettingsPage.overlay | ||||
| title: l10n.get('room-forget-confirm-popup-title') | title: l10n.get('room-forget-confirm-popup-title') | ||||
| Show All 18 Lines | |||||