Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 27dd120

Browse files
Akos Kittakittaakos
Akos Kitta
authored andcommitted
Cleaned up File menu.
Removed: - `New File`, - `New Window`. Closes #1014. Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
1 parent f5cee97 commit 27dd120

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

‎arduino-ide-extension/src/browser/arduino-ide-frontend-module.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ import {
296296
SurveyNotificationService,
297297
SurveyNotificationServicePath,
298298
} from '../common/protocol/survey-service';
299+
import { WindowContribution } from './theia/core/window-contribution';
300+
import { WindowContribution as TheiaWindowContribution } from '@theia/core/lib/browser/window-contribution';
299301

300302
MonacoThemingService.register({
301303
id: 'arduino-theme',
@@ -605,6 +607,10 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
605607
bind(OutputToolbarContribution).toSelf().inSingletonScope();
606608
rebind(TheiaOutputToolbarContribution).toService(OutputToolbarContribution);
607609

610+
// To remove `New Window` from the `File` menu
611+
bind(WindowContribution).toSelf().inSingletonScope();
612+
rebind(TheiaWindowContribution).toService(WindowContribution);
613+
608614
bind(ArduinoDaemon)
609615
.toDynamicValue((context) =>
610616
WebSocketConnectionProvider.createProxy(

‎arduino-ide-extension/src/browser/theia/core/common-frontend-contribution.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export class CommonFrontendContribution extends TheiaCommonFrontendContribution
2121
CommonCommands.TOGGLE_MAXIMIZED,
2222
CommonCommands.PIN_TAB,
2323
CommonCommands.UNPIN_TAB,
24+
CommonCommands.NEW_FILE,
2425
]) {
2526
commandRegistry.unregisterCommand(command);
2627
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { injectable } from '@theia/core/shared/inversify';
2+
import { WindowContribution as TheiaWindowContribution } from '@theia/core/lib/browser/window-contribution';
3+
4+
@injectable()
5+
export class WindowContribution extends TheiaWindowContribution {
6+
override registerCommands(): void {
7+
// NOOP
8+
}
9+
override registerKeybindings(): void {
10+
// NOO
11+
}
12+
override registerMenus(): void {
13+
// NOOP;
14+
}
15+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /