1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-25 11:43:17 +01:00

Show file title in window title

https://github.com/mifi/lossless-cut/issues/46
This commit is contained in:
Mikael Finstad 2017-10-08 21:49:43 +02:00
parent 72c182b132
commit 8edf9446f3

View File

@ -3,6 +3,7 @@ const $ = require('jquery');
const keyboardJs = require('keyboardjs'); const keyboardJs = require('keyboardjs');
const _ = require('lodash'); const _ = require('lodash');
const Hammer = require('react-hammerjs'); const Hammer = require('react-hammerjs');
const path = require('path');
const React = require('react'); const React = require('react');
const ReactDOM = require('react-dom'); const ReactDOM = require('react-dom');
@ -14,6 +15,11 @@ const util = require('./util');
const dialog = electron.remote.dialog; const dialog = electron.remote.dialog;
function setFileNameTitle(filePath) {
const appName = 'LosslessCut';
document.title = `${appName} - ${path.basename(filePath)}`;
}
function getVideo() { function getVideo() {
return $('#player video')[0]; return $('#player video')[0];
} }
@ -108,6 +114,7 @@ class App extends React.Component {
return ffmpeg.getFormat(filePath) return ffmpeg.getFormat(filePath)
.then((fileFormat) => { .then((fileFormat) => {
if (!fileFormat) return alert('Unsupported file'); if (!fileFormat) return alert('Unsupported file');
setFileNameTitle(filePath);
return this.setState({ filePath, fileFormat }); return this.setState({ filePath, fileFormat });
}) })
.catch((err) => { .catch((err) => {