Initial commit

This commit is contained in:
Nuintun
2015-11-20 12:47:35 +08:00
parent 72f3cc1ad8
commit a20d1def1b
29 changed files with 12094 additions and 0 deletions

28
bin/open-directory.js Normal file
View File

@@ -0,0 +1,28 @@
/**
* Created by nuintun on 2015/11/18.
*/
'use strict';
// module to control application life
var ipc = require('ipc-main');
var dialog = require('dialog');
/**
* open directory
* @param window
*/
module.exports = function (window){
// listen open directory ipc
ipc.on('open-directory', function (event, path, uid){
dialog.showOpenDialog(window, {
title: window.getTitle(),
properties: ['openDirectory'],
defaultPath: path || ''
}, function (directorys){
if (directorys) {
event.sender.send('select-directory', directorys, uid);
}
});
});
};