@codingame/monaco-vscode-update-service-override 28.4.0 → 29.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 +39 -20
- package/vscode/src/vs/workbench/contrib/markdown/browser/markdownSettingRenderer.js +14 -14
- package/vscode/src/vs/workbench/contrib/update/browser/media/updateStatusBarEntry.css +0 -133
- package/vscode/src/vs/workbench/contrib/update/browser/media/updateTitleBarEntry.css +109 -0
- package/vscode/src/vs/workbench/contrib/update/browser/media/updateTooltip.css +159 -0
- package/vscode/src/vs/workbench/contrib/update/browser/releaseNotesEditor.d.ts +22 -1
- package/vscode/src/vs/workbench/contrib/update/browser/releaseNotesEditor.js +32 -14
- package/vscode/src/vs/workbench/contrib/update/browser/update.contribution.js +19 -17
- package/vscode/src/vs/workbench/contrib/update/browser/update.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/update/browser/update.js +132 -94
- package/vscode/src/vs/workbench/contrib/update/browser/updateStatusBarEntry.d.ts +9 -55
- package/vscode/src/vs/workbench/contrib/update/browser/updateStatusBarEntry.js +64 -395
- package/vscode/src/vs/workbench/contrib/update/browser/updateTitleBarEntry.d.ts +58 -0
- package/vscode/src/vs/workbench/contrib/update/browser/updateTitleBarEntry.js +319 -0
- package/vscode/src/vs/workbench/contrib/update/browser/updateTooltip.d.ts +66 -0
- package/vscode/src/vs/workbench/contrib/update/browser/updateTooltip.js +429 -0
- package/vscode/src/vs/workbench/contrib/update/common/updateUtils.d.ts +61 -0
- package/vscode/src/vs/workbench/contrib/update/common/updateUtils.js +141 -0
- package/vscode/src/vs/workbench/contrib/update/browser/media/releasenoteseditor.css +0 -9
|
@@ -34,6 +34,10 @@ import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event'
|
|
|
34
34
|
import { toAction } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
|
|
35
35
|
import { IDefaultAccountService } from '@codingame/monaco-vscode-api/vscode/vs/platform/defaultAccount/common/defaultAccount.service';
|
|
36
36
|
import { getInternalOrg } from '../../../../platform/assignment/common/assignment.js';
|
|
37
|
+
import { tryParseVersion, preprocessError } from '../common/updateUtils.js';
|
|
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';
|
|
37
41
|
|
|
38
42
|
var ProductContribution_1, DefaultAccountUpdateContribution_1;
|
|
39
43
|
const CONTEXT_UPDATE_STATE = ( new RawContextKey("updateState", StateType.Uninitialized));
|
|
@@ -53,7 +57,7 @@ async function openLatestReleaseNotesInBrowser(accessor) {
|
|
|
53
57
|
await openerService.open(uri);
|
|
54
58
|
} else {
|
|
55
59
|
throw ( new Error(( localize(
|
|
56
|
-
|
|
60
|
+
14739,
|
|
57
61
|
"This version of {0} does not have release notes online",
|
|
58
62
|
productService.nameLong
|
|
59
63
|
))));
|
|
@@ -76,7 +80,7 @@ function appendUpdateMenuItems(menuId, group) {
|
|
|
76
80
|
group,
|
|
77
81
|
command: {
|
|
78
82
|
id: "update.check",
|
|
79
|
-
title: ( localize(
|
|
83
|
+
title: ( localize(14740, "Check for Updates..."))
|
|
80
84
|
},
|
|
81
85
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Idle))
|
|
82
86
|
});
|
|
@@ -84,7 +88,7 @@ function appendUpdateMenuItems(menuId, group) {
|
|
|
84
88
|
group,
|
|
85
89
|
command: {
|
|
86
90
|
id: "update.checking",
|
|
87
|
-
title: ( localize(
|
|
91
|
+
title: ( localize(14741, "Checking for Updates...")),
|
|
88
92
|
precondition: ( ContextKeyExpr.false())
|
|
89
93
|
},
|
|
90
94
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.CheckingForUpdates))
|
|
@@ -93,7 +97,7 @@ function appendUpdateMenuItems(menuId, group) {
|
|
|
93
97
|
group,
|
|
94
98
|
command: {
|
|
95
99
|
id: "update.downloadNow",
|
|
96
|
-
title: ( localize(
|
|
100
|
+
title: ( localize(14742, "Download Update (1)"))
|
|
97
101
|
},
|
|
98
102
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.AvailableForDownload))
|
|
99
103
|
});
|
|
@@ -101,7 +105,7 @@ function appendUpdateMenuItems(menuId, group) {
|
|
|
101
105
|
group,
|
|
102
106
|
command: {
|
|
103
107
|
id: "update.downloading",
|
|
104
|
-
title: ( localize(
|
|
108
|
+
title: ( localize(14743, "Downloading Update...")),
|
|
105
109
|
precondition: ( ContextKeyExpr.false())
|
|
106
110
|
},
|
|
107
111
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Downloading))
|
|
@@ -110,7 +114,7 @@ function appendUpdateMenuItems(menuId, group) {
|
|
|
110
114
|
group,
|
|
111
115
|
command: {
|
|
112
116
|
id: "update.install",
|
|
113
|
-
title: ( localize(
|
|
117
|
+
title: ( localize(14744, "Install Update... (1)"))
|
|
114
118
|
},
|
|
115
119
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Downloaded))
|
|
116
120
|
});
|
|
@@ -118,7 +122,7 @@ function appendUpdateMenuItems(menuId, group) {
|
|
|
118
122
|
group,
|
|
119
123
|
command: {
|
|
120
124
|
id: "update.updating",
|
|
121
|
-
title: ( localize(
|
|
125
|
+
title: ( localize(14745, "Installing Update...")),
|
|
122
126
|
precondition: ( ContextKeyExpr.false())
|
|
123
127
|
},
|
|
124
128
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Updating))
|
|
@@ -128,22 +132,11 @@ function appendUpdateMenuItems(menuId, group) {
|
|
|
128
132
|
order: 2,
|
|
129
133
|
command: {
|
|
130
134
|
id: "update.restart",
|
|
131
|
-
title: ( localize(
|
|
135
|
+
title: ( localize(14746, "Restart to Update (1)"))
|
|
132
136
|
},
|
|
133
137
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Ready))
|
|
134
138
|
});
|
|
135
139
|
}
|
|
136
|
-
function parseVersion(version) {
|
|
137
|
-
const match = /([0-9]+)\.([0-9]+)\.([0-9]+)/.exec(version);
|
|
138
|
-
if (!match) {
|
|
139
|
-
return undefined;
|
|
140
|
-
}
|
|
141
|
-
return {
|
|
142
|
-
major: parseInt(match[1]),
|
|
143
|
-
minor: parseInt(match[2]),
|
|
144
|
-
patch: parseInt(match[3])
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
140
|
function isMajorMinorUpdate(before, after) {
|
|
148
141
|
return before.major < after.major || before.minor < after.minor;
|
|
149
142
|
}
|
|
@@ -171,21 +164,24 @@ let ProductContribution = class ProductContribution {
|
|
|
171
164
|
if (!hadLastFocus) {
|
|
172
165
|
return;
|
|
173
166
|
}
|
|
174
|
-
|
|
167
|
+
if (configurationService.getValue("update.titleBar") !== "none") {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
const lastVersion = tryParseVersion(
|
|
175
171
|
storageService.get(ProductContribution_1.KEY, StorageScope.APPLICATION, "")
|
|
176
172
|
);
|
|
177
|
-
const currentVersion =
|
|
173
|
+
const currentVersion = tryParseVersion(productService.version);
|
|
178
174
|
const shouldShowReleaseNotes = configurationService.getValue("update.showReleaseNotes");
|
|
179
175
|
const releaseNotesUrl = productService.releaseNotesUrl;
|
|
180
176
|
if (shouldShowReleaseNotes && !environmentService.skipReleaseNotes && releaseNotesUrl && lastVersion && currentVersion && isMajorMinorUpdate(lastVersion, currentVersion)) {
|
|
181
177
|
showReleaseNotesInEditor(instantiationService, productService.version, false).then(undefined, () => {
|
|
182
178
|
notificationService.prompt(Severity.Info, ( localize(
|
|
183
|
-
|
|
179
|
+
14747,
|
|
184
180
|
"Welcome to {0} v{1}! Would you like to read the Release Notes?",
|
|
185
181
|
productService.nameLong,
|
|
186
182
|
productService.version
|
|
187
183
|
)), [{
|
|
188
|
-
label: ( localize(
|
|
184
|
+
label: ( localize(14748, "Release Notes")),
|
|
189
185
|
run: () => {
|
|
190
186
|
const uri = ( URI.parse(releaseNotesUrl));
|
|
191
187
|
openerService.open(uri);
|
|
@@ -217,7 +213,8 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
217
213
|
productService,
|
|
218
214
|
openerService,
|
|
219
215
|
configurationService,
|
|
220
|
-
hostService
|
|
216
|
+
hostService,
|
|
217
|
+
layoutService
|
|
221
218
|
) {
|
|
222
219
|
super();
|
|
223
220
|
this.storageService = storageService;
|
|
@@ -231,10 +228,12 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
231
228
|
this.openerService = openerService;
|
|
232
229
|
this.configurationService = configurationService;
|
|
233
230
|
this.hostService = hostService;
|
|
231
|
+
this.layoutService = layoutService;
|
|
234
232
|
this.badgeDisposable = this._register(( new MutableDisposable()));
|
|
235
233
|
this.state = updateService.state;
|
|
236
234
|
this.updateStateContextKey = CONTEXT_UPDATE_STATE.bindTo(this.contextKeyService);
|
|
237
235
|
this.majorMinorUpdateAvailableContextKey = MAJOR_MINOR_UPDATE_AVAILABLE.bindTo(this.contextKeyService);
|
|
236
|
+
this.titleBarEnabled = this.isTitleBarEnabled();
|
|
238
237
|
this._register(updateService.onStateChange(this.onUpdateStateChange, this));
|
|
239
238
|
this.onUpdateStateChange(this.updateService.state);
|
|
240
239
|
const currentVersion = this.productService.commit;
|
|
@@ -243,24 +242,39 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
243
242
|
this.storageService.remove("update/lastKnownVersion", StorageScope.APPLICATION);
|
|
244
243
|
this.storageService.remove("update/updateNotificationTime", StorageScope.APPLICATION);
|
|
245
244
|
}
|
|
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
|
+
}));
|
|
246
257
|
this.registerGlobalActivityActions();
|
|
247
258
|
}
|
|
259
|
+
isTitleBarEnabled() {
|
|
260
|
+
return this.configurationService.getValue("update.titleBar") !== "none" && this.layoutService.isVisible(Parts.TITLEBAR_PART, mainWindow);
|
|
261
|
+
}
|
|
248
262
|
async onUpdateStateChange(state) {
|
|
249
263
|
this.updateStateContextKey.set(state.type);
|
|
250
264
|
switch (state.type) {
|
|
251
265
|
case StateType.Disabled:
|
|
252
|
-
if (state.reason === DisablementReason.RunningAsAdmin) {
|
|
266
|
+
if (!this.titleBarEnabled && state.reason === DisablementReason.RunningAsAdmin) {
|
|
253
267
|
this.notificationService.notify({
|
|
254
268
|
severity: Severity.Info,
|
|
255
269
|
message: ( localize(
|
|
256
|
-
|
|
270
|
+
14749,
|
|
257
271
|
"Updates are disabled because you are running the user-scope installation of {0} as Administrator.",
|
|
258
272
|
this.productService.nameLong
|
|
259
273
|
)),
|
|
260
274
|
actions: {
|
|
261
275
|
primary: [toAction({
|
|
262
276
|
id: "",
|
|
263
|
-
label: ( localize(
|
|
277
|
+
label: ( localize(14750, "Learn More")),
|
|
264
278
|
run: () => this.openerService.open("https://aka.ms/vscode-windows-setup")
|
|
265
279
|
})]
|
|
266
280
|
},
|
|
@@ -290,8 +304,8 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
290
304
|
{
|
|
291
305
|
const productVersion = state.update.productVersion;
|
|
292
306
|
if (productVersion) {
|
|
293
|
-
const currentVersion =
|
|
294
|
-
const nextVersion =
|
|
307
|
+
const currentVersion = tryParseVersion(this.productService.version);
|
|
308
|
+
const nextVersion = tryParseVersion(productVersion);
|
|
295
309
|
this.majorMinorUpdateAvailableContextKey.set(Boolean(
|
|
296
310
|
currentVersion && nextVersion && isMajorMinorUpdate(currentVersion, nextVersion)
|
|
297
311
|
));
|
|
@@ -301,14 +315,16 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
301
315
|
}
|
|
302
316
|
}
|
|
303
317
|
let badge = undefined;
|
|
304
|
-
if (
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
318
|
+
if (!this.titleBarEnabled) {
|
|
319
|
+
if (state.type === StateType.AvailableForDownload || state.type === StateType.Downloaded || state.type === StateType.Ready) {
|
|
320
|
+
badge = ( new NumberBadge(1, () => ( localize(14751, "New {0} update available.", this.productService.nameShort))));
|
|
321
|
+
} else if (state.type === StateType.CheckingForUpdates) {
|
|
322
|
+
badge = ( new ProgressBadge(() => ( localize(14752, "Checking for {0} updates...", this.productService.nameShort))));
|
|
323
|
+
} else if (state.type === StateType.Downloading || state.type === StateType.Overwriting) {
|
|
324
|
+
badge = ( new ProgressBadge(() => ( localize(14753, "Downloading {0} update...", this.productService.nameShort))));
|
|
325
|
+
} else if (state.type === StateType.Updating) {
|
|
326
|
+
badge = ( new ProgressBadge(() => ( localize(14754, "Updating {0}...", this.productService.nameShort))));
|
|
327
|
+
}
|
|
312
328
|
}
|
|
313
329
|
this.badgeDisposable.clear();
|
|
314
330
|
if (badge) {
|
|
@@ -319,23 +335,28 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
319
335
|
this.state = state;
|
|
320
336
|
}
|
|
321
337
|
onError(error) {
|
|
322
|
-
if (
|
|
338
|
+
if (this.titleBarEnabled) {
|
|
323
339
|
return;
|
|
324
340
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
});
|
|
341
|
+
const processedError = preprocessError(error);
|
|
342
|
+
if (processedError) {
|
|
343
|
+
this.notificationService.notify({
|
|
344
|
+
severity: Severity.Error,
|
|
345
|
+
message: processedError,
|
|
346
|
+
source: ( localize(14755, "Update Service"))
|
|
347
|
+
});
|
|
348
|
+
}
|
|
334
349
|
}
|
|
335
350
|
onUpdateNotAvailable() {
|
|
336
|
-
|
|
351
|
+
if (this.titleBarEnabled) {
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
this.dialogService.info(( localize(14756, "There are currently no updates available.")));
|
|
337
355
|
}
|
|
338
356
|
onUpdateAvailable(update) {
|
|
357
|
+
if (this.titleBarEnabled) {
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
339
360
|
if (!this.shouldShowNotification()) {
|
|
340
361
|
return;
|
|
341
362
|
}
|
|
@@ -343,14 +364,14 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
343
364
|
if (!productVersion) {
|
|
344
365
|
return;
|
|
345
366
|
}
|
|
346
|
-
this.notificationService.prompt(Severity.Info, ( localize(
|
|
347
|
-
label: ( localize(
|
|
367
|
+
this.notificationService.prompt(Severity.Info, ( localize(14757, "There is an available update.")), [{
|
|
368
|
+
label: ( localize(14758, "Download Update")),
|
|
348
369
|
run: () => this.updateService.downloadUpdate(true)
|
|
349
370
|
}, {
|
|
350
|
-
label: ( localize(
|
|
371
|
+
label: ( localize(14759, "Later")),
|
|
351
372
|
run: () => {}
|
|
352
373
|
}, {
|
|
353
|
-
label: ( localize(
|
|
374
|
+
label: ( localize(14748, "Release Notes")),
|
|
354
375
|
run: () => {
|
|
355
376
|
this.instantiationService.invokeFunction(accessor => showReleaseNotes(accessor, productVersion));
|
|
356
377
|
}
|
|
@@ -359,6 +380,9 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
359
380
|
});
|
|
360
381
|
}
|
|
361
382
|
onUpdateDownloaded(update) {
|
|
383
|
+
if (this.titleBarEnabled) {
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
362
386
|
if (isMacintosh) {
|
|
363
387
|
return;
|
|
364
388
|
}
|
|
@@ -373,18 +397,18 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
373
397
|
return;
|
|
374
398
|
}
|
|
375
399
|
this.notificationService.prompt(Severity.Info, ( localize(
|
|
376
|
-
|
|
400
|
+
14760,
|
|
377
401
|
"There's an update available: {0} {1}",
|
|
378
402
|
this.productService.nameLong,
|
|
379
403
|
productVersion
|
|
380
404
|
)), [{
|
|
381
|
-
label: ( localize(
|
|
405
|
+
label: ( localize(14761, "Install Update")),
|
|
382
406
|
run: () => this.updateService.applyUpdate()
|
|
383
407
|
}, {
|
|
384
|
-
label: ( localize(
|
|
408
|
+
label: ( localize(14759, "Later")),
|
|
385
409
|
run: () => {}
|
|
386
410
|
}, {
|
|
387
|
-
label: ( localize(
|
|
411
|
+
label: ( localize(14748, "Release Notes")),
|
|
388
412
|
run: () => {
|
|
389
413
|
this.instantiationService.invokeFunction(accessor => showReleaseNotes(accessor, productVersion));
|
|
390
414
|
}
|
|
@@ -393,46 +417,60 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
393
417
|
});
|
|
394
418
|
}
|
|
395
419
|
onUpdateReady(state) {
|
|
420
|
+
if (this.titleBarEnabled) {
|
|
421
|
+
this.overwriteNotificationHandle?.progress.done();
|
|
422
|
+
this.overwriteNotificationHandle = undefined;
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
396
425
|
if (state.overwrite && this.overwriteNotificationHandle) {
|
|
397
426
|
const handle = this.overwriteNotificationHandle;
|
|
398
427
|
this.overwriteNotificationHandle = undefined;
|
|
399
428
|
handle.progress.done();
|
|
400
|
-
handle.updateMessage(( localize(
|
|
429
|
+
handle.updateMessage(( localize(14762, "The newer update is ready to install.")));
|
|
401
430
|
handle.updateActions({
|
|
402
431
|
primary: [toAction({
|
|
403
432
|
id: "update.restartToUpdate",
|
|
404
|
-
label: ( localize(
|
|
433
|
+
label: ( localize(14763, "Restart to Update")),
|
|
405
434
|
run: () => this.updateService.quitAndInstall()
|
|
406
435
|
})]
|
|
407
436
|
});
|
|
408
|
-
} else
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
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(14764, "Update Now")),
|
|
445
|
+
run: () => this.updateService.quitAndInstall()
|
|
446
|
+
}, {
|
|
447
|
+
label: ( localize(14759, "Later")),
|
|
448
|
+
run: () => {}
|
|
449
|
+
}];
|
|
450
|
+
const productVersion = state.update.productVersion;
|
|
451
|
+
if (productVersion) {
|
|
452
|
+
actions.push({
|
|
453
|
+
label: ( localize(14748, "Release Notes")),
|
|
454
|
+
run: () => {
|
|
455
|
+
this.instantiationService.invokeFunction(accessor => showReleaseNotes(accessor, productVersion));
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
this.notificationService.prompt(Severity.Info, ( localize(
|
|
460
|
+
14765,
|
|
461
|
+
"Restart {0} to apply the latest update.",
|
|
462
|
+
this.productService.nameLong
|
|
463
|
+
)), actions, {
|
|
464
|
+
sticky: true,
|
|
465
|
+
priority: NotificationPriority.OPTIONAL
|
|
423
466
|
});
|
|
424
467
|
}
|
|
425
|
-
this.notificationService.prompt(Severity.Info, ( localize(
|
|
426
|
-
14499,
|
|
427
|
-
"Restart {0} to apply the latest update.",
|
|
428
|
-
this.productService.nameLong
|
|
429
|
-
)), actions, {
|
|
430
|
-
sticky: true,
|
|
431
|
-
priority: NotificationPriority.OPTIONAL
|
|
432
|
-
});
|
|
433
468
|
}
|
|
434
469
|
}
|
|
435
470
|
onUpdateOverwriting(state) {
|
|
471
|
+
if (this.titleBarEnabled) {
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
436
474
|
if (!state.explicit) {
|
|
437
475
|
return;
|
|
438
476
|
}
|
|
@@ -440,10 +478,10 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
440
478
|
severity: Severity.Info,
|
|
441
479
|
sticky: true,
|
|
442
480
|
message: ( localize(
|
|
443
|
-
|
|
481
|
+
14766,
|
|
444
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."
|
|
445
483
|
)),
|
|
446
|
-
source: ( localize(
|
|
484
|
+
source: ( localize(14755, "Update Service"))
|
|
447
485
|
});
|
|
448
486
|
this.overwriteNotificationHandle.progress.infinite();
|
|
449
487
|
}
|
|
@@ -496,14 +534,14 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
496
534
|
order: 1,
|
|
497
535
|
command: {
|
|
498
536
|
id: "update.showUpdateReleaseNotes",
|
|
499
|
-
title: ( localize(
|
|
537
|
+
title: ( localize(14767, "Show Update Release Notes"))
|
|
500
538
|
},
|
|
501
539
|
when: ( ContextKeyExpr.and(( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Ready)), MAJOR_MINOR_UPDATE_AVAILABLE))
|
|
502
540
|
});
|
|
503
541
|
}
|
|
504
542
|
}
|
|
505
543
|
};
|
|
506
|
-
UpdateContribution = ( __decorate([( __param(0, IStorageService)), ( __param(1, IInstantiationService)), ( __param(2, INotificationService)), ( __param(3, IDialogService)), ( __param(4, IUpdateService)), ( __param(5, IActivityService)), ( __param(6, IContextKeyService)), ( __param(7, IProductService)), ( __param(8, IOpenerService)), ( __param(9, IConfigurationService)), ( __param(10, IHostService))], UpdateContribution));
|
|
544
|
+
UpdateContribution = ( __decorate([( __param(0, IStorageService)), ( __param(1, IInstantiationService)), ( __param(2, INotificationService)), ( __param(3, IDialogService)), ( __param(4, IUpdateService)), ( __param(5, IActivityService)), ( __param(6, IContextKeyService)), ( __param(7, IProductService)), ( __param(8, IOpenerService)), ( __param(9, IConfigurationService)), ( __param(10, IHostService)), ( __param(11, IWorkbenchLayoutService))], UpdateContribution));
|
|
507
545
|
let SwitchProductQualityContribution = class SwitchProductQualityContribution extends Disposable {
|
|
508
546
|
constructor(productService, environmentService) {
|
|
509
547
|
super();
|
|
@@ -522,7 +560,7 @@ let SwitchProductQualityContribution = class SwitchProductQualityContribution ex
|
|
|
522
560
|
constructor() {
|
|
523
561
|
super({
|
|
524
562
|
id: commandId,
|
|
525
|
-
title: isSwitchingToInsiders ? ( localize(
|
|
563
|
+
title: isSwitchingToInsiders ? ( localize(14768, "Switch to Insiders Version...")) : ( localize(14769, "Switch to Stable Version...")),
|
|
526
564
|
precondition: IsWebContext,
|
|
527
565
|
menu: {
|
|
528
566
|
id: MenuId.GlobalActivity,
|
|
@@ -560,15 +598,15 @@ let SwitchProductQualityContribution = class SwitchProductQualityContribution ex
|
|
|
560
598
|
}
|
|
561
599
|
const res = await dialogService.confirm({
|
|
562
600
|
type: "info",
|
|
563
|
-
message: ( localize(
|
|
601
|
+
message: ( localize(14770, "Changing the version requires a reload to take effect")),
|
|
564
602
|
detail: newQuality === "insider" ? ( localize(
|
|
565
|
-
|
|
603
|
+
14771,
|
|
566
604
|
"Press the reload button to switch to the Insiders version of VS Code."
|
|
567
605
|
)) : ( localize(
|
|
568
|
-
|
|
606
|
+
14772,
|
|
569
607
|
"Press the reload button to switch to the Stable version of VS Code."
|
|
570
608
|
)),
|
|
571
|
-
primaryButton: ( localize(
|
|
609
|
+
primaryButton: ( localize(14773, "&&Reload"))
|
|
572
610
|
});
|
|
573
611
|
if (res.confirmed) {
|
|
574
612
|
const promises = [];
|
|
@@ -598,18 +636,18 @@ let SwitchProductQualityContribution = class SwitchProductQualityContribution ex
|
|
|
598
636
|
} = await dialogService.prompt({
|
|
599
637
|
type: Severity.Info,
|
|
600
638
|
message: ( localize(
|
|
601
|
-
|
|
639
|
+
14774,
|
|
602
640
|
"Choose the settings sync service to use after changing the version"
|
|
603
641
|
)),
|
|
604
642
|
detail: ( localize(
|
|
605
|
-
|
|
643
|
+
14775,
|
|
606
644
|
"The Insiders version of VS Code will synchronize your settings, keybindings, extensions, snippets and UI State using separate insiders settings sync service by default."
|
|
607
645
|
)),
|
|
608
646
|
buttons: [{
|
|
609
|
-
label: ( localize(
|
|
647
|
+
label: ( localize(14776, "&&Insiders")),
|
|
610
648
|
run: () => "insiders"
|
|
611
649
|
}, {
|
|
612
|
-
label: ( localize(
|
|
650
|
+
label: ( localize(14777, "&&Stable (current)")),
|
|
613
651
|
run: () => "stable"
|
|
614
652
|
}],
|
|
615
653
|
cancelButton: true
|
|
@@ -1,68 +1,22 @@
|
|
|
1
1
|
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
-
import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service";
|
|
3
2
|
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
4
|
-
import {
|
|
5
|
-
import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service";
|
|
6
|
-
import { Downloading } from "@codingame/monaco-vscode-api/vscode/vs/platform/update/common/update";
|
|
3
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
7
4
|
import { IUpdateService } from "@codingame/monaco-vscode-api/vscode/vs/platform/update/common/update.service";
|
|
8
5
|
import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
9
6
|
import { IStatusbarService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/statusbar/browser/statusbar.service";
|
|
10
7
|
/**
|
|
11
8
|
* Displays update status and actions in the status bar.
|
|
12
9
|
*/
|
|
13
|
-
export declare class
|
|
14
|
-
private readonly updateService;
|
|
15
|
-
private readonly statusbarService;
|
|
16
|
-
private readonly productService;
|
|
17
|
-
private readonly commandService;
|
|
18
|
-
private readonly hoverService;
|
|
10
|
+
export declare class UpdateStatusBarContribution extends Disposable implements IWorkbenchContribution {
|
|
19
11
|
private readonly configurationService;
|
|
20
|
-
private
|
|
21
|
-
private readonly
|
|
12
|
+
private readonly statusbarService;
|
|
13
|
+
private static readonly actionableStates;
|
|
14
|
+
private readonly accessor;
|
|
15
|
+
private readonly tooltip;
|
|
22
16
|
private lastStateType;
|
|
23
|
-
constructor(
|
|
24
|
-
private
|
|
25
|
-
private
|
|
26
|
-
private getCheckingTooltip;
|
|
27
|
-
private getAvailableTooltip;
|
|
17
|
+
constructor(configurationService: IConfigurationService, instantiationService: IInstantiationService, statusbarService: IStatusbarService, updateService: IUpdateService);
|
|
18
|
+
private onStateChange;
|
|
19
|
+
private updateEntry;
|
|
28
20
|
private getDownloadingText;
|
|
29
|
-
private getDownloadingTooltip;
|
|
30
|
-
private getReadyToInstallTooltip;
|
|
31
|
-
private getRestartToUpdateTooltip;
|
|
32
21
|
private getUpdatingText;
|
|
33
|
-
private getUpdatingTooltip;
|
|
34
|
-
private getOverwritingTooltip;
|
|
35
|
-
private createTooltipDisposableStore;
|
|
36
|
-
private runCommandAndClose;
|
|
37
|
-
private appendHeader;
|
|
38
|
-
private appendProductInfo;
|
|
39
|
-
private appendWhatsIncluded;
|
|
40
22
|
}
|
|
41
|
-
/**
|
|
42
|
-
* Returns the progress percentage based on the current and maximum progress values.
|
|
43
|
-
*/
|
|
44
|
-
export declare function getProgressPercent(current: number | undefined, max: number | undefined): number | undefined;
|
|
45
|
-
/**
|
|
46
|
-
* Tries to parse a date string and returns the timestamp or undefined if parsing fails.
|
|
47
|
-
*/
|
|
48
|
-
export declare function tryParseDate(date: string | undefined): number | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* Formats a timestamp as a localized date string.
|
|
51
|
-
*/
|
|
52
|
-
export declare function formatDate(timestamp: number): string;
|
|
53
|
-
/**
|
|
54
|
-
* Computes an estimate of remaining download time in seconds.
|
|
55
|
-
*/
|
|
56
|
-
export declare function computeDownloadTimeRemaining(state: Downloading): number | undefined;
|
|
57
|
-
/**
|
|
58
|
-
* Formats the time remaining as a human-readable string.
|
|
59
|
-
*/
|
|
60
|
-
export declare function formatTimeRemaining(seconds: number): string;
|
|
61
|
-
/**
|
|
62
|
-
* Formats a byte count as a human-readable string.
|
|
63
|
-
*/
|
|
64
|
-
export declare function formatBytes(bytes: number): string;
|
|
65
|
-
/**
|
|
66
|
-
* Computes the current download speed in bytes per second.
|
|
67
|
-
*/
|
|
68
|
-
export declare function computeDownloadSpeed(state: Downloading): number | undefined;
|