feat: 完善剩余功能
This commit is contained in:
3
electron-app/.gitignore
vendored
3
electron-app/.gitignore
vendored
@@ -102,3 +102,6 @@ ENV/
|
||||
|
||||
# Local dev configurations
|
||||
config.local.js
|
||||
|
||||
# SQLite database
|
||||
lyrics.db
|
||||
|
||||
@@ -199,12 +199,6 @@ app.on("activate", function () {
|
||||
}
|
||||
});
|
||||
|
||||
// 应用退出前
|
||||
app.on("before-quit", () => {
|
||||
// 清理Python进程
|
||||
backendService.stopPythonBackend();
|
||||
});
|
||||
|
||||
// 监听第二实例启动事件
|
||||
app.on("second-instance", (event, commandLine, workingDirectory) => {
|
||||
// 当尝试启动第二个实例时,让主窗口获得焦点
|
||||
|
||||
@@ -267,7 +267,7 @@ function createWindow(frontendUrl, frontendPort, backendPort, isDev) {
|
||||
* @returns {Array} 菜单模板数组
|
||||
*/
|
||||
function getMenuTemplate() {
|
||||
return [
|
||||
const res = [
|
||||
{
|
||||
label: i18next.t("menu.lockWindow"),
|
||||
click: () => {
|
||||
@@ -286,12 +286,6 @@ function createWindow(frontendUrl, frontendPort, backendPort, isDev) {
|
||||
mainWindow.reload();
|
||||
},
|
||||
},
|
||||
{
|
||||
label: i18next.t("menu.openDevTools"),
|
||||
click: () => {
|
||||
mainWindow.webContents.openDevTools();
|
||||
},
|
||||
},
|
||||
{
|
||||
label: i18next.t("menu.language"),
|
||||
submenu: [
|
||||
@@ -339,6 +333,16 @@ function createWindow(frontendUrl, frontendPort, backendPort, isDev) {
|
||||
},
|
||||
},
|
||||
];
|
||||
if (isDev) {
|
||||
res.push({
|
||||
label: i18next.t("menu.openDevTools"),
|
||||
click: () => {
|
||||
mainWindow.webContents.openDevTools();
|
||||
searchWindow && searchWindow.webContents.openDevTools();
|
||||
},
|
||||
});
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user