@@ -6,13 +6,15 @@ import { Tab, Tabs, TabList, TabPanel } from 'react-tabs';
6
6
import 'react-tabs/style/react-tabs.css' ;
7
7
import { Disable } from 'react-disable' ;
8
8
import 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' ;
10
10
import { Deferred } from '@theia/core/lib/common/promise-util' ;
11
11
import { deepClone } from '@theia/core/lib/common/objects' ;
12
12
import { FileService } from '@theia/filesystem/lib/browser/file-service' ;
13
13
import { ThemeService } from '@theia/core/lib/browser/theming' ;
14
14
import { MaybePromise } from '@theia/core/lib/common/types' ;
15
15
import { 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' ;
16
18
import { FileDialogService } from '@theia/filesystem/lib/browser/file-dialog/file-dialog-service' ;
17
19
import { DisposableCollection } from '@theia/core/lib/common/disposable' ;
18
20
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state' ;
@@ -376,9 +378,18 @@ export class SettingsComponent extends React.Component<SettingsComponent.Props,
376
378
onChange = { this . additionalUrlsDidChange } />
377
379
< i className = 'fa fa-window-restore theia-button shrink' onClick = { this . editAdditionalUrlDidClick } />
378
380
</ div >
381
+
382
+ < div className = 'flex-line' >
383
+ < button className = 'theia-button shrink' onClick = { this . openExtendedSettings } > Extended Settings</ button >
384
+ </ div >
379
385
</ div > ;
380
386
}
381
387
388
+ protected openExtendedSettings = ( e : React . MouseEvent < HTMLElement > ) => {
389
+ this . props . commandService . executeCommand ( CommonCommands . OPEN_PREFERENCES . id ) ;
390
+ this . props . onCloseDidRequestEmitter . fire ( ) ;
391
+ }
392
+
382
393
protected renderNetwork ( ) : React . ReactNode {
383
394
return < div className = 'content noselect' >
384
395
< form >
@@ -662,6 +673,8 @@ export namespace SettingsComponent {
662
673
readonly fileService : FileService ;
663
674
readonly fileDialogService : FileDialogService ;
664
675
readonly windowService : WindowService ;
676
+ readonly onCloseDidRequestEmitter : Emitter < void > ;
677
+ readonly commandService : CommandService ;
665
678
}
666
679
export interface State extends Settings { }
667
680
}
@@ -681,12 +694,23 @@ export class SettingsWidget extends ReactWidget {
681
694
@inject ( WindowService )
682
695
protected readonly windowService : WindowService ;
683
696
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
+
684
705
protected render ( ) : React . ReactNode {
685
706
return < SettingsComponent
686
707
settingsService = { this . settingsService }
687
708
fileService = { this . fileService }
688
709
fileDialogService = { this . fileDialogService }
689
- windowService = { this . windowService } /> ;
710
+ windowService = { this . windowService }
711
+ onCloseDidRequestEmitter = { this . onCloseDidRequestEmitter }
712
+ commandService = { this . commandService }
713
+ /> ;
690
714
}
691
715
692
716
}
@@ -733,7 +757,10 @@ export class SettingsDialog extends AbstractDialog<Promise<Settings>> {
733
757
Widget . detach ( this . widget ) ;
734
758
}
735
759
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
+ ] ) ;
737
764
super . onAfterAttach ( msg ) ;
738
765
this . update ( ) ;
739
766
}
0 commit comments