From b1cebf09058948c7b0cf9851ca34f380738963a8 Mon Sep 17 00:00:00 2001 From: dj2ls Date: Mon, 18 Apr 2022 11:13:53 +0200 Subject: [PATCH] WIP Settings and Updater updater not yet working, moved settings to settings modal and started working on new updater --- gui/main.js | 4 +-- gui/preload-main.js | 27 ++++++++++++++++--- gui/src/index.html | 49 +++++++++++++++++++++++++---------- gui/src/waterfall/spectrum.js | 2 +- 4 files changed, 62 insertions(+), 20 deletions(-) diff --git a/gui/main.js b/gui/main.js index 75d59860..b64b6978 100644 --- a/gui/main.js +++ b/gui/main.js @@ -538,8 +538,8 @@ autoUpdater.on('update-downloaded', (info) => { // we need to call this at this point. // if an update is available and we are force closing the app // the entire screen crashes... - mainLog.info('quit application and install update'); - autoUpdater.quitAndInstall(); + //mainLog.info('quit application and install update'); + //autoUpdater.quitAndInstall(); }); diff --git a/gui/preload-main.js b/gui/preload-main.js index 8a6b5a2d..6bfb2620 100644 --- a/gui/preload-main.js +++ b/gui/preload-main.js @@ -156,6 +156,7 @@ document.getElementById('openReceivedFilesFolder').addEventListener('click', () // Update channel selector document.getElementById("update_channel_selector").value = config.update_channel; + document.getElementById("updater_channel").innerHTML = config.update_channel; // Update tuning range fmin fmax document.getElementById("tuning_range_fmin").value = config.tuning_range_fmin; @@ -193,7 +194,7 @@ document.getElementById('openReceivedFilesFolder').addEventListener('click', () //document.getElementById("radio-control-rigctl").style.visibility = 'hidden'; document.getElementById("radio-control-rigctld").style.visibility = 'hidden'; //document.getElementById("radio-control-rigctl").style.display = 'none'; - document.getElementById("radio-control-rigctld").style.display = 'none'; + document.getElementById("radio-control-rigctld").style.display = 'none'; document.getElementById("radio-control-direct").style.display = 'block'; document.getElementById("radio-control-direct").style.visibility = 'visible'; @@ -1855,12 +1856,23 @@ ipcRenderer.on('action-updater', (event, arg) => { ); // Returns a Bootstrap toast instance toast.show(); document.title = "FreeDATA by DJ2LS" + ' - v' + arg.version; + document.getElementById("updater_status").innerHTML = "checking for update..." + document.getElementById("updater_status").setAttribute("class") = "btn btn-secondary btn-sm" + document.getElementById("update_and_install").style.display = 'none'; } if (arg.status == "update-downloaded"){ var toast = bootstrap.Toast.getOrCreateInstance( document.getElementById('toastUpdateDownloaded') ); // Returns a Bootstrap toast instance toast.show(); + document.getElementById("updater_status").innerHTML = "update downloaded..." + document.getElementById("updater_status").setAttribute("class") = "btn btn-secondary btn-sm" + document.getElementById("update_and_install").style.display = 'block'; + + // HERE WE NEED TO RUN THIS SOMEHOW... + //mainLog.info('quit application and install update'); + //autoUpdater.quitAndInstall(); + } if (arg.status == "update-not-available"){ bootstrap.Toast.getOrCreateInstance(document.getElementById('toastUpdateChecking')).hide(); @@ -1868,6 +1880,9 @@ ipcRenderer.on('action-updater', (event, arg) => { document.getElementById('toastUpdateNotAvailable') ); // Returns a Bootstrap toast instance toast.show(); + document.getElementById("updater_status").innerHTML = "update not available" + document.getElementById("updater_status").setAttribute("class") = "btn btn-secondary btn-sm" + document.getElementById("update_and_install").style.display = 'none'; } if (arg.status == "update-available"){ @@ -1876,15 +1891,21 @@ ipcRenderer.on('action-updater', (event, arg) => { document.getElementById('toastUpdateAvailable') ); // Returns a Bootstrap toast instance toast.show(); + document.getElementById("updater_status").innerHTML = "update available..." + document.getElementById("updater_status").setAttribute("class") = "btn btn-secondary btn-sm" + document.getElementById("update_and_install").style.display = 'block'; + } + if (arg.status == "error"){ var toast = bootstrap.Toast.getOrCreateInstance( document.getElementById('toastUpdateNotChecking') ); // Returns a Bootstrap toast instance toast.show(); - - + document.getElementById("updater_status").innerHTML = "update error..." + document.getElementById("updater_status").setAttribute("class") = "btn btn-danger btn-sm" + document.getElementById("update_and_install").style.display = 'none'; } diff --git a/gui/src/index.html b/gui/src/index.html index 17bbfedd..77f5463c 100644 --- a/gui/src/index.html +++ b/gui/src/index.html @@ -757,22 +757,13 @@
- TNC SETTINGS + Auto-Updater
-
- - -
-
- - -
-
- - -
- + + + + @@ -1320,6 +1311,36 @@
+ +
+ + +
+
+ + +
+
+ + +
+ + diff --git a/gui/src/waterfall/spectrum.js b/gui/src/waterfall/spectrum.js index 74beabaa..24cc9067 100644 --- a/gui/src/waterfall/spectrum.js +++ b/gui/src/waterfall/spectrum.js @@ -383,7 +383,7 @@ Spectrum.prototype.onKeypress = function(e) { function Spectrum(id, options) { // Handle options - this.centerHz = (options && options.centerHz) ? options.centerHz : 0; + this.centerHz = (options && options.centerHz) ? options.centerHz : 1500; this.spanHz = (options && options.spanHz) ? options.spanHz : 0; this.wf_size = (options && options.wf_size) ? options.wf_size : 0; this.wf_rows = (options && options.wf_rows) ? options.wf_rows : 1024;