Skip to content

Commit 56ac5cd

Browse files
committed
Add menu item and keyboard shortcut for repository settings
1 parent 76af090 commit 56ac5cd

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

app/src/main-process/menu/build-default-menu.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ export function buildDefaultMenu({
8282
accelerator: 'CmdOrCtrl+,',
8383
click: emit('show-preferences'),
8484
},
85+
{
86+
label: 'Repository Options…',
87+
id: 'repository-preferences',
88+
accelerator: 'CmdOrCtrl+Shift+,',
89+
click: emit('show-repository-preferences'),
90+
},
8591
separator,
8692
{
8793
label: 'Install Command Line Tool…',
@@ -146,6 +152,12 @@ export function buildDefaultMenu({
146152
accelerator: 'CmdOrCtrl+,',
147153
click: emit('show-preferences'),
148154
},
155+
{
156+
label: 'Repository options…',
157+
id: 'repository-preferences',
158+
accelerator: 'CmdOrCtrl+Shift+,',
159+
click: emit('show-repository-preferences'),
160+
},
149161
separator,
150162
{
151163
role: 'quit',

app/src/main-process/menu/menu-event.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export type MenuEvent =
1919
| 'permanently-discard-all-changes'
2020
| 'stash-all-changes'
2121
| 'show-preferences'
22+
| 'show-repository-preferences'
2223
| 'choose-repository'
2324
| 'open-working-directory'
2425
| 'update-branch-with-contribution-target-branch'

app/src/ui/app.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,8 @@ export class App extends React.Component<IAppProps, IAppState> {
480480
return this.stashAllChanges()
481481
case 'show-preferences':
482482
return this.props.dispatcher.showPopup({ type: PopupType.Preferences })
483+
case 'show-repository-preferences':
484+
return this.showRepositoryPreferences()
483485
case 'open-working-directory':
484486
return this.openCurrentRepositoryWorkingDirectory()
485487
case 'update-branch-with-contribution-target-branch':
@@ -3125,6 +3127,16 @@ export class App extends React.Component<IAppProps, IAppState> {
31253127
openRepositoryInNewWindow(repository.path)
31263128
}
31273129

3130+
private showRepositoryPreferences = () => {
3131+
const repository = this.getRepository()
3132+
if (repository instanceof Repository) {
3133+
this.props.dispatcher.showPopup({
3134+
type: PopupType.RepositorySettings,
3135+
repository,
3136+
})
3137+
}
3138+
}
3139+
31283140
private getOpenFileInExternalEditorHandler(repository: Repository) {
31293141
return (fullPath: string) =>
31303142
this.openFileInExternalEditor(repository, fullPath)

0 commit comments

Comments
 (0)