1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-22 02:12:30 +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 _ = require('lodash');
const Hammer = require('react-hammerjs');
const path = require('path');
const React = require('react');
const ReactDOM = require('react-dom');
@ -14,6 +15,11 @@ const util = require('./util');
const dialog = electron.remote.dialog;
function setFileNameTitle(filePath) {
const appName = 'LosslessCut';
document.title = `${appName} - ${path.basename(filePath)}`;
}
function getVideo() {
return $('#player video')[0];
}
@ -108,6 +114,7 @@ class App extends React.Component {
return ffmpeg.getFormat(filePath)
.then((fileFormat) => {
if (!fileFormat) return alert('Unsupported file');
setFileNameTitle(filePath);
return this.setState({ filePath, fileFormat });
})
.catch((err) => {