mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 11:41:17 +02:00
Fixed merge conflict
This commit is contained in:
commit
568e96b6c5
4 changed files with 181 additions and 117 deletions
|
@ -2,7 +2,7 @@
|
||||||
// ScreenshareScriptingInterface.cpp
|
// ScreenshareScriptingInterface.cpp
|
||||||
// interface/src/scripting/
|
// interface/src/scripting/
|
||||||
//
|
//
|
||||||
// Created by Milad Nazeri on 2019-10-23.
|
// Created by Milad Nazeri and Zach Fox on 2019-10-23.
|
||||||
// Copyright 2019 High Fidelity, Inc.
|
// Copyright 2019 High Fidelity, Inc.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
@ -12,16 +12,27 @@
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
|
#include <QJsonObject>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
#include <QObject>
|
||||||
|
#include <QNetworkAccessManager>
|
||||||
|
#include <QNetworkReply>
|
||||||
|
#include <QNetworkRequest>
|
||||||
|
#include <QProcessEnvironment>
|
||||||
|
|
||||||
#include <AddressManager.h>
|
#include <AddressManager.h>
|
||||||
|
#include <EntityTreeRenderer.h>
|
||||||
|
#include <EntityTree.h>
|
||||||
|
|
||||||
#include "EntityScriptingInterface.h"
|
#include "EntityScriptingInterface.h"
|
||||||
#include "ScreenshareScriptingInterface.h"
|
#include "ScreenshareScriptingInterface.h"
|
||||||
|
|
||||||
ScreenshareScriptingInterface::ScreenshareScriptingInterface() {
|
#include <RenderableEntityItem.h>
|
||||||
};
|
#include <RenderableTextEntityItem.h>
|
||||||
|
#include <RenderableWebEntityItem.h>
|
||||||
|
|
||||||
|
ScreenshareScriptingInterface::ScreenshareScriptingInterface(){};
|
||||||
|
|
||||||
ScreenshareScriptingInterface::~ScreenshareScriptingInterface() {
|
ScreenshareScriptingInterface::~ScreenshareScriptingInterface() {
|
||||||
stopScreenshare();
|
stopScreenshare();
|
||||||
|
@ -29,17 +40,20 @@ ScreenshareScriptingInterface::~ScreenshareScriptingInterface() {
|
||||||
|
|
||||||
static const EntityTypes::EntityType LOCAL_SCREENSHARE_WEB_ENTITY_TYPE = EntityTypes::Web;
|
static const EntityTypes::EntityType LOCAL_SCREENSHARE_WEB_ENTITY_TYPE = EntityTypes::Web;
|
||||||
static const uint8_t LOCAL_SCREENSHARE_WEB_ENTITY_FPS = 30;
|
static const uint8_t LOCAL_SCREENSHARE_WEB_ENTITY_FPS = 30;
|
||||||
static const glm::vec3 LOCAL_SCREENSHARE_WEB_ENTITY_LOCAL_POSITION(0.0f, 0.0f, 0.1f);
|
static const glm::vec3 LOCAL_SCREENSHARE_WEB_ENTITY_LOCAL_POSITION(0.0f, -0.0862f, 0.0711f);
|
||||||
static const QString LOCAL_SCREENSHARE_WEB_ENTITY_URL = "https://hifi-content.s3.amazonaws.com/Experiences/Releases/usefulUtilities/smartBoard/screenshareViewer/screenshareClient.html?1";
|
static const QString LOCAL_SCREENSHARE_WEB_ENTITY_URL =
|
||||||
void ScreenshareScriptingInterface::startScreenshare(const QUuid& screenshareZoneID, const QUuid& smartboardEntityID, const bool& isPresenter) {
|
"https://hifi-content.s3.amazonaws.com/Experiences/Releases/usefulUtilities/smartBoard/screenshareViewer/screenshareClient.html";
|
||||||
|
static const glm::vec3 LOCAL_SCREENSHARE_WEB_ENTITY_DIMENSIONS(4.0419f, 2.2735f, 0.0100f);
|
||||||
|
QString token;
|
||||||
|
QString apiKey;
|
||||||
|
QString sessionID;
|
||||||
|
void ScreenshareScriptingInterface::startScreenshare(const QUuid& screenshareZoneID,
|
||||||
|
const QUuid& smartboardEntityID,
|
||||||
|
const bool& isPresenter) {
|
||||||
if (QThread::currentThread() != thread()) {
|
if (QThread::currentThread() != thread()) {
|
||||||
// We must start a new QProcess from the main thread.
|
// We must start a new QProcess from the main thread.
|
||||||
QMetaObject::invokeMethod(
|
QMetaObject::invokeMethod(this, "startScreenshare", Q_ARG(const QUuid&, screenshareZoneID),
|
||||||
this, "startScreenshare",
|
Q_ARG(const QUuid&, smartboardEntityID), Q_ARG(const bool&, isPresenter));
|
||||||
Q_ARG(const QUuid&, screenshareZoneID),
|
|
||||||
Q_ARG(const QUuid&, smartboardEntityID),
|
|
||||||
Q_ARG(const bool&, isPresenter)
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,99 +73,130 @@ void ScreenshareScriptingInterface::startScreenshare(const QUuid& screenshareZon
|
||||||
}
|
}
|
||||||
|
|
||||||
QUuid currentDomainID = DependencyManager::get<AddressManager>()->getDomainID();
|
QUuid currentDomainID = DependencyManager::get<AddressManager>()->getDomainID();
|
||||||
|
|
||||||
// Make HTTP GET request to:
|
|
||||||
// `https://metaverse.highfidelity.com/api/v1/domain/:domain_id/screenshare`,
|
// `https://metaverse.highfidelity.com/api/v1/domain/:domain_id/screenshare`,
|
||||||
// passing the Domain ID that the user is connected to, as well as the `roomName`.
|
// passing the Domain ID that the user is connected to, as well as the `roomName`.
|
||||||
// The server will respond with the relevant OpenTok Token, Session ID, and API Key.
|
// The server will respond with the relevant OpenTok Token, Session ID, and API Key.
|
||||||
// Upon error-free response, do the logic below, passing in that info as necessary.
|
// Upon error-free response, do the logic below, passing in that info as necessary.
|
||||||
QString token = "";
|
QNetworkAccessManager* manager = new QNetworkAccessManager();
|
||||||
QString apiKey = "";
|
QObject::connect(manager, &QNetworkAccessManager::finished, this, [=](QNetworkReply* reply) {
|
||||||
QString sessionID = "";
|
if (reply->error()) {
|
||||||
|
qDebug() << "\n\n MN HERE: REPLY" << reply->errorString();
|
||||||
if (isPresenter) {
|
return;
|
||||||
QStringList arguments;
|
|
||||||
arguments << "--token=" + token;
|
|
||||||
arguments << "--apiKey=" + apiKey;
|
|
||||||
arguments << "--sessionID=" + sessionID;
|
|
||||||
|
|
||||||
connect(_screenshareProcess.get(), &QProcess::errorOccurred,
|
|
||||||
[=](QProcess::ProcessError error) { qDebug() << "ZRF QProcess::errorOccurred. `error`:" << error; });
|
|
||||||
connect(_screenshareProcess.get(), &QProcess::started, [=]() { qDebug() << "ZRF QProcess::started"; });
|
|
||||||
connect(_screenshareProcess.get(), &QProcess::stateChanged,
|
|
||||||
[=](QProcess::ProcessState newState) { qDebug() << "ZRF QProcess::stateChanged. `newState`:" << newState; });
|
|
||||||
connect(_screenshareProcess.get(), QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
|
||||||
[=](int exitCode, QProcess::ExitStatus exitStatus) {
|
|
||||||
qDebug() << "ZRF QProcess::finished. `exitCode`:" << exitCode << "`exitStatus`:" << exitStatus;
|
|
||||||
emit screenshareStopped();
|
|
||||||
});
|
|
||||||
|
|
||||||
_screenshareProcess->start(SCREENSHARE_EXE_PATH, arguments);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!_screenshareViewerLocalWebEntityUUID.isNull()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto esi = DependencyManager::get<EntityScriptingInterface>();
|
|
||||||
if (!esi) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
EntityItemProperties localScreenshareWebEntityProps;
|
|
||||||
localScreenshareWebEntityProps.setType(LOCAL_SCREENSHARE_WEB_ENTITY_TYPE);
|
|
||||||
localScreenshareWebEntityProps.setMaxFPS(LOCAL_SCREENSHARE_WEB_ENTITY_FPS);
|
|
||||||
localScreenshareWebEntityProps.setLocalPosition(LOCAL_SCREENSHARE_WEB_ENTITY_LOCAL_POSITION);
|
|
||||||
localScreenshareWebEntityProps.setSourceUrl(LOCAL_SCREENSHARE_WEB_ENTITY_URL);
|
|
||||||
localScreenshareWebEntityProps.setParentID(smartboardEntityID);
|
|
||||||
|
|
||||||
EntityPropertyFlags desiredSmartboardProperties;
|
|
||||||
desiredSmartboardProperties += PROP_POSITION;
|
|
||||||
desiredSmartboardProperties += PROP_DIMENSIONS;
|
|
||||||
EntityItemProperties smartboardProps = esi->getEntityProperties(smartboardEntityID, desiredSmartboardProperties);
|
|
||||||
|
|
||||||
localScreenshareWebEntityProps.setPosition(smartboardProps.getPosition());
|
|
||||||
localScreenshareWebEntityProps.setDimensions(smartboardProps.getDimensions());
|
|
||||||
|
|
||||||
QString hostType = "local";
|
|
||||||
_screenshareViewerLocalWebEntityUUID = esi->addEntity(localScreenshareWebEntityProps, hostType);
|
|
||||||
|
|
||||||
QObject::connect(esi.data(), &EntityScriptingInterface::webEventReceived, this, [&](const QUuid& entityID, const QVariant& message) {
|
|
||||||
if (entityID == _screenshareViewerLocalWebEntityUUID) {
|
|
||||||
qDebug() << "ZRF HERE! Inside `webEventReceived(). `entityID`:" << entityID << "`_screenshareViewerLocalWebEntityUUID`:" << _screenshareViewerLocalWebEntityUUID;
|
|
||||||
|
|
||||||
auto esi = DependencyManager::get<EntityScriptingInterface>();
|
|
||||||
if (!esi) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QJsonDocument jsonMessage = QJsonDocument::fromVariant(message);
|
|
||||||
QJsonObject jsonObject = jsonMessage.object();
|
|
||||||
|
|
||||||
qDebug() << "ZRF HERE! Inside `webEventReceived(). `message`:" << message << "`jsonMessage`:" << jsonMessage;
|
|
||||||
|
|
||||||
if (jsonObject["app"] != "screenshare") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
qDebug() << "ZRF HERE! Inside `webEventReceived(). we're still here!";
|
|
||||||
|
|
||||||
if (jsonObject["method"] == "eventBridgeReady") {
|
|
||||||
QJsonObject responseObject;
|
|
||||||
responseObject.insert("app", "screenshare");
|
|
||||||
responseObject.insert("method", "receiveConnectionInfo");
|
|
||||||
QJsonObject responseObjectData;
|
|
||||||
responseObjectData.insert("token", token);
|
|
||||||
responseObjectData.insert("projectAPIKey", apiKey);
|
|
||||||
responseObjectData.insert("sessionID", sessionID);
|
|
||||||
responseObject.insert("data", responseObjectData);
|
|
||||||
|
|
||||||
qDebug() << "ZRF HERE! Inside `webEventReceived(). `responseObject.toVariantMap()`:" << responseObject.toVariantMap();
|
|
||||||
|
|
||||||
esi->emitScriptEvent(_screenshareViewerLocalWebEntityUUID, responseObject.toVariantMap());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString answer = reply->readAll();
|
||||||
|
qDebug() << "\n\n MN HERE: REPLY" << answer;
|
||||||
|
|
||||||
|
QByteArray answerByteArray = answer.toUtf8();
|
||||||
|
QJsonDocument answerJSONObject = QJsonDocument::fromJson(answerByteArray);
|
||||||
|
|
||||||
|
token = answerJSONObject["token"].toString();
|
||||||
|
apiKey = answerJSONObject["apiKey"].toString();
|
||||||
|
sessionID = answerJSONObject["sessionId"].toString(); // hifi-test has Id camel-case. Change for metaverse.
|
||||||
|
qDebug() << "token:" << token << " apiKey:" << apiKey << " sessionID: " << sessionID;
|
||||||
|
|
||||||
|
if (isPresenter) {
|
||||||
|
QStringList arguments;
|
||||||
|
arguments << "--token=" + token;
|
||||||
|
arguments << "--apiKey=" + apiKey;
|
||||||
|
arguments << "--sessionID=" + sessionID;
|
||||||
|
|
||||||
|
connect(_screenshareProcess.get(), &QProcess::errorOccurred,
|
||||||
|
[=](QProcess::ProcessError error) { qDebug() << "ZRF QProcess::errorOccurred. `error`:" << error; });
|
||||||
|
connect(_screenshareProcess.get(), &QProcess::started, [=]() { qDebug() << "ZRF QProcess::started"; });
|
||||||
|
connect(_screenshareProcess.get(), &QProcess::stateChanged, [=](QProcess::ProcessState newState) {
|
||||||
|
qDebug() << "ZRF QProcess::stateChanged. `newState`:" << newState;
|
||||||
|
});
|
||||||
|
connect(_screenshareProcess.get(), QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
||||||
|
[=](int exitCode, QProcess::ExitStatus exitStatus) {
|
||||||
|
qDebug() << "ZRF QProcess::finished. `exitCode`:" << exitCode << "`exitStatus`:" << exitStatus;
|
||||||
|
emit screenshareStopped();
|
||||||
|
});
|
||||||
|
|
||||||
|
_screenshareProcess->start(SCREENSHARE_EXE_PATH, arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_screenshareViewerLocalWebEntityUUID.isNull()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto esi = DependencyManager::get<EntityScriptingInterface>();
|
||||||
|
if (!esi) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
EntityItemProperties localScreenshareWebEntityProps;
|
||||||
|
localScreenshareWebEntityProps.setType(LOCAL_SCREENSHARE_WEB_ENTITY_TYPE);
|
||||||
|
localScreenshareWebEntityProps.setMaxFPS(LOCAL_SCREENSHARE_WEB_ENTITY_FPS);
|
||||||
|
localScreenshareWebEntityProps.setLocalPosition(LOCAL_SCREENSHARE_WEB_ENTITY_LOCAL_POSITION);
|
||||||
|
localScreenshareWebEntityProps.setSourceUrl(LOCAL_SCREENSHARE_WEB_ENTITY_URL);
|
||||||
|
localScreenshareWebEntityProps.setParentID(smartboardEntityID);
|
||||||
|
localScreenshareWebEntityProps.setDimensions(LOCAL_SCREENSHARE_WEB_ENTITY_DIMENSIONS);
|
||||||
|
|
||||||
|
// EntityPropertyFlags desiredSmartboardProperties;
|
||||||
|
// desiredSmartboardProperties += PROP_POSITION;
|
||||||
|
// desiredSmartboardProperties += PROP_DIMENSIONS;
|
||||||
|
// EntityItemProperties smartboardProps = esi->getEntityProperties(smartboardEntityID, desiredSmartboardProperties);
|
||||||
|
|
||||||
|
QString hostType = "local";
|
||||||
|
_screenshareViewerLocalWebEntityUUID = esi->addEntity(localScreenshareWebEntityProps, hostType);
|
||||||
|
|
||||||
|
QObject::connect(esi.data(), &EntityScriptingInterface::webEventReceived, this,
|
||||||
|
[&](const QUuid& entityID, const QVariant& message) {
|
||||||
|
if (entityID == _screenshareViewerLocalWebEntityUUID) {
|
||||||
|
qDebug() << "ZRF HERE! Inside `webEventReceived(). `entityID`:" << entityID
|
||||||
|
<< "`_screenshareViewerLocalWebEntityUUID`:" << _screenshareViewerLocalWebEntityUUID;
|
||||||
|
|
||||||
|
auto esi = DependencyManager::get<EntityScriptingInterface>();
|
||||||
|
if (!esi) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
qDebug() << "MN HERE! message:" << message;
|
||||||
|
QByteArray jsonByteArray = QVariant(message).toString().toUtf8();
|
||||||
|
QJsonDocument jsonObject = QJsonDocument::fromJson(jsonByteArray);
|
||||||
|
|
||||||
|
qDebug() << "ZRF HERE! Inside `webEventReceived(). `message`:" << message
|
||||||
|
<< "`jsonObject`:" << jsonObject;
|
||||||
|
qDebug() << jsonObject["app"];
|
||||||
|
if (jsonObject["app"] != "screenshare") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
qDebug() << "ZRF HERE! Inside `webEventReceived(). we're still here!";
|
||||||
|
|
||||||
|
if (jsonObject["method"] == "eventBridgeReady") {
|
||||||
|
QJsonObject responseObject;
|
||||||
|
responseObject.insert("app", "screenshare");
|
||||||
|
responseObject.insert("method", "receiveConnectionInfo");
|
||||||
|
QJsonObject responseObjectData;
|
||||||
|
responseObjectData.insert("token", token);
|
||||||
|
responseObjectData.insert("projectAPIKey", apiKey);
|
||||||
|
responseObjectData.insert("sessionID", sessionID);
|
||||||
|
responseObject.insert("data", responseObjectData);
|
||||||
|
|
||||||
|
qDebug() << "ZRF HERE! Inside `webEventReceived(). `responseObject.toVariantMap()`:"
|
||||||
|
<< responseObject.toVariantMap();
|
||||||
|
|
||||||
|
// Attempt 1, we receive the eventBridge message, but this won't send a message
|
||||||
|
// to that js
|
||||||
|
auto esi = DependencyManager::get<EntityScriptingInterface>();
|
||||||
|
esi->emitScriptEvent(_screenshareViewerLocalWebEntityUUID, responseObject.toVariantMap());
|
||||||
|
|
||||||
|
// atempt 2, same outcome
|
||||||
|
//auto entityTreeRenderer = DependencyManager::get<EntityTreeRenderer>();
|
||||||
|
//auto webEntityRenderable =
|
||||||
|
// entityTreeRenderer->renderableForEntityId(_screenshareViewerLocalWebEntityUUID);
|
||||||
|
//webEntityRenderable->emitScriptEvent(responseObject.toVariantMap());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QNetworkRequest request;
|
||||||
|
QString tokboxURL = QProcessEnvironment::systemEnvironment().value("hifiScreenshareUrl");
|
||||||
|
request.setUrl(QUrl(tokboxURL));
|
||||||
|
manager->get(request);
|
||||||
};
|
};
|
||||||
|
|
||||||
void ScreenshareScriptingInterface::stopScreenshare() {
|
void ScreenshareScriptingInterface::stopScreenshare() {
|
||||||
|
|
|
@ -1,10 +1,23 @@
|
||||||
|
//
|
||||||
|
// ScreenshareScriptingInterface.h
|
||||||
|
// interface/src/scripting/
|
||||||
|
//
|
||||||
|
// Created by Milad Nazeri and Zach Fox on 2019-10-23.
|
||||||
|
// Copyright 2019 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef hifi_ScreenshareScriptingInterface_h
|
#ifndef hifi_ScreenshareScriptingInterface_h
|
||||||
#define hifi_ScreenshareScriptingInterface_h
|
#define hifi_ScreenshareScriptingInterface_h
|
||||||
|
|
||||||
#include <QObject>
|
// #include <QObject>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QtCore/QCoreApplication>
|
#include <QtCore/QCoreApplication>
|
||||||
|
// #include <QNetworkAccessManager>
|
||||||
|
// #include <QNetworkReply>
|
||||||
|
// #include <QNetworkRequest>
|
||||||
#include <DependencyManager.h>
|
#include <DependencyManager.h>
|
||||||
#include <PathUtils.h>
|
#include <PathUtils.h>
|
||||||
|
|
||||||
|
|
|
@ -245,20 +245,21 @@ function togglePage(){
|
||||||
|
|
||||||
|
|
||||||
// main TODO:
|
// main TODO:
|
||||||
// const {ipcRenderer} = ipcRenderer;
|
const ipcRenderer = electron.ipcRenderer;
|
||||||
// let apiKey;
|
let apiKey;
|
||||||
// let sessionId;
|
let sessionId;
|
||||||
// let token;
|
let token;
|
||||||
// let session;
|
let session;
|
||||||
// ipcRenderer.on('connectionInfo', function(event, message){
|
|
||||||
// console.log("event", event);
|
ipcRenderer.on('connectionInfo', function(event, message){
|
||||||
// console.log("MESSAGE FROM MAIN", message);
|
console.log("event:" + event);
|
||||||
// const connectionInfo = JSON.parse(message);
|
console.log("MESSAGE FROM MAIN:" + message);
|
||||||
|
// const connectionInfo = JSON.parse(message);
|
||||||
// apiKey = connectionInfo.apiKey;
|
// apiKey = connectionInfo.apiKey;
|
||||||
// sessionId = connectionInfo.sessionId;
|
// sessionId = connectionInfo.sessionId;
|
||||||
// token = connectionInfo.token;
|
// token = connectionInfo.token;
|
||||||
// initializeTokboxSession();
|
// initializeTokboxSession();
|
||||||
// })
|
})
|
||||||
|
|
||||||
function startup(){
|
function startup(){
|
||||||
console.log("\n\n IN STARTUP \n\n")
|
console.log("\n\n IN STARTUP \n\n")
|
||||||
|
|
|
@ -6,7 +6,8 @@ const {app, BrowserWindow, ipcMain} = require('electron');
|
||||||
const gotTheLock = app.requestSingleInstanceLock()
|
const gotTheLock = app.requestSingleInstanceLock()
|
||||||
const argv = require('yargs').argv;
|
const argv = require('yargs').argv;
|
||||||
// ./screenshare.exe --userName=miladN ...
|
// ./screenshare.exe --userName=miladN ...
|
||||||
|
console.log("argV:", argv)
|
||||||
|
console.log("argV Username", argv.userName);
|
||||||
const connectionInfo = {
|
const connectionInfo = {
|
||||||
userName: argv.userName || "testName",
|
userName: argv.userName || "testName",
|
||||||
displayName: argv.displayName || "displayName",
|
displayName: argv.displayName || "displayName",
|
||||||
|
@ -23,6 +24,7 @@ if (!gotTheLock) {
|
||||||
|
|
||||||
var window;
|
var window;
|
||||||
function createWindow(){
|
function createWindow(){
|
||||||
|
console.log("Creating window")
|
||||||
const zoomFactor = 1.0;
|
const zoomFactor = 1.0;
|
||||||
window = new BrowserWindow({
|
window = new BrowserWindow({
|
||||||
backgroundColor: "#000000",
|
backgroundColor: "#000000",
|
||||||
|
@ -33,23 +35,26 @@ function createWindow(){
|
||||||
useContentSize: true,
|
useContentSize: true,
|
||||||
zoomFactor: zoomFactor,
|
zoomFactor: zoomFactor,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
alwaysOnTop: false, // TRY
|
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
nodeIntegration: true
|
nodeIntegration: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
window.loadURL('file://' + __dirname + '/index.html');
|
window.loadURL('file://' + __dirname + '/index.html');
|
||||||
window.setMenu(null);
|
window.setMenu(null);
|
||||||
|
|
||||||
|
window.webContents.on("did-finish-load", function(){
|
||||||
|
console.log("connectionInfo:", connectionInfo)
|
||||||
|
console.log("in did finish loading");
|
||||||
|
window.webContents.send('connectionInfo', JSON.stringify(connectionInfo));
|
||||||
|
});
|
||||||
|
|
||||||
window.once('ready-to-show', () => {
|
|
||||||
window.show();
|
|
||||||
window.webContents.openDevTools()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method will be called when Electron has finished
|
// This method will be called when Electron has finished
|
||||||
// initialization and is ready to create browser windows.
|
// initialization and is ready to create browser windows.
|
||||||
|
console.log("setting up on ready");
|
||||||
app.on('ready', function() {
|
app.on('ready', function() {
|
||||||
|
console.log("app ready");
|
||||||
createWindow();
|
createWindow();
|
||||||
console.log("sending info");
|
console.log("sending info");
|
||||||
window.webContents.send('connectionInfo', JSON.stringify(connectionInfo))
|
window.webContents.send('connectionInfo', JSON.stringify(connectionInfo))
|
||||||
|
|
Loading…
Reference in a new issue