Allow configuration of the connection manager URL.
This commit is contained in:
parent
4b6cf4b86a
commit
e38d68579d
2
main.js
2
main.js
|
@ -33,7 +33,7 @@ function createWindow () {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the browser window.
|
// Create the browser window.
|
||||||
mainWindow = new BrowserWindow(mainWindowOptions)
|
app.mainWindow = mainWindow = new BrowserWindow(mainWindowOptions)
|
||||||
mainWindow.maximize();
|
mainWindow.maximize();
|
||||||
|
|
||||||
// and load the index.html of the app.
|
// and load the index.html of the app.
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
*/
|
*/
|
||||||
const {app, Menu, MenuItem, BrowserWindow} = require('electron')
|
const {app, Menu, MenuItem, BrowserWindow} = require('electron')
|
||||||
const settingsService = require(__dirname + '/../modules/settings-service')
|
const settingsService = require(__dirname + '/../modules/settings-service')
|
||||||
|
const prompt = require('electron-prompt');
|
||||||
|
|
||||||
const menuService = {}
|
const menuService = {}
|
||||||
|
|
||||||
|
@ -31,6 +32,26 @@ menuService.createMenu = () => {
|
||||||
settingsService.set('minimizeOnClose', converse.getMenuItemById('minimize-on-close').checked);
|
settingsService.set('minimizeOnClose', converse.getMenuItemById('minimize-on-close').checked);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'Connection Manager...',
|
||||||
|
click: () => {
|
||||||
|
let currentValue = settingsService.get('connectionManager') || '';
|
||||||
|
prompt({
|
||||||
|
title: 'Connection manager'
|
||||||
|
, label: 'Connection manager URL:'
|
||||||
|
, value: currentValue
|
||||||
|
, resizable: true
|
||||||
|
, width: 620
|
||||||
|
, height: 180
|
||||||
|
}, app.mainWindow).then(function (newValue) {
|
||||||
|
if (newValue !== null && newValue !== currentValue) {
|
||||||
|
settingsService.set('connectionManager', newValue === '' ? null : newValue);
|
||||||
|
app.mainWindow.reload()
|
||||||
|
}
|
||||||
|
}).catch(function (ex) {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'separator',
|
type: 'separator',
|
||||||
},
|
},
|
||||||
|
|
|
@ -33,7 +33,8 @@
|
||||||
"electron-settings": "^4.0.2",
|
"electron-settings": "^4.0.2",
|
||||||
"github-buttons": "^2.8.0",
|
"github-buttons": "^2.8.0",
|
||||||
"keytar": "^7.3.0",
|
"keytar": "^7.3.0",
|
||||||
"open-iconic": "^1.1.1"
|
"open-iconic": "^1.1.1",
|
||||||
|
"electron-prompt": "^1.7.0"
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"appId": "com.denry.converse-desktop",
|
"appId": "com.denry.converse-desktop",
|
||||||
|
|
Loading…
Reference in New Issue