mirror of
https://github.com/cryptoadvance/specter-desktop.git
synced 2026-08-13 12:33:29 +02:00
UIUX: Consistent use of "Settings" in Electron app and specterd args parsing (#2288)
* consistent usage of "settings" in menus * simpler specterd cli args code * Change cli args label to illustrate need of "=" sign * Change headline in settings.html --------- Co-authored-by: k9ert <k9ert@gmx.de>
This commit is contained in:
parent
45c3a32041
commit
b004ca2e30
2 changed files with 15 additions and 16 deletions
|
|
@ -301,7 +301,7 @@ app.whenReady().then(() => {
|
|||
trayMenu = [
|
||||
{ label: 'Launching Specter ...', enabled: false },
|
||||
{ label: 'Show Specter', click() { mainWindow.show() }},
|
||||
{ label: 'Preferences', click() { openPreferences() }},
|
||||
{ label: 'Settings', click() { openPreferences() }},
|
||||
{ label: 'Quit', click() { quitSpecterd(); app.quit() } },
|
||||
]
|
||||
tray.setToolTip('Specter')
|
||||
|
|
@ -381,7 +381,7 @@ function initMainWindow() {
|
|||
|
||||
mainWindow.webContents.on("did-fail-load", function() {
|
||||
mainWindow.loadURL(`file://${__dirname}/splash.html`);
|
||||
updatingLoaderMsg(`Failed to load: ${appSettings.specterURL}<br>Please make sure the URL is entered correctly in the Preferences and try again...`)
|
||||
updatingLoaderMsg(`Failed to load: ${appSettings.specterURL}<br>Please make sure the URL is entered correctly in the settings and try again...`)
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -490,16 +490,15 @@ function startSpecterd(specterdPath) {
|
|||
specterdArgs.push("--no-filelog")
|
||||
if (hwiBridgeMode) specterdArgs.push('--hwibridge')
|
||||
if (appSettings.specterdCLIArgs != '') {
|
||||
if (specterdArgs == null) {
|
||||
specterdArgs = []
|
||||
}
|
||||
// User has inputed cli arguments in the UI
|
||||
let specterdExtraArgs = appSettings.specterdCLIArgs.split(' ')
|
||||
specterdExtraArgs.forEach((arg, index) => specterdExtraArgs[index] = arg.trim())
|
||||
specterdArgs = specterdArgs.concat(specterdExtraArgs)
|
||||
specterdExtraArgs.forEach((arg) => {
|
||||
// Ensures that whitespaces are not used as cli arguments
|
||||
if (arg != '') {
|
||||
specterdArgs.push(arg)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
logger.info(`Starting specterd ${specterdPath} ${specterdArgs}`);
|
||||
// locale fix (copying from nodejs-env + adding locales)
|
||||
const options = {
|
||||
env: { ...process.env}
|
||||
|
|
@ -657,7 +656,7 @@ function setMainMenu() {
|
|||
if (platformName == 'osx') {
|
||||
menu[0].submenu.splice(1, 0,
|
||||
{
|
||||
label: 'Preferences',
|
||||
label: 'Settings...', // This is a naming convention on MacOS. If you use just "Preferences", it gets translated to "Settings..." on MacOS.
|
||||
click: openPreferences,
|
||||
accelerator: "CmdOrCtrl+,"
|
||||
}
|
||||
|
|
@ -666,7 +665,7 @@ function setMainMenu() {
|
|||
{
|
||||
label: 'Specter Logs',
|
||||
click: openErrorLog,
|
||||
accelerator: "CmdOrCtrl+,"
|
||||
accelerator: "CmdOrCtrl+L"
|
||||
}
|
||||
);
|
||||
} else {
|
||||
|
|
@ -674,14 +673,14 @@ function setMainMenu() {
|
|||
label: 'Specter',
|
||||
submenu: [
|
||||
{
|
||||
label: 'Preferences',
|
||||
label: 'Settings',
|
||||
click: openPreferences,
|
||||
accelerator: "CmdOrCtrl+,"
|
||||
},
|
||||
{
|
||||
label: 'Specter Logs',
|
||||
click: openErrorLog,
|
||||
accelerator: "CmdOrCtrl+,"
|
||||
accelerator: "CmdOrCtrl+L"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
<body class="flex flex-col items-center">
|
||||
<div class="max-w-[700px] w-[700px]">
|
||||
<h1 class="mt-10">Preferences</h1>
|
||||
<h1 class="mt-10">Settings</h1>
|
||||
<form action="">
|
||||
<div>
|
||||
<h3 class="mt-8">Do you want to connect to a remote Specter?</h3>
|
||||
|
|
@ -90,7 +90,7 @@
|
|||
|
||||
<div class="floating-wrapper">
|
||||
<input id="specterd-cli-args" class="floating-input peer" type="text" placeholder=" " />
|
||||
<label class="floating-label">Specterd CLI args (example: --tor --port=25441)</label>
|
||||
<label class="floating-label">Specterd CLI args (--tor). Use an equal sign to specify values (--port=25441)</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue