Merge pull request #407 from warhog/master

Add confirmation to reset settings button to avoid accidentally reset settings
pull/332/head^2
Konstantin Sharlaimov 7 years ago committed by GitHub
commit 891d5486b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2465,5 +2465,8 @@
}, },
"servoMixerAdd": { "servoMixerAdd": {
"message": "Add new mixer rule" "message": "Add new mixer rule"
},
"confirm_reset_settings": {
"message": "Do you really want to reset all settings?\nATTENTION: All settings are lost! You have to setup the whole aircraft after this operation!"
} }
} }

@ -62,13 +62,15 @@ TABS.setup.initialize = function (callback) {
self.initializeInstruments(); self.initializeInstruments();
$('a.resetSettings').click(function () { $('a.resetSettings').click(function () {
MSP.send_message(MSPCodes.MSP_RESET_CONF, false, false, function () { if (confirm(chrome.i18n.getMessage('confirm_reset_settings'))) {
GUI.log(chrome.i18n.getMessage('initialSetupSettingsRestored')); MSP.send_message(MSPCodes.MSP_RESET_CONF, false, false, function () {
GUI.log(chrome.i18n.getMessage('initialSetupSettingsRestored'));
GUI.tab_switch_cleanup(function () { GUI.tab_switch_cleanup(function () {
TABS.setup.initialize(); TABS.setup.initialize();
});
}); });
}); }
}); });
// display current yaw fix value (important during tab re-initialization) // display current yaw fix value (important during tab re-initialization)

Loading…
Cancel
Save