Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Commit

Permalink
Added file pickers to export flow to minimize typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Ari Bornstein committed Jun 26, 2017
1 parent c4c1bd9 commit 98a9708
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 4 deletions.
1 change: 1 addition & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ if (process.platform === 'darwin') {
})
template[1].submenu.push();
template[2].submenu.push();

}

const menu = Menu.buildFromTemplate(template);
Expand Down
2 changes: 1 addition & 1 deletion src/public/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ label {
max-width:800px;
}

#model_selector{
.file_selector{
width:30px;
vertical-align: middle;
display:inline-block;
Expand Down
8 changes: 7 additions & 1 deletion src/public/html/export-configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@

<div class="form-group">
<label for="Out"> Output Path</label>
<input id="output" class="form-control" type="text" />
<input id="output" class="form-control" type="text" style=" width:268px; display:inline-block;" />
<div class="file_selector" onclick="getOutputFolder()" >
<svg id="icon-folder-plus" viewBox="0 0 32 32">
<title>folder-plus</title>
<path d="M18 8l-4-4h-14v26h32v-22h-14zM22 22h-4v4h-4v-4h-4v-4h4v-4h4v4h4v4z"></path>
</svg>
</div>
</div>

<div id="exportButton" class="btn btn-primary" style="display:inline-block;">Export</div>
Expand Down
10 changes: 8 additions & 2 deletions src/public/html/review-configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<div class="form-group">
<label for="Model"> Model Path</label>
<input id="model" class="form-control" type="text" style=" width:268px; display:inline-block;" />
<div id="model_selector" onclick="getModelFile()" >
<div class="file_selector" onclick="getModelFile()" >
<svg id="icon-folder-plus" viewBox="0 0 32 32">
<title>folder-plus</title>
<path d="M18 8l-4-4h-14v26h32v-22h-14zM22 22h-4v4h-4v-4h-4v-4h4v-4h4v4h4v4z"></path>
Expand All @@ -39,7 +39,13 @@

<div class="form-group">
<label for="Out"> Output Path</label>
<input id="output" class="form-control" type="text" />
<input id="output" class="form-control" type="text" style=" width:268px; display:inline-block;" />
<div class="file_selector" onclick="getOutputFolder()" >
<svg id="icon-folder-plus" viewBox="0 0 32 32">
<title>folder-plus</title>
<path d="M18 8l-4-4h-14v26h32v-22h-14zM22 22h-4v4h-4v-4h-4v-4h4v-4h4v4h4v4z"></path>
</svg>
</div>
</div>

<div id="reviewButton" class="btn btn-primary" style="display:inline-block;">Review</div>
Expand Down
9 changes: 9 additions & 0 deletions src/public/js/export-configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,13 @@ function getExportConfiguration() {

function closeWindow() {
remote.getCurrentWindow().hide();
}

function getOutputFolder(){
remote.dialog.showOpenDialog({
filters: [{ name: 'Output Folder'}],
properties: ['openDirectory']
}, (pathName) => {
$('#output').val(pathName);
});
}
9 changes: 9 additions & 0 deletions src/public/js/review-configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,13 @@ function getModelFile(){
}, (pathName) => {
$('#model').val(pathName);
});
}

function getOutputFolder(){
remote.dialog.showOpenDialog({
filters: [{ name: 'Output Folder'}],
properties: ['openDirectory']
}, (pathName) => {
$('#output').val(pathName);
});
}

0 comments on commit 98a9708

Please sign in to comment.