@@ -13,6 +13,8 @@ import { FileService } from '@theia/filesystem/lib/browser/file-service';
1313import { ThemeService } from '@theia/core/lib/browser/theming' ;
1414import { MaybePromise } from '@theia/core/lib/common/types' ;
1515import { WindowService } from '@theia/core/lib/browser/window/window-service' ;
16+ import { CommandRegistry } from "@theia/core" ;
17+ import { CommonCommands } from '@theia/core/lib/browser/common-frontend-contribution' ;
1618import { FileDialogService } from '@theia/filesystem/lib/browser/file-dialog/file-dialog-service' ;
1719import { DisposableCollection } from '@theia/core/lib/common/disposable' ;
1820import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state' ;
@@ -376,9 +378,18 @@ export class SettingsComponent extends React.Component<SettingsComponent.Props,
376378 onChange = { this . additionalUrlsDidChange } />
377379 < i className = 'fa fa-window-restore theia-button shrink' onClick = { this . editAdditionalUrlDidClick } />
378380 </ div >
381+
382+ < div className = 'flex-line' >
383+ < button className = 'theia-button shrink' onClick = { this . openExtendedSettings } > Extended Settings</ button >
384+ </ div >
379385 </ div > ;
380386 }
381387
388+ protected openExtendedSettings = ( e : React . MouseEvent < HTMLElement > ) => {
389+ this . props . commands . executeCommand ( CommonCommands . OPEN_PREFERENCES . id ) ;
390+ this . props . commands . executeCommand ( 'arduino-settings-close' ) ;
391+ }
392+
382393 protected renderNetwork ( ) : React . ReactNode {
383394 return < div className = 'content noselect' >
384395 < form >
@@ -662,6 +673,7 @@ export namespace SettingsComponent {
662673 readonly fileService : FileService ;
663674 readonly fileDialogService : FileDialogService ;
664675 readonly windowService : WindowService ;
676+ readonly commands : CommandRegistry
665677 }
666678 export interface State extends Settings { }
667679}
@@ -681,12 +693,17 @@ export class SettingsWidget extends ReactWidget {
681693 @inject ( WindowService )
682694 protected readonly windowService : WindowService ;
683695
696+ @inject ( CommandRegistry )
697+ protected readonly commands : CommandRegistry ;
698+
684699 protected render ( ) : React . ReactNode {
685700 return < SettingsComponent
686701 settingsService = { this . settingsService }
687702 fileService = { this . fileService }
688703 fileDialogService = { this . fileDialogService }
689- windowService = { this . windowService } /> ;
704+ windowService = { this . windowService }
705+ commands = { this . commands }
706+ /> ;
690707 }
691708
692709}
0 commit comments