Skip to content

Commit b87ede5

Browse files
unregister old toolbar icons
1 parent fb690c9 commit b87ede5

File tree

4 files changed

+1
-64
lines changed

4 files changed

+1
-64
lines changed

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

Lines changed: 1 addition & 34 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,7 +10,6 @@ import {
1010
Command,
1111
CommandRegistry,
1212
SketchContribution,
13-
TabBarToolbarRegistry,
1413
} from './contribution';
1514
import { MaybePromise, nls } from '@theia/core/lib/common';
1615
import { CurrentSketch } from '../../common/protocol/sketches-service-client-impl';
@@ -51,35 +50,7 @@ export class Debug extends SketchContribution {
5150
this.disabledMessageDidChangeEmitter.fire(this._disabledMessages);
5251
}
5352

54-
protected readonly debugToolbarItem = {
55-
id: Debug.Commands.START_DEBUGGING.id,
56-
command: Debug.Commands.START_DEBUGGING.id,
57-
tooltip: `${
58-
this.disabledMessage
59-
? nls.localize(
60-
'arduino/debug/debugWithMessage',
61-
'Debug - {0}',
62-
this.disabledMessage
63-
)
64-
: Debug.Commands.START_DEBUGGING.label
65-
}`,
66-
priority: 3,
67-
onDidChange: this.onDisabledMessageDidChange as Event<void>,
68-
};
69-
7053
override onStart(): void {
71-
this.onDisabledMessageDidChange(
72-
() =>
73-
(this.debugToolbarItem.tooltip = `${
74-
this.disabledMessage
75-
? nls.localize(
76-
'arduino/debug/debugWithMessage',
77-
'Debug - {0}',
78-
this.disabledMessage
79-
)
80-
: Debug.Commands.START_DEBUGGING.label
81-
}`)
82-
);
8354
this.boardsServiceProvider.onBoardsConfigChanged(({ selectedBoard }) =>
8455
this.refreshState(selectedBoard)
8556
);
@@ -100,10 +71,6 @@ export class Debug extends SketchContribution {
10071
});
10172
}
10273

103-
override registerToolbarItems(registry: TabBarToolbarRegistry): void {
104-
registry.registerItem(this.debugToolbarItem);
105-
}
106-
10774
private async refreshState(
10875
board: Board | undefined = this.boardsServiceProvider.boardsConfig
10976
.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)