Skip to content
代码片段 群组 项目
提交 dc95ab87 编辑于 作者: Timotej Ecimovic's avatar Timotej Ecimovic
浏览文件

Deal with saving a new configuration.

上级 d139f8d4
No related branches found
No related tags found
无相关合并请求
......@@ -31,13 +31,14 @@ const commonUrl = require('../../src-shared/common-url.js')
const browserApi = require('../ui/browser-api.js')
let httpPort
const newConfiguration = 'New Configuration'
const template = [
{
role: 'fileMenu',
submenu: [
{
label: 'New Configuration...',
label: newConfiguration + '...',
accelerator: 'CmdOrCtrl+N',
click(menuItem, browserWindow, event) {
uiJs.openNewConfiguration(env.mainDatabase(), httpPort)
......@@ -212,7 +213,11 @@ function doOpen(menuItem, browserWindow, event) {
* @param {*} event
*/
function doSave(menuItem, browserWindow, event) {
fileSave(browserWindow, null)
if (browserWindow.getTitle().includes(newConfiguration)) {
doSaveAs(menuItem, browserWindow, event)
} else {
fileSave(browserWindow, null)
}
}
/**
......@@ -380,3 +385,4 @@ function initMenu(port) {
}
exports.initMenu = initMenu
exports.newConfiguration = newConfiguration
......@@ -79,7 +79,7 @@ function windowCreate(port, args = {}) {
resizable: true,
center: true,
icon: path.join(env.iconsDirectory(), 'zap_32x32.png'),
title: args.filePath == null ? 'New Configuration' : args.filePath,
title: args.filePath == null ? menu.newConfiguration : args.filePath,
useContentSize: true,
webPreferences: webPreferences,
})
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册