Merge pull request #435 from DJ2LS/qm-gui

This commit is contained in:
DJ2LS 2023-05-26 07:30:14 +02:00 committed by GitHub
commit 36fcc5fee6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 28 deletions

View file

@ -71,6 +71,11 @@ var noise_level_raw = 0;
//Global version variable
var appVer = null;
//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
var tncStartCount = 0;
// START INTERVALL COMMAND EXECUTION FOR STATES
//setInterval(sock.getRxBuffer, 1000);
@ -1363,20 +1368,12 @@ window.addEventListener("DOMContentLoaded", () => {
document.getElementById("wikiUrl").addEventListener("click", () => {
shell.openExternal("https://wiki.freedata.app");
});
// Groups.io Link clicked
document.getElementById("groupsioUrl").addEventListener("click", () => {
shell.openExternal("https://groups.io/g/freedata");
});
// Discord Link clicked
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
var tncStartCount = 0;
// startTNC button clicked
document.getElementById("startTNC").addEventListener("click", () => {
tncStartCount++;
@ -1733,6 +1730,8 @@ window.addEventListener("DOMContentLoaded", () => {
sorthslTable(7);
resetSortIcon();
});
autostart_rigctld();
});
function resetSortIcon() {
@ -2406,7 +2405,15 @@ function updateHeardStations(arg) {
timestampRaw = arg.stations[i]["timestamp"];
var datetime = new Date(timestampRaw * 1000).toLocaleString(
navigator.language
navigator.language,{
hourCycle: 'h23',
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit"
}
);
//var hours = date.getHours();
//var minutes = "0" + date.getMinutes();
@ -2644,6 +2651,9 @@ ipcRenderer.on("action-update-daemon-state", (event, arg) => {
document.getElementById("audio_output_selectbox").add(option);
}
}
//Once audio devices are populated, try starting TNC if it hasn't been started yet in this session
//and if autostart is enabled
if (tncStartCount <= 0) autostart_tnc();
});
// ACTION UPDATE HAMLIB TEST
@ -2724,6 +2734,9 @@ ipcRenderer.on("action-update-tnc-connection", (event, arg) => {
//Set tuning for fancy graphics mode (high/low CPU)
set_CPU_mode();
//GUI will auto connect to TNC if already running, if that is the case increment start count if 0
if (tncStartCount==0) tncStartCount++;
} else {
/*
document.getElementById('hamlib_deviceid').disabled = false;
@ -3731,18 +3744,18 @@ function sorthslTable(n) {
}
}
function autostart() {
//Auto start stuff if option is enabled
function autostart_rigctld() {
if (config.auto_start == 1) {
//Start rigctld if radiocontrol is in correct mode and is not active
if (config.radiocontrol == "rigctld" && rigctldActive == false) {
//console.log("Autostarting rigctld");
document.getElementById("hamlib_rigctld_start").click();
}
//Now start TNC
document.getElementById("startTNC").click();
}
}
setTimeout(() => {
autostart();
}, 5000);
function autostart_tnc() {
if (config.auto_start == 1) {
//Now start TNC
document.getElementById("startTNC").click();
}
}

View file

@ -3855,17 +3855,6 @@
role="button"
></i>
</div>
<div class="btn-group">
<i
style="font-size: 1.5rem"
class="btn bi bi-envelope-at"
id="groupsioUrl"
data-bs-toggle="tooltip"
data-bs-trigger="hover"
title="Groups.io"
role="button"
></i>
</div>
<div class="btn-group">
<i
style="font-size: 1.5rem"