mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-12 13:56:34 +00:00
Added save button and turned auto save on by default.
Signed-off-by: jbicker <jan.bicker@typefox.io>
This commit is contained in:
parent
f4f7a9998e
commit
54d90d5413
@ -31,7 +31,10 @@
|
||||
"frontend": {
|
||||
"config": {
|
||||
"applicationName": "Arduino-PoC",
|
||||
"defaultTheme": "arduino-theme"
|
||||
"defaultTheme": "arduino-theme",
|
||||
"preferences": {
|
||||
"editor.autoSave": "on"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,10 @@
|
||||
"frontend": {
|
||||
"config": {
|
||||
"applicationName": "Arduino-PoC",
|
||||
"defaultTheme": "arduino-theme"
|
||||
"defaultTheme": "arduino-theme",
|
||||
"preferences": {
|
||||
"editor.autoSave": "on"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,10 @@ export namespace ArduinoCommands {
|
||||
id: 'arduino-open-file'
|
||||
}
|
||||
|
||||
export const SAVE_SKETCH: Command = {
|
||||
id: 'arduino-save-file'
|
||||
}
|
||||
|
||||
export const NEW_SKETCH: Command = {
|
||||
id: "arduino-new-sketch",
|
||||
label: 'New Sketch',
|
||||
|
@ -26,6 +26,7 @@ import { FileSystem } from '@theia/filesystem/lib/common';
|
||||
import { ArduinoOpenSketchContextMenu } from './arduino-file-menu';
|
||||
import { Sketch, SketchesService } from '../common/protocol/sketches-service';
|
||||
import { WindowService } from '@theia/core/lib/browser/window/window-service';
|
||||
import { CommonCommands } from '@theia/core/lib/browser/common-frontend-contribution'
|
||||
|
||||
@injectable()
|
||||
export class ArduinoFrontendContribution implements TabBarToolbarContribution, CommandContribution {
|
||||
@ -112,6 +113,13 @@ export class ArduinoFrontendContribution implements TabBarToolbarContribution, C
|
||||
group: 'arduino',
|
||||
text: '$(arrow-up)'
|
||||
});
|
||||
registry.registerItem({
|
||||
id: ArduinoCommands.SAVE_SKETCH.id,
|
||||
command: ArduinoCommands.SAVE_SKETCH.id,
|
||||
tooltip: 'Save',
|
||||
group: 'arduino',
|
||||
text: '$(arrow-down)'
|
||||
});
|
||||
registry.registerItem({
|
||||
id: ConnectedBoards.TOOLBAR_ID,
|
||||
render: () => <ConnectedBoards
|
||||
@ -190,6 +198,13 @@ export class ArduinoFrontendContribution implements TabBarToolbarContribution, C
|
||||
this.openSketchFilesInNewWindow(sketch.uri);
|
||||
}
|
||||
})
|
||||
registry.registerCommand(ArduinoCommands.SAVE_SKETCH, {
|
||||
isEnabled: widget => this.isArduinoToolbar(widget),
|
||||
isVisible: widget => this.isArduinoToolbar(widget),
|
||||
execute: async (sketch: Sketch) => {
|
||||
registry.executeCommand(CommonCommands.SAVE_ALL.id);
|
||||
}
|
||||
})
|
||||
registry.registerCommand(ArduinoCommands.NEW_SKETCH, new WorkspaceRootUriAwareCommandHandler(this.workspaceService, this.selectionService, {
|
||||
execute: async uri => {
|
||||
try {
|
||||
|
@ -10,6 +10,20 @@
|
||||
color: var(--theia-ui-font-color3);
|
||||
}
|
||||
|
||||
#arduino-verify.arduino-tool-icon:hover,
|
||||
#arduino-save-file.arduino-tool-icon:hover,
|
||||
#arduino-show-open-context-menu.arduino-tool-icon:hover,
|
||||
#arduino-upload.arduino-tool-icon:hover {
|
||||
background-position-y: 45px;
|
||||
}
|
||||
|
||||
#arduino-save-file {
|
||||
background: url(../icons/buttons.svg);
|
||||
background-size: 800%;
|
||||
background-position-y: 21px;
|
||||
background-position-x: 44px;
|
||||
}
|
||||
|
||||
#arduino-verify {
|
||||
background: url(../icons/buttons.svg);
|
||||
background-size: 800%;
|
||||
@ -17,12 +31,6 @@
|
||||
background-position-x: 141px;
|
||||
}
|
||||
|
||||
#arduino-verify.arduino-tool-icon:hover,
|
||||
#arduino-show-open-context-menu.arduino-tool-icon:hover,
|
||||
#arduino-upload.arduino-tool-icon:hover {
|
||||
background-position-y: 45px;
|
||||
}
|
||||
|
||||
#arduino-upload {
|
||||
background: url(../icons/buttons.svg);
|
||||
background-size: 800%;
|
||||
|
Loading…
x
Reference in New Issue
Block a user