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

Clean up some old files.

上级 2e7774ea
No related branches found
No related tags found
无相关合并请求
{
"type": "commonjs",
"name": "zap",
"version": "2022.3.29",
"version": "2022.3.30",
"description": "Configuration tool for the Zigbee Cluster Library",
"productName": "zap",
"cordovaId": "",
......@@ -271,8 +271,21 @@
]
},
"pkg": {
"name": "zap-cli",
"scripts": "dist/**/*.js",
"scripts": [
"dist/src-electron/client/*.js",
"dist/src-electron/db/*.js",
"dist/src-electron/generator/*.js",
"dist/src-electron/ide-integration/*.js",
"dist/src-electron/importexport/*.js",
"dist/src-electron/main-process/*.js",
"dist/src-electron/rest/*.js",
"dist/src-electron/server/*.js",
"dist/src-electron/types/*.js",
"dist/src-electron/util/*.js",
"dist/src-electron/validation/*.js",
"dist/src-electron/zcl/*.js",
"dist/src-shared/**/*.js"
],
"targets": [
"node16-linux-x64",
"node16-macos-x64",
......
/**
*
* Copyright (c) 2020 Silicon Labs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { BrowserWindow } from "electron"
const path = require('path')
const env = require('../util/env')
let window: BrowserWindow | null
function createPreferencesWindow(parentWindow: Electron.BrowserWindow, port: number) {
let webPreferences: Electron.WebPreferences
= {
nodeIntegration: false,
}
if (parentWindow != null && 'webContents' in parentWindow) {
webPreferences.session = parentWindow.webContents.session
}
window = new BrowserWindow({
width: 800,
height: 600,
resizable: true,
center: true,
title: 'ZAP Preferences',
icon: path.join(env.iconsDirectory(), 'zap_32x32.png'),
useContentSize: true,
webPreferences: webPreferences,
})
window.setMenu(null)
window.loadURL(`http://localhost:${port}/#/preference`)
window.on('close', () => {
window = null
})
window.on('page-title-updated', (e) => {
e.preventDefault()
}) // EO page-title-updated
}
/**
* Call this function to create a new or show an existing preference window.
*
* @export
* @param {*} port
*/
function createOrShowPreferencesWindow(parentWindow: Electron.BrowserWindow, port: number) {
if (window == null) {
createPreferencesWindow(parentWindow, port)
} else {
window.show()
}
}
exports.createOrShowPreferencesWindow = createOrShowPreferencesWindow
......@@ -15,12 +15,12 @@
* limitations under the License.
*/
import { BrowserWindow } from "electron"
import { BrowserWindow } from 'electron'
const path = require('path')
const env = require('../util/env')
let window:BrowserWindow|null
let window: BrowserWindow | null
function createAboutWindow(parentWindow: BrowserWindow, port: number) {
let webPreferences: Electron.WebPreferences = {
......
......@@ -17,7 +17,7 @@
const { dialog, Menu, shell } = require('electron')
const uiJs = require('./ui-util')
const about = require('../main-process/about')
const about = require('./about')
const commonUrl = require('../../src-shared/common-url.js')
const browserApi = require('./browser-api.js')
const rendApi = require('../../src-shared/rend-api.js')
......@@ -61,19 +61,6 @@ const template = (httpPort) => [
{
type: 'separator',
},
// {
// label: 'Preferences...',
// httpPort: httpPort,
// click(menuItem, browserWindow, event) {
// preference.createOrShowPreferencesWindow(
// browserWindow,
// menuItem.httpPort
// )
// },
// },
{
type: 'separator',
},
{
role: 'close',
},
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册