Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Add Payments to Bravery system menu #3929

Merged
merged 1 commit into from
Sep 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/browser/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,8 @@ const createMenu = () => {
label: locale.translation('bravery'),
submenu: [
CommonMenu.braveryGlobalMenuItem(),
CommonMenu.braverySiteMenuItem()
CommonMenu.braverySiteMenuItem(),
CommonMenu.braveryPaymentsMenuItem()
]
},
{ label: locale.translation('window'), submenu: createWindowSubmenu(), role: 'window' },
Expand Down
19 changes: 19 additions & 0 deletions app/common/commonMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,3 +349,22 @@ module.exports.braveryGlobalMenuItem = () => {
}
}
}

module.exports.braveryPaymentsMenuItem = () => {
const label =
getSetting(settings.PAYMENTS_ENABLED)
? locale.translation('braveryPayments')
: locale.translation('braveryStartUsingPayments')
return {
label: label,
click: (item, focusedWindow) => {
if (BrowserWindow.getAllWindows().length === 0) {
appActions.newWindow(Immutable.fromJS({
location: 'about:preferences#payments'
}))
} else {
module.exports.sendToFocusedWindow(focusedWindow, [messages.SHORTCUT_NEW_FRAME, 'about:preferences#payments', { singleFrame: true }])
}
}
}
}
2 changes: 2 additions & 0 deletions app/extensions/brave/locales/en-US/menu.properties
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ bookmarksToolbar=Bookmarks Toolbar
bravery=Bravery
braverySite=Bravery site settings...
braveryGlobal=Bravery global settings...
braveryPayments=Brave payments...
braveryStartUsingPayments=Start using Brave payments...
addBookmark=Add Bookmark...
addFolder=Add Folder...
unmuteTabs=Unmute Tabs
Expand Down
2 changes: 2 additions & 0 deletions app/locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ var rendererIdentifiers = function () {
'bravery',
'braverySite',
'braveryGlobal',
'braveryPayments',
'braveryStartUsingPayments',
'blockPopups',
'learnSpelling',
'ignoreSpelling',
Expand Down
3 changes: 2 additions & 1 deletion js/contextMenus.js
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,8 @@ function hamburgerTemplateInit (location, e) {
label: locale.translation('bravery'),
submenu: [
CommonMenu.braveryGlobalMenuItem(),
CommonMenu.braverySiteMenuItem()
CommonMenu.braverySiteMenuItem(),
CommonMenu.braveryPaymentsMenuItem()
]
},
CommonMenu.downloadsMenuItem(),
Expand Down