提交 f690d5e1 编写于 作者: J Joao Moreno

rename update.channel to update.mode

fixes #67407
上级 6dd6b441
......@@ -56,8 +56,20 @@ export abstract class AbstractUpdateService implements IUpdateService {
return;
}
const updateChannel = this.configurationService.getValue<string>('update.channel');
const quality = this.getProductQuality(updateChannel);
const updateModeSetting = this.configurationService.inspect<string>('update.mode');
const updateChannelSetting = this.configurationService.inspect<string>('update.channel');
let updateMode: string;
if (typeof updateModeSetting.user !== 'undefined') {
updateMode = updateModeSetting.user;
} else if (typeof updateChannelSetting.user !== 'undefined') {
updateMode = updateChannelSetting.user;
} else {
updateMode = updateModeSetting.default;
}
const quality = this.getProductQuality(updateMode);
if (!quality) {
this.logService.info('update#ctor - updates are disabled by user preference');
......@@ -72,7 +84,7 @@ export abstract class AbstractUpdateService implements IUpdateService {
this.setState(State.Idle(this.getUpdateType()));
if (updateChannel === 'manual') {
if (updateMode === 'manual') {
this.logService.info('update#ctor - manual checks only; automatic updates are disabled by user preference');
return;
}
......@@ -81,8 +93,8 @@ export abstract class AbstractUpdateService implements IUpdateService {
this.scheduleCheckForUpdates(30 * 1000).then(undefined, err => this.logService.error(err));
}
private getProductQuality(updateChannel: string): string | undefined {
return updateChannel === 'none' ? undefined : product.quality;
private getProductQuality(updateMode: string): string | undefined {
return updateMode === 'none' ? undefined : product.quality;
}
private scheduleCheckForUpdates(delay = 60 * 60 * 1000): Promise<void> {
......
......@@ -14,12 +14,12 @@ configurationRegistry.registerConfiguration({
title: localize('updateConfigurationTitle', "Update"),
type: 'object',
properties: {
'update.channel': {
'update.mode': {
type: 'string',
enum: ['none', 'manual', 'default'],
default: 'default',
scope: ConfigurationScope.APPLICATION,
description: localize('updateChannel', "Configure whether you receive automatic updates from an update channel. Requires a restart after change. The updates are fetched from a Microsoft online service."),
description: localize('updateMode', "Configure whether you receive automatic updates. Requires a restart after change. The updates are fetched from a Microsoft online service."),
tags: ['usesOnlineServices'],
enumDescriptions: [
localize('none', "Disable updates."),
......
......@@ -21,7 +21,7 @@ import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { equals } from 'vs/base/common/objects';
interface IConfiguration extends IWindowsConfiguration {
update: { channel: string; };
update: { mode: string; };
telemetry: { enableCrashReporter: boolean };
keyboard: { touchbar: { enabled: boolean } };
workbench: { tree: { horizontalScrolling: boolean }, useExperimentalGridLayout: boolean };
......@@ -34,7 +34,7 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo
private nativeTabs: boolean;
private nativeFullScreen: boolean;
private clickThroughInactive: boolean;
private updateChannel: string;
private updateMode: string;
private enableCrashReporter: boolean;
private touchbarEnabled: boolean;
private treeHorizontalScrolling: boolean;
......@@ -84,8 +84,8 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo
}
// Update channel
if (config.update && typeof config.update.channel === 'string' && config.update.channel !== this.updateChannel) {
this.updateChannel = config.update.channel;
if (config.update && typeof config.update.mode === 'string' && config.update.mode !== this.updateMode) {
this.updateMode = config.update.mode;
changed = true;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册