Page MenuHomePhorge

D125.1732889216.diff
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

D125.1732889216.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
@@ -311,4 +311,9 @@
action-undo = 撤销
action-redo = 重做
action-delete = 删除
-action-select-all = 全选
\ No newline at end of file
+action-select-all = 全选
+
+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
@@ -332,4 +332,9 @@
action-undo = Undo
action-redo = Redo
action-delete = Delete
-action-select-all = Select All
\ No newline at end of file
+action-select-all = Select All
+
+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 29, 6:06 AM (18 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41379
Default Alt Text
D125.1732889216.diff (2 KB)

Event Timeline