mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-11 10:56:14 +03:00
Customize Electron menus, use aiosqlite fork, chiapos to 0.12.26 (#370)
* Initial check in of new menu creation * aiosqlite by hash ea281b81 * Fix typo in setup.py * Get version from build scripts * Update to Mariano's py36 changes * Test windows w/o Mariano aiosql * Changes for electron Win * Add window menu on Win * Add wiki, faq, etc * Use quit - upgrade chiapos to 0.12.26
This commit is contained in:
parent
1c7d47f1f9
commit
5d57cc3942
@ -9,11 +9,15 @@ for setuptools_scm/PEP 440 reasons.
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
- The Chia UI now has a proper About menu entry that gives the various component versions and directs people to submit issues on GitHub. Thank you to @freddiecoleman for this pull request!
|
||||
|
||||
### Changed
|
||||
- To complement the new About menu, we have revamped all Electron menus and made them OS native. There are now direct links to the Wiki, Keybase, and FAQ in the Help menu.
|
||||
- There are minor improvements to how working space is calculated and displayed by the plotter. The plotter also has additional debugging information in its output.
|
||||
|
||||
### Fixed
|
||||
- A bug in aiosqlite is causing tests to hang.
|
||||
- kOffsetSize should have been 10 bits and not 9. This was causing plots, especially larger plots, to fail with "Error 0". This bug was introduced in Beta 8 with the new plot file format.
|
||||
- A bug in aiosqlite is caused tests to hang - especially on the ci.
|
||||
|
||||
## [1.0beta10] aka Beta 1.10 - 2020-08-18
|
||||
|
||||
|
@ -28,7 +28,7 @@ cd electron-react || exit
|
||||
echo "npm build"
|
||||
npm install
|
||||
npm run build
|
||||
electron-packager . Chia --asar.unpack="**/daemon/**" --platform=darwin --icon=src/assets/img/Chia.icns --overwrite --app-bundle-id=net.chia.blockchain
|
||||
electron-packager . Chia --asar.unpack="**/daemon/**" --platform=darwin --icon=src/assets/img/Chia.icns --overwrite --app-bundle-id=net.chia.blockchain --appVersion=$CHIA_INSTALLER_VERSION
|
||||
electron-osx-sign Chia-darwin-x64/Chia.app --no-gatekeeper-assess --platform=darwin --hardened-runtime --provisioning-profile=chiablockchain.provisionprofile --entitlements=entitlements.mac.plist --entitlements-inherit=entitlements.mac.plist
|
||||
mv Chia-darwin-x64 ../build_scripts/dist/
|
||||
cd ../build_scripts || exit
|
||||
|
14
electron-react/package-lock.json
generated
14
electron-react/package-lock.json
generated
@ -4881,7 +4881,7 @@
|
||||
}
|
||||
},
|
||||
"electron-osx-sign": {
|
||||
"version": "github:electron/electron-osx-sign#6ba45b2deec3f4f3629010645f92e6506df133ee",
|
||||
"version": "github:electron/electron-osx-sign#877226b5198f2ed9661129ea56a1ea048c4c55ae",
|
||||
"from": "github:electron/electron-osx-sign#master",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
@ -10890,12 +10890,6 @@
|
||||
"integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=",
|
||||
"dev": true
|
||||
},
|
||||
"prettier": {
|
||||
"version": "1.19.1",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz",
|
||||
"integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==",
|
||||
"dev": true
|
||||
},
|
||||
"prettier-eslint": {
|
||||
"version": "9.0.2",
|
||||
"resolved": "https://registry.npmjs.org/prettier-eslint/-/prettier-eslint-9.0.2.tgz",
|
||||
@ -11149,6 +11143,12 @@
|
||||
"mimic-fn": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"prettier": {
|
||||
"version": "1.19.1",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz",
|
||||
"integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==",
|
||||
"dev": true
|
||||
},
|
||||
"pretty-format": {
|
||||
"version": "23.6.0",
|
||||
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-23.6.0.tgz",
|
||||
|
@ -3,7 +3,6 @@
|
||||
"author": "Straya Markovic <hello@chia.net> (https://chia.net/)",
|
||||
"description": "GUI for Chia Blockchain",
|
||||
"productName": "Chia Blockchain",
|
||||
"version": "1.0.0-beta11",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"electron": "^8.5.0",
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 26 KiB |
@ -6,7 +6,14 @@ if (setupEvents.handleSquirrelEvent()) {
|
||||
}
|
||||
|
||||
const { promisify } = require("util");
|
||||
const { app, dialog, ipcMain, BrowserWindow, Menu } = require("electron");
|
||||
const {
|
||||
app,
|
||||
dialog,
|
||||
shell,
|
||||
ipcMain,
|
||||
BrowserWindow,
|
||||
Menu,
|
||||
} = require("electron");
|
||||
const openAboutWindow = require("about-window").default;
|
||||
const path = require("path");
|
||||
const config = require("./config");
|
||||
@ -84,17 +91,17 @@ const createPyProc = () => {
|
||||
if (pyProc != null) {
|
||||
pyProc.stdout.setEncoding("utf8");
|
||||
|
||||
pyProc.stdout.on("data", function(data) {
|
||||
pyProc.stdout.on("data", function (data) {
|
||||
process.stdout.write(data.toString());
|
||||
});
|
||||
|
||||
pyProc.stderr.setEncoding("utf8");
|
||||
pyProc.stderr.on("data", function(data) {
|
||||
pyProc.stderr.on("data", function (data) {
|
||||
//Here is where the error output goes
|
||||
process.stdout.write("stderr: " + data.toString());
|
||||
});
|
||||
|
||||
pyProc.on("close", function(code) {
|
||||
pyProc.on("close", function (code) {
|
||||
//Here you can get the exit code of the script
|
||||
console.log("closing code: " + code);
|
||||
});
|
||||
@ -104,9 +111,9 @@ const createPyProc = () => {
|
||||
//pyProc.unref();
|
||||
};
|
||||
|
||||
const closeDaemon = callback => {
|
||||
const closeDaemon = (callback) => {
|
||||
const timeout = setTimeout(() => callback(), 20000);
|
||||
const clearTimeoutCallback = err => {
|
||||
const clearTimeoutCallback = (err) => {
|
||||
clearTimeout(timeout);
|
||||
callback(err);
|
||||
};
|
||||
@ -114,7 +121,7 @@ const closeDaemon = callback => {
|
||||
try {
|
||||
const request_id = crypto.randomBytes(32).toString("hex");
|
||||
ws = new WebSocket(daemon_rpc_ws, {
|
||||
perMessageDeflate: false
|
||||
perMessageDeflate: false,
|
||||
});
|
||||
ws.on("open", function open() {
|
||||
console.log("Opened websocket with", daemon_rpc_ws);
|
||||
@ -123,7 +130,7 @@ const closeDaemon = callback => {
|
||||
ack: false,
|
||||
origin: "wallet_ui",
|
||||
destination: "daemon",
|
||||
request_id
|
||||
request_id,
|
||||
};
|
||||
ws.send(JSON.stringify(msg));
|
||||
});
|
||||
@ -133,7 +140,7 @@ const closeDaemon = callback => {
|
||||
clearTimeoutCallback();
|
||||
}
|
||||
});
|
||||
ws.on("error", err => {
|
||||
ws.on("error", (err) => {
|
||||
if (err.errno === "ECONNREFUSED") {
|
||||
clearTimeoutCallback();
|
||||
} else {
|
||||
@ -145,7 +152,7 @@ const closeDaemon = callback => {
|
||||
}
|
||||
};
|
||||
|
||||
const exitPyProc = e => {};
|
||||
const exitPyProc = (e) => {};
|
||||
|
||||
app.on("will-quit", exitPyProc);
|
||||
|
||||
@ -167,8 +174,8 @@ const createWindow = () => {
|
||||
show: false,
|
||||
webPreferences: {
|
||||
preload: __dirname + "/preload.js",
|
||||
nodeIntegration: true
|
||||
}
|
||||
nodeIntegration: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (dev_config.redux_tool) {
|
||||
@ -188,12 +195,12 @@ const createWindow = () => {
|
||||
url.format({
|
||||
pathname: path.join(__dirname, "/../build/index.html"),
|
||||
protocol: "file:",
|
||||
slashes: true
|
||||
slashes: true,
|
||||
});
|
||||
|
||||
mainWindow.loadURL(startUrl);
|
||||
|
||||
mainWindow.once("ready-to-show", function() {
|
||||
mainWindow.once("ready-to-show", function () {
|
||||
mainWindow.show();
|
||||
});
|
||||
|
||||
@ -201,7 +208,7 @@ const createWindow = () => {
|
||||
// if (!guessPackaged()) {
|
||||
// mainWindow.webContents.openDevTools();
|
||||
// }
|
||||
mainWindow.on("close", e => {
|
||||
mainWindow.on("close", (e) => {
|
||||
if (decidedToClose) {
|
||||
return;
|
||||
}
|
||||
@ -211,7 +218,7 @@ const createWindow = () => {
|
||||
buttons: ["No", "Yes"],
|
||||
title: "Confirm",
|
||||
message:
|
||||
"Are you sure you want to quit? GUI Plotting and farming will stop."
|
||||
"Are you sure you want to quit? GUI Plotting and farming will stop.",
|
||||
});
|
||||
if (choice == 0) {
|
||||
return;
|
||||
@ -226,27 +233,12 @@ const createWindow = () => {
|
||||
};
|
||||
|
||||
const createMenu = () => {
|
||||
const menu = Menu.buildFromTemplate([{
|
||||
label: "Help",
|
||||
submenu: [{
|
||||
label: "About",
|
||||
click: () =>
|
||||
openAboutWindow({
|
||||
homepage: "https://www.chia.net/",
|
||||
bug_report_url: "https://github.com/Chia-Network/chia-blockchain/issues",
|
||||
icon_path: path.join(__dirname, "assets/img/chia_circle.png"),
|
||||
copyright: "Copyright (c) 2020 Chia Network"
|
||||
}),
|
||||
}]
|
||||
}
|
||||
]);
|
||||
|
||||
const menu = Menu.buildFromTemplate(getMenuTemplate());
|
||||
return menu;
|
||||
}
|
||||
};
|
||||
|
||||
const appReady = async() => {
|
||||
const appReady = async () => {
|
||||
app.applicationMenu = createMenu();
|
||||
|
||||
try {
|
||||
await promisify(closeDaemon)();
|
||||
} catch (e) {
|
||||
@ -275,7 +267,304 @@ ipcMain.on("load-page", (event, arg) => {
|
||||
require("url").format({
|
||||
pathname: path.join(__dirname, arg.file),
|
||||
protocol: "file:",
|
||||
slashes: true
|
||||
slashes: true,
|
||||
}) + arg.query
|
||||
);
|
||||
});
|
||||
|
||||
function getMenuTemplate() {
|
||||
const template = [
|
||||
{
|
||||
label: "File",
|
||||
submenu: [
|
||||
{
|
||||
role: "quit",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "Edit",
|
||||
submenu: [
|
||||
{
|
||||
role: "undo",
|
||||
},
|
||||
{
|
||||
role: "redo",
|
||||
},
|
||||
{
|
||||
type: "separator",
|
||||
},
|
||||
{
|
||||
role: "cut",
|
||||
},
|
||||
{
|
||||
role: "copy",
|
||||
},
|
||||
{
|
||||
role: "paste",
|
||||
},
|
||||
{
|
||||
role: "delete",
|
||||
},
|
||||
{
|
||||
type: "separator",
|
||||
},
|
||||
{
|
||||
role: "selectall",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "View",
|
||||
submenu: [
|
||||
{
|
||||
role: "reload",
|
||||
},
|
||||
{
|
||||
role: "forcereload",
|
||||
},
|
||||
{
|
||||
label: "Developer",
|
||||
submenu: [
|
||||
{
|
||||
label: "Developer Tools",
|
||||
accelerator:
|
||||
process.platform === "darwin"
|
||||
? "Alt+Command+I"
|
||||
: "Ctrl+Shift+I",
|
||||
click: () => windows.main.toggleDevTools(),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "separator",
|
||||
},
|
||||
{
|
||||
role: "resetzoom",
|
||||
},
|
||||
{
|
||||
role: "zoomin",
|
||||
},
|
||||
{
|
||||
role: "zoomout",
|
||||
},
|
||||
{
|
||||
type: "separator",
|
||||
},
|
||||
{
|
||||
label: "Full Screen",
|
||||
type: "checkbox",
|
||||
accelerator: process.platform === "darwin" ? "Ctrl+Command+F" : "F11",
|
||||
click: () => windows.main.toggleFullScreen(),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "Window",
|
||||
submenu: [
|
||||
{
|
||||
role: "minimize",
|
||||
},
|
||||
{
|
||||
role: "zoom",
|
||||
},
|
||||
{
|
||||
role: "close",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "Help",
|
||||
role: "help",
|
||||
submenu: [
|
||||
{
|
||||
label: "Chia Blockchain Wiki",
|
||||
click: () => {
|
||||
openExternal(
|
||||
"https://github.com/Chia-Network/chia-blockchain/wiki"
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Frequently Asked Questions",
|
||||
click: () => {
|
||||
openExternal(
|
||||
"https://github.com/Chia-Network/chia-blockchain/wiki/FAQ"
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Release Notes",
|
||||
click: () => {
|
||||
openExternal(
|
||||
"https://github.com/Chia-Network/chia-blockchain/releases"
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Contribute on GitHub",
|
||||
click: () => {
|
||||
openExternal(
|
||||
"https://github.com/Chia-Network/chia-blockchain/blob/master/CONTRIBUTING.md"
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "separator",
|
||||
},
|
||||
{
|
||||
label: "Report an Issue...",
|
||||
click: () => {
|
||||
openExternal(
|
||||
"https://github.com/Chia-Network/chia-blockchain/issues"
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Chat on KeyBase",
|
||||
click: () => {
|
||||
openExternal("https://keybase.io/team/chia_network.public");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Follow on Twitter",
|
||||
click: () => {
|
||||
openExternal("https://twitter.com/chia_project");
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
if (process.platform === "darwin") {
|
||||
// Chia Blockchain menu (Mac)
|
||||
template.unshift({
|
||||
label: "Chia",
|
||||
submenu: [
|
||||
{
|
||||
label: "About " + "Chia Blockchain",
|
||||
click: () =>
|
||||
openAboutWindow({
|
||||
homepage: "https://www.chia.net/",
|
||||
bug_report_url:
|
||||
"https://github.com/Chia-Network/chia-blockchain/issues",
|
||||
icon_path: path.join(__dirname, "assets/img/chia_circle.png"),
|
||||
copyright: "Copyright (c) 2020 Chia Network",
|
||||
license: "Apache 2.0",
|
||||
}),
|
||||
},
|
||||
{
|
||||
type: "separator",
|
||||
},
|
||||
{
|
||||
role: "services",
|
||||
},
|
||||
{
|
||||
type: "separator",
|
||||
},
|
||||
{
|
||||
role: "hide",
|
||||
},
|
||||
{
|
||||
role: "hideothers",
|
||||
},
|
||||
{
|
||||
role: "unhide",
|
||||
},
|
||||
{
|
||||
type: "separator",
|
||||
},
|
||||
{
|
||||
role: "quit",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
// File menu (MacOS)
|
||||
template.splice(1, 1, {
|
||||
label: "File",
|
||||
submenu: [
|
||||
{
|
||||
role: "close",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
// Edit menu (MacOS)
|
||||
template[2].submenu.push(
|
||||
{
|
||||
type: "separator",
|
||||
},
|
||||
{
|
||||
label: "Speech",
|
||||
submenu: [
|
||||
{
|
||||
role: "startspeaking",
|
||||
},
|
||||
{
|
||||
role: "stopspeaking",
|
||||
},
|
||||
],
|
||||
}
|
||||
);
|
||||
|
||||
// Window menu (MacOS)
|
||||
template.splice(4, 1, {
|
||||
role: "window",
|
||||
submenu: [
|
||||
{
|
||||
role: "minimize",
|
||||
},
|
||||
{
|
||||
role: "zoom",
|
||||
},
|
||||
{
|
||||
type: "separator",
|
||||
},
|
||||
{
|
||||
role: "front",
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
if (process.platform === "linux" || process.platform === "win32") {
|
||||
// Help menu (Windows, Linux)
|
||||
template[4].submenu.push(
|
||||
{
|
||||
type: "separator",
|
||||
},
|
||||
{
|
||||
label: "About " + "Chia Blockchain",
|
||||
click: () =>
|
||||
openAboutWindow({
|
||||
homepage: "https://www.chia.net/",
|
||||
bug_report_url:
|
||||
"https://github.com/Chia-Network/chia-blockchain/issues",
|
||||
icon_path: path.join(__dirname, "assets/img/chia_circle.png"),
|
||||
copyright: "Copyright (c) 2020 Chia Network",
|
||||
license: "Apache 2.0",
|
||||
}),
|
||||
}
|
||||
);
|
||||
}
|
||||
// Add "File > Quit" menu item so Linux distros where the system tray icon is
|
||||
// missing will have a way to quit the app.
|
||||
if (process.platform === "linux") {
|
||||
// File menu (Linux)
|
||||
template[0].submenu.push({
|
||||
label: "Quit",
|
||||
click: () => app.quit(),
|
||||
});
|
||||
}
|
||||
|
||||
return template;
|
||||
}
|
||||
|
||||
/**
|
||||
* Open the given external protocol URL in the desktop’s default manner.
|
||||
*/
|
||||
function openExternal(url) {
|
||||
// console.log(`openExternal: ${url}`)
|
||||
shell.openExternal(url);
|
||||
}
|
||||
|
4
setup.py
4
setup.py
@ -6,11 +6,11 @@ dependencies = [
|
||||
"blspy==0.2.3", # Signature library
|
||||
"chiavdf==0.12.24", # timelord and vdf verification
|
||||
"chiabip158==0.16", # bip158-style wallet filters
|
||||
"chiapos==0.12.25", # proof of space
|
||||
"chiapos==0.12.26", # proof of space
|
||||
"clvm==0.4.1", # contract language
|
||||
"clvm-tools==0.1.4", # clvm compiler tools
|
||||
"aiohttp==3.6.2", # HTTP server for full node rpc
|
||||
"aiosqlite@git+https://github.com/mariano54/aiosqlite.git@a2c7946fd0150b6a3ecd5dd421cf6092f907eb0e#egg=aiosqlite", # asyncio wrapper for sqlite, to store blocks
|
||||
"aiosqlite@git+https://github.com/mariano54/aiosqlite.git@28cb5754deec562ac931da8fca799fb82df97a12#egg=aiosqlite", # asyncio wrapper for sqlite, to store blocks
|
||||
"bitstring==3.1.7", # Binary data management library
|
||||
"cbor2==5.1.2", # Used for network wire format
|
||||
"colorlog==4.2.1", # Adds color to logs
|
||||
|
Loading…
Reference in New Issue
Block a user