Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Breeze
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
Breeze
Commits
6af1ba3b
Commit
6af1ba3b
authored
Jul 04, 2017
by
Pieterjan Vanhoof
Committed by
GitHub
Jul 04, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #151 from stratisproject/ui
Add copy/paste to OS X
parents
26a88ea4
e1447686
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
10 deletions
+39
-10
main.ts
Breeze.UI/main.ts
+39
-10
No files found.
Breeze.UI/main.ts
View file @
6af1ba3b
...
@@ -9,8 +9,6 @@ const path = require('path');
...
@@ -9,8 +9,6 @@ const path = require('path');
const
url
=
require
(
'url'
);
const
url
=
require
(
'url'
);
const
os
=
require
(
'os'
);
const
os
=
require
(
'os'
);
var
apiProcess
;
let
serve
;
let
serve
;
const
args
=
process
.
argv
.
slice
(
1
);
const
args
=
process
.
argv
.
slice
(
1
);
serve
=
args
.
some
(
val
=>
val
===
"--serve"
);
serve
=
args
.
some
(
val
=>
val
===
"--serve"
);
...
@@ -71,7 +69,8 @@ function createWindow() {
...
@@ -71,7 +69,8 @@ function createWindow() {
req
.
write
(
''
);
req
.
write
(
''
);
req
.
end
();
req
.
end
();
}
}
});
}
);
}
}
// This method will be called when Electron has finished
// This method will be called when Electron has finished
...
@@ -86,7 +85,10 @@ app.on('ready', function () {
...
@@ -86,7 +85,10 @@ app.on('ready', function () {
}
}
createTray
();
createTray
();
createWindow
();
createWindow
();
})
if
(
os
.
platform
()
===
'darwin'
){
createMenu
();
}
});
// Quit when all windows are closed.
// Quit when all windows are closed.
app
.
on
(
'window-all-closed'
,
function
()
{
app
.
on
(
'window-all-closed'
,
function
()
{
...
@@ -107,18 +109,19 @@ app.on('activate', function () {
...
@@ -107,18 +109,19 @@ app.on('activate', function () {
});
});
function
startApi
()
{
function
startApi
()
{
var
apiProcess
;
const
exec
=
require
(
'child_process'
).
exec
;
const
exec
=
require
(
'child_process'
).
exec
;
//Start Breeze Daemon
//Start Breeze Daemon
let
apipath
=
path
.
join
(
__dirname
,
'.//assets//daemon//Breeze.Daemon'
);
let
apiPath
=
path
.
join
(
__dirname
,
'.//assets//daemon//Breeze.Daemon'
);
apiPath
=
apiPath
.
replace
(
/ /g
,
'// '
);
if
(
os
.
platform
()
===
'win32'
)
{
if
(
os
.
platform
()
===
'win32'
)
{
apipath
=
path
.
join
(
__dirname
,
'.
\\
assets
\\
daemon
\\
Breeze.Daemon.exe'
);
apiPath
=
path
.
join
(
__dirname
,
'.
\\
assets
\\
daemon
\\
Breeze.Daemon.exe'
);
}
//Handle spaces in paths
//Handle spaces in paths
apipath
=
apipath
.
replace
(
/ /g
,
'
\\
'
);
apiPath
=
apiPath
.
replace
(
/ /g
,
'
\\
'
);
}
apiProcess
=
exec
(
api
p
ath
+
' light -testnet'
,
{
apiProcess
=
exec
(
api
P
ath
+
' light -testnet'
,
{
detached
:
true
detached
:
true
},
(
error
,
stdout
,
stderr
)
=>
{
},
(
error
,
stdout
,
stderr
)
=>
{
if
(
error
)
{
if
(
error
)
{
...
@@ -168,3 +171,29 @@ function writeLog(msg) {
...
@@ -168,3 +171,29 @@ function writeLog(msg) {
function
writeLogError
(
msg
)
{
function
writeLogError
(
msg
)
{
console
.
error
(
msg
);
console
.
error
(
msg
);
};
};
function
createMenu
()
{
const
Menu
=
electron
.
Menu
;
// Create the Application's main menu
var
menuTemplate
=
[{
label
:
"Application"
,
submenu
:
[
{
label
:
"About Application"
,
selector
:
"orderFrontStandardAboutPanel:"
},
{
type
:
"separator"
},
{
label
:
"Quit"
,
accelerator
:
"Command+Q"
,
click
:
function
()
{
app
.
quit
();
}}
]},
{
label
:
"Edit"
,
submenu
:
[
{
label
:
"Undo"
,
accelerator
:
"CmdOrCtrl+Z"
,
selector
:
"undo:"
},
{
label
:
"Redo"
,
accelerator
:
"Shift+CmdOrCtrl+Z"
,
selector
:
"redo:"
},
{
type
:
"separator"
},
{
label
:
"Cut"
,
accelerator
:
"CmdOrCtrl+X"
,
selector
:
"cut:"
},
{
label
:
"Copy"
,
accelerator
:
"CmdOrCtrl+C"
,
selector
:
"copy:"
},
{
label
:
"Paste"
,
accelerator
:
"CmdOrCtrl+V"
,
selector
:
"paste:"
},
{
label
:
"Select All"
,
accelerator
:
"CmdOrCtrl+A"
,
selector
:
"selectAll:"
}
]}
];
Menu
.
setApplicationMenu
(
Menu
.
buildFromTemplate
(
menuTemplate
));
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment