提交 f8257413 编写于 作者: B Benjamin Pasero

debt - only show action for release notes if having a url for it

上级 5a569ad3
...@@ -298,15 +298,6 @@ if (OpenDocumentationUrlAction.AVAILABLE) { ...@@ -298,15 +298,6 @@ if (OpenDocumentationUrlAction.AVAILABLE) {
}); });
} }
MenuRegistry.appendMenuItem(MenuId.MenubarHelpMenu, {
group: '1_welcome',
command: {
id: 'update.showCurrentReleaseNotes',
title: nls.localize({ key: 'miReleaseNotes', comment: ['&& denotes a mnemonic'] }, "&&Release Notes")
},
order: 4
});
// Reference // Reference
if (KeybindingsReferenceAction.AVAILABLE) { if (KeybindingsReferenceAction.AVAILABLE) {
MenuRegistry.appendMenuItem(MenuId.MenubarHelpMenu, { MenuRegistry.appendMenuItem(MenuId.MenubarHelpMenu, {
......
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import 'vs/platform/update/common/update.config.contribution'; import 'vs/platform/update/common/update.config.contribution';
import { localize } from 'vs/nls';
import { Registry } from 'vs/platform/registry/common/platform'; import { Registry } from 'vs/platform/registry/common/platform';
import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions';
import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions';
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
import { ShowCurrentReleaseNotesAction, ProductContribution, UpdateContribution, CheckForVSCodeUpdateAction, CONTEXT_UPDATE_STATE } from 'vs/workbench/contrib/update/browser/update'; import { ShowCurrentReleaseNotesAction, ProductContribution, UpdateContribution, CheckForVSCodeUpdateAction, CONTEXT_UPDATE_STATE } from 'vs/workbench/contrib/update/browser/update';
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
import product from 'vs/platform/product/common/product'; import product from 'vs/platform/product/common/product';
...@@ -26,3 +27,15 @@ actionRegistry ...@@ -26,3 +27,15 @@ actionRegistry
actionRegistry actionRegistry
.registerWorkbenchAction(new SyncActionDescriptor(CheckForVSCodeUpdateAction, CheckForVSCodeUpdateAction.ID, CheckForVSCodeUpdateAction.LABEL), `${product.nameShort}: Check for Update`, product.nameShort, CONTEXT_UPDATE_STATE.isEqualTo(StateType.Idle)); .registerWorkbenchAction(new SyncActionDescriptor(CheckForVSCodeUpdateAction, CheckForVSCodeUpdateAction.ID, CheckForVSCodeUpdateAction.LABEL), `${product.nameShort}: Check for Update`, product.nameShort, CONTEXT_UPDATE_STATE.isEqualTo(StateType.Idle));
// Menu
if (ShowCurrentReleaseNotesAction.AVAILABE) {
MenuRegistry.appendMenuItem(MenuId.MenubarHelpMenu, {
group: '1_welcome',
command: {
id: ShowCurrentReleaseNotesAction.ID,
title: localize({ key: 'miReleaseNotes', comment: ['&& denotes a mnemonic'] }, "&&Release Notes")
},
order: 4
});
}
...@@ -29,6 +29,7 @@ import { FalseContext } from 'vs/platform/contextkey/common/contextkeys'; ...@@ -29,6 +29,7 @@ import { FalseContext } from 'vs/platform/contextkey/common/contextkeys';
import { ShowCurrentReleaseNotesActionId, CheckForVSCodeUpdateActionId } from 'vs/workbench/contrib/update/common/update'; import { ShowCurrentReleaseNotesActionId, CheckForVSCodeUpdateActionId } from 'vs/workbench/contrib/update/common/update';
import { IHostService } from 'vs/workbench/services/host/browser/host'; import { IHostService } from 'vs/workbench/services/host/browser/host';
import { IProductService } from 'vs/platform/product/common/productService'; import { IProductService } from 'vs/platform/product/common/productService';
import product from 'vs/platform/product/common/product';
export const CONTEXT_UPDATE_STATE = new RawContextKey<string>('updateState', StateType.Idle); export const CONTEXT_UPDATE_STATE = new RawContextKey<string>('updateState', StateType.Idle);
...@@ -100,6 +101,7 @@ export class ShowCurrentReleaseNotesAction extends AbstractShowReleaseNotesActio ...@@ -100,6 +101,7 @@ export class ShowCurrentReleaseNotesAction extends AbstractShowReleaseNotesActio
static readonly ID = ShowCurrentReleaseNotesActionId; static readonly ID = ShowCurrentReleaseNotesActionId;
static readonly LABEL = nls.localize('showReleaseNotes', "Show Release Notes"); static readonly LABEL = nls.localize('showReleaseNotes', "Show Release Notes");
static readonly AVAILABE = !!product.releaseNotesUrl;
constructor( constructor(
id = ShowCurrentReleaseNotesAction.ID, id = ShowCurrentReleaseNotesAction.ID,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册