aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDevine Lu Linvega <[email protected]>2018-12-10 10:35:55 +1200
committerDevine Lu Linvega <[email protected]>2018-12-10 10:35:55 +1200
commit616a6e66b62de1771ebe7c36c837c367f4bf288e (patch)
treecf59fc584149108c331f651db09177b76ca18f40
parent01c133a8af0f7e8c2a629fa5209885e6e99efc36 (diff)
downloadOrca-616a6e66b62de1771ebe7c36c837c367f4bf288e.tar.gz
Orca-616a6e66b62de1771ebe7c36c837c367f4bf288e.zip
Added filters to open dialogs
-rw-r--r--desktop/sources/scripts/lib/theme.js3
-rw-r--r--desktop/sources/scripts/source.js2
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])