[Updated docs] [Launch hidden option]

This commit is contained in:
Scott E. Graves
2018-11-09 11:42:37 -06:00
parent 741dc9a260
commit f264dad6ce
3 changed files with 40 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
# Changelog # # Changelog #
## 1.0.2 ## ## 1.0.2 ##
* Launch hidden (notification icon only)
* OS X support * OS X support
* SiaPrime support * SiaPrime support

View File

@@ -1,8 +1,9 @@
# Repertory UI # Repertory UI
![alt text](https://image.ibb.co/edOg5A/repertory-ui-1-0-2.png) ![alt text](https://image.ibb.co/edOg5A/repertory-ui-1-0-2.png)
### GUI for [Repertory](https://bitbucket.org/blockstorage/repertory) ### ### GUI for [Repertory](https://bitbucket.org/blockstorage/repertory) ###
Repertory allows you to mount Hyperspace or Sia blockchain storage solutions via FUSE on Linux/OS X or via WinFSP on Windows. Repertory allows you to mount Sia, SiaPrime and/or Hyperspace blockchain storage solutions via FUSE on Linux/OS X or via WinFSP on Windows.
# Downloads # # Downloads #
* [Repertory UI v1.0.2 OS X]()
* [Repertory UI v1.0.2 Windows 64-bit]() * [Repertory UI v1.0.2 Windows 64-bit]()
# Supported Platforms # # Supported Platforms #
* OS X * OS X

View File

@@ -19,14 +19,18 @@ let mainWindow;
let mainWindowTray; let mainWindowTray;
let mountedPIDs = []; let mountedPIDs = [];
let expectedUnmount = {}; let expectedUnmount = {};
let launchHidden = false;
function createWindow() { function createWindow() {
loadUiSettings();
// Create the browser window. // Create the browser window.
const height = process.env.ELECTRON_START_URL ? 394 : 374; const height = process.env.ELECTRON_START_URL ? 394 : 374;
mainWindow = new BrowserWindow({ mainWindow = new BrowserWindow({
width: 425, width: 425,
height: height, height: height,
resizable: false, resizable: false,
show: !launchHidden,
title: 'Repertory UI', title: 'Repertory UI',
webPreferences: { webPreferences: {
webSecurity: !process.env.ELECTRON_START_URL webSecurity: !process.env.ELECTRON_START_URL
@@ -72,7 +76,8 @@ function createWindow() {
} else { } else {
mainWindow.hide(); mainWindow.hide();
} }
} },
checked: !launchHidden,
}, },
{ {
label: 'Auto-start', type: 'checkbox', click(item) { label: 'Auto-start', type: 'checkbox', click(item) {
@@ -86,6 +91,16 @@ function createWindow() {
{ {
type: 'separator' type: 'separator'
}, },
{
label: 'Launch Hidden', type: 'checkbox', click(item) {
launchHidden = !!item.checked;
saveUiSettings();
},
checked: launchHidden,
},
{
type: 'separator'
},
{ {
label: 'Exit', click(item) { label: 'Exit', click(item) {
app.quit(); app.quit();
@@ -93,7 +108,6 @@ function createWindow() {
} }
]); ]);
mainContextWindow.items[0].checked = true;
autoLauncher autoLauncher
.isEnabled() .isEnabled()
.then((enabled) => { .then((enabled) => {
@@ -145,6 +159,27 @@ if (!instanceLock) {
}); });
} }
const loadUiSettings = () => {
const settingFile = path.join(helpers.resolvePath(Constants.DATA_LOCATIONS[os.platform()]), 'ui.json');
try {
if (fs.statSync(settingFile).isFile()) {
const settings = JSON.parse(fs.readFileSync(settingFile, 'utf8'));
launchHidden = settings.launch_hidden;
}
} catch (e) {
}
};
const saveUiSettings = () => {
const settingFile = path.join(helpers.resolvePath(Constants.DATA_LOCATIONS[os.platform()]), 'ui.json');
try {
fs.writeFileSync(settingFile, JSON.stringify({
launch_hidden: launchHidden,
}), 'utf-8');
} catch (e) {
}
};
const standardIPCReply = (event, channel, data, error) => { const standardIPCReply = (event, channel, data, error) => {
event.sender.send(channel, { event.sender.send(channel, {
data: { data: {