mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1143939 - Add single-item delete to about:passwords context menu. r=ally
This commit is contained in:
parent
73d995b610
commit
f1b3db2a8a
@ -136,7 +136,8 @@ let Passwords = {
|
||||
let menuItems = [
|
||||
{ label: gStringBundle.GetStringFromName("passwordsMenu.copyPassword") },
|
||||
{ label: gStringBundle.GetStringFromName("passwordsMenu.copyUsername") },
|
||||
{ label: gStringBundle.GetStringFromName("passwordsMenu.details") } ];
|
||||
{ label: gStringBundle.GetStringFromName("passwordsMenu.details") },
|
||||
{ label: gStringBundle.GetStringFromName("passwordsMenu.delete") } ];
|
||||
|
||||
prompt.setSingleChoiceItems(menuItems);
|
||||
prompt.show((data) => {
|
||||
@ -152,6 +153,21 @@ let Passwords = {
|
||||
this._showDetails(loginItem);
|
||||
history.pushState({ id: login.guid }, document.title);
|
||||
break;
|
||||
case 3:
|
||||
let confirmPrompt = new Prompt({
|
||||
window: window,
|
||||
message: gStringBundle.GetStringFromName("passwordsDialog.confirmDelete"),
|
||||
buttons: [
|
||||
gStringBundle.GetStringFromName("passwordsDialog.confirm"),
|
||||
gStringBundle.GetStringFromName("passwordsDialog.cancel") ]
|
||||
});
|
||||
confirmPrompt.show((data) => {
|
||||
switch (data.button) {
|
||||
case 0:
|
||||
// Corresponds to "confirm" button.
|
||||
Services.logins.removeLogin(login);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -5,6 +5,11 @@
|
||||
passwordsMenu.copyPassword=Copy password
|
||||
passwordsMenu.copyUsername=Copy username
|
||||
passwordsMenu.details=Details
|
||||
passwordsMenu.delete=Delete
|
||||
|
||||
passwordsDialog.confirmDelete=Delete this login?
|
||||
passwordsDialog.confirm=OK
|
||||
passwordsDialog.cancel=Cancel
|
||||
|
||||
passwordsDetails.age=Age: %S days
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user