Allow configuration of the connection manager URL.

This commit is contained in:
Keith Maika 2022-02-14 13:33:59 -05:00
parent 4b6cf4b86a
commit e38d68579d
No known key found for this signature in database
GPG Key ID: F71740E8722C75F1
3 changed files with 24 additions and 2 deletions

View File

@ -33,7 +33,7 @@ function createWindow () {
}
// Create the browser window.
mainWindow = new BrowserWindow(mainWindowOptions)
app.mainWindow = mainWindow = new BrowserWindow(mainWindowOptions)
mainWindow.maximize();
// and load the index.html of the app.

View File

@ -3,6 +3,7 @@
*/
const {app, Menu, MenuItem, BrowserWindow} = require('electron')
const settingsService = require(__dirname + '/../modules/settings-service')
const prompt = require('electron-prompt');
const menuService = {}
@ -31,6 +32,26 @@ menuService.createMenu = () => {
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',
},

View File

@ -33,7 +33,8 @@
"electron-settings": "^4.0.2",
"github-buttons": "^2.8.0",
"keytar": "^7.3.0",
"open-iconic": "^1.1.1"
"open-iconic": "^1.1.1",
"electron-prompt": "^1.7.0"
},
"build": {
"appId": "com.denry.converse-desktop",