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