File tree Expand file tree Collapse file tree 5 files changed +20
-12
lines changed
Expand file tree Collapse file tree 5 files changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -223,13 +223,6 @@ var Application = View.extend({
223223 event . preventDefault ( ) ;
224224 this . router . history . navigate ( pathname ) ;
225225 }
226- } ,
227- sendMessage : function ( msg ) {
228- ipc . send ( 'message' , msg ) ;
229- } ,
230- onMessageReceived : function ( msg ) {
231- debug ( 'message received from main process:' , msg ) ;
232- this . trigger ( msg ) ;
233226 }
234227} ) ;
235228
@@ -262,6 +255,13 @@ app.extend({
262255 isFeatureEnabled : function ( id ) {
263256 return FEATURES [ id ] === true ;
264257 } ,
258+ sendMessage : function ( msg ) {
259+ ipc . send ( 'message' , msg ) ;
260+ } ,
261+ onMessageReceived : function ( msg ) {
262+ debug ( 'message received from main process:' , msg ) ;
263+ this . trigger ( msg ) ;
264+ } ,
265265 init : function ( ) {
266266 domReady ( function ( ) {
267267 state . render ( ) ;
@@ -298,7 +298,7 @@ app.extend({
298298 } ) ;
299299 } ) ;
300300 // set up ipc
301- ipc . on ( 'message' , state . onMessageReceived . bind ( this ) ) ;
301+ ipc . on ( 'message' , this . onMessageReceived . bind ( this ) ) ;
302302 } ,
303303 navigate : state . navigate . bind ( state )
304304} ) ;
Original file line number Diff line number Diff line change 55/**
66* The outer dimensions to use for new windows.
77*/
8- exports . DEFAULT_WIDTH = 1024 ;
9- exports . DEFAULT_HEIGHT = 700 ;
8+ exports . DEFAULT_WIDTH = 1280 ;
9+ exports . DEFAULT_HEIGHT = 800 ;
1010
1111/**
1212* The outer window dimensions to use for new dialog
Original file line number Diff line number Diff line change @@ -7,11 +7,11 @@ if (!process.env.NODE_ENV) {
77// will be created in `/tmp/Compass`
88// (`~\AppData\Local\Temp\Compass` on Windows).
99require ( './crash-reporter' ) ;
10+ var debug = require ( 'debug' ) ( 'electron:index' ) ;
1011
1112if ( ! require ( 'electron-squirrel-startup' ) ) {
1213 var app = require ( 'app' ) ;
1314 var serverctl = require ( './scout-server-ctl' ) ;
14- var debug = require ( 'debug' ) ( 'scout-electron' ) ;
1515
1616 app . on ( 'window-all-closed' , function ( ) {
1717 debug ( 'All windows closed. Quitting app.' ) ;
Original file line number Diff line number Diff line change @@ -128,3 +128,9 @@ app.on('show connect dialog', function(opts) {
128128app . on ( 'ready' , function ( ) {
129129 app . emit ( 'show connect dialog' ) ;
130130} ) ;
131+
132+ var ipc = require ( 'ipc' ) ;
133+ ipc . on ( 'message' , function ( event , msg ) {
134+ debug ( 'message received in main process' , msg ) ;
135+ app . emit ( msg ) ;
136+ } ) ;
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ var HomeView = View.extend({
4848 app . instance . fetch ( ) ;
4949 } ,
5050 onInstanceFetched : function ( ) {
51- if ( _ . size ( app . instance . collections ) === 0 ) {
51+ if ( app . instance . collections . length === 0 ) {
5252 this . showNoCollectionsZeroState = true ;
5353 } else {
5454 this . showDefaultZeroState = true ;
@@ -82,6 +82,8 @@ var HomeView = View.extend({
8282 } ,
8383 onClickShowConnectWindow : function ( ) {
8484 // code to close current connection window and open connect dialog
85+ app . sendMessage ( 'show connect dialog' ) ;
86+ window . close ( ) ;
8587 } ,
8688 template : require ( './index.jade' ) ,
8789 subviews : {
You can’t perform that action at this time.
0 commit comments