@@ -6,10 +6,11 @@ if (pkg.hasOwnProperty("NRelectron")) { options = pkg["NRelectron"] }
66
77// Some settings you can edit if you don't set them in package.json
88//console.log(options)
9- const editable = options . editable || true ; // set this to false to create a run only application - no editor/no console
9+ const editable = options . editable || true ; // set this to false to create a run only application - no editor/no console
1010const allowLoadSave = options . allowLoadSave || false ; // set to true to allow import and export of flow file
1111const showMap = options . showMap || false ; // set to true to add Worldmap to the menu
12- const kioskMode = options . kioskMode || false ; // set to true to start in kiosk mode
12+ const kioskMode = options . kioskMode || false ; // set to true to start in kiosk mode
13+ const addNodes = options . addNodes || true ; // set to false to block installing extra nodes
1314let flowfile = options . flowFile || 'electronflow.json' ; // default Flows file name - loaded at start
1415
1516const urldash = "/ui/#/0" ; // url for the dashboard page
@@ -112,7 +113,7 @@ var settings = {
112113 httpNodeRoot : "/" ,
113114 userDir : userdir ,
114115 flowFile : flowfile ,
115- editorTheme : { projects :{ enabled :false } } , // enable projects feature
116+ editorTheme : { projects :{ enabled :false } , palette : { editable : addNodes } } , // enable projects feature
116117 functionGlobalContext : { } , // enables global context - add extras ehre if you need them
117118 logging : {
118119 websock : {
@@ -354,6 +355,19 @@ function createWindow() {
354355 option . height = w . height ;
355356 } )
356357
358+ mainWindow . on ( 'close' , function ( e ) {
359+ const choice = require ( 'electron' ) . dialog . showMessageBoxSync ( this , {
360+ type : 'question' ,
361+ icon : nrIcon ,
362+ buttons : [ 'Yes' , 'No' ] ,
363+ title : 'Confirm' ,
364+ message : 'Are you sure you want to quit?'
365+ } ) ;
366+ if ( choice === 1 ) {
367+ e . preventDefault ( ) ;
368+ }
369+ } ) ;
370+
357371 mainWindow . on ( 'closed' , ( ) => {
358372 mainWindow = null ;
359373 } ) ;
0 commit comments