@codingame/monaco-vscode-user-data-profile-service-override 8.0.4 → 9.0.2
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/base/browser/ui/radio/radio.js +2 -2
- package/vscode/src/vs/platform/userDataSync/common/keybindingsSync.js +2 -2
- package/vscode/src/vs/platform/userDataSync/common/settingsSync.js +1 -1
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/media/userDataProfilesEditor.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.contribution.js +1 -6
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.js +73 -372
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.js +6 -110
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.js +151 -69
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js +93 -56
- package/vscode/src/vs/workbench/services/userDataProfile/browser/extensionsResource.js +5 -5
- package/vscode/src/vs/workbench/services/userDataProfile/browser/globalStateResource.js +2 -17
- package/vscode/src/vs/workbench/services/userDataProfile/browser/keybindingsResource.js +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/settingsResource.js +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/snippetsResource.js +2 -2
- package/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.js +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.js +67 -887
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js +8 -8
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilePreview.js +0 -24
|
@@ -15,6 +15,7 @@ import { IUserDataProfilesService } from 'vscode/vscode/vs/platform/userDataProf
|
|
|
15
15
|
import { EditorPane } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorPane';
|
|
16
16
|
import { EditorInput } from 'vscode/vscode/vs/workbench/common/editor/editorInput';
|
|
17
17
|
import { PROFILE_FILTER, defaultUserDataProfileIcon } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile';
|
|
18
|
+
import { IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
18
19
|
import { SplitView, Sizing } from 'vscode/vscode/vs/base/browser/ui/splitview/splitview';
|
|
19
20
|
import { ButtonWithDropdown, Button } from 'vscode/vscode/vs/base/browser/ui/button/button';
|
|
20
21
|
import { getListStyles, defaultButtonStyles, getInputBoxStyle, defaultInputBoxStyles, defaultCheckboxStyles, defaultSelectBoxStyles } from 'vscode/vscode/vs/platform/theme/browser/defaultStyles';
|
|
@@ -63,7 +64,7 @@ import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/commo
|
|
|
63
64
|
import { Orientation } from 'vscode/vscode/vs/base/browser/ui/sash/sash';
|
|
64
65
|
|
|
65
66
|
var UserDataProfilesEditor_1, ExistingProfileResourceTreeRenderer_1, NewProfileResourceTreeRenderer_1, ProfileResourceChildTreeItemRenderer_1, UserDataProfilesEditorInput_1;
|
|
66
|
-
const profilesSashBorder = registerColor('profiles.sashBorder', PANEL_BORDER, ( localize(
|
|
67
|
+
const profilesSashBorder = registerColor('profiles.sashBorder', PANEL_BORDER, ( localize(10974, "The color of the Profiles editor splitview sash border.")));
|
|
67
68
|
const listStyles = getListStyles({
|
|
68
69
|
listActiveSelectionBackground: editorBackground,
|
|
69
70
|
listActiveSelectionForeground: foreground,
|
|
@@ -91,6 +92,7 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
91
92
|
this.fileDialogService = fileDialogService;
|
|
92
93
|
this.contextMenuService = contextMenuService;
|
|
93
94
|
this.instantiationService = instantiationService;
|
|
95
|
+
this.templates = [];
|
|
94
96
|
}
|
|
95
97
|
layout(dimension, position) {
|
|
96
98
|
if (this.container && this.splitView) {
|
|
@@ -157,7 +159,7 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
157
159
|
return profileElement?.name ?? '';
|
|
158
160
|
},
|
|
159
161
|
getWidgetAriaLabel() {
|
|
160
|
-
return ( localize(
|
|
162
|
+
return ( localize(10975, "Profiles"));
|
|
161
163
|
}
|
|
162
164
|
},
|
|
163
165
|
openOnSingleClick: true,
|
|
@@ -177,11 +179,11 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
177
179
|
actions: {
|
|
178
180
|
getActions: () => {
|
|
179
181
|
const actions = [];
|
|
180
|
-
if (this.
|
|
181
|
-
actions.push(( (new SubmenuAction('from.template', ( localize(
|
|
182
|
+
if (this.templates.length) {
|
|
183
|
+
actions.push(( (new SubmenuAction('from.template', ( localize(10976, "From Template")), this.getCreateFromTemplateActions()))));
|
|
182
184
|
actions.push(( (new Separator())));
|
|
183
185
|
}
|
|
184
|
-
actions.push(( (new Action('importProfile', ( localize(
|
|
186
|
+
actions.push(( (new Action('importProfile', ( localize(10977, "Import Profile...")), undefined, true, () => this.importProfile()))));
|
|
185
187
|
return actions;
|
|
186
188
|
}
|
|
187
189
|
},
|
|
@@ -190,19 +192,19 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
190
192
|
supportIcons: true,
|
|
191
193
|
...defaultButtonStyles
|
|
192
194
|
}))));
|
|
193
|
-
button.label = ( localize(
|
|
195
|
+
button.label = ( localize(10978, "New Profile"));
|
|
194
196
|
this._register(button.onDidClick(e => this.createNewProfile()));
|
|
195
197
|
}
|
|
196
198
|
getCreateFromTemplateActions() {
|
|
197
|
-
return
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
199
|
+
return (
|
|
200
|
+
(this.templates.map(template => ( (new Action(
|
|
201
|
+
`template:${template.url}`,
|
|
202
|
+
template.name,
|
|
203
|
+
undefined,
|
|
204
|
+
true,
|
|
205
|
+
() => this.createNewProfile(( (URI.parse(template.url))))
|
|
206
|
+
)))))
|
|
207
|
+
);
|
|
206
208
|
}
|
|
207
209
|
registerListeners() {
|
|
208
210
|
if (this.profilesList) {
|
|
@@ -237,13 +239,13 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
237
239
|
}
|
|
238
240
|
getTreeContextMenuActions() {
|
|
239
241
|
const actions = [];
|
|
240
|
-
actions.push(( (new Action('newProfile', ( localize(
|
|
242
|
+
actions.push(( (new Action('newProfile', ( localize(10978, "New Profile")), undefined, true, () => this.createNewProfile()))));
|
|
241
243
|
const templateActions = this.getCreateFromTemplateActions();
|
|
242
244
|
if (templateActions.length) {
|
|
243
|
-
actions.push(( (new SubmenuAction('from.template', ( localize(
|
|
245
|
+
actions.push(( (new SubmenuAction('from.template', ( localize(10979, "New Profile From Template")), templateActions))));
|
|
244
246
|
}
|
|
245
247
|
actions.push(( (new Separator())));
|
|
246
|
-
actions.push(( (new Action('importProfile', ( localize(
|
|
248
|
+
actions.push(( (new Action('importProfile', ( localize(10977, "Import Profile...")), undefined, true, () => this.importProfile()))));
|
|
247
249
|
return actions;
|
|
248
250
|
}
|
|
249
251
|
async importProfile() {
|
|
@@ -252,13 +254,13 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
252
254
|
const updateQuickPickItems = (value) => {
|
|
253
255
|
const quickPickItems = [];
|
|
254
256
|
if (value) {
|
|
255
|
-
quickPickItems.push({ label: quickPick.value, description: ( localize(
|
|
257
|
+
quickPickItems.push({ label: quickPick.value, description: ( localize(10980, "Import from URL")) });
|
|
256
258
|
}
|
|
257
|
-
quickPickItems.push({ label: ( localize(
|
|
259
|
+
quickPickItems.push({ label: ( localize(10981, "Select File...")) });
|
|
258
260
|
quickPick.items = quickPickItems;
|
|
259
261
|
};
|
|
260
|
-
quickPick.title = ( localize(
|
|
261
|
-
quickPick.placeholder = ( localize(
|
|
262
|
+
quickPick.title = ( localize(10982, "Import from Profile Template..."));
|
|
263
|
+
quickPick.placeholder = ( localize(10983, "Provide Profile Template URL"));
|
|
262
264
|
quickPick.ignoreFocusOut = true;
|
|
263
265
|
disposables.add(quickPick.onDidChangeValue(updateQuickPickItems));
|
|
264
266
|
updateQuickPickItems();
|
|
@@ -281,13 +283,19 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
281
283
|
async createNewProfile(copyFrom) {
|
|
282
284
|
await this.model?.createNewProfile(copyFrom);
|
|
283
285
|
}
|
|
286
|
+
selectProfile(profile) {
|
|
287
|
+
const index = this.model?.profiles.findIndex(p => p instanceof UserDataProfileElement && p.profile.id === profile.id);
|
|
288
|
+
if (index !== undefined && index >= 0) {
|
|
289
|
+
this.profilesList?.setSelection([index]);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
284
292
|
async getProfileUriFromFileSystem() {
|
|
285
293
|
const profileLocation = await this.fileDialogService.showOpenDialog({
|
|
286
294
|
canSelectFolders: false,
|
|
287
295
|
canSelectFiles: true,
|
|
288
296
|
canSelectMany: false,
|
|
289
297
|
filters: PROFILE_FILTER,
|
|
290
|
-
title: ( localize(
|
|
298
|
+
title: ( localize(10984, "Select Profile Template File")),
|
|
291
299
|
});
|
|
292
300
|
if (!profileLocation) {
|
|
293
301
|
return null;
|
|
@@ -297,9 +305,12 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
297
305
|
async setInput(input, options, context, token) {
|
|
298
306
|
await super.setInput(input, options, context, token);
|
|
299
307
|
this.model = await input.resolve();
|
|
300
|
-
|
|
301
|
-
this.
|
|
302
|
-
|
|
308
|
+
this.model.getTemplates().then(templates => {
|
|
309
|
+
this.templates = templates;
|
|
310
|
+
if (this.profileWidget) {
|
|
311
|
+
this.profileWidget.templates = templates;
|
|
312
|
+
}
|
|
313
|
+
});
|
|
303
314
|
this.updateProfilesList();
|
|
304
315
|
this._register(this.model.onDidChange(element => this.updateProfilesList(element)));
|
|
305
316
|
}
|
|
@@ -361,7 +372,7 @@ let ProfileElementRenderer = class ProfileElementRenderer {
|
|
|
361
372
|
const label = append(container, $('.profile-list-item-label'));
|
|
362
373
|
const dirty = append(container, $(`span${ThemeIcon.asCSSSelector(Codicon.circleFilled)}`));
|
|
363
374
|
const description = append(container, $('.profile-list-item-description'));
|
|
364
|
-
append(description, $('span', undefined, ( localize(
|
|
375
|
+
append(description, $(`span${ThemeIcon.asCSSSelector(Codicon.check)}`), $('span', undefined, ( localize(10985, "In use"))));
|
|
365
376
|
const actionsContainer = append(container, $('.profile-tree-item-actions-container'));
|
|
366
377
|
const actionBar = disposables.add(this.instantiationService.createInstance(WorkbenchToolBar, actionsContainer, {
|
|
367
378
|
hoverDelegate: disposables.add(createInstantHoverDelegate()),
|
|
@@ -428,6 +439,7 @@ let ProfileWidget = class ProfileWidget extends Disposable {
|
|
|
428
439
|
this.profileTree = this._register(this.instantiationService.createInstance((WorkbenchAsyncDataTree), 'ProfileEditor-Tree', this.profileTreeContainer, delegate, [
|
|
429
440
|
this._register(this.instantiationService.createInstance(ProfileNameRenderer)),
|
|
430
441
|
this._register(this.instantiationService.createInstance(ProfileIconRenderer)),
|
|
442
|
+
this._register(this.instantiationService.createInstance(UseForCurrentWindowPropertyRenderer)),
|
|
431
443
|
this._register(this.instantiationService.createInstance(UseAsDefaultProfileRenderer)),
|
|
432
444
|
this.copyFromProfileRenderer,
|
|
433
445
|
contentsRenderer,
|
|
@@ -483,6 +495,12 @@ let ProfileWidget = class ProfileWidget extends Disposable {
|
|
|
483
495
|
this.profileTree.layout(height, dimension.width);
|
|
484
496
|
}
|
|
485
497
|
render(profileElement) {
|
|
498
|
+
if (this._profileElement.value?.element === profileElement) {
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
if (this._profileElement.value?.element instanceof UserDataProfileElement) {
|
|
502
|
+
this._profileElement.value.element.reset();
|
|
503
|
+
}
|
|
486
504
|
this.profileTree.setInput(profileElement);
|
|
487
505
|
const disposables = ( (new DisposableStore()));
|
|
488
506
|
this._profileElement.value = { element: profileElement, dispose: () => disposables.dispose() };
|
|
@@ -569,6 +587,7 @@ class ProfileTreeDelegate extends CachedListVirtualDelegate {
|
|
|
569
587
|
return 68;
|
|
570
588
|
case 'copyFrom':
|
|
571
589
|
return 90;
|
|
590
|
+
case 'useForCurrent':
|
|
572
591
|
case 'useAsDefault':
|
|
573
592
|
return 68;
|
|
574
593
|
case 'contents':
|
|
@@ -676,15 +695,15 @@ class AbstractProfileResourceTreeRenderer extends Disposable {
|
|
|
676
695
|
getResourceTypeTitle(resourceType) {
|
|
677
696
|
switch (resourceType) {
|
|
678
697
|
case ProfileResourceType.Settings:
|
|
679
|
-
return ( localize(
|
|
698
|
+
return ( localize(10986, "Settings"));
|
|
680
699
|
case ProfileResourceType.Keybindings:
|
|
681
|
-
return ( localize(
|
|
700
|
+
return ( localize(10987, "Keyboard Shortcuts"));
|
|
682
701
|
case ProfileResourceType.Snippets:
|
|
683
|
-
return ( localize(
|
|
702
|
+
return ( localize(10988, "Snippets"));
|
|
684
703
|
case ProfileResourceType.Tasks:
|
|
685
|
-
return ( localize(
|
|
704
|
+
return ( localize(10989, "Tasks"));
|
|
686
705
|
case ProfileResourceType.Extensions:
|
|
687
|
-
return ( localize(
|
|
706
|
+
return ( localize(10990, "Extensions"));
|
|
688
707
|
}
|
|
689
708
|
return '';
|
|
690
709
|
}
|
|
@@ -713,18 +732,18 @@ let ProfileNameRenderer = class ProfileNameRenderer extends ProfilePropertyRende
|
|
|
713
732
|
const elementDisposables = disposables.add(( (new DisposableStore())));
|
|
714
733
|
let profileElement;
|
|
715
734
|
const nameContainer = append(parent, $('.profile-row-container'));
|
|
716
|
-
append(nameContainer, $('.profile-label-element', undefined, ( localize(
|
|
735
|
+
append(nameContainer, $('.profile-label-element', undefined, ( localize(10991, "Name"))));
|
|
717
736
|
const nameInput = disposables.add(( (new InputBox(nameContainer, this.contextViewService, {
|
|
718
737
|
inputBoxStyles: getInputBoxStyle({
|
|
719
738
|
inputBorder: settingsTextInputBorder
|
|
720
739
|
}),
|
|
721
|
-
ariaLabel: ( localize(
|
|
722
|
-
placeholder: ( localize(
|
|
740
|
+
ariaLabel: ( localize(10992, "Profile Name")),
|
|
741
|
+
placeholder: ( localize(10992, "Profile Name")),
|
|
723
742
|
validationOptions: {
|
|
724
743
|
validation: (value) => {
|
|
725
744
|
if (!value) {
|
|
726
745
|
return {
|
|
727
|
-
content: ( localize(
|
|
746
|
+
content: ( localize(10993, "Profile name is required and must be a non-empty value.")),
|
|
728
747
|
type: MessageType.WARNING
|
|
729
748
|
};
|
|
730
749
|
}
|
|
@@ -736,9 +755,9 @@ let ProfileNameRenderer = class ProfileNameRenderer extends ProfilePropertyRende
|
|
|
736
755
|
}
|
|
737
756
|
const initialName = profileElement?.root.getInitialName();
|
|
738
757
|
value = value.trim();
|
|
739
|
-
if (initialName !== value && ( (this.userDataProfilesService.profiles.some(p => p.name === value)))) {
|
|
758
|
+
if (initialName !== value && ( (this.userDataProfilesService.profiles.some(p => !p.isTransient && p.name === value)))) {
|
|
740
759
|
return {
|
|
741
|
-
content: ( localize(
|
|
760
|
+
content: ( localize(10994, "Profile with name {0} already exists.", value)),
|
|
742
761
|
type: MessageType.WARNING
|
|
743
762
|
};
|
|
744
763
|
}
|
|
@@ -746,7 +765,6 @@ let ProfileNameRenderer = class ProfileNameRenderer extends ProfilePropertyRende
|
|
|
746
765
|
}
|
|
747
766
|
}
|
|
748
767
|
}))));
|
|
749
|
-
disposables.add(this.userDataProfilesService.onDidChangeProfiles(() => nameInput.validate()));
|
|
750
768
|
nameInput.onDidChange(value => {
|
|
751
769
|
if (profileElement && value) {
|
|
752
770
|
profileElement.root.name = value;
|
|
@@ -776,6 +794,9 @@ let ProfileNameRenderer = class ProfileNameRenderer extends ProfilePropertyRende
|
|
|
776
794
|
if (e.name || e.disabled) {
|
|
777
795
|
renderName(element);
|
|
778
796
|
}
|
|
797
|
+
if (e.profile) {
|
|
798
|
+
nameInput.validate();
|
|
799
|
+
}
|
|
779
800
|
}));
|
|
780
801
|
},
|
|
781
802
|
disposables,
|
|
@@ -799,9 +820,9 @@ let ProfileIconRenderer = class ProfileIconRenderer extends ProfilePropertyRende
|
|
|
799
820
|
const elementDisposables = disposables.add(( (new DisposableStore())));
|
|
800
821
|
let profileElement;
|
|
801
822
|
const iconContainer = append(parent, $('.profile-row-container'));
|
|
802
|
-
append(iconContainer, $('.profile-label-element', undefined, ( localize(
|
|
823
|
+
append(iconContainer, $('.profile-label-element', undefined, ( localize(10995, "Icon"))));
|
|
803
824
|
const iconValueContainer = append(iconContainer, $('.profile-icon-container'));
|
|
804
|
-
const iconElement = append(iconValueContainer, $(`${ThemeIcon.asCSSSelector(DEFAULT_ICON)}`, { 'tabindex': '0', 'role': 'button', 'aria-label': ( localize(
|
|
825
|
+
const iconElement = append(iconValueContainer, $(`${ThemeIcon.asCSSSelector(DEFAULT_ICON)}`, { 'tabindex': '0', 'role': 'button', 'aria-label': ( localize(10996, "Profile Icon")) }));
|
|
805
826
|
const iconSelectBox = disposables.add(this.instantiationService.createInstance(WorkbenchIconSelectBox, { icons: ICONS, inputBoxStyles: defaultInputBoxStyles }));
|
|
806
827
|
let hoverWidget;
|
|
807
828
|
const showIconSelectBox = () => {
|
|
@@ -856,7 +877,7 @@ let ProfileIconRenderer = class ProfileIconRenderer extends ProfilePropertyRende
|
|
|
856
877
|
profileElement.root.icon = selectedIcon.id;
|
|
857
878
|
}
|
|
858
879
|
}));
|
|
859
|
-
append(iconValueContainer, $('.profile-description-element', undefined, ( localize(
|
|
880
|
+
append(iconValueContainer, $('.profile-description-element', undefined, ( localize(10997, "Profile icon to be shown in the activity bar"))));
|
|
860
881
|
const renderIcon = (profileElement) => {
|
|
861
882
|
if (profileElement.root.icon) {
|
|
862
883
|
iconElement.className = ThemeIcon.asClassName(ThemeIcon.fromId(profileElement.root.icon));
|
|
@@ -884,6 +905,59 @@ ProfileIconRenderer = ( (__decorate([
|
|
|
884
905
|
( (__param(0, IInstantiationService))),
|
|
885
906
|
( (__param(1, IHoverService)))
|
|
886
907
|
], ProfileIconRenderer)));
|
|
908
|
+
let UseForCurrentWindowPropertyRenderer = class UseForCurrentWindowPropertyRenderer extends ProfilePropertyRenderer {
|
|
909
|
+
constructor(userDataProfileService) {
|
|
910
|
+
super();
|
|
911
|
+
this.userDataProfileService = userDataProfileService;
|
|
912
|
+
this.templateId = 'useForCurrent';
|
|
913
|
+
}
|
|
914
|
+
renderTemplate(parent) {
|
|
915
|
+
const disposables = ( (new DisposableStore()));
|
|
916
|
+
const elementDisposables = disposables.add(( (new DisposableStore())));
|
|
917
|
+
let profileElement;
|
|
918
|
+
const useForCurrentWindowContainer = append(parent, $('.profile-row-container'));
|
|
919
|
+
append(useForCurrentWindowContainer, $('.profile-label-element', undefined, ( localize(10998, "Use for Current Window"))));
|
|
920
|
+
const useForCurrentWindowValueContainer = append(useForCurrentWindowContainer, $('.profile-use-for-current-container'));
|
|
921
|
+
const useForCurrentWindowTitle = ( localize(10999, "Use this profile for the current window"));
|
|
922
|
+
const useForCurrentWindowCheckbox = disposables.add(( (new Checkbox(useForCurrentWindowTitle, false, defaultCheckboxStyles))));
|
|
923
|
+
append(useForCurrentWindowValueContainer, useForCurrentWindowCheckbox.domNode);
|
|
924
|
+
const useForCurrentWindowLabel = append(useForCurrentWindowValueContainer, $('.profile-description-element', undefined, useForCurrentWindowTitle));
|
|
925
|
+
disposables.add(useForCurrentWindowCheckbox.onChange(() => {
|
|
926
|
+
if (profileElement?.root instanceof UserDataProfileElement) {
|
|
927
|
+
profileElement.root.toggleCurrentWindowProfile();
|
|
928
|
+
}
|
|
929
|
+
}));
|
|
930
|
+
disposables.add(addDisposableListener(useForCurrentWindowLabel, EventType.CLICK, () => {
|
|
931
|
+
if (profileElement?.root instanceof UserDataProfileElement) {
|
|
932
|
+
profileElement.root.toggleCurrentWindowProfile();
|
|
933
|
+
}
|
|
934
|
+
}));
|
|
935
|
+
const renderUseCurrentProfile = (profileElement) => {
|
|
936
|
+
useForCurrentWindowCheckbox.checked = profileElement.root instanceof UserDataProfileElement && this.userDataProfileService.currentProfile.id === profileElement.root.profile.id;
|
|
937
|
+
if (useForCurrentWindowCheckbox.checked && this.userDataProfileService.currentProfile.isDefault) {
|
|
938
|
+
useForCurrentWindowCheckbox.disable();
|
|
939
|
+
}
|
|
940
|
+
else {
|
|
941
|
+
useForCurrentWindowCheckbox.enable();
|
|
942
|
+
}
|
|
943
|
+
};
|
|
944
|
+
const that = this;
|
|
945
|
+
return {
|
|
946
|
+
set element(element) {
|
|
947
|
+
profileElement = element;
|
|
948
|
+
renderUseCurrentProfile(profileElement);
|
|
949
|
+
elementDisposables.add(that.userDataProfileService.onDidChangeCurrentProfile(e => {
|
|
950
|
+
renderUseCurrentProfile(element);
|
|
951
|
+
}));
|
|
952
|
+
},
|
|
953
|
+
disposables,
|
|
954
|
+
elementDisposables
|
|
955
|
+
};
|
|
956
|
+
}
|
|
957
|
+
};
|
|
958
|
+
UseForCurrentWindowPropertyRenderer = ( (__decorate([
|
|
959
|
+
( (__param(0, IUserDataProfileService)))
|
|
960
|
+
], UseForCurrentWindowPropertyRenderer)));
|
|
887
961
|
class UseAsDefaultProfileRenderer extends ProfilePropertyRenderer {
|
|
888
962
|
constructor() {
|
|
889
963
|
super(...arguments);
|
|
@@ -894,9 +968,9 @@ class UseAsDefaultProfileRenderer extends ProfilePropertyRenderer {
|
|
|
894
968
|
const elementDisposables = disposables.add(( (new DisposableStore())));
|
|
895
969
|
let profileElement;
|
|
896
970
|
const useAsDefaultProfileContainer = append(parent, $('.profile-row-container'));
|
|
897
|
-
append(useAsDefaultProfileContainer, $('.profile-label-element', undefined, ( localize(
|
|
971
|
+
append(useAsDefaultProfileContainer, $('.profile-label-element', undefined, ( localize(11000, "Use for New Windows"))));
|
|
898
972
|
const useAsDefaultProfileValueContainer = append(useAsDefaultProfileContainer, $('.profile-use-as-default-container'));
|
|
899
|
-
const useAsDefaultProfileTitle = ( localize(
|
|
973
|
+
const useAsDefaultProfileTitle = ( localize(11001, "Use this profile as the default for new windows"));
|
|
900
974
|
const useAsDefaultProfileCheckbox = disposables.add(( (new Checkbox(useAsDefaultProfileTitle, false, defaultCheckboxStyles))));
|
|
901
975
|
append(useAsDefaultProfileValueContainer, useAsDefaultProfileCheckbox.domNode);
|
|
902
976
|
const useAsDefaultProfileLabel = append(useAsDefaultProfileValueContainer, $('.profile-description-element', undefined, useAsDefaultProfileTitle));
|
|
@@ -943,11 +1017,11 @@ let CopyFromProfileRenderer = class CopyFromProfileRenderer extends ProfilePrope
|
|
|
943
1017
|
const elementDisposables = disposables.add(( (new DisposableStore())));
|
|
944
1018
|
let profileElement;
|
|
945
1019
|
const copyFromContainer = append(parent, $('.profile-row-container.profile-copy-from-container'));
|
|
946
|
-
append(copyFromContainer, $('.profile-label-element', undefined, ( localize(
|
|
947
|
-
append(copyFromContainer, $('.profile-description-element', undefined, ( localize(
|
|
1020
|
+
append(copyFromContainer, $('.profile-label-element', undefined, ( localize(11002, "Copy from"))));
|
|
1021
|
+
append(copyFromContainer, $('.profile-description-element', undefined, ( localize(11003, "Select the profile source from which you want to copy contents"))));
|
|
948
1022
|
const copyFromSelectBox = disposables.add(this.instantiationService.createInstance(SelectBox, [], 0, this.contextViewService, defaultSelectBoxStyles, {
|
|
949
1023
|
useCustomDrawn: true,
|
|
950
|
-
ariaLabel: ( localize(
|
|
1024
|
+
ariaLabel: ( localize(11004, "Copy profile from")),
|
|
951
1025
|
}));
|
|
952
1026
|
copyFromSelectBox.render(append(copyFromContainer, $('.profile-select-container')));
|
|
953
1027
|
const render = (profileElement, copyFromOptions) => {
|
|
@@ -991,7 +1065,7 @@ let CopyFromProfileRenderer = class CopyFromProfileRenderer extends ProfilePrope
|
|
|
991
1065
|
getCopyFromOptions(profileElement) {
|
|
992
1066
|
const separator = { text: '\u2500\u2500\u2500\u2500\u2500\u2500', isDisabled: true };
|
|
993
1067
|
const copyFromOptions = [];
|
|
994
|
-
copyFromOptions.push({ text: ( localize(
|
|
1068
|
+
copyFromOptions.push({ text: ( localize(11005, "None")) });
|
|
995
1069
|
for (const [copyFromTemplate, name] of profileElement.copyFromTemplates) {
|
|
996
1070
|
if (!( (this.templates.some(
|
|
997
1071
|
template => this.uriIdentityService.extUri.isEqual(( (URI.parse(template.url))), copyFromTemplate)
|
|
@@ -1000,12 +1074,12 @@ let CopyFromProfileRenderer = class CopyFromProfileRenderer extends ProfilePrope
|
|
|
1000
1074
|
}
|
|
1001
1075
|
}
|
|
1002
1076
|
if (this.templates.length) {
|
|
1003
|
-
copyFromOptions.push({ ...separator, decoratorRight: ( localize(
|
|
1077
|
+
copyFromOptions.push({ ...separator, decoratorRight: ( localize(11006, "Profile Templates")) });
|
|
1004
1078
|
for (const template of this.templates) {
|
|
1005
1079
|
copyFromOptions.push({ text: template.name, id: template.url, source: ( (URI.parse(template.url))) });
|
|
1006
1080
|
}
|
|
1007
1081
|
}
|
|
1008
|
-
copyFromOptions.push({ ...separator, decoratorRight: ( localize(
|
|
1082
|
+
copyFromOptions.push({ ...separator, decoratorRight: ( localize(11007, "Existing Profiles")) });
|
|
1009
1083
|
for (const profile of this.userDataProfilesService.profiles) {
|
|
1010
1084
|
copyFromOptions.push({ text: profile.name, id: profile.id, source: profile });
|
|
1011
1085
|
}
|
|
@@ -1034,11 +1108,11 @@ let ContentsProfileRenderer = class ContentsProfileRenderer extends ProfilePrope
|
|
|
1034
1108
|
const elementDisposables = disposables.add(( (new DisposableStore())));
|
|
1035
1109
|
let profileElement;
|
|
1036
1110
|
const configureRowContainer = append(parent, $('.profile-row-container'));
|
|
1037
|
-
append(configureRowContainer, $('.profile-label-element', undefined, ( localize(
|
|
1111
|
+
append(configureRowContainer, $('.profile-label-element', undefined, ( localize(11008, "Contents"))));
|
|
1038
1112
|
const contentsDescriptionElement = append(configureRowContainer, $('.profile-description-element'));
|
|
1039
1113
|
const contentsTreeHeader = append(configureRowContainer, $('.profile-content-tree-header'));
|
|
1040
|
-
const optionsLabel = $('.options-header', undefined, $('span', undefined, ( localize(
|
|
1041
|
-
append(contentsTreeHeader, $(''), $('', undefined, ( localize(
|
|
1114
|
+
const optionsLabel = $('.options-header', undefined, $('span', undefined, ( localize(11009, "Source"))));
|
|
1115
|
+
append(contentsTreeHeader, $(''), $('', undefined, ( localize(11008, "Contents"))), optionsLabel, $('.actions-header', undefined, ( localize(11010, "Actions"))));
|
|
1042
1116
|
const delegate = ( (new ProfileContentTreeElementDelegate()));
|
|
1043
1117
|
const profilesContentTree = this.profilesContentTree = disposables.add(this.instantiationService.createInstance((WorkbenchAsyncDataTree), 'ProfileEditor-ContentsTree', append(configureRowContainer, $('.profile-content-tree.file-icon-themable-tree.show-file-icons')), delegate, [
|
|
1044
1118
|
this.instantiationService.createInstance(ExistingProfileResourceTreeRenderer),
|
|
@@ -1100,9 +1174,9 @@ let ContentsProfileRenderer = class ContentsProfileRenderer extends ProfilePrope
|
|
|
1100
1174
|
}
|
|
1101
1175
|
}));
|
|
1102
1176
|
const updateDescription = (element) => {
|
|
1103
|
-
const defaultHelpInfo = ( localize(
|
|
1177
|
+
const defaultHelpInfo = ( localize(11011, "- *Default:* Use contents from the Default profile\n"));
|
|
1104
1178
|
const markdown = ( (new MarkdownString()))
|
|
1105
|
-
.appendMarkdown(( localize(
|
|
1179
|
+
.appendMarkdown(( localize(11012, "Configure source of contents for this profile\n")));
|
|
1106
1180
|
clearNode(contentsDescriptionElement);
|
|
1107
1181
|
if (element.root instanceof UserDataProfileElement && element.root.profile.isDefault) {
|
|
1108
1182
|
return;
|
|
@@ -1110,12 +1184,12 @@ let ContentsProfileRenderer = class ContentsProfileRenderer extends ProfilePrope
|
|
|
1110
1184
|
if (element.root instanceof NewProfileElement) {
|
|
1111
1185
|
const copyFromName = element.root.getCopyFromName();
|
|
1112
1186
|
const optionName = copyFromName === this.userDataProfilesService.defaultProfile.name
|
|
1113
|
-
? ( localize(
|
|
1187
|
+
? ( localize(11013, "{0} (Copy)", copyFromName))
|
|
1114
1188
|
: copyFromName;
|
|
1115
1189
|
if (optionName) {
|
|
1116
1190
|
markdown
|
|
1117
1191
|
.appendMarkdown(( localize(
|
|
1118
|
-
|
|
1192
|
+
11014,
|
|
1119
1193
|
"- *{0}:* Copy contents from the {1} profile\n",
|
|
1120
1194
|
optionName,
|
|
1121
1195
|
copyFromName
|
|
@@ -1123,13 +1197,13 @@ let ContentsProfileRenderer = class ContentsProfileRenderer extends ProfilePrope
|
|
|
1123
1197
|
}
|
|
1124
1198
|
markdown
|
|
1125
1199
|
.appendMarkdown(defaultHelpInfo)
|
|
1126
|
-
.appendMarkdown(( localize(
|
|
1200
|
+
.appendMarkdown(( localize(11015, "- *None:* Create empty contents\n")));
|
|
1127
1201
|
}
|
|
1128
1202
|
else if (element.root instanceof UserDataProfileElement) {
|
|
1129
1203
|
markdown
|
|
1130
1204
|
.appendMarkdown(defaultHelpInfo)
|
|
1131
1205
|
.appendMarkdown(( localize(
|
|
1132
|
-
|
|
1206
|
+
11016,
|
|
1133
1207
|
"- *{1}:* Use contents from the {0} profile\n",
|
|
1134
1208
|
element.root.profile.name,
|
|
1135
1209
|
element.root.profile.name
|
|
@@ -1208,13 +1282,13 @@ let ExistingProfileResourceTreeRenderer = class ExistingProfileResourceTreeRende
|
|
|
1208
1282
|
}
|
|
1209
1283
|
const updateRadioItems = () => {
|
|
1210
1284
|
templateData.radio.setItems([{
|
|
1211
|
-
text: ( localize(
|
|
1212
|
-
tooltip: ( localize(
|
|
1285
|
+
text: ( localize(11017, "Default")),
|
|
1286
|
+
tooltip: ( localize(11018, "Use {0} from the Default profile", resourceTypeTitle)),
|
|
1213
1287
|
isActive: root.getFlag(element.resourceType)
|
|
1214
1288
|
},
|
|
1215
1289
|
{
|
|
1216
1290
|
text: root.name,
|
|
1217
|
-
tooltip: ( localize(
|
|
1291
|
+
tooltip: ( localize(11019, "Use {0} from the {1} profile", resourceTypeTitle, root.name)),
|
|
1218
1292
|
isActive: !root.getFlag(element.resourceType)
|
|
1219
1293
|
}]);
|
|
1220
1294
|
};
|
|
@@ -1275,22 +1349,22 @@ let NewProfileResourceTreeRenderer = class NewProfileResourceTreeRenderer extend
|
|
|
1275
1349
|
templateData.label.textContent = resourceTypeTitle;
|
|
1276
1350
|
const renderRadioItems = () => {
|
|
1277
1351
|
const options = [{
|
|
1278
|
-
text: ( localize(
|
|
1279
|
-
tooltip: ( localize(
|
|
1352
|
+
text: ( localize(11017, "Default")),
|
|
1353
|
+
tooltip: ( localize(11018, "Use {0} from the Default profile", resourceTypeTitle)),
|
|
1280
1354
|
},
|
|
1281
1355
|
{
|
|
1282
|
-
text: ( localize(
|
|
1283
|
-
tooltip: ( localize(
|
|
1356
|
+
text: ( localize(11020, "None")),
|
|
1357
|
+
tooltip: ( localize(11021, "Create empty {0}", resourceTypeTitle))
|
|
1284
1358
|
}];
|
|
1285
1359
|
const copyFromName = root.getCopyFromName();
|
|
1286
1360
|
const name = copyFromName === this.userDataProfilesService.defaultProfile.name
|
|
1287
|
-
? ( localize(
|
|
1361
|
+
? ( localize(11013, "{0} (Copy)", copyFromName))
|
|
1288
1362
|
: copyFromName;
|
|
1289
1363
|
if (root.copyFrom && name) {
|
|
1290
1364
|
templateData.radio.setItems([
|
|
1291
1365
|
{
|
|
1292
1366
|
text: name,
|
|
1293
|
-
tooltip: name ? ( localize(
|
|
1367
|
+
tooltip: name ? ( localize(11022, "Copy {0} from the {1} profile", resourceTypeTitle, name)) : ( localize(11023, "Copy")),
|
|
1294
1368
|
},
|
|
1295
1369
|
...options
|
|
1296
1370
|
]);
|
|
@@ -1404,7 +1478,7 @@ let UserDataProfilesEditorInput = class UserDataProfilesEditorInput extends Edit
|
|
|
1404
1478
|
this._register(this.model.onDidChange(e => this.dirty = ( (this.model.profiles.some(profile => profile instanceof NewProfileElement)))));
|
|
1405
1479
|
}
|
|
1406
1480
|
get typeId() { return UserDataProfilesEditorInput_1.ID; }
|
|
1407
|
-
getName() { return ( localize(
|
|
1481
|
+
getName() { return ( localize(11024, "Profiles")); }
|
|
1408
1482
|
getIcon() { return defaultUserDataProfileIcon; }
|
|
1409
1483
|
async resolve() {
|
|
1410
1484
|
await this.model.resolve();
|
|
@@ -1421,6 +1495,14 @@ let UserDataProfilesEditorInput = class UserDataProfilesEditorInput extends Edit
|
|
|
1421
1495
|
this.model.revert();
|
|
1422
1496
|
}
|
|
1423
1497
|
matches(otherInput) { return otherInput instanceof UserDataProfilesEditorInput_1; }
|
|
1498
|
+
dispose() {
|
|
1499
|
+
for (const profile of this.model.profiles) {
|
|
1500
|
+
if (profile instanceof UserDataProfileElement) {
|
|
1501
|
+
profile.reset();
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
super.dispose();
|
|
1505
|
+
}
|
|
1424
1506
|
};
|
|
1425
1507
|
UserDataProfilesEditorInput = UserDataProfilesEditorInput_1 = ( (__decorate([
|
|
1426
1508
|
( (__param(0, IInstantiationService)))
|