Added Comments

This commit is contained in:
2026-01-21 12:19:35 +01:00
parent c202d3960b
commit 192ef447a6
+12 -4
View File
@@ -1,31 +1,39 @@
/*
This file contains the ipc communication methos between the ui and the gui
*/
const { contextBridge, ipcRenderer, webUtils } = require('electron') const { contextBridge, ipcRenderer, webUtils } = require('electron')
try { try {
//For file lookup on drop
contextBridge.exposeInMainWorld("explorer", { contextBridge.exposeInMainWorld("explorer", {
onFileDrop: (file) => webUtils.getPathForFile(file) onFileDrop: (file) => webUtils.getPathForFile(file)
}) })
//For sending the specifications to the main
contextBridge.exposeInMainWorld("submit", { contextBridge.exposeInMainWorld("submit", {
submit: (meeting_specifications) => { ipcRenderer.send("file_submit", meeting_specifications) } submit: (meeting_specifications) => { ipcRenderer.send("file_submit", meeting_specifications) }
}) })
//For file lookup on search
contextBridge.exposeInMainWorld("electronAPI", { contextBridge.exposeInMainWorld("electronAPI", {
getFilePath: (file) => { return webUtils.getPathForFile(file) } getFilePath: (file) => { return webUtils.getPathForFile(file) }
}) })
//Gets all information from the main process
contextBridge.exposeInMainWorld("onStartup", { contextBridge.exposeInMainWorld("onStartup", {
getModuleNames: () => ipcRenderer.invoke('get-module-names') getModuleNames: () => ipcRenderer.invoke('get-module-names')
}) })
//Calls from the main process regarding the progress
contextBridge.exposeInMainWorld('electron', { contextBridge.exposeInMainWorld('electron', {
progress: (callback) => ipcRenderer.on('progress', callback) progress: (callback) => ipcRenderer.on('progress', callback)
}) })
//For getting the speaker audios and names from the main
contextBridge.exposeInMainWorld('audios', { contextBridge.exposeInMainWorld('audios', {
speakerAudios: (callback) => ipcRenderer.on('speakerAudios', callback) speakerAudios: (callback) => ipcRenderer.on('speakerAudios', callback)
}) })
//For sending the new speaker names to the main process
contextBridge.exposeInMainWorld("submitSpeaker", { contextBridge.exposeInMainWorld("submitSpeaker", {
speaker_submit: (speaker_names) => { ipcRenderer.send("speaker_submit", speaker_names) } speaker_submit: (speaker_names) => { ipcRenderer.send("speaker_submit", speaker_names) }
}) })
//For downloading the finished document
contextBridge.exposeInMainWorld("download", { contextBridge.exposeInMainWorld("download", {
file_download: () => { ipcRenderer.send("file_download") } file_download: () => { ipcRenderer.send("file_download") }
}) })