Commit f2ea9e15 authored by antoor's avatar antoor

Add debug switch

parent 2c3afe95
......@@ -4,6 +4,11 @@
'use strict';
// 读取package.json信息
const info = JSON.parse(
require('fs').readFileSync(require('path').join(__dirname, '../package.json'))
);
class Menubar {
constructor(electron, app, mainWindow) {
......@@ -14,6 +19,7 @@ class Menubar {
Menu.setApplicationMenu(Menu.buildFromTemplate([]));
// 监听重载菜单事件
ipcMain.on('menubar', this.reload.bind(this));
ipcMain.on('quit', app.quit.bind(app));
this.electron = electron;
this.app = app;
......@@ -95,8 +101,11 @@ class Menubar {
click: event.sender.send.bind(event.sender, 'menubar', 'tabbar-close')
}
]
}, {
// 调试
}
];
// 调试菜单
if (info['debug']) {
template.push({
label: LANG['debug']['title'],
submenu: [
{
......@@ -109,10 +118,9 @@ class Menubar {
click: this.mainWindow.webContents.toggleDevTools.bind(this.mainWindow.webContents)
}
]
}
];
// OSX主菜单
// if (process.platform === 'darwin') {
});
};
// 主菜单
template.unshift({
label: LANG['main']['title'],
submenu: [
......@@ -153,7 +161,6 @@ class Menubar {
},
]
});
// };
// 更新菜单栏
this.Menu.setApplicationMenu(this.Menu.buildFromTemplate(template));
}
......
......@@ -28,6 +28,7 @@
"type": "git",
"url": "https://github.com/antoor/antSword"
},
"debug": true,
"update": {
"md5": "f7287aa765941d1e039f5b654344ccc5",
"logs": "测试更新日志1\n测试更新日志2\n新增在线更新功能\n新增文件管理模块双击文件打开编辑窗口(如果文件大小<100kb)",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment