1+ import  {  nls  }  from  '@theia/core/lib/common/nls' ; 
12import  {  inject ,  injectable  }  from  '@theia/core/shared/inversify' ; 
3+ import  {  MainMenuManager  }  from  '../../common/main-menu-manager' ; 
4+ import  type  {  Settings  }  from  '../dialogs/settings/settings' ; 
5+ import  {  SettingsDialog  }  from  '../dialogs/settings/settings-dialog' ; 
6+ import  {  ArduinoMenus  }  from  '../menu/arduino-menus' ; 
27import  { 
38  Command , 
4-   MenuModelRegistry , 
59  CommandRegistry , 
6-   SketchContribution , 
710  KeybindingRegistry , 
11+   MenuModelRegistry , 
12+   SketchContribution , 
813}  from  './contribution' ; 
9- import  {  ArduinoMenus  }  from  '../menu/arduino-menus' ; 
10- import  {  Settings  as  Preferences  }  from  '../dialogs/settings/settings' ; 
11- import  {  SettingsDialog  }  from  '../dialogs/settings/settings-dialog' ; 
12- import  {  nls  }  from  '@theia/core/lib/common' ; 
1314
1415@injectable ( ) 
15- export  class  Settings  extends  SketchContribution  { 
16+ export  class  OpenSettings  extends  SketchContribution  { 
1617  @inject ( SettingsDialog ) 
17-   protected  readonly  settingsDialog : SettingsDialog ; 
18+   private  readonly  settingsDialog : SettingsDialog ; 
19+   @inject ( MainMenuManager ) 
20+   private  readonly  menuManager : MainMenuManager ; 
1821
19-   protected  settingsOpened  =  false ; 
22+   private  settingsOpened  =  false ; 
2023
2124  override  registerCommands ( registry : CommandRegistry ) : void   { 
22-     registry . registerCommand ( Settings . Commands . OPEN ,  { 
25+     registry . registerCommand ( OpenSettings . Commands . OPEN ,  { 
2326      execute : async  ( )  =>  { 
24-         let  settings : Preferences  |  undefined  =  undefined ; 
27+         let  settings : Settings  |  undefined  =  undefined ; 
2528        try  { 
2629          this . settingsOpened  =  true ; 
30+           this . menuManager . update ( ) ; 
2731          settings  =  await  this . settingsDialog . open ( ) ; 
2832        }  finally  { 
2933          this . settingsOpened  =  false ; 
34+           this . menuManager . update ( ) ; 
3035        } 
3136        if  ( settings )  { 
3237          await  this . settingsService . update ( settings ) ; 
@@ -41,7 +46,7 @@ export class Settings extends SketchContribution {
4146
4247  override  registerMenus ( registry : MenuModelRegistry ) : void   { 
4348    registry . registerMenuAction ( ArduinoMenus . FILE__PREFERENCES_GROUP ,  { 
44-       commandId : Settings . Commands . OPEN . id , 
49+       commandId : OpenSettings . Commands . OPEN . id , 
4550      label :
4651        nls . localize ( 
4752          'vscode/preferences.contribution/preferences' , 
@@ -57,13 +62,13 @@ export class Settings extends SketchContribution {
5762
5863  override  registerKeybindings ( registry : KeybindingRegistry ) : void   { 
5964    registry . registerKeybinding ( { 
60-       command : Settings . Commands . OPEN . id , 
65+       command : OpenSettings . Commands . OPEN . id , 
6166      keybinding : 'CtrlCmd+,' , 
6267    } ) ; 
6368  } 
6469} 
6570
66- export  namespace  Settings  { 
71+ export  namespace  OpenSettings  { 
6772  export  namespace  Commands  { 
6873    export  const  OPEN : Command  =  { 
6974      id : 'arduino-settings-open' , 
0 commit comments