Skip to content

Commit

Permalink
resolve: #147
Browse files Browse the repository at this point in the history
  • Loading branch information
windingwind committed Oct 24, 2023
1 parent 59fb70a commit d81a9d1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions addon/locale/en-US/addon.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ prefs-rule-operation-triggerAction = Trigger Another Action
prefs-rule-edit-title = Edit Action
prefs-rule-edit-save = Save
prefs-rule-edit-cancel = Cancel
prefs-rule-edit-delete = Delete
prefs-rule-edit-shortcut-empty = No Shortcut
prefs-rule-edit-shortcut-placeholder = Press to record shortcut
prefs-rule-edit-menu-placeholder = Leave empty to hide in menu
Expand Down
1 change: 1 addition & 0 deletions addon/locale/zh-CN/addon.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ prefs-rule-operation-triggerAction = 触发另一个动作
prefs-rule-edit-title = 编辑动作
prefs-rule-edit-save = 保存
prefs-rule-edit-cancel = 取消
prefs-rule-edit-delete = 删除
prefs-rule-edit-shortcut-empty = 无快捷键
prefs-rule-edit-shortcut-placeholder = 按下键盘以记录快捷键
prefs-rule-edit-menu-placeholder = 若为空则不显示菜单项
Expand Down
10 changes: 8 additions & 2 deletions src/modules/preferenceWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,9 @@ async function editAction(currentKey?: string) {
},
],
})
.addButton("Save", "save")
.addButton("Cancel", "cancel")
.addButton(getString("prefs-rule-edit-save"), "save")
.addButton(getString("prefs-rule-edit-cancel"), "cancel")
.addButton(getString("prefs-rule-edit-delete"), "delete")
.open(getString("prefs-rule-edit-title"), {
centerscreen: true,
noDialogMode: true,
Expand Down Expand Up @@ -451,6 +452,11 @@ async function editAction(currentKey?: string) {
updateUI();
}
break;
case "delete": {
addon.api.actionManager.deleteAction(currentKey);
updateUI();
break;
}
default:
break;
}
Expand Down

0 comments on commit d81a9d1

Please sign in to comment.