Set file type descriptions for open / save dialogs.

10.4.x-maintenance
mikeller 2018-07-17 22:01:18 +12:00
parent 1a2fe994fd
commit eec1388a2d
8 changed files with 11 additions and 11 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "betaflight-configurator",
"version": "10.3.0",
"version": "10.4.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -26,7 +26,7 @@ var LogoManager = LogoManager || {
},
// config for logo image selection dialog
acceptFileTypes: [
{ extensions: ['png', 'bmp'] },
{ description: 'images', extensions: ['png', 'bmp'] },
],
};

View File

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

View 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) {

View File

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

View File

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

View 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) {

View File

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