mirror of
https://github.com/mifi/lossless-cut.git
synced 2024-11-22 02:12:30 +01:00
show LosslessCut last in app title
(show most interesting stuff first)
This commit is contained in:
parent
06266e4a4d
commit
029ba35c01
2
src/main/common.ts
Normal file
2
src/main/common.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export const appName = 'LosslessCut';
|
||||
export const copyrightYear = 2024;
|
@ -17,6 +17,7 @@ import logger from './logger.js';
|
||||
import menu from './menu.js';
|
||||
import * as configStore from './configStore.js';
|
||||
import { isLinux } from './util.js';
|
||||
import { appName, copyrightYear } from './common.js';
|
||||
import attachContextMenu from './contextMenu.js';
|
||||
import HttpServer from './httpServer.js';
|
||||
import isDev from './isDev.js';
|
||||
@ -63,8 +64,6 @@ unhandled({
|
||||
showDialog: true,
|
||||
});
|
||||
|
||||
const appName = 'LosslessCut';
|
||||
const copyrightYear = 2024;
|
||||
|
||||
const appVersion = app.getVersion();
|
||||
|
||||
|
@ -12,6 +12,7 @@ import type { PlatformPath } from 'node:path';
|
||||
import isDev from './isDev';
|
||||
import Swal, { errorToast, toast } from './swal';
|
||||
import { ffmpegExtractWindow } from './util/constants';
|
||||
import { appName } from '../../main/common';
|
||||
|
||||
const { dirname, parse: parsePath, join, extname, isAbsolute, resolve, basename }: PlatformPath = window.require('path');
|
||||
const fsExtra: typeof FsExtra = window.require('fs-extra');
|
||||
@ -400,19 +401,21 @@ export function checkFileSizes(inputSize, outputSize) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function setDocumentExtraTitle(extra) {
|
||||
const baseTitle = 'LosslessCut';
|
||||
document.title = extra != null ? `${baseTitle} - ${extra}` : baseTitle;
|
||||
}
|
||||
|
||||
export function setDocumentTitle({ filePath, working, cutProgress }: { filePath?: string | undefined, working?: string | undefined, cutProgress?: number | undefined }) {
|
||||
const parts: string[] = [];
|
||||
if (filePath) parts.push(basename(filePath));
|
||||
|
||||
if (working) {
|
||||
parts.push('-', working);
|
||||
if (cutProgress != null) parts.push(`${(cutProgress * 100).toFixed(1)}%`);
|
||||
parts.push(working);
|
||||
}
|
||||
setDocumentExtraTitle(parts.length > 0 ? parts.join(' ') : undefined);
|
||||
|
||||
if (filePath) {
|
||||
parts.push(basename(filePath));
|
||||
}
|
||||
|
||||
parts.push(appName);
|
||||
|
||||
document.title = parts.join(' - ');
|
||||
}
|
||||
|
||||
export function mustDisallowVob() {
|
||||
|
Loading…
Reference in New Issue
Block a user