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:
parent
72c182b132
commit
8edf9446f3
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user