Skip to content

Commit 4e3b89a

Browse files
authored
Merge pull request #32 from SpringRoll/feature/json-export
Feature/json export
2 parents aa3be6e + b6b16fb commit 4e3b89a

19 files changed

+710
-112
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## [1.0.0] - UNRELEASED
88
### Changed
99
- Caption Studio now reads audio files directly from project root, or user specified audio directory
10+
- Caption studio now allows for saving/opening caption JSON files directly from projects
1011
### Added
1112
- This CHANGELOG
1213
- VUE front end renderer

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@
8888
"last 2 versions",
8989
"not dead"
9090
]
91-
}
91+
}

src/contents/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ export const EVENTS = {
99
UPDATE_TEMPLATE_CREATION_LOG: 'updateTemplateCreateLog',
1010
PROJECT_CREATION_COMPLETE: 'projectCreationComplete',
1111
UPDATE_AUDIO_LOCATION: 'updateAudioLocation',
12+
SAVE_CAPTION_DATA: 'saveCaptionData',
13+
CLEAR_CAPTION_DATA: 'clearCaptionData',
14+
OPEN_TEMPLATE_DIALOG: 'openTemplateDialog',
15+
OPEN_CAPTION_FILE: 'openCaptionFile',
1216
};
1317

1418
export const DIALOGS = {

src/main/index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
'use strict';
22

3-
import { app, protocol, BrowserWindow } from 'electron';
3+
import { app, protocol, BrowserWindow, Menu, MenuItem, ipcMain } from 'electron';
44
import { createProtocol } from 'vue-cli-plugin-electron-builder/lib';
55
import installExtension, { VUEJS_DEVTOOLS } from 'electron-devtools-installer';
66
import { studio } from './studio';
7+
import { template, captionStudioTemplate } from './studio/menus/AppMenuTemplate';
78

89
const isDevelopment = process.env.NODE_ENV !== 'production';
910

@@ -16,6 +17,16 @@ protocol.registerSchemesAsPrivileged([
1617
{ scheme: 'app', privileges: { secure: true, standard: true } }
1718
]);
1819

20+
// Create menus from templates
21+
const menu = Menu.buildFromTemplate(template);
22+
const captionStudioMenu = Menu.buildFromTemplate(captionStudioTemplate);
23+
Menu.setApplicationMenu(menu);
24+
25+
//on caption studio open or close, set the appropriate menu
26+
ipcMain.on('captionStudio', (event, page) => {
27+
Menu.setApplicationMenu(page ? captionStudioMenu : menu);
28+
});
29+
1930
/**
2031
* Creates electron window
2132
*/

src/main/studio/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class SpringRollStudio {
5959
if (paths !== undefined) {
6060
projectInfo.location = paths[0];
6161
captionInfo.audioLocation = paths[0]; //when the project location changes also change the default audio files directory
62+
captionInfo.captionLocation = '';
6263
}
6364
break;
6465

0 commit comments

Comments
 (0)