Add buttons to download base tune
This commit is contained in:
parent
ec11e3a7af
commit
c88c816872
|
@ -62,8 +62,9 @@
|
|||
<div id="detailsText" style="padding-left: 0.9em; padding-right: 0.9em; overflow-y: auto; height: 50vh;"></div>
|
||||
</div>
|
||||
<ul class="actions">
|
||||
<li><input type='button' id="btnDetails" value="Select Different Version" onclick="window.location.href='#loader';" /></li>
|
||||
<li><input type='button' id="btnChoosePort" value="Choose Port" onclick="window.location.href='#port';" /></li>
|
||||
<li><input type='button' value="Download Base Tune" id="btnBasetune" onclick="downloadTune();" /></li>
|
||||
<li><input type='button' id="btnDetails" value="Change Version" onclick="window.location.href='#loader';" /></li>
|
||||
<li><input type='button' id="btnChoosePort" value="Install" onclick="window.location.href='#port';" /></li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
@ -104,7 +105,8 @@
|
|||
</section>
|
||||
</div>
|
||||
<ul class="actions">
|
||||
<li><input type='button' value="Burn again" id="btnReinstall" onclick="uploadFW();" /></li>
|
||||
<li><input type='button' value="Burn again" id="btnReinstall" onclick="uploadFW();" /></li>
|
||||
<li><input type='button' value="Download Base Tune" id="btnBasetune" onclick="downloadTune();" /></li>
|
||||
<li><input type='button' value="Exit" id="btnExit" onclick="quit();" /></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
7
main.js
7
main.js
|
@ -70,6 +70,11 @@ ipcMain.on('download', (e, args) => {
|
|||
}
|
||||
|
||||
//console.log("Filename: " + fullFile );
|
||||
options = {};
|
||||
if(filename == "Speeduino%20base%20tune.msq")
|
||||
{
|
||||
options = { saveAs: true };
|
||||
}
|
||||
|
||||
fs.exists(fullFile, (exists) => {
|
||||
if (exists) {
|
||||
|
@ -77,7 +82,7 @@ ipcMain.on('download', (e, args) => {
|
|||
e.sender.send( "download complete", fullFile, "exists" );
|
||||
}
|
||||
else {
|
||||
download(BrowserWindow.getFocusedWindow(), args.url)
|
||||
download(BrowserWindow.getFocusedWindow(), args.url, options)
|
||||
.then(dl => e.sender.send( "download complete", dl.getSavePath(), dl.getState() ) )
|
||||
.catch(console.error);
|
||||
}
|
||||
|
|
15
renderer.js
15
renderer.js
|
@ -166,6 +166,21 @@ function downloadIni()
|
|||
|
||||
}
|
||||
|
||||
function downloadTune()
|
||||
{
|
||||
|
||||
var e = document.getElementById('versionsSelect');
|
||||
var DLurl = "https://raw.githubusercontent.com/noisymime/speeduino/" + e.options[e.selectedIndex].value + "/reference/Base%20Tunes/Speeduino%20base%20tune.msq";
|
||||
console.log("Downloading: " + DLurl);
|
||||
|
||||
//Download the ini file
|
||||
ipcRenderer.send("download", {
|
||||
url: DLurl,
|
||||
properties: {directory: "downloads"}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function uploadFW()
|
||||
{
|
||||
//Jump to the progress section
|
||||
|
|
Loading…
Reference in New Issue