Skip to content

Commit

Permalink
fixes #19638
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno committed Feb 1, 2017
1 parent 46c3726 commit 27240e7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/vs/code/electron-main/menus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,8 @@ export class VSCodeMenu {
private setViewMenu(viewMenu: Electron.Menu): void {
const explorer = this.createMenuItem(nls.localize({ key: 'miViewExplorer', comment: ['&& denotes a mnemonic'] }, "&&Explorer"), 'workbench.view.explorer');
const search = this.createMenuItem(nls.localize({ key: 'miViewSearch', comment: ['&& denotes a mnemonic'] }, "&&Search"), 'workbench.view.search');
const scm = this.createMenuItem(nls.localize({ key: 'miViewSCM', comment: ['&& denotes a mnemonic'] }, "S&&CM"), 'workbench.view.scm');
const git = this.createMenuItem(nls.localize({ key: 'miViewGit', comment: ['&& denotes a mnemonic'] }, "&&Git"), 'workbench.view.git');
// const scm = this.createMenuItem(nls.localize({ key: 'miViewSCM', comment: ['&& denotes a mnemonic'] }, "S&&CM"), 'workbench.view.scm');
const debug = this.createMenuItem(nls.localize({ key: 'miViewDebug', comment: ['&& denotes a mnemonic'] }, "&&Debug"), 'workbench.view.debug');
const extensions = this.createMenuItem(nls.localize({ key: 'miViewExtensions', comment: ['&& denotes a mnemonic'] }, "E&&xtensions"), 'workbench.view.extensions');
const output = this.createMenuItem(nls.localize({ key: 'miToggleOutput', comment: ['&& denotes a mnemonic'] }, "&&Output"), 'workbench.action.output.toggleOutput');
Expand Down Expand Up @@ -701,7 +702,8 @@ export class VSCodeMenu {
__separator__(),
explorer,
search,
scm,
git,
// scm,
debug,
extensions,
additionalViewlets,
Expand Down
19 changes: 18 additions & 1 deletion src/vs/workbench/parts/git/electron-browser/git.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,25 @@ import { Registry } from 'vs/platform/platform';
import { CloneAction } from './gitActions';
import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actionRegistry';
import SCMPreview from 'vs/workbench/parts/scm/browser/scmPreview';
import { ToggleViewletAction } from 'vs/workbench/browser/viewlet';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';

if (!SCMPreview.enabled) {
// TODO@joao: remove
class OpenScmViewletAction extends ToggleViewletAction {

static ID = 'workbench.view.git'; // fake redirect
static LABEL = localize('toggleSCMViewlet', "Show SCM");

constructor(id: string, label: string, @IViewletService viewletService: IViewletService, @IWorkbenchEditorService editorService: IWorkbenchEditorService) {
super(id, label, 'workbench.view.scm', viewletService, editorService);
}
}

if (SCMPreview.enabled) {
Registry.as<IWorkbenchActionRegistry>(WorkbenchActionExtensions.WorkbenchActions)
.registerWorkbenchAction(new SyncActionDescriptor(OpenScmViewletAction, OpenScmViewletAction.ID, OpenScmViewletAction.LABEL), 'View: Show SCM', 'View');
} else {
registerContributions();

// Register Service
Expand Down

0 comments on commit 27240e7

Please sign in to comment.