Page MenuHomePhorge

D125.1732288243.diff
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

D125.1732288243.diff

diff --git a/src/contents/ui/Bubble.qml b/src/contents/ui/Bubble.qml
--- a/src/contents/ui/Bubble.qml
+++ b/src/contents/ui/Bubble.qml
@@ -52,6 +52,17 @@
}
}
+ property var confirmDeletionOverlay: Kazv.ConfirmationOverlay {
+ objectName: 'confirmDeletionPopup'
+ parent: roomPage.overlay
+ title: l10n.get('confirm-deletion-popup-title')
+ message: l10n.get('confirm-deletion-popup-message')
+ confirmActionText: l10n.get('confirm-deletion-popup-confirm-action')
+ cancelActionText: l10n.get('confirm-deletion-popup-cancel-action')
+
+ onAccepted: eventView.redactSelf()
+ }
+
function getIsEditable(event) {
return event.sender === matrixSdk.userId
&& event.type === 'm.room.message'
@@ -80,7 +91,7 @@
Kirigami.Action {
objectName: 'deleteMenuItem'
text: l10n.get('event-delete')
- onTriggered: eventView.redactSelf()
+ onTriggered: upper.confirmDeletionOverlay.open()
enabled: event && !event.redacted
},
Kirigami.Action {
diff --git a/src/l10n/cmn-Hans/100-ui.ftl b/src/l10n/cmn-Hans/100-ui.ftl
--- a/src/l10n/cmn-Hans/100-ui.ftl
+++ b/src/l10n/cmn-Hans/100-ui.ftl
@@ -333,3 +333,8 @@
confirm-logout-popup-prompt = 你确定要登出吗?
confirm-logout-popup-accept-button = 是
confirm-logout-popup-cancel-button = 取消
+
+confirm-deletion-popup-title = 删除事件
+confirm-deletion-popup-message = 你确定要删除这个事件吗?
+confirm-deletion-popup-confirm-action = 删除
+confirm-deletion-popup-cancel-action = 取消
diff --git a/src/l10n/en/100-ui.ftl b/src/l10n/en/100-ui.ftl
--- a/src/l10n/en/100-ui.ftl
+++ b/src/l10n/en/100-ui.ftl
@@ -358,3 +358,8 @@
confirm-logout-popup-prompt = Are you sure to logout?
confirm-logout-popup-accept-button = Yes
confirm-logout-popup-cancel-button = Cancel
+
+confirm-deletion-popup-title = Delete event
+confirm-deletion-popup-message = Are you sure you want to delete this event?
+confirm-deletion-popup-confirm-action = Delete
+confirm-deletion-popup-cancel-action = Cancel
diff --git a/src/tests/quick-tests/tst_EventView.qml b/src/tests/quick-tests/tst_EventView.qml
--- a/src/tests/quick-tests/tst_EventView.qml
+++ b/src/tests/quick-tests/tst_EventView.qml
@@ -432,7 +432,10 @@
const menuComp = findChild(eventViewFailed, 'bubble').menuComp;
const menu = menuComp.createObject(menuComp.parent);
const deleteAction = findChild(menu, 'deleteMenuItem');
+ const deleteConfirmPopup = findChild(eventViewFailed, 'confirmDeletionPopup');
deleteAction.trigger();
+ tryVerify(() => deleteConfirmPopup.opened);
+ deleteConfirmPopup.accepted();
tryVerify(() => item.room.removeLocalEcho.calledTimes() === 1);
tryVerify(() => item.room.removeLocalEcho.lastArgs()[0] === 'some-txn-id');

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 7:10 AM (4 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38860
Default Alt Text
D125.1732288243.diff (2 KB)

Event Timeline