Skip to content

Commit

Permalink
fix: open report from dialog
Browse files Browse the repository at this point in the history
Fixes #25
  • Loading branch information
marisademeglio committed Oct 11, 2018
1 parent 5049636 commit 590d2dc
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/shared/helpers/fileDialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
filters: [{name: 'Zip Archive', extensions: ['zip']}],
}, callback);
},

showFolderBrowseDialog: callback => {
return showOpenDialog({
title: "Choose a directory",
Expand All @@ -19,7 +19,7 @@ module.exports = {
filters: [{name: 'All Files', extensions: ['*']}],
}, callback);
},

showEpubFileOrFolderBrowseDialog: callback => {
return showOpenDialog({
title: "Choose an EPUB file or folder",
Expand All @@ -28,7 +28,7 @@ module.exports = {
filters: [{name: 'EPUB', extensions: ['epub']}, {name: 'All Files', extensions: ['*']}],
}, callback);
},

showEpubFileBrowseDialog: callback => {
return showOpenDialog({
title: "Choose an EPUB file",
Expand All @@ -37,7 +37,7 @@ module.exports = {
filters: [{name: 'EPUB', extensions: ['epub']}, {name: 'All Files', extensions: ['*']}],
}, callback);
},

showEpubFolderBrowseDialog: callback => {
return showOpenDialog({
title: "Choose an EPUB directory",
Expand All @@ -46,6 +46,15 @@ module.exports = {
filters: [{name: 'All Files', extensions: ['*']}],
}, callback);
},

showReportFileBrowseDialog: callback => {
return showOpenDialog({
title: "Choose an Ace report",
buttonLabel: "Open",
properties: ['openFile'],
filters: [{name: 'JSON', extensions: ['json']}, {name: 'All Files', extensions: ['*']}],
}, callback);
},
};

function showOpenDialog(options, callback) {
Expand All @@ -70,4 +79,4 @@ function showSaveDialog(options, callback) {
}
}
);
}
}

0 comments on commit 590d2dc

Please sign in to comment.