@@ -7,6 +7,7 @@ const browserPage = 'file://' + __dirname + '/index.html';
7
7
8
8
var mainWindow = null ;
9
9
var isFocusMode = false ;
10
+ var appIsReady = false ;
10
11
11
12
function sendIPCToWindow ( window , action , data ) {
12
13
//if there are no windows, create a new one
@@ -24,6 +25,7 @@ function createWindow() {
24
25
'min-width' : 320 ,
25
26
'min-height' : 500 ,
26
27
'title-bar-style' : 'hidden-inset' ,
28
+ 'auto-hide-menu-bar' : true ,
27
29
icon : __dirname + '/icons/icon256.png' ,
28
30
} ) ;
29
31
@@ -87,6 +89,8 @@ app.on('window-all-closed', function () {
87
89
// This method will be called when Electron has finished
88
90
// initialization and is ready to create browser windows.
89
91
app . on ( 'ready' , function ( ) {
92
+ appIsReady = true ;
93
+
90
94
// Create the browser window.
91
95
electronScreen = electron . screen ; //this module must be loaded after the app is ready
92
96
@@ -99,6 +103,22 @@ app.on('ready', function () {
99
103
100
104
} ) ;
101
105
106
+ app . on ( "open-url" , function ( e , url ) {
107
+ if ( appIsReady ) {
108
+ sendIPCToWindow ( mainWindow , "addTab" , {
109
+ url : url
110
+ } ) ;
111
+ } else {
112
+ app . on ( "ready" , function ( ) {
113
+ setTimeout ( function ( ) { //TODO replace this with an event that occurs when the browserWindow finishes loading
114
+ sendIPCToWindow ( mainWindow , "addTab" , {
115
+ url : url
116
+ } ) ;
117
+ } , 750 ) ;
118
+ } ) ;
119
+ }
120
+ } ) ;
121
+
102
122
103
123
function createAppMenu ( ) {
104
124
// create the menu. based on example from http://electron.atom.io/docs/v0.34.0/api/menu/
@@ -124,6 +144,13 @@ function createAppMenu() {
124
144
click : function ( item , window ) {
125
145
sendIPCToWindow ( window , "addPrivateTab" ) ;
126
146
}
147
+ } ,
148
+ {
149
+ label : 'New Task' ,
150
+ accelerator : 'shift+CmdOrCtrl+n' ,
151
+ click : function ( item , window ) {
152
+ sendIPCToWindow ( window , "addTask" ) ;
153
+ }
127
154
} ,
128
155
{
129
156
type : "separator"
@@ -243,8 +270,8 @@ function createAppMenu() {
243
270
label : 'Developer' ,
244
271
submenu : [
245
272
{
246
- label : 'Reload' ,
247
- accelerator : 'CmdOrCtrl+R' ,
273
+ label : 'Reload Browser ' ,
274
+ accelerator : undefined ,
248
275
click : function ( item , focusedWindow ) {
249
276
if ( focusedWindow )
250
277
focusedWindow . reload ( ) ;
0 commit comments