Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F112236
D125.1732283933.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D125.1732283933.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 5:58 AM (3 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38861
Default Alt Text
D125.1732283933.diff (2 KB)
Attached To
Mode
D125: Add confirm popup for delete event
Attached
Detach File
Event Timeline
Log In to Comment