Set file type descriptions for open / save dialogs.
parent
1a2fe994fd
commit
eec1388a2d
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "betaflight-configurator",
|
||||
"version": "10.3.0",
|
||||
"version": "10.4.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -26,7 +26,7 @@ var LogoManager = LogoManager || {
|
|||
},
|
||||
// config for logo image selection dialog
|
||||
acceptFileTypes: [
|
||||
{ extensions: ['png', 'bmp'] },
|
||||
{ description: 'images', extensions: ['png', 'bmp'] },
|
||||
],
|
||||
};
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ function configuration_backup(callback) {
|
|||
var filename = generateFilename(prefix, suffix);
|
||||
|
||||
var accepts = [{
|
||||
extensions: [suffix]
|
||||
description: suffix.toUpperCase() + ' files', extensions: [suffix]
|
||||
}];
|
||||
|
||||
// create or load the file
|
||||
|
@ -277,7 +277,7 @@ function configuration_restore(callback) {
|
|||
var chosenFileEntry = null;
|
||||
|
||||
var accepts = [{
|
||||
extensions: ['json']
|
||||
description: 'JSON files', extensions: ['json']
|
||||
}];
|
||||
|
||||
// load up the file
|
||||
|
|
|
@ -67,7 +67,7 @@ TABS.cli.initialize = function (callback) {
|
|||
var filename = generateFilename(prefix, suffix);
|
||||
|
||||
var accepts = [{
|
||||
extensions: [suffix],
|
||||
description: suffix.toUpperCase() + ' files', extensions: [suffix],
|
||||
}];
|
||||
|
||||
chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: filename, accepts: accepts}, function(entry) {
|
||||
|
|
|
@ -325,7 +325,7 @@ TABS.firmware_flasher.initialize = function (callback) {
|
|||
|
||||
// UI Hooks
|
||||
$('a.load_file').click(function () {
|
||||
chrome.fileSystem.chooseEntry({type: 'openFile', accepts: [{extensions: ['hex']}]}, function (fileEntry) {
|
||||
chrome.fileSystem.chooseEntry({type: 'openFile', accepts: [{description: 'HEX files', extensions: ['hex']}]}, function (fileEntry) {
|
||||
if (chrome.runtime.lastError) {
|
||||
console.error(chrome.runtime.lastError.message);
|
||||
|
||||
|
@ -465,7 +465,7 @@ TABS.firmware_flasher.initialize = function (callback) {
|
|||
|
||||
$(document).on('click', 'span.progressLabel a.save_firmware', function () {
|
||||
var summary = $('select[name="firmware_version"] option:selected').data('summary');
|
||||
chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: summary.file, accepts: [{extensions: ['hex']}]}, function (fileEntry) {
|
||||
chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: summary.file, accepts: [{description: 'HEX files', extensions: ['hex']}]}, function (fileEntry) {
|
||||
if (chrome.runtime.lastError) {
|
||||
console.error(chrome.runtime.lastError.message);
|
||||
return;
|
||||
|
|
|
@ -236,7 +236,7 @@ TABS.logging.initialize = function (callback) {
|
|||
var filename = generateFilename(prefix, suffix);
|
||||
|
||||
var accepts = [{
|
||||
extensions: [suffix],
|
||||
description: suffix.toUpperCase() + ' files', extensions: [suffix],
|
||||
}];
|
||||
|
||||
// create or load the file
|
||||
|
|
|
@ -445,7 +445,7 @@ TABS.onboard_logging.initialize = function (callback) {
|
|||
var filename = generateFilename(prefix, suffix);
|
||||
|
||||
chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: filename,
|
||||
accepts: [{extensions: [suffix]}]}, function(fileEntry) {
|
||||
accepts: [{description: suffix.toUpperCase() + ' files', extensions: [suffix]}]}, function(fileEntry) {
|
||||
var error = chrome.runtime.lastError;
|
||||
|
||||
if (error) {
|
||||
|
|
|
@ -129,7 +129,7 @@ FONT.parseMCMFontFile = function(data) {
|
|||
|
||||
FONT.openFontFile = function($preview) {
|
||||
return new Promise(function(resolve) {
|
||||
chrome.fileSystem.chooseEntry({type: 'openFile', accepts: [{extensions: ['mcm']}]}, function (fileEntry) {
|
||||
chrome.fileSystem.chooseEntry({type: 'openFile', accepts: [{description: 'MCM files', extensions: ['mcm']}]}, function (fileEntry) {
|
||||
FONT.data.loaded_font_file = fileEntry.name;
|
||||
if (chrome.runtime.lastError) {
|
||||
console.error(chrome.runtime.lastError.message);
|
||||
|
@ -2047,7 +2047,7 @@ TABS.osd.initialize = function (callback) {
|
|||
})
|
||||
|
||||
$(document).on('click', 'span.progressLabel a.save_font', function () {
|
||||
chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: 'baseflight', accepts: [{extensions: ['mcm']}]}, function (fileEntry) {
|
||||
chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: 'baseflight', accepts: [{description: 'MCM files', extensions: ['mcm']}]}, function (fileEntry) {
|
||||
if (chrome.runtime.lastError) {
|
||||
console.error(chrome.runtime.lastError.message);
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue