diff --git a/gui/main.js b/gui/main.js index 437405a4..1e52c0ce 100644 --- a/gui/main.js +++ b/gui/main.js @@ -212,7 +212,7 @@ function createWindow() { }) */ win.loadFile("src/index.html"); - +/* chat = new BrowserWindow({ height: 600, width: 1000, @@ -226,6 +226,8 @@ function createWindow() { chat.loadFile("src/chat-module.html"); chat.setMenuBarVisibility(false); +*/ + logViewer = new BrowserWindow({ height: 900, @@ -297,13 +299,15 @@ function createWindow() { //autoUpdater.quitAndInstall(); }); - chat.on("closed", function () {}); + //chat.on("closed", function () {}); // https://stackoverflow.com/questions/44258831/only-hide-the-window-when-closing-it-electron + /* chat.on("close", function (evt) { evt.preventDefault(); chat.hide(); }); + */ } app.whenReady().then(() => { @@ -399,7 +403,7 @@ app.on("window-all-closed", () => { ipcMain.on("set-config-global", (event, data) => { config = data; win.webContents.send("update-config", config); - chat.webContents.send("update-config", config); + //chat.webContents.send("update-config", config); //console.log("set-config-global called"); }); @@ -409,12 +413,12 @@ ipcMain.on("request-show-electron-progressbar", (event, data) => { }); ipcMain.on("request-show-chat-window", () => { - chat.show(); + //chat.show(); }); ipcMain.on("request-clear-chat-connected", () => { //Clear chat window's connected with text - chat.webContents.send("action-clear-reception-status"); + //chat.webContents.send("action-clear-reception-status"); }); ipcMain.on("request-update-dbclean-spinner", () => { @@ -478,26 +482,26 @@ ipcMain.on("request-update-rx-buffer", (event, arg) => { /* ipcMain.on('request-update-rx-msg-buffer', (event, arg) => { - chat.webContents.send('action-update-rx-msg-buffer', arg); + //chat.webContents.send('action-update-rx-msg-buffer', arg); }); */ ipcMain.on("request-new-msg-received", (event, arg) => { - chat.webContents.send("action-new-msg-received", arg); + //chat.webContents.send("action-new-msg-received", arg); }); ipcMain.on("request-update-transmission-status", (event, arg) => { - chat.webContents.send("action-update-transmission-status", arg); + //chat.webContents.send("action-update-transmission-status", arg); win.webContents.send("action-update-transmission-status", arg); }); ipcMain.on("request-update-reception-status", (event, arg) => { win.webContents.send("action-update-reception-status", arg); - chat.webContents.send("action-update-reception-status", arg); + //chat.webContents.send("action-update-reception-status", arg); }); //Called by main to query chat if there are new messages ipcMain.on("request-update-unread-messages", () => { //mainLog.info("Got request to check if chat has new messages") - chat.webContents.send("action-update-unread-messages"); + //chat.webContents.send("action-update-unread-messages"); }); //Called by chat to notify main if there are new messages ipcMain.on("request-update-unread-messages-main", (event, arg) => { @@ -507,7 +511,7 @@ ipcMain.on("request-update-unread-messages-main", (event, arg) => { //Called by main to notify chat we should clean the DB ipcMain.on("request-clean-db", () => { - chat.webContents.send("action-clean-db"); + //chat.webContents.send("action-clean-db"); }); ipcMain.on("request-open-tnc-log", () => { @@ -579,11 +583,13 @@ ipcMain.on("select-file", (event, data) => { if (mimeType == "" || mimeType == null) { mimeType = "plain/text"; } + /* chat.webContents.send("return-selected-files", { data: data, mime: mimeType, filename: filename, }); + */ }); } catch (err) { console.log(err); @@ -611,12 +617,13 @@ ipcMain.on("select-user-image", (event, data) => { if (mimeType == "" || mimeType == null) { mimeType = "plain/text"; } - + /* chat.webContents.send("return-select-user-image", { data: data, mime: mimeType, filename: filename, }); + */ }); } catch (err) { console.log(err); @@ -629,9 +636,11 @@ ipcMain.on("read-files-in-folder", (event, data) => { let fileList = []; if (config["enable_request_shared_folder"].toLowerCase() == "false") { //mainLog.info("Shared file folder is disable, not populating fileList"); + /* chat.webContents.send("return-shared-folder-files", { files: fileList, }); + */ return; } let folder = data.folder; @@ -654,10 +663,11 @@ ipcMain.on("read-files-in-folder", (event, data) => { console.log(err); } }); - + /* chat.webContents.send("return-shared-folder-files", { files: fileList, }); + */ }); //save file to folder @@ -689,7 +699,7 @@ ipcMain.on("save-file-to-folder", (event, data) => { // FEC iswriting received ipcMain.on("request-show-fec-toast-iswriting", (event, data) => { win.webContents.send("action-show-fec-toast-iswriting", data); - chat.webContents.send("action-show-feciswriting", data); + //chat.webContents.send("action-show-feciswriting", data); }); // CQ TRANSMITTING @@ -934,7 +944,7 @@ function close_all() { mainLog.warn("quitting app"); win.destroy(); - chat.destroy(); + //chat.destroy(); logViewer.destroy(); meshViewer.destroy(); diff --git a/gui/preload-chat.js b/gui/preload-chat.js index 473f89a9..e3181cc1 100644 --- a/gui/preload-chat.js +++ b/gui/preload-chat.js @@ -1258,13 +1258,13 @@ update_chat = function (obj) { `; document - .getElementById("list-tab") + .getElementById("list-tab-chat") .insertAdjacentHTML("beforeend", new_callsign); var message_area = `
`; document - .getElementById("nav-tabContent") + .getElementById("nav-tabContent-Chat") .insertAdjacentHTML("beforeend", message_area); // finally get and set user information to first selected item @@ -2246,9 +2246,9 @@ async function updateAllChat(clear) { callsign_counter = 0; //selected_callsign = ""; dxcallsigns.clear(); - document.getElementById("list-tab").innerHTML = ""; - document.getElementById("nav-tabContent").innerHTML = ""; - //document.getElementById("list-tab").childNodes.remove(); + document.getElementById("list-tab-chat").innerHTML = ""; + document.getElementById("nav-tabContent-Chat").innerHTML = ""; + //document.getElementById("list-tab-chat").childNodes.remove(); //document.getElementById("nav-tab-content").childrenNodes.remove(); } //Ensure we create an index before running db.find diff --git a/gui/preload-main.js b/gui/preload-main.js index 82c47384..2cd737cd 100644 --- a/gui/preload-main.js +++ b/gui/preload-main.js @@ -3,6 +3,12 @@ const { ipcRenderer, shell, clipboard } = require("electron"); const exec = require("child_process").spawn; const sock = require("./sock.js"); const daemon = require("./daemon.js"); + + +require("./preload-chat.js"); + + + const fs = require("fs"); const FD = require("./freedata"); const { @@ -1751,7 +1757,7 @@ window.addEventListener("DOMContentLoaded", () => { let Data = { command: "openRFChat", }; - ipcRenderer.send("request-show-chat-window", Data); + //ipcRenderer.send("request-show-chat-window", Data); }); document.getElementById("thTime").addEventListener("click", () => { diff --git a/gui/src/index.html b/gui/src/index.html index a3159503..7426b74e 100644 --- a/gui/src/index.html +++ b/gui/src/index.html @@ -1286,7 +1286,815 @@ -
...
+
+ + +
+
+
+ +
+
+ + + + + +
+
+
+
+
+
+
+
+ +
+
+ + + + + + + + + + + + + ------ +
+
+ +
+ +
+ + +
+ +
+ + + +
+ + +
+ +
+ + + +
+ + + +
+
+
+
+
+
+ + + + + + + + + + + + + + +
...
@@ -2977,6 +3785,15 @@ + + +