From d43d6f5c5ae39546501aa38a81b618a2f51b4a0b Mon Sep 17 00:00:00 2001 From: Mashintime Date: Sat, 21 Jan 2023 16:34:00 -0500 Subject: [PATCH] Move Tx progress updates to tnc message status --- gui/main.js | 1 + gui/preload-main.js | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gui/main.js b/gui/main.js index b618d842..724ab816 100644 --- a/gui/main.js +++ b/gui/main.js @@ -456,6 +456,7 @@ ipcMain.on('request-new-msg-received', (event, arg) => { }); ipcMain.on('request-update-transmission-status', (event, arg) => { chat.webContents.send('action-update-transmission-status', arg); + win.webContents.send('action-update-transmission-status',arg); }); ipcMain.on('request-open-tnc-log', () => { diff --git a/gui/preload-main.js b/gui/preload-main.js index 97ba277a..cab4b84c 100644 --- a/gui/preload-main.js +++ b/gui/preload-main.js @@ -1478,8 +1478,13 @@ document.getElementById('hamlib_rigctld_stop').addEventListener('click', () => { }) - - +//Listen for events caused by tnc 'tnc-message's +ipcRenderer.on('action-update-transmission-status', (event, arg) => { + var data =arg["data"][0]; + var txprog = document.getElementById("transmission_progress") + txprog.setAttribute("aria-valuenow", data.percent); + txprog.setAttribute("style", "width:" + data.percent + "%;"); +}); ipcRenderer.on('action-update-tnc-state', (event, arg) => { // update FFT @@ -1893,12 +1898,7 @@ var speedChartOptions = { var total_bytes = arg.total_bytes; } document.getElementById("total_bytes").innerHTML = total_bytes; - //Only update if values differ to prevent re-rendering control - var txprog = document.getElementById("transmission_progress") - if (txprog.getAttribute("aria-valuenow") != arg.arq_transmission_percent) - txprog.setAttribute("aria-valuenow", arg.arq_transmission_percent); - if (txprog.getAttribute("style") != "width:" + arg.arq_transmission_percent + "%;") - txprog.setAttribute("style", "width:" + arg.arq_transmission_percent + "%;"); + // UPDATE HEARD STATIONS var tbl = document.getElementById("heardstations");