Skip to content

Commit f6b6f34

Browse files
unregister old toolbar icons
1 parent 8ad10b5 commit f6b6f34

File tree

4 files changed

+2
-74
lines changed

4 files changed

+2
-74
lines changed

arduino-ide-extension/src/browser/contributions/debug.ts

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { inject, injectable } from '@theia/core/shared/inversify';
2-
import { Event, Emitter } from '@theia/core/lib/common/event';
2+
import { Emitter } from '@theia/core/lib/common/event';
33
import { HostedPluginSupport } from '@theia/plugin-ext/lib/hosted/browser/hosted-plugin';
44
import { ArduinoToolbar } from '../toolbar/arduino-toolbar';
55
import { NotificationCenter } from '../notification-center';
@@ -10,11 +10,9 @@ import {
1010
Command,
1111
CommandRegistry,
1212
SketchContribution,
13-
TabBarToolbarRegistry,
1413
} from './contribution';
15-
import { MaybePromise, MenuModelRegistry, nls } from '@theia/core/lib/common';
14+
import { MaybePromise, nls } from '@theia/core/lib/common';
1615
import { CurrentSketch } from '../../common/protocol/sketches-service-client-impl';
17-
import { ArduinoMenus } from '../menu/arduino-menus';
1816
import {
1917
PreferenceScope,
2018
PreferenceService,
@@ -59,35 +57,7 @@ export class Debug extends SketchContribution {
5957
this.disabledMessageDidChangeEmitter.fire(this._disabledMessages);
6058
}
6159

62-
private readonly debugToolbarItem = {
63-
id: Debug.Commands.START_DEBUGGING.id,
64-
command: Debug.Commands.START_DEBUGGING.id,
65-
tooltip: `${
66-
this.disabledMessage
67-
? nls.localize(
68-
'arduino/debug/debugWithMessage',
69-
'Debug - {0}',
70-
this.disabledMessage
71-
)
72-
: Debug.Commands.START_DEBUGGING.label
73-
}`,
74-
priority: 3,
75-
onDidChange: this.onDisabledMessageDidChange as Event<void>,
76-
};
77-
7860
override onStart(): void {
79-
this.onDisabledMessageDidChange(
80-
() =>
81-
(this.debugToolbarItem.tooltip = `${
82-
this.disabledMessage
83-
? nls.localize(
84-
'arduino/debug/debugWithMessage',
85-
'Debug - {0}',
86-
this.disabledMessage
87-
)
88-
: Debug.Commands.START_DEBUGGING.label
89-
}`)
90-
);
9161
this.boardsServiceProvider.onBoardsConfigChanged(({ selectedBoard }) =>
9262
this.refreshState(selectedBoard)
9363
);
@@ -112,18 +82,6 @@ export class Debug extends SketchContribution {
11282
});
11383
}
11484

115-
override registerToolbarItems(registry: TabBarToolbarRegistry): void {
116-
registry.registerItem(this.debugToolbarItem);
117-
}
118-
119-
override registerMenus(registry: MenuModelRegistry): void {
120-
registry.registerMenuAction(ArduinoMenus.SKETCH__MAIN_GROUP, {
121-
commandId: Debug.Commands.OPTIMIZE_FOR_DEBUG.id,
122-
label: Debug.Commands.OPTIMIZE_FOR_DEBUG.label,
123-
order: '5',
124-
});
125-
}
126-
12785
private async refreshState(
12886
board: Board | undefined = this.boardsServiceProvider.boardsConfig
12987
.selectedBoard

arduino-ide-extension/src/browser/contributions/new-sketch.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
CommandRegistry,
1010
MenuModelRegistry,
1111
KeybindingRegistry,
12-
TabBarToolbarRegistry,
1312
} from './contribution';
1413

1514
@injectable()
@@ -40,15 +39,6 @@ export class NewSketch extends SketchContribution {
4039
});
4140
}
4241

43-
override registerToolbarItems(registry: TabBarToolbarRegistry): void {
44-
registry.registerItem({
45-
id: NewSketch.Commands.NEW_SKETCH__TOOLBAR.id,
46-
command: NewSketch.Commands.NEW_SKETCH__TOOLBAR.id,
47-
tooltip: nls.localize('arduino/sketch/new', 'New'),
48-
priority: 3,
49-
});
50-
}
51-
5242
async newSketch(): Promise<void> {
5343
try {
5444
const sketch = await this.sketchService.createNewSketch();

arduino-ide-extension/src/browser/contributions/open-sketch.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
CommandRegistry,
1717
MenuModelRegistry,
1818
KeybindingRegistry,
19-
TabBarToolbarRegistry,
2019
} from './contribution';
2120
import { ExamplesService } from '../../common/protocol/examples-service';
2221
import { BuiltInExamples } from './examples';
@@ -131,15 +130,6 @@ export class OpenSketch extends SketchContribution {
131130
});
132131
}
133132

134-
override registerToolbarItems(registry: TabBarToolbarRegistry): void {
135-
registry.registerItem({
136-
id: OpenSketch.Commands.OPEN_SKETCH__TOOLBAR.id,
137-
command: OpenSketch.Commands.OPEN_SKETCH__TOOLBAR.id,
138-
tooltip: nls.localize('vscode/dialogMainService/open', 'Open'),
139-
priority: 4,
140-
});
141-
}
142-
143133
async openSketch(
144134
toOpen: MaybePromise<Sketch | undefined> = this.selectSketch()
145135
): Promise<void> {

arduino-ide-extension/src/browser/contributions/save-sketch.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
CommandRegistry,
1010
MenuModelRegistry,
1111
KeybindingRegistry,
12-
TabBarToolbarRegistry,
1312
} from './contribution';
1413
import { nls } from '@theia/core/lib/common';
1514
import { CurrentSketch } from '../../common/protocol/sketches-service-client-impl';
@@ -43,15 +42,6 @@ export class SaveSketch extends SketchContribution {
4342
});
4443
}
4544

46-
override registerToolbarItems(registry: TabBarToolbarRegistry): void {
47-
registry.registerItem({
48-
id: SaveSketch.Commands.SAVE_SKETCH__TOOLBAR.id,
49-
command: SaveSketch.Commands.SAVE_SKETCH__TOOLBAR.id,
50-
tooltip: nls.localize('vscode/fileCommands/save', 'Save'),
51-
priority: 5,
52-
});
53-
}
54-
5545
async saveSketch(): Promise<void> {
5646
const sketch = await this.sketchServiceClient.currentSketch();
5747
if (!CurrentSketch.isValid(sketch)) {

0 commit comments

Comments
 (0)