From 9e5833e3b70b0820ccc764da54239f8bed1bf125 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Wed, 14 Mar 2018 15:44:14 +0100 Subject: [PATCH 1/2] Rename wallet to UI --- .travis.yml | 14 +++++++------- README.md | 4 ++-- package-lock.json | 2 +- package.electron.json | 4 ++-- package.json | 2 +- webpack/app.js | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1c110e7..f0f5c4c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,11 +25,11 @@ deploy: - provider: releases api_key: $GH_TOKEN draft: true - name: Parity Wallet + name: Parity UI v0.1.0 file: - - ./dist/parity-wallet_0.1.0_amd64.deb - - ./dist/parity-wallet_0.1.0_amd64.snap - - ./dist/parity-wallet-0.1.0-x86_64.AppImage + - ./dist/parity-ui_0.1.0_amd64.deb + - ./dist/parity-ui_0.1.0_amd64.snap + - ./dist/parity-ui-0.1.0-x86_64.AppImage skip_cleanup: true on: condition: $TRAVIS_OS_NAME = linux @@ -37,10 +37,10 @@ deploy: - provider: releases api_key: $GH_TOKEN draft: true - name: Parity Wallet + name: Parity UI v0.1.0 file: - - "./dist/Parity Wallet Setup 0.1.0.exe" - - "./dist/Parity Wallet-0.1.0.dmg" + - "./dist/Parity UI Setup 0.1.0.exe" + - "./dist/Parity UI-0.1.0.dmg" skip_cleanup: true on: condition: $TRAVIS_OS_NAME = osx diff --git a/README.md b/README.md index b2af6a0..514304b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Parity Wallet +# Parity UI -The Electron app of Parity Wallet user interface. +The Electron app for Parity UI. ## Development diff --git a/package-lock.json b/package-lock.json index 12906db..59aeaf2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "parity-wallet", + "name": "parity-ui", "version": "0.1.0", "lockfileVersion": 1, "requires": true, diff --git a/package.electron.json b/package.electron.json index 937e376..5d50e01 100644 --- a/package.electron.json +++ b/package.electron.json @@ -1,5 +1,5 @@ { - "appId": "com.parity.wallet", + "appId": "com.parity.ui", "directories": { "buildResources": "./" }, @@ -15,7 +15,7 @@ "category": "public.app-category.productivity", "icon": "./assets/icon/small-white-512x512.png" }, - "productName": "Parity Wallet", + "productName": "Parity UI", "win": { "icon": "./assets/icon/small-white-512x512.png" } diff --git a/package.json b/package.json index 385520e..1cd39c9 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "parity-wallet", + "name": "parity-ui", "version": "0.1.0", "main": ".build/electron.js", "jsnext:main": ".build/electron.js", diff --git a/webpack/app.js b/webpack/app.js index ea554a4..f2ed26b 100644 --- a/webpack/app.js +++ b/webpack/app.js @@ -174,7 +174,7 @@ module.exports = { plugins, new HtmlWebpackPlugin({ - title: 'Parity Wallet', + title: 'Parity UI', filename: 'index.html', template: './index.parity.ejs', favicon: FAVICON, -- GitLab From 248e4eca02ae82cf22496505a95a90cdbf46ed68 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Wed, 14 Mar 2018 17:27:41 +0100 Subject: [PATCH 2/2] Close parity when electron closes --- src/index.electron.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/index.electron.js b/src/index.electron.js index 0d9be07..ca8d3b1 100644 --- a/src/index.electron.js +++ b/src/index.electron.js @@ -24,6 +24,7 @@ const pick = require('lodash/pick'); const { spawn } = require('child_process'); const url = require('url'); +let parity; // Will hold the parity process (if spawned by node) const parityInstallLocation = require('./util/parityInstallLocation'); const { app, BrowserWindow, ipcMain, Menu, session, shell } = electron; @@ -62,7 +63,7 @@ function createWindow () { ipcMain.on('asynchronous-message', (event, arg) => { // Run an instance of parity if we receive the `run-parity` message if (arg === 'run-parity') { - spawn(global.parityInstallLocation); + parity = spawn(global.parityInstallLocation); } }); @@ -163,20 +164,26 @@ function createWindow () { callback({ requestHeaders: details.requestHeaders }); }); - mainWindow.on('closed', function () { + mainWindow.on('closed', () => { mainWindow = null; }); } app.on('ready', createWindow); -app.on('window-all-closed', function () { +app.on('window-all-closed', () => { if (process.platform !== 'darwin') { app.quit(); } }); -app.on('activate', function () { +app.on('will-quit', () => { + if (parity) { + parity.kill(); + } +}); + +app.on('activate', () => { if (mainWindow === null) { createWindow(); } -- GitLab