diff options
author | Devine Lu Linvega <[email protected]> | 2018-12-10 10:35:55 +1200 |
---|---|---|
committer | Devine Lu Linvega <[email protected]> | 2018-12-10 10:35:55 +1200 |
commit | 616a6e66b62de1771ebe7c36c837c367f4bf288e (patch) | |
tree | cf59fc584149108c331f651db09177b76ca18f40 | |
parent | 01c133a8af0f7e8c2a629fa5209885e6e99efc36 (diff) | |
download | Orca-616a6e66b62de1771ebe7c36c837c367f4bf288e.tar.gz Orca-616a6e66b62de1771ebe7c36c837c367f4bf288e.zip |
Added filters to open dialogs
-rw-r--r-- | desktop/sources/scripts/lib/theme.js | 3 | ||||
-rw-r--r-- | desktop/sources/scripts/source.js | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/desktop/sources/scripts/lib/theme.js b/desktop/sources/scripts/lib/theme.js index 4b9e3b1..7e54f4d 100644 --- a/desktop/sources/scripts/lib/theme.js +++ b/desktop/sources/scripts/lib/theme.js @@ -83,8 +83,7 @@ function Theme (noir, pale) { } this.open = function () { - console.log('Open') - let paths = dialog.showOpenDialog(app.win, { properties: ['openFile'] }) + let paths = dialog.showOpenDialog(app.win, { properties: ['openFile'], filters: [{ name: 'Themes', extensions: ['svg'] }] }) if (!paths) { console.log('Nothing to load') } fs.readFile(paths[0], 'utf8', function (err, data) { if (err) throw err diff --git a/desktop/sources/scripts/source.js b/desktop/sources/scripts/source.js index b01dedd..9486b83 100644 --- a/desktop/sources/scripts/source.js +++ b/desktop/sources/scripts/source.js @@ -18,7 +18,7 @@ function Source (orca, terminal) { this.open = function () { console.log('Open') - let paths = dialog.showOpenDialog(app.win, { properties: ['openFile'] }) + let paths = dialog.showOpenDialog(app.win, { properties: ['openFile'], filters: [{ name: 'Orca Machines', extensions: ['orca'] }] }) if (!paths) { console.log('Nothing to load') } this.path = paths[0] this.read(paths[0]) |