@@ -6,13 +6,15 @@ import { Tab, Tabs, TabList, TabPanel } from 'react-tabs';
66import 'react-tabs/style/react-tabs.css' ;
77import { Disable } from 'react-disable' ;
88import URI from '@theia/core/lib/common/uri' ;
9- import { Emitter } from '@theia/core/lib/common/event' ;
9+ import { Event , Emitter } from '@theia/core/lib/common/event' ;
1010import { Deferred } from '@theia/core/lib/common/promise-util' ;
1111import { deepClone } from '@theia/core/lib/common/objects' ;
1212import { 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 { CommandService } 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 . commandService . executeCommand ( CommonCommands . OPEN_PREFERENCES . id ) ;
390+ this . props . onCloseDidRequestEmitter . fire ( ) ;
391+ }
392+
382393 protected renderNetwork ( ) : React . ReactNode {
383394 return < div className = 'content noselect' >
384395 < form >
@@ -662,6 +673,8 @@ export namespace SettingsComponent {
662673 readonly fileService : FileService ;
663674 readonly fileDialogService : FileDialogService ;
664675 readonly windowService : WindowService ;
676+ readonly onCloseDidRequestEmitter : Emitter < void > ;
677+ readonly commandService : CommandService ;
665678 }
666679 export interface State extends Settings { }
667680}
@@ -681,12 +694,23 @@ export class SettingsWidget extends ReactWidget {
681694 @inject ( WindowService )
682695 protected readonly windowService : WindowService ;
683696
697+ @inject ( CommandService )
698+ protected commandService : CommandService ;
699+
700+ protected readonly onCloseDidRequestEmitter = new Emitter < void > ( ) ;
701+ get onCloseDidRequest ( ) : Event < void > {
702+ return this . onCloseDidRequestEmitter . event ;
703+ }
704+
684705 protected render ( ) : React . ReactNode {
685706 return < SettingsComponent
686707 settingsService = { this . settingsService }
687708 fileService = { this . fileService }
688709 fileDialogService = { this . fileDialogService }
689- windowService = { this . windowService } /> ;
710+ windowService = { this . windowService }
711+ onCloseDidRequestEmitter = { this . onCloseDidRequestEmitter }
712+ commandService = { this . commandService }
713+ /> ;
690714 }
691715
692716}
@@ -733,7 +757,10 @@ export class SettingsDialog extends AbstractDialog<Promise<Settings>> {
733757 Widget . detach ( this . widget ) ;
734758 }
735759 Widget . attach ( this . widget , this . contentNode ) ;
736- this . toDisposeOnDetach . push ( this . settingsService . onDidChange ( ( ) => this . update ( ) ) ) ;
760+ this . toDisposeOnDetach . pushAll ( [
761+ this . settingsService . onDidChange ( ( ) => this . update ( ) ) ,
762+ this . widget . onCloseDidRequest ( ( ) => this . close ( ) )
763+ ] ) ;
737764 super . onAfterAttach ( msg ) ;
738765 this . update ( ) ;
739766 }
0 commit comments