@codingame/monaco-vscode-update-service-override 30.0.0 → 31.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/platform/update/common/update.config.contribution.js +23 -46
- package/vscode/src/vs/workbench/contrib/markdown/browser/markdownSettingRenderer.js +14 -14
- package/vscode/src/vs/workbench/contrib/update/browser/media/postUpdateWidget.css +68 -0
- package/vscode/src/vs/workbench/contrib/update/browser/media/updateTitleBarEntry.css +2 -20
- package/vscode/src/vs/workbench/contrib/update/browser/media/updateTooltip.css +32 -26
- package/vscode/src/vs/workbench/contrib/update/browser/postUpdateWidget.d.ts +35 -0
- package/vscode/src/vs/workbench/contrib/update/browser/postUpdateWidget.js +219 -0
- package/vscode/src/vs/workbench/contrib/update/browser/releaseNotesEditor.d.ts +1 -7
- package/vscode/src/vs/workbench/contrib/update/browser/releaseNotesEditor.js +5 -177
- package/vscode/src/vs/workbench/contrib/update/browser/update.contribution.js +44 -17
- package/vscode/src/vs/workbench/contrib/update/browser/update.d.ts +1 -17
- package/vscode/src/vs/workbench/contrib/update/browser/update.js +40 -279
- package/vscode/src/vs/workbench/contrib/update/browser/updateTitleBarEntry.d.ts +5 -7
- package/vscode/src/vs/workbench/contrib/update/browser/updateTitleBarEntry.js +83 -78
- package/vscode/src/vs/workbench/contrib/update/browser/updateTooltip.d.ts +6 -12
- package/vscode/src/vs/workbench/contrib/update/browser/updateTooltip.js +83 -125
- package/vscode/src/vs/workbench/contrib/update/common/updateInfoParser.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/update/common/updateInfoParser.js +74 -0
- package/vscode/src/vs/workbench/contrib/update/common/updateUtils.js +9 -21
- package/vscode/src/vs/workbench/contrib/update/browser/media/updateStatusBarEntry.css +0 -9
- package/vscode/src/vs/workbench/contrib/update/browser/updateStatusBarEntry.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/update/browser/updateStatusBarEntry.js +0 -140
|
@@ -10,14 +10,14 @@ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
10
10
|
import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
|
|
11
11
|
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
12
12
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
13
|
-
import { StateType
|
|
13
|
+
import { StateType } from '@codingame/monaco-vscode-api/vscode/vs/platform/update/common/update';
|
|
14
14
|
import { IUpdateService } from '@codingame/monaco-vscode-api/vscode/vs/platform/update/common/update.service';
|
|
15
15
|
import { NotificationPriority } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification';
|
|
16
16
|
import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service';
|
|
17
17
|
import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
18
18
|
import { IBrowserWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/browser/environmentService.service';
|
|
19
19
|
import { ReleaseNotesManager } from './releaseNotesEditor.js';
|
|
20
|
-
import { isWeb
|
|
20
|
+
import { isWeb } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
21
21
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
22
22
|
import { RawContextKey, ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
23
23
|
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
@@ -31,13 +31,9 @@ import { IsWebContext } from '@codingame/monaco-vscode-api/vscode/vs/platform/co
|
|
|
31
31
|
import { Promises, Throttler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
32
32
|
import { IUserDataSyncWorkbenchService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/userDataSync/common/userDataSync.service';
|
|
33
33
|
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
34
|
-
import { toAction } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
|
|
35
34
|
import { IDefaultAccountService } from '@codingame/monaco-vscode-api/vscode/vs/platform/defaultAccount/common/defaultAccount.service';
|
|
36
35
|
import { getInternalOrg } from '../../../../platform/assignment/common/assignment.js';
|
|
37
|
-
import { tryParseVersion
|
|
38
|
-
import { Parts } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
39
|
-
import { IWorkbenchLayoutService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
40
|
-
import { mainWindow } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/window';
|
|
36
|
+
import { tryParseVersion } from '../common/updateUtils.js';
|
|
41
37
|
|
|
42
38
|
var ProductContribution_1, DefaultAccountUpdateContribution_1;
|
|
43
39
|
const CONTEXT_UPDATE_STATE = ( new RawContextKey("updateState", StateType.Uninitialized));
|
|
@@ -57,7 +53,7 @@ async function openLatestReleaseNotesInBrowser(accessor) {
|
|
|
57
53
|
await openerService.open(uri);
|
|
58
54
|
} else {
|
|
59
55
|
throw ( new Error(( localize(
|
|
60
|
-
|
|
56
|
+
14982,
|
|
61
57
|
"This version of {0} does not have release notes online",
|
|
62
58
|
productService.nameLong
|
|
63
59
|
))));
|
|
@@ -80,7 +76,7 @@ function appendUpdateMenuItems(menuId, group) {
|
|
|
80
76
|
group,
|
|
81
77
|
command: {
|
|
82
78
|
id: "update.check",
|
|
83
|
-
title: ( localize(
|
|
79
|
+
title: ( localize(14983, "Check for Updates..."))
|
|
84
80
|
},
|
|
85
81
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Idle))
|
|
86
82
|
});
|
|
@@ -88,7 +84,7 @@ function appendUpdateMenuItems(menuId, group) {
|
|
|
88
84
|
group,
|
|
89
85
|
command: {
|
|
90
86
|
id: "update.checking",
|
|
91
|
-
title: ( localize(
|
|
87
|
+
title: ( localize(14984, "Checking for Updates...")),
|
|
92
88
|
precondition: ( ContextKeyExpr.false())
|
|
93
89
|
},
|
|
94
90
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.CheckingForUpdates))
|
|
@@ -97,7 +93,7 @@ function appendUpdateMenuItems(menuId, group) {
|
|
|
97
93
|
group,
|
|
98
94
|
command: {
|
|
99
95
|
id: "update.downloadNow",
|
|
100
|
-
title: ( localize(
|
|
96
|
+
title: ( localize(14985, "Download Update (1)"))
|
|
101
97
|
},
|
|
102
98
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.AvailableForDownload))
|
|
103
99
|
});
|
|
@@ -105,7 +101,7 @@ function appendUpdateMenuItems(menuId, group) {
|
|
|
105
101
|
group,
|
|
106
102
|
command: {
|
|
107
103
|
id: "update.downloading",
|
|
108
|
-
title: ( localize(
|
|
104
|
+
title: ( localize(14986, "Downloading Update...")),
|
|
109
105
|
precondition: ( ContextKeyExpr.false())
|
|
110
106
|
},
|
|
111
107
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Downloading))
|
|
@@ -114,7 +110,7 @@ function appendUpdateMenuItems(menuId, group) {
|
|
|
114
110
|
group,
|
|
115
111
|
command: {
|
|
116
112
|
id: "update.install",
|
|
117
|
-
title: ( localize(
|
|
113
|
+
title: ( localize(14987, "Install Update... (1)"))
|
|
118
114
|
},
|
|
119
115
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Downloaded))
|
|
120
116
|
});
|
|
@@ -122,7 +118,7 @@ function appendUpdateMenuItems(menuId, group) {
|
|
|
122
118
|
group,
|
|
123
119
|
command: {
|
|
124
120
|
id: "update.updating",
|
|
125
|
-
title: ( localize(
|
|
121
|
+
title: ( localize(14988, "Installing Update...")),
|
|
126
122
|
precondition: ( ContextKeyExpr.false())
|
|
127
123
|
},
|
|
128
124
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Updating))
|
|
@@ -132,7 +128,7 @@ function appendUpdateMenuItems(menuId, group) {
|
|
|
132
128
|
order: 2,
|
|
133
129
|
command: {
|
|
134
130
|
id: "update.restart",
|
|
135
|
-
title: ( localize(
|
|
131
|
+
title: ( localize(14989, "Restart to Update (1)"))
|
|
136
132
|
},
|
|
137
133
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Ready))
|
|
138
134
|
});
|
|
@@ -164,9 +160,6 @@ let ProductContribution = class ProductContribution {
|
|
|
164
160
|
if (!hadLastFocus) {
|
|
165
161
|
return;
|
|
166
162
|
}
|
|
167
|
-
if (configurationService.getValue("update.titleBar") !== "none") {
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
163
|
const lastVersion = tryParseVersion(
|
|
171
164
|
storageService.get(ProductContribution_1.KEY, StorageScope.APPLICATION, "")
|
|
172
165
|
);
|
|
@@ -176,12 +169,12 @@ let ProductContribution = class ProductContribution {
|
|
|
176
169
|
if (shouldShowReleaseNotes && !environmentService.skipReleaseNotes && releaseNotesUrl && lastVersion && currentVersion && isMajorMinorUpdate(lastVersion, currentVersion)) {
|
|
177
170
|
showReleaseNotesInEditor(instantiationService, productService.version, false).then(undefined, () => {
|
|
178
171
|
notificationService.prompt(Severity.Info, ( localize(
|
|
179
|
-
|
|
172
|
+
14990,
|
|
180
173
|
"Welcome to {0} v{1}! Would you like to read the Release Notes?",
|
|
181
174
|
productService.nameLong,
|
|
182
175
|
productService.version
|
|
183
176
|
)), [{
|
|
184
|
-
label: ( localize(
|
|
177
|
+
label: ( localize(14991, "Release Notes")),
|
|
185
178
|
run: () => {
|
|
186
179
|
const uri = ( URI.parse(releaseNotesUrl));
|
|
187
180
|
openerService.open(uri);
|
|
@@ -205,101 +198,42 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
205
198
|
constructor(
|
|
206
199
|
storageService,
|
|
207
200
|
instantiationService,
|
|
208
|
-
notificationService,
|
|
209
201
|
dialogService,
|
|
210
202
|
updateService,
|
|
211
203
|
activityService,
|
|
212
204
|
contextKeyService,
|
|
213
205
|
productService,
|
|
214
|
-
|
|
215
|
-
configurationService,
|
|
216
|
-
hostService,
|
|
217
|
-
layoutService
|
|
206
|
+
hostService
|
|
218
207
|
) {
|
|
219
208
|
super();
|
|
220
|
-
this.storageService = storageService;
|
|
221
209
|
this.instantiationService = instantiationService;
|
|
222
|
-
this.notificationService = notificationService;
|
|
223
210
|
this.dialogService = dialogService;
|
|
224
211
|
this.updateService = updateService;
|
|
225
212
|
this.activityService = activityService;
|
|
226
|
-
this.contextKeyService = contextKeyService;
|
|
227
213
|
this.productService = productService;
|
|
228
|
-
this.openerService = openerService;
|
|
229
|
-
this.configurationService = configurationService;
|
|
230
214
|
this.hostService = hostService;
|
|
231
|
-
this.layoutService = layoutService;
|
|
232
215
|
this.badgeDisposable = this._register(( new MutableDisposable()));
|
|
233
216
|
this.state = updateService.state;
|
|
234
|
-
this.updateStateContextKey = CONTEXT_UPDATE_STATE.bindTo(
|
|
235
|
-
this.majorMinorUpdateAvailableContextKey = MAJOR_MINOR_UPDATE_AVAILABLE.bindTo(
|
|
236
|
-
this.titleBarEnabled = this.isTitleBarEnabled();
|
|
217
|
+
this.updateStateContextKey = CONTEXT_UPDATE_STATE.bindTo(contextKeyService);
|
|
218
|
+
this.majorMinorUpdateAvailableContextKey = MAJOR_MINOR_UPDATE_AVAILABLE.bindTo(contextKeyService);
|
|
237
219
|
this._register(updateService.onStateChange(this.onUpdateStateChange, this));
|
|
238
220
|
this.onUpdateStateChange(this.updateService.state);
|
|
239
221
|
const currentVersion = this.productService.commit;
|
|
240
|
-
const lastKnownVersion =
|
|
222
|
+
const lastKnownVersion = storageService.get("update/lastKnownVersion", StorageScope.APPLICATION);
|
|
241
223
|
if (currentVersion !== lastKnownVersion) {
|
|
242
|
-
|
|
243
|
-
|
|
224
|
+
storageService.remove("update/lastKnownVersion", StorageScope.APPLICATION);
|
|
225
|
+
storageService.remove("update/updateNotificationTime", StorageScope.APPLICATION);
|
|
244
226
|
}
|
|
245
|
-
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
|
246
|
-
if (e.affectsConfiguration("update.titleBar")) {
|
|
247
|
-
this.titleBarEnabled = this.isTitleBarEnabled();
|
|
248
|
-
this.onUpdateStateChange(this.updateService.state);
|
|
249
|
-
}
|
|
250
|
-
}));
|
|
251
|
-
this._register(this.layoutService.onDidChangePartVisibility(e => {
|
|
252
|
-
if (e.partId === Parts.TITLEBAR_PART) {
|
|
253
|
-
this.titleBarEnabled = this.isTitleBarEnabled();
|
|
254
|
-
this.onUpdateStateChange(this.updateService.state);
|
|
255
|
-
}
|
|
256
|
-
}));
|
|
257
227
|
this.registerGlobalActivityActions();
|
|
258
228
|
}
|
|
259
|
-
isTitleBarEnabled() {
|
|
260
|
-
return this.configurationService.getValue("update.titleBar") !== "none" && this.layoutService.isVisible(Parts.TITLEBAR_PART, mainWindow);
|
|
261
|
-
}
|
|
262
229
|
async onUpdateStateChange(state) {
|
|
263
230
|
this.updateStateContextKey.set(state.type);
|
|
264
231
|
switch (state.type) {
|
|
265
|
-
case StateType.Disabled:
|
|
266
|
-
if (!this.titleBarEnabled && state.reason === DisablementReason.RunningAsAdmin) {
|
|
267
|
-
this.notificationService.notify({
|
|
268
|
-
severity: Severity.Info,
|
|
269
|
-
message: ( localize(
|
|
270
|
-
14831,
|
|
271
|
-
"Updates are disabled because you are running the user-scope installation of {0} as Administrator.",
|
|
272
|
-
this.productService.nameLong
|
|
273
|
-
)),
|
|
274
|
-
actions: {
|
|
275
|
-
primary: [toAction({
|
|
276
|
-
id: "",
|
|
277
|
-
label: ( localize(14832, "Learn More")),
|
|
278
|
-
run: () => this.openerService.open("https://aka.ms/vscode-windows-setup")
|
|
279
|
-
})]
|
|
280
|
-
},
|
|
281
|
-
neverShowAgain: {
|
|
282
|
-
id: "no-updates-running-as-admin"
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
break;
|
|
287
232
|
case StateType.Idle:
|
|
288
|
-
if (state.error) {
|
|
289
|
-
this.onError(state.error);
|
|
290
|
-
} else if (this.state.type === StateType.CheckingForUpdates && this.state.explicit && (await this.hostService.hadLastFocus())) {
|
|
233
|
+
if (this.state.type === StateType.CheckingForUpdates && this.state.explicit && !state.error && (await this.hostService.hadLastFocus())) {
|
|
291
234
|
this.onUpdateNotAvailable();
|
|
292
235
|
}
|
|
293
236
|
break;
|
|
294
|
-
case StateType.AvailableForDownload:
|
|
295
|
-
this.onUpdateAvailable(state.update);
|
|
296
|
-
break;
|
|
297
|
-
case StateType.Downloaded:
|
|
298
|
-
this.onUpdateDownloaded(state.update);
|
|
299
|
-
break;
|
|
300
|
-
case StateType.Overwriting:
|
|
301
|
-
this.onUpdateOverwriting(state);
|
|
302
|
-
break;
|
|
303
237
|
case StateType.Ready:
|
|
304
238
|
{
|
|
305
239
|
const productVersion = state.update.productVersion;
|
|
@@ -310,21 +244,18 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
310
244
|
currentVersion && nextVersion && isMajorMinorUpdate(currentVersion, nextVersion)
|
|
311
245
|
));
|
|
312
246
|
}
|
|
313
|
-
this.onUpdateReady(state);
|
|
314
247
|
break;
|
|
315
248
|
}
|
|
316
249
|
}
|
|
317
250
|
let badge = undefined;
|
|
318
|
-
if (
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
badge = ( new ProgressBadge(() => ( localize(14836, "Updating {0}...", this.productService.nameShort))));
|
|
327
|
-
}
|
|
251
|
+
if (state.type === StateType.AvailableForDownload || state.type === StateType.Downloaded || state.type === StateType.Ready) {
|
|
252
|
+
badge = ( new NumberBadge(1, () => ( localize(14992, "New {0} update available.", this.productService.nameShort))));
|
|
253
|
+
} else if (state.type === StateType.CheckingForUpdates) {
|
|
254
|
+
badge = ( new ProgressBadge(() => ( localize(14993, "Checking for {0} updates...", this.productService.nameShort))));
|
|
255
|
+
} else if (state.type === StateType.Downloading || state.type === StateType.Overwriting) {
|
|
256
|
+
badge = ( new ProgressBadge(() => ( localize(14994, "Downloading {0} update...", this.productService.nameShort))));
|
|
257
|
+
} else if (state.type === StateType.Updating) {
|
|
258
|
+
badge = ( new ProgressBadge(() => ( localize(14995, "Updating {0}...", this.productService.nameShort))));
|
|
328
259
|
}
|
|
329
260
|
this.badgeDisposable.clear();
|
|
330
261
|
if (badge) {
|
|
@@ -334,178 +265,8 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
334
265
|
}
|
|
335
266
|
this.state = state;
|
|
336
267
|
}
|
|
337
|
-
onError(error) {
|
|
338
|
-
if (this.titleBarEnabled) {
|
|
339
|
-
return;
|
|
340
|
-
}
|
|
341
|
-
const processedError = preprocessError(error);
|
|
342
|
-
if (processedError) {
|
|
343
|
-
this.notificationService.notify({
|
|
344
|
-
severity: Severity.Error,
|
|
345
|
-
message: processedError,
|
|
346
|
-
source: ( localize(14837, "Update Service"))
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
268
|
onUpdateNotAvailable() {
|
|
351
|
-
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
this.dialogService.info(( localize(14838, "There are currently no updates available.")));
|
|
355
|
-
}
|
|
356
|
-
onUpdateAvailable(update) {
|
|
357
|
-
if (this.titleBarEnabled) {
|
|
358
|
-
return;
|
|
359
|
-
}
|
|
360
|
-
if (!this.shouldShowNotification()) {
|
|
361
|
-
return;
|
|
362
|
-
}
|
|
363
|
-
const productVersion = update.productVersion;
|
|
364
|
-
if (!productVersion) {
|
|
365
|
-
return;
|
|
366
|
-
}
|
|
367
|
-
this.notificationService.prompt(Severity.Info, ( localize(14839, "There is an available update.")), [{
|
|
368
|
-
label: ( localize(14840, "Download Update")),
|
|
369
|
-
run: () => this.updateService.downloadUpdate(true)
|
|
370
|
-
}, {
|
|
371
|
-
label: ( localize(14841, "Later")),
|
|
372
|
-
run: () => {}
|
|
373
|
-
}, {
|
|
374
|
-
label: ( localize(14830, "Release Notes")),
|
|
375
|
-
run: () => {
|
|
376
|
-
this.instantiationService.invokeFunction(accessor => showReleaseNotes(accessor, productVersion));
|
|
377
|
-
}
|
|
378
|
-
}], {
|
|
379
|
-
priority: NotificationPriority.OPTIONAL
|
|
380
|
-
});
|
|
381
|
-
}
|
|
382
|
-
onUpdateDownloaded(update) {
|
|
383
|
-
if (this.titleBarEnabled) {
|
|
384
|
-
return;
|
|
385
|
-
}
|
|
386
|
-
if (isMacintosh) {
|
|
387
|
-
return;
|
|
388
|
-
}
|
|
389
|
-
if (this.configurationService.getValue("update.enableWindowsBackgroundUpdates") && this.productService.target === "user") {
|
|
390
|
-
return;
|
|
391
|
-
}
|
|
392
|
-
if (!this.shouldShowNotification()) {
|
|
393
|
-
return;
|
|
394
|
-
}
|
|
395
|
-
const productVersion = update.productVersion;
|
|
396
|
-
if (!productVersion) {
|
|
397
|
-
return;
|
|
398
|
-
}
|
|
399
|
-
this.notificationService.prompt(Severity.Info, ( localize(
|
|
400
|
-
14842,
|
|
401
|
-
"There's an update available: {0} {1}",
|
|
402
|
-
this.productService.nameLong,
|
|
403
|
-
productVersion
|
|
404
|
-
)), [{
|
|
405
|
-
label: ( localize(14843, "Install Update")),
|
|
406
|
-
run: () => this.updateService.applyUpdate()
|
|
407
|
-
}, {
|
|
408
|
-
label: ( localize(14841, "Later")),
|
|
409
|
-
run: () => {}
|
|
410
|
-
}, {
|
|
411
|
-
label: ( localize(14830, "Release Notes")),
|
|
412
|
-
run: () => {
|
|
413
|
-
this.instantiationService.invokeFunction(accessor => showReleaseNotes(accessor, productVersion));
|
|
414
|
-
}
|
|
415
|
-
}], {
|
|
416
|
-
priority: NotificationPriority.OPTIONAL
|
|
417
|
-
});
|
|
418
|
-
}
|
|
419
|
-
onUpdateReady(state) {
|
|
420
|
-
if (this.titleBarEnabled) {
|
|
421
|
-
this.overwriteNotificationHandle?.progress.done();
|
|
422
|
-
this.overwriteNotificationHandle = undefined;
|
|
423
|
-
return;
|
|
424
|
-
}
|
|
425
|
-
if (state.overwrite && this.overwriteNotificationHandle) {
|
|
426
|
-
const handle = this.overwriteNotificationHandle;
|
|
427
|
-
this.overwriteNotificationHandle = undefined;
|
|
428
|
-
handle.progress.done();
|
|
429
|
-
handle.updateMessage(( localize(14844, "The newer update is ready to install.")));
|
|
430
|
-
handle.updateActions({
|
|
431
|
-
primary: [toAction({
|
|
432
|
-
id: "update.restartToUpdate",
|
|
433
|
-
label: ( localize(14845, "Restart to Update")),
|
|
434
|
-
run: () => this.updateService.quitAndInstall()
|
|
435
|
-
})]
|
|
436
|
-
});
|
|
437
|
-
} else {
|
|
438
|
-
if (this.overwriteNotificationHandle) {
|
|
439
|
-
this.overwriteNotificationHandle.close();
|
|
440
|
-
this.overwriteNotificationHandle = undefined;
|
|
441
|
-
}
|
|
442
|
-
if ((isWindows && this.productService.target !== "user") || this.shouldShowNotification()) {
|
|
443
|
-
const actions = [{
|
|
444
|
-
label: ( localize(14846, "Update Now")),
|
|
445
|
-
run: () => this.updateService.quitAndInstall()
|
|
446
|
-
}, {
|
|
447
|
-
label: ( localize(14841, "Later")),
|
|
448
|
-
run: () => {}
|
|
449
|
-
}];
|
|
450
|
-
const productVersion = state.update.productVersion;
|
|
451
|
-
if (productVersion) {
|
|
452
|
-
actions.push({
|
|
453
|
-
label: ( localize(14830, "Release Notes")),
|
|
454
|
-
run: () => {
|
|
455
|
-
this.instantiationService.invokeFunction(accessor => showReleaseNotes(accessor, productVersion));
|
|
456
|
-
}
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
this.notificationService.prompt(Severity.Info, ( localize(
|
|
460
|
-
14847,
|
|
461
|
-
"Restart {0} to apply the latest update.",
|
|
462
|
-
this.productService.nameLong
|
|
463
|
-
)), actions, {
|
|
464
|
-
sticky: true,
|
|
465
|
-
priority: NotificationPriority.OPTIONAL
|
|
466
|
-
});
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
onUpdateOverwriting(state) {
|
|
471
|
-
if (this.titleBarEnabled) {
|
|
472
|
-
return;
|
|
473
|
-
}
|
|
474
|
-
if (!state.explicit) {
|
|
475
|
-
return;
|
|
476
|
-
}
|
|
477
|
-
this.overwriteNotificationHandle = this.notificationService.notify({
|
|
478
|
-
severity: Severity.Info,
|
|
479
|
-
sticky: true,
|
|
480
|
-
message: ( localize(
|
|
481
|
-
14848,
|
|
482
|
-
"We found a newer update available and have started to download it. We'll let you know as soon as it's ready to install."
|
|
483
|
-
)),
|
|
484
|
-
source: ( localize(14837, "Update Service"))
|
|
485
|
-
});
|
|
486
|
-
this.overwriteNotificationHandle.progress.infinite();
|
|
487
|
-
}
|
|
488
|
-
shouldShowNotification() {
|
|
489
|
-
const currentVersion = this.productService.commit;
|
|
490
|
-
const currentMillis = ( new Date()).getTime();
|
|
491
|
-
const lastKnownVersion = this.storageService.get("update/lastKnownVersion", StorageScope.APPLICATION);
|
|
492
|
-
if (currentVersion !== lastKnownVersion) {
|
|
493
|
-
this.storageService.store(
|
|
494
|
-
"update/lastKnownVersion",
|
|
495
|
-
currentVersion,
|
|
496
|
-
StorageScope.APPLICATION,
|
|
497
|
-
StorageTarget.MACHINE
|
|
498
|
-
);
|
|
499
|
-
this.storageService.store(
|
|
500
|
-
"update/updateNotificationTime",
|
|
501
|
-
currentMillis,
|
|
502
|
-
StorageScope.APPLICATION,
|
|
503
|
-
StorageTarget.MACHINE
|
|
504
|
-
);
|
|
505
|
-
}
|
|
506
|
-
const updateNotificationMillis = this.storageService.getNumber("update/updateNotificationTime", StorageScope.APPLICATION, currentMillis);
|
|
507
|
-
const diffDays = (currentMillis - updateNotificationMillis) / (1000 * 60 * 60 * 24);
|
|
508
|
-
return diffDays > 5;
|
|
269
|
+
this.dialogService.info(( localize(14996, "There are currently no updates available.")));
|
|
509
270
|
}
|
|
510
271
|
registerGlobalActivityActions() {
|
|
511
272
|
CommandsRegistry.registerCommand("update.check", () => this.updateService.checkForUpdates(true));
|
|
@@ -534,14 +295,14 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
534
295
|
order: 1,
|
|
535
296
|
command: {
|
|
536
297
|
id: "update.showUpdateReleaseNotes",
|
|
537
|
-
title: ( localize(
|
|
298
|
+
title: ( localize(14997, "Show Update Release Notes"))
|
|
538
299
|
},
|
|
539
300
|
when: ( ContextKeyExpr.and(( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Ready)), MAJOR_MINOR_UPDATE_AVAILABLE))
|
|
540
301
|
});
|
|
541
302
|
}
|
|
542
303
|
}
|
|
543
304
|
};
|
|
544
|
-
UpdateContribution = ( __decorate([( __param(0, IStorageService)), ( __param(1, IInstantiationService)), ( __param(2,
|
|
305
|
+
UpdateContribution = ( __decorate([( __param(0, IStorageService)), ( __param(1, IInstantiationService)), ( __param(2, IDialogService)), ( __param(3, IUpdateService)), ( __param(4, IActivityService)), ( __param(5, IContextKeyService)), ( __param(6, IProductService)), ( __param(7, IHostService))], UpdateContribution));
|
|
545
306
|
let SwitchProductQualityContribution = class SwitchProductQualityContribution extends Disposable {
|
|
546
307
|
constructor(productService, environmentService) {
|
|
547
308
|
super();
|
|
@@ -560,7 +321,7 @@ let SwitchProductQualityContribution = class SwitchProductQualityContribution ex
|
|
|
560
321
|
constructor() {
|
|
561
322
|
super({
|
|
562
323
|
id: commandId,
|
|
563
|
-
title: isSwitchingToInsiders ? ( localize(
|
|
324
|
+
title: isSwitchingToInsiders ? ( localize(14998, "Switch to Insiders Version...")) : ( localize(14999, "Switch to Stable Version...")),
|
|
564
325
|
precondition: IsWebContext,
|
|
565
326
|
menu: {
|
|
566
327
|
id: MenuId.GlobalActivity,
|
|
@@ -598,15 +359,15 @@ let SwitchProductQualityContribution = class SwitchProductQualityContribution ex
|
|
|
598
359
|
}
|
|
599
360
|
const res = await dialogService.confirm({
|
|
600
361
|
type: "info",
|
|
601
|
-
message: ( localize(
|
|
362
|
+
message: ( localize(15000, "Changing the version requires a reload to take effect")),
|
|
602
363
|
detail: newQuality === "insider" ? ( localize(
|
|
603
|
-
|
|
364
|
+
15001,
|
|
604
365
|
"Press the reload button to switch to the Insiders version of VS Code."
|
|
605
366
|
)) : ( localize(
|
|
606
|
-
|
|
367
|
+
15002,
|
|
607
368
|
"Press the reload button to switch to the Stable version of VS Code."
|
|
608
369
|
)),
|
|
609
|
-
primaryButton: ( localize(
|
|
370
|
+
primaryButton: ( localize(15003, "&&Reload"))
|
|
610
371
|
});
|
|
611
372
|
if (res.confirmed) {
|
|
612
373
|
const promises = [];
|
|
@@ -636,18 +397,18 @@ let SwitchProductQualityContribution = class SwitchProductQualityContribution ex
|
|
|
636
397
|
} = await dialogService.prompt({
|
|
637
398
|
type: Severity.Info,
|
|
638
399
|
message: ( localize(
|
|
639
|
-
|
|
400
|
+
15004,
|
|
640
401
|
"Choose the settings sync service to use after changing the version"
|
|
641
402
|
)),
|
|
642
403
|
detail: ( localize(
|
|
643
|
-
|
|
404
|
+
15005,
|
|
644
405
|
"The Insiders version of VS Code will synchronize your settings, keybindings, extensions, snippets and UI State using separate insiders settings sync service by default."
|
|
645
406
|
)),
|
|
646
407
|
buttons: [{
|
|
647
|
-
label: ( localize(
|
|
408
|
+
label: ( localize(15006, "&&Insiders")),
|
|
648
409
|
run: () => "insiders"
|
|
649
410
|
}, {
|
|
650
|
-
label: ( localize(
|
|
411
|
+
label: ( localize(15007, "&&Stable (current)")),
|
|
651
412
|
run: () => "stable"
|
|
652
413
|
}],
|
|
653
414
|
cancelButton: true
|
|
@@ -4,34 +4,32 @@ import { IAction } from "@codingame/monaco-vscode-api/vscode/vs/base/common/acti
|
|
|
4
4
|
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
5
5
|
import { IActionViewItemService } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/actionViewItemService.service";
|
|
6
6
|
import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service";
|
|
7
|
-
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
8
7
|
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
9
8
|
import { IHoverService } from "@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service";
|
|
10
9
|
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
11
|
-
import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service";
|
|
12
10
|
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
13
11
|
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
14
12
|
import { IUpdateService } from "@codingame/monaco-vscode-api/vscode/vs/platform/update/common/update.service";
|
|
15
13
|
import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
16
14
|
import { IHostService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service";
|
|
15
|
+
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service";
|
|
17
16
|
import { UpdateTooltip } from "./updateTooltip.js";
|
|
18
17
|
/**
|
|
19
18
|
* Displays update status and actions in the title bar.
|
|
20
19
|
*/
|
|
21
20
|
export declare class UpdateTitleBarContribution extends Disposable implements IWorkbenchContribution {
|
|
21
|
+
private readonly chatService;
|
|
22
22
|
private readonly hostService;
|
|
23
|
-
private readonly productService;
|
|
24
23
|
private readonly storageService;
|
|
25
24
|
private readonly context;
|
|
26
25
|
private readonly tooltip;
|
|
27
|
-
private mode;
|
|
28
26
|
private state;
|
|
29
27
|
private entry;
|
|
30
28
|
private tooltipVisible;
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
private readonly pendingShow;
|
|
30
|
+
constructor(actionViewItemService: IActionViewItemService, chatService: IChatService, contextKeyService: IContextKeyService, hostService: IHostService, instantiationService: IInstantiationService, storageService: IStorageService, updateService: IUpdateService);
|
|
33
31
|
private onStateChange;
|
|
34
|
-
private
|
|
32
|
+
private setContextWhenChatIdle;
|
|
35
33
|
}
|
|
36
34
|
/**
|
|
37
35
|
* Custom action view item for the update indicator in the title bar.
|