WIP Settings and Updater

updater not yet working, moved settings to settings modal and started working on new updater
This commit is contained in:
dj2ls 2022-04-18 11:13:53 +02:00
parent 88149830df
commit b1cebf0905
4 changed files with 62 additions and 20 deletions

View file

@ -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();
});

View file

@ -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';
}

View file

@ -757,22 +757,13 @@
<div class="col">
<div class="card text-dark mb-0">
<div class="card-header p-1">
<i class="bi bi-sliders2" style="font-size: 1rem; color: black;"></i> <strong>TNC SETTINGS</strong>
<i class="bi bi-sliders2" style="font-size: 1rem; color: black;"></i> <strong>Auto-Updater</strong>
</div>
<div class="card-body p-2 mb-1">
<div class="form-check form-switch form-check-inline">
<input class="form-check-input" type="checkbox" id="fftSwitch">
<label class="form-check-label" for="fftSwitch">Waterfall</label>
</div>
<div class="form-check form-switch form-check-inline">
<input class="form-check-input" type="checkbox" id="scatterSwitch">
<label class="form-check-label" for="scatterSwitch">Scatter</label>
</div>
<div class="form-check form-switch form-check-inline">
<input class="form-check-input" type="checkbox" id="500HzModeSwitch">
<label class="form-check-label" for="500HzModeSwitch">500Hz (HF)</label>
</div>
<button class="btn btn-secondary btn-sm" id="updater_channel" type="button" disabled>...</button>
<button class="btn btn-secondary btn-sm" id="updater_status" type="button" disabled>...</button>
<button class="btn btn-secondary btn-sm" id="updater_changelog" type="button" style="display:none;">Changelog</button>
<button class="btn btn-primary btn-sm" id="update_and_install" type="button" style="display:none;">Install & Restart</button>
<!--<button class="btn btn-secondary btn-sm" id="python_version" type="button" disabled>Python</button>-->
<!--<button class="btn btn-secondary btn-sm" id="node_version" type="button" disabled>Node</button>-->
@ -1320,6 +1311,36 @@
</div>
</label>
</div>
<div class="input-group input-group-sm mb-1">
<label class="input-group-text">Enable Waterfall data</label>
<label class="input-group-text">
<div class="form-check form-switch form-check-inline">
<input class="form-check-input" type="checkbox" id="fftSwitch">
<label class="form-check-label" for="fftSwitch">Waterfall</label>
</div>
</label>
</div>
<div class="input-group input-group-sm mb-1">
<label class="input-group-text">Enable Scatter diagram data</label>
<label class="input-group-text">
<div class="form-check form-switch form-check-inline">
<input class="form-check-input" type="checkbox" id="scatterSwitch">
<label class="form-check-label" for="scatterSwitch">Scatter</label>
</div>
</label>
</div>
<div class="input-group input-group-sm mb-1">
<label class="input-group-text">Enable 500Hz mode</label>
<label class="input-group-text">
<div class="form-check form-switch form-check-inline">
<input class="form-check-input" type="checkbox" id="500HzModeSwitch">
<label class="form-check-label" for="500HzModeSwitch">500Hz</label>
</div>
</label>
</div>

View file

@ -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;