added "open anyway?" option to "unable to import" dialog for variables

pull/89/head
jmoenig 2018-11-27 15:30:06 +01:00
rodzic 4c4a676f4f
commit 287764bfea
2 zmienionych plików z 14 dodań i 7 usunięć

Wyświetl plik

@ -5,6 +5,7 @@
* Objects: Cache stage>>penTrailsMorph to optimize collision detection
* Objects: Fixed a collision detection errror when objects are sub-pixel sized
* Objects: made importing files into variable watchers more lenient wrt to file types
* Objects: added "open anyway?" option to "unable to import" dialog for variables
## v4.2.2.8
### 2018-11-21

Wyświetl plik

@ -9616,13 +9616,16 @@ WatcherMorph.prototype.userMenu = function () {
function () {
var file;
function txtOnlyMsg(ftype) {
ide.inform(
function txtOnlyMsg(ftype, anyway) {
ide.confirm(
localize(
'Snap! can only import "text" files.\n' +
'You selected a file of type "' +
ftype +
'".'
) + '\n\n' + localize('Open anyway?'),
'Unable to import',
'Snap! can only import "text" files.\n' +
'You selected a file of type "' +
ftype +
'".'
anyway // callback
);
}
@ -9636,7 +9639,10 @@ WatcherMorph.prototype.userMenu = function () {
};
if (aFile.type.indexOf("text") === -1) {
txtOnlyMsg(aFile.type);
txtOnlyMsg(
aFile.type,
function () {frd.readAsText(aFile); }
);
} else {
frd.readAsText(aFile);
}