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({
223
223
event . preventDefault ( ) ;
224
224
this . router . history . navigate ( pathname ) ;
225
225
}
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 ) ;
233
226
}
234
227
} ) ;
235
228
@@ -262,6 +255,13 @@ app.extend({
262
255
isFeatureEnabled : function ( id ) {
263
256
return FEATURES [ id ] === true ;
264
257
} ,
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
+ } ,
265
265
init : function ( ) {
266
266
domReady ( function ( ) {
267
267
state . render ( ) ;
@@ -298,7 +298,7 @@ app.extend({
298
298
} ) ;
299
299
} ) ;
300
300
// set up ipc
301
- ipc . on ( 'message' , state . onMessageReceived . bind ( this ) ) ;
301
+ ipc . on ( 'message' , this . onMessageReceived . bind ( this ) ) ;
302
302
} ,
303
303
navigate : state . navigate . bind ( state )
304
304
} ) ;
Original file line number Diff line number Diff line change 5
5
/**
6
6
* The outer dimensions to use for new windows.
7
7
*/
8
- exports . DEFAULT_WIDTH = 1024 ;
9
- exports . DEFAULT_HEIGHT = 700 ;
8
+ exports . DEFAULT_WIDTH = 1280 ;
9
+ exports . DEFAULT_HEIGHT = 800 ;
10
10
11
11
/**
12
12
* 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) {
7
7
// will be created in `/tmp/Compass`
8
8
// (`~\AppData\Local\Temp\Compass` on Windows).
9
9
require ( './crash-reporter' ) ;
10
+ var debug = require ( 'debug' ) ( 'electron:index' ) ;
10
11
11
12
if ( ! require ( 'electron-squirrel-startup' ) ) {
12
13
var app = require ( 'app' ) ;
13
14
var serverctl = require ( './scout-server-ctl' ) ;
14
- var debug = require ( 'debug' ) ( 'scout-electron' ) ;
15
15
16
16
app . on ( 'window-all-closed' , function ( ) {
17
17
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) {
128
128
app . on ( 'ready' , function ( ) {
129
129
app . emit ( 'show connect dialog' ) ;
130
130
} ) ;
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({
48
48
app . instance . fetch ( ) ;
49
49
} ,
50
50
onInstanceFetched : function ( ) {
51
- if ( _ . size ( app . instance . collections ) === 0 ) {
51
+ if ( app . instance . collections . length === 0 ) {
52
52
this . showNoCollectionsZeroState = true ;
53
53
} else {
54
54
this . showDefaultZeroState = true ;
@@ -82,6 +82,8 @@ var HomeView = View.extend({
82
82
} ,
83
83
onClickShowConnectWindow : function ( ) {
84
84
// code to close current connection window and open connect dialog
85
+ app . sendMessage ( 'show connect dialog' ) ;
86
+ window . close ( ) ;
85
87
} ,
86
88
template : require ( './index.jade' ) ,
87
89
subviews : {
You can’t perform that action at this time.
0 commit comments