diff --git a/ui (gen4)/features/app.js b/ui (gen4)/features/app.js index 2fd85933..8157f0c3 100755 --- a/ui (gen4)/features/app.js +++ b/ui (gen4)/features/app.js @@ -433,7 +433,9 @@ module.PortableAppControl = core.ImageGridFeatures.Feature({ //--------------------------------------------------------------------- -// XXX would be nice to store/restore dev-tools state... +// XXX should we create and show the window here??? +// ...if yes, then we'll need to start the ui features later as +// they need the dom ready... var WindowedAppControlActions = actions.Actions({ config: { // Window state: @@ -454,7 +456,6 @@ var WindowedAppControlActions = actions.Actions({ 'show-splash-screen': 'on', }, - // XXX revise these... close: ['File|Window/Close viewer', function(){ this.stop() @@ -525,9 +526,6 @@ var WindowedAppControlActions = actions.Actions({ })], }) -// XXX store/load window state... -// - size -// - state (fullscreen/normal) var WindowedAppControl = module.WindowedAppControl = core.ImageGridFeatures.Feature({ title: '', @@ -558,6 +556,7 @@ module.WindowedAppControl = core.ImageGridFeatures.Feature({ function(){ // we are going to declare ready ourselves... this.requestReadyAnnounce() }], + // XXX should we create and show the window here??? ['start', function(){ var that = this diff --git a/ui (gen4)/features/cli.js b/ui (gen4)/features/cli.js index 4d534388..7678ed82 100755 --- a/ui (gen4)/features/cli.js +++ b/ui (gen4)/features/cli.js @@ -23,6 +23,7 @@ if(typeof(process) != 'undefined'){ } + /*********************************************************************/ // setup logger... @@ -215,6 +216,8 @@ module.CLI = core.ImageGridFeatures.Feature({ actions: CLIActions, handlers: [ + // XXX sort out different run/stop/exit paths -- make this more + // systematic... ['ready', function(){ var that = this @@ -363,7 +366,7 @@ module.CLI = core.ImageGridFeatures.Feature({ // npm install -g nwjs // npm link nwjs // nw install 0.14.5-sdk - .option('gui, --gui', 'start ImageGrid.Viewer', function(){ + .option('nw, --nw', 'start ImageGrid.Viewer (nw)', function(){ throw new Error('ig: GUI startup not implemented.') var path = requirejs('path') @@ -374,6 +377,25 @@ module.CLI = core.ImageGridFeatures.Feature({ keep_running = true }) + .option('electron, --electron', 'start ImageGrid.Viewer (electron)', function(){ + var path = requirejs('path') + + requirejs('child_process') + .spawn(requirejs('electron'), [ + path.join( + path.dirname(nodeRequire.main.filename), + 'e.js')]) + // XXX need to stop the process iff nothing + // else is running, like repl... + // XXX feels hackish... + .on('exit', function(){ + (!global.ig + || global.ig.isStopped()) + && process.exit() + }) + + keep_running = true + }) /* // XXX the problem with this is that it still tires // to find and run 'ig-index'...