From 56fb5536b08b507279c729a4f94ffe1cf95dd676 Mon Sep 17 00:00:00 2001 From: Mashintime Date: Wed, 26 Apr 2023 01:19:02 +0000 Subject: [PATCH] Prettified Code! --- gui/main.js | 3 +-- gui/preload-main.js | 37 +++++++++++++++++++------------------ gui/src/index.html | 12 ++++++------ 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/gui/main.js b/gui/main.js index 61783ab4..d38fea4e 100644 --- a/gui/main.js +++ b/gui/main.js @@ -952,8 +952,7 @@ ipcMain.on("request-check-rigctld", (event, data) => { rigctld_events_wired = true; mainLog.info("Starting rigctld event listeners"); rigctld_connection_state = true; - Data["state"] = - "Connected"; + Data["state"] = "Connected"; Data["active"] = true; if (win !== null && win !== "" && typeof win != "undefined") { // try catch for being sure we have a clean app close diff --git a/gui/preload-main.js b/gui/preload-main.js index 3d669085..5478cd1f 100644 --- a/gui/preload-main.js +++ b/gui/preload-main.js @@ -1249,7 +1249,7 @@ window.addEventListener("DOMContentLoaded", () => { document.getElementById("discordUrl").addEventListener("click", () => { shell.openExternal("https://discord.gg/jnADeDtxUF"); }); - + //Track the number of times TNC has been started //So that warning is shown when using auto start and 2nd start //if hamlib is not running @@ -1403,14 +1403,18 @@ window.addEventListener("DOMContentLoaded", () => { FD.saveConfig(config, configPath); //Display a message if hamlib control is enabled and not running - if (config.radiocontrol == "rigctld" && rigctldActive == false && (config.auto_start == 0 || tncStartCount > 1 )) { - + if ( + config.radiocontrol == "rigctld" && + rigctldActive == false && + (config.auto_start == 0 || tncStartCount > 1) + ) { if ( - !window.confirm("Rig control is set to hamlib/rigctl, but it doesn't appear to be running.\n\nPlease start rigctld (start button in Rig Control area), or use rigctl mode 'none'. If you're having issues starting rigctld please review the Hamlib tab in settings.\n\nClick OK to continue or cancel to abort.") + !window.confirm( + "Rig control is set to hamlib/rigctl, but it doesn't appear to be running.\n\nPlease start rigctld (start button in Rig Control area), or use rigctl mode 'none'. If you're having issues starting rigctld please review the Hamlib tab in settings.\n\nClick OK to continue or cancel to abort." ) - { - return; - } + ) { + return; + } } daemon.startTNC( @@ -3215,17 +3219,14 @@ function checkRigctld() { ipcRenderer.on("action-check-rigctld", (event, data) => { document.getElementById("hamlib_rigctld_status").value = data["state"]; rigctldActive = data["active"]; - if (data["active"] == true) - { - document.getElementById("hamlib_rigctld_stop").disabled=false; - document.getElementById("hamlib_rigctld_start").disabled=true; - document.getElementById("testHamlib").disabled=false; - - - } else { - document.getElementById("hamlib_rigctld_stop").disabled=true; - document.getElementById("hamlib_rigctld_start").disabled=false; - document.getElementById("testHamlib").disabled=true; + if (data["active"] == true) { + document.getElementById("hamlib_rigctld_stop").disabled = false; + document.getElementById("hamlib_rigctld_start").disabled = true; + document.getElementById("testHamlib").disabled = false; + } else { + document.getElementById("hamlib_rigctld_stop").disabled = true; + document.getElementById("hamlib_rigctld_start").disabled = false; + document.getElementById("testHamlib").disabled = true; } }); diff --git a/gui/src/index.html b/gui/src/index.html index 96c106d1..bca66314 100644 --- a/gui/src/index.html +++ b/gui/src/index.html @@ -472,12 +472,12 @@ Start + class="btn btn-outline-danger" + type="button" + id="hamlib_rigctld_stop" + > + Stop +