diff --git a/tabs/magnetometer.js b/tabs/magnetometer.js
index 9d139da0..1af6a504 100644
--- a/tabs/magnetometer.js
+++ b/tabs/magnetometer.js
@@ -1,5 +1,5 @@
'use strict';
-/*global chrome,GUI,BOARD_ALIGNMENT,TABS,nwdialog,helper,$*/
+/*global chrome,GUI,BOARD_ALIGNMENT,TABS,helper,$*/
TABS.magnetometer = {};
diff --git a/tabs/mission_control.js b/tabs/mission_control.js
index 04114afe..6433bdee 100644
--- a/tabs/mission_control.js
+++ b/tabs/mission_control.js
@@ -79,6 +79,10 @@ TABS.mission_control.initialize = function (callback) {
var textGeom;
let isOffline = false;
let rthUpdateInterval = 0;
+ let $safehomesTable;
+ let $safehomesTableBody;
+ let $waypointOptionsTable;
+ let $waypointOptionsTableBody;
if (GUI.active_tab != 'mission_control') {
GUI.active_tab = 'mission_control';
@@ -948,13 +952,22 @@ TABS.mission_control.initialize = function (callback) {
if (singleMissionActive()) {
return true;
} else if (confirm(localization.getMessage('confirm_overwrite_multimission_file_load_option'))) {
- nwdialog.setContext(document);
- nwdialog.openFileDialog(function(result) {
- loadMissionFile(result);
- multimissionCount = 0;
- multimission.flush();
- renderMultimissionTable();
- })
+ var options = {
+ filters: [ { name: "Mission file", extensions: ['mission'] } ]
+ };
+ dialog.showOpenDialog(options).then(result => {
+ if (result.canceled) {
+ console.log('No file selected');
+ return;
+ }
+
+ if (result.filePaths.length == 1) {
+ loadMissionFile(result.filePaths[0]);
+ multimissionCount = 0;
+ multimission.flush();
+ renderMultimissionTable();
+ }
+ });
}
return false;
}
@@ -2139,7 +2152,7 @@ TABS.mission_control.initialize = function (callback) {
const returnAltitude = checkAltElevSanity(false, selectedMarker.getAlt(), elevationAtWP, selectedMarker.getP3());
selectedMarker.setAlt(returnAltitude);
$('#pointAlt').val(selectedMarker.getAlt());
- altitudeMeters = app.ConvertCentimetersToMeters(selectedMarker.getAlt());
+ let altitudeMeters = app.ConvertCentimetersToMeters(selectedMarker.getAlt());
$('#altitudeInMeters').text(` ${altitudeMeters}m`);
mission.updateWaypoint(selectedMarker);
@@ -2416,17 +2429,30 @@ TABS.mission_control.initialize = function (callback) {
if (!fileLoadMultiMissionCheck()) return;
if (markers.length && !confirm(localization.getMessage('confirm_delete_all_points'))) return;
- nwdialog.setContext(document);
- nwdialog.openFileDialog('.mission', function(result) {
- loadMissionFile(result);
+ var options = {
+ filters: [ { name: "Mission file", extensions: ['mission'] } ]
+ };
+ dialog.showOpenDialog(options).then(result => {
+ if (result.canceled) {
+ console.log('No file selected');
+ return;
+ }
+ if (result.filePaths.length == 1) {
+ loadMissionFile(result.filePaths[0]);
+ }
})
});
$('#saveFileMissionButton').on('click', function () {
- nwdialog.setContext(document);
- nwdialog.saveFileDialog('', '.mission', function(result) {
- saveMissionFile(result);
- })
+ var options = {
+ filters: [ { name: "Mission file", extensions: ['mission'] } ]
+ };
+ dialog.showSaveDialog(options).then(result => {
+ if (result.canceled) {
+ return;
+ }
+ saveMissionFile(result.filePath);
+ });
});
$('#loadMissionButton').on('click', function () {
diff --git a/tabs/onboard_logging.js b/tabs/onboard_logging.js
index 535b9e77..c4e9438d 100644
--- a/tabs/onboard_logging.js
+++ b/tabs/onboard_logging.js
@@ -1,4 +1,4 @@
-/*global $,MSP,MSPCodes,TABS,GUI,CONFIGURATOR,helper,mspHelper,nwdialog,SDCARD,chrome*/
+/*global $,MSP,MSPCodes,TABS,GUI,CONFIGURATOR,helper,mspHelper,SDCARD,chrome*/
'use strict';
var
@@ -394,9 +394,15 @@ TABS.onboard_logging.initialize = function (callback) {
+ zeroPad(date.getDate(), 2) + '_' + zeroPad(date.getHours(), 2) + zeroPad(date.getMinutes(), 2)
+ zeroPad(date.getSeconds(), 2) + '.TXT';
- nwdialog.setContext(document);
- nwdialog.saveFileDialog(filename, function(file) {
- onComplete(file);
+ var options = {
+ defaultPath: filename,
+ filters: [ { name: "TXT file", extensions: ['txt'] } ]
+ };
+ dialog.showSaveDialog(options).then(result => {
+ if (result.canceled) {
+ return;
+ }
+ onComplete(result.filePath);
});
}
diff --git a/tabs/osd.js b/tabs/osd.js
index 29794ce1..9475189e 100644
--- a/tabs/osd.js
+++ b/tabs/osd.js
@@ -1,4 +1,4 @@
-/*global $,nwdialog*/
+/*global $*/
'use strict';
const inflection = require( 'inflection' );
@@ -3315,58 +3315,6 @@ TABS.osd.initialize = function (callback) {
}
});
- $(document).on('click', 'span.progressLabel a.save_font', function () {
- //noinspection JSUnresolvedVariable
- chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: 'baseflight', accepts: [
- {extensions: ['mcm']}
- ]}, function (fileEntry) {
- //noinspection JSUnresolvedVariable
- if (chrome.runtime.lastError) {
- //noinspection JSUnresolvedVariable
- console.error(chrome.runtime.lastError.message);
- return;
- }
-
- //noinspection JSUnresolvedVariable
- chrome.fileSystem.getDisplayPath(fileEntry, function (path) {
- console.log('Saving firmware to: ' + path);
-
- // check if file is writable
- //noinspection JSUnresolvedVariable
- chrome.fileSystem.isWritableEntry(fileEntry, function (isWritable) {
- if (isWritable) {
- var blob = new Blob([intel_hex], {type: 'text/plain'});
-
- fileEntry.createWriter(function (writer) {
- var truncated = false;
-
- writer.onerror = function (e) {
- console.error(e);
- };
-
- writer.onwriteend = function () {
- if (!truncated) {
- // onwriteend will be fired again when truncation is finished
- truncated = true;
- writer.truncate(blob.size);
-
- return;
- }
- };
-
- writer.write(blob);
- }, function (e) {
- console.error(e);
- });
- } else {
- console.log('You don\'t have write permissions for this file, sorry.');
- GUI.log(localization.getMessage('writePermissionsForFile'));
- }
- });
- });
- });
- });
-
$('.update_preview').on('change', function () {
if (OSD.data) {
// Force an OSD redraw by saving any element
diff --git a/tabs/receiver.html b/tabs/receiver.html
index e71a64e3..fbea3946 100644
--- a/tabs/receiver.html
+++ b/tabs/receiver.html
@@ -37,7 +37,7 @@