提交 c5bd9c41 编写于 作者: J João Moreno

Merge pull request #505 from bpasero/git-sync-command

add the "Sync" command to the command palette as global command
......@@ -31,7 +31,7 @@ import {IFileService, IFileStat} from 'vs/platform/files/common/files';
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
import wbar = require('vs/workbench/browser/actionRegistry');
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { OpenChangeAction } from './gitActions';
import { OpenChangeAction, SyncAction } from './gitActions';
import Severity from 'vs/base/common/severity';
function getStatus(gitService: IGitService, contextService: IWorkspaceContextService, input: WorkbenchEditorCommon.IFileEditorInput): IFileStatus {
......@@ -432,5 +432,7 @@ actionBarRegistry.registerActionBarContributor(abr.Scope.EDITOR, GitWorkingTreeD
let workbenchActionRegistry = (<wbar.IWorkbenchActionRegistry> platform.Registry.as(wbar.Extensions.WorkbenchActions));
// Register Action to Open Viewlet
workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(GlobalOpenChangeAction, GlobalOpenChangeAction.ID, GlobalOpenChangeAction.LABEL), nls.localize('git', "Git"));
// Register Actions
const category = nls.localize('git', "Git");
workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(GlobalOpenChangeAction, GlobalOpenChangeAction.ID, GlobalOpenChangeAction.LABEL), category);
workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(SyncAction, SyncAction.ID, SyncAction.LABEL), category);
......@@ -941,9 +941,10 @@ export abstract class BaseSyncAction extends GitAction {
export class SyncAction extends BaseSyncAction {
static ID = 'workbench.action.sync';
static LABEL = nls.localize('sync', "Sync");
constructor(@IGitService gitService: IGitService) {
super(SyncAction.ID, nls.localize('sync', "Sync"), 'git-action sync', gitService);
constructor(id: string, label: string, @IGitService gitService: IGitService) {
super(id, label, 'git-action sync', gitService);
}
}
......
......@@ -246,7 +246,7 @@ export class ChangesView extends EventEmitter.EventEmitter implements GitView.IV
public getSecondaryActions(): Actions.IAction[] {
if (!this.secondaryActions) {
this.secondaryActions = [
this.instantiationService.createInstance(GitActions.SyncAction),
this.instantiationService.createInstance(GitActions.SyncAction, GitActions.SyncAction.ID, GitActions.SyncAction.LABEL),
this.instantiationService.createInstance(GitActions.PullAction),
this.instantiationService.createInstance(GitActions.PushAction),
new ActionBar.Separator(),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册