[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 #
## 1.0.2 ##
* Launch hidden (notification icon only)
* OS X support
* SiaPrime support

View File

@@ -1,8 +1,9 @@
# Repertory UI
![alt text](https://image.ibb.co/edOg5A/repertory-ui-1-0-2.png)
### 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 #
* [Repertory UI v1.0.2 OS X]()
* [Repertory UI v1.0.2 Windows 64-bit]()
# Supported Platforms #
* OS X

View File

@@ -19,14 +19,18 @@ let mainWindow;
let mainWindowTray;
let mountedPIDs = [];
let expectedUnmount = {};
let launchHidden = false;
function createWindow() {
loadUiSettings();
// Create the browser window.
const height = process.env.ELECTRON_START_URL ? 394 : 374;
mainWindow = new BrowserWindow({
width: 425,
height: height,
resizable: false,
show: !launchHidden,
title: 'Repertory UI',
webPreferences: {
webSecurity: !process.env.ELECTRON_START_URL
@@ -72,7 +76,8 @@ function createWindow() {
} else {
mainWindow.hide();
}
}
},
checked: !launchHidden,
},
{
label: 'Auto-start', type: 'checkbox', click(item) {
@@ -86,6 +91,16 @@ function createWindow() {
{
type: 'separator'
},
{
label: 'Launch Hidden', type: 'checkbox', click(item) {
launchHidden = !!item.checked;
saveUiSettings();
},
checked: launchHidden,
},
{
type: 'separator'
},
{
label: 'Exit', click(item) {
app.quit();
@@ -93,7 +108,6 @@ function createWindow() {
}
]);
mainContextWindow.items[0].checked = true;
autoLauncher
.isEnabled()
.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) => {
event.sender.send(channel, {
data: {