mirror of
https://github.com/nuintun/command-manager.git
synced 2025-10-20 09:51:31 +08:00
Initial commit
This commit is contained in:
28
bin/open-directory.js
Normal file
28
bin/open-directory.js
Normal 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);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
Reference in New Issue
Block a user