Skip to content

Commit

Permalink
Merging develop into 82-remove-created-component
Browse files Browse the repository at this point in the history
* Fixed merge conflicts

Signed-off-by: Jillian Daguil <jdaguil@nexb.com>
  • Loading branch information
jdaguil committed May 19, 2017
2 parents 674f217 + b1a46bc commit 7f62b2e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 10 deletions.
28 changes: 20 additions & 8 deletions assets/js/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ $(document).ready(function () {
const showComponentButton = $("#show-component-table");
const saveComponentButton = $("#save-component");
const deleteComponentButton = $("#delete-component");
const openDBFileButton = $("#open-file");
const saveDBFileButton = $("#save-file");
const saveSQLiteFileButton = $("#save-file");
const openSQLiteFileButton = $("#open-file");
const submitComponentButton = $("#componentSubmit");
const leftCol = $("#leftCol");
const tabBar = $("#tabbar");
Expand Down Expand Up @@ -388,10 +388,10 @@ $(document).ready(function () {
}

// Open a SQLite Database File
openDBFileButton.click(function() {
function openSQLite() {
dialog.showOpenDialog({
properties: ['openFile'],
title: "Open a SQLite file",
title: "Open a SQLite File",
filters: [{
name: 'SQLite File',
extensions: ['sqlite']
Expand All @@ -400,10 +400,16 @@ $(document).ready(function () {
if (fileNames === undefined) return;
loadDatabaseFromFile(fileNames[0]);
});
});
}

// Save a SQLite Database file
saveDBFileButton.click(function() {
// Open a SQLite Database File
openSQLiteFileButton.click(openSQLite);

// Open a SQLite Database File -- custom menu
ipcRenderer.on('open-SQLite', openSQLite);

// Save a SQLite Database File
function saveSQLite() {
dialog.showSaveDialog(
{
title: 'Save as a Database File',
Expand All @@ -423,7 +429,13 @@ $(document).ready(function () {
})
}
);
});
}

// Save a SQLite Database file
saveSQLiteFileButton.click(saveSQLite);

// Save a SQLite Database File -- custom menu
ipcRenderer.on('save-SQLite', saveSQLite);

// Open a ScanCode results JSON file
ipcRenderer.on('import-JSON', function () {
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
<div id="sidebar-wrapper">
<ul class="sidebar-nav">
<li>
<button class="btn btn-sidebar" id="open-file" data-toggle="tooltip" title="Open file"><i class="fa fa-folder-open-o" aria-hidden="true"></i></button>
<button class="btn btn-sidebar" id="open-file" data-toggle="tooltip" title="Open SQLite File"><i class="fa fa-folder-open-o" aria-hidden="true"></i></button>
</li>
<li>
<button class="btn btn-sidebar" id="save-file" data-toggle="tooltip" title="Save file"><i class="fa fa-floppy-o" aria-hidden="true"></i></button>
<button class="btn btn-sidebar" id="save-file" data-toggle="tooltip" title="Save SQLite File"><i class="fa fa-floppy-o" aria-hidden="true"></i></button>
</li>
<li>
<button class="btn btn-sidebar" id="show-clue-table" data-toggle="tooltip" title="Table view"><i class="fa fa-table" aria-hidden="true"></i></button>
Expand Down
12 changes: 12 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ function getTemplate() {
{
label: 'File',
submenu: [
{
label: "Open SQLite File",
click: function (menuItem, currentWindow) {
currentWindow.webContents.send('open-SQLite')
}
},
{
label: "Save SQLite File",
click: function (menuItem, currentWindow) {
currentWindow.webContents.send('save-SQLite')
}
},
{
label: "Import JSON File",
accelerator: 'CmdOrCtrl+I',
Expand Down

0 comments on commit 7f62b2e

Please sign in to comment.