parent
b2c6b5d037
commit
f7f7bcd465
20
app/app.js
20
app/app.js
|
@ -20,6 +20,7 @@ const electron = require('electron');
|
||||||
const app = require('electron').app;
|
const app = require('electron').app;
|
||||||
const BrowserWindow = require('electron').BrowserWindow;
|
const BrowserWindow = require('electron').BrowserWindow;
|
||||||
const {ipcMain} = require('electron');
|
const {ipcMain} = require('electron');
|
||||||
|
const {globalShortcut} = require('electron');
|
||||||
var updater = require('electron').autoUpdater
|
var updater = require('electron').autoUpdater
|
||||||
|
|
||||||
var mainWindow = null;
|
var mainWindow = null;
|
||||||
|
@ -105,8 +106,6 @@ app.on('ready', function() {
|
||||||
parent:mainWindow
|
parent:mainWindow
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
introWindow.loadURL('file://' + __dirname + '/splash.html');
|
introWindow.loadURL('file://' + __dirname + '/splash.html');
|
||||||
//mainWindow.setMenu(null);
|
//mainWindow.setMenu(null);
|
||||||
introWindow.webContents.on('did-finish-load', () => {
|
introWindow.webContents.on('did-finish-load', () => {
|
||||||
|
@ -157,8 +156,16 @@ app.on('ready', function() {
|
||||||
});
|
});
|
||||||
ipcMain.on('pt-did-finish-load',function(){
|
ipcMain.on('pt-did-finish-load',function(){
|
||||||
mainWindow.show()
|
mainWindow.show()
|
||||||
|
|
||||||
|
globalShortcut.register('CommandOrControl+J', () => {
|
||||||
|
openPTSettings()
|
||||||
|
})
|
||||||
|
|
||||||
|
// Animations GC
|
||||||
|
|
||||||
introWindow.hide()
|
introWindow.hide()
|
||||||
})
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//Splash handling
|
//Splash handling
|
||||||
|
@ -220,7 +227,7 @@ ipcMain.on('maximise-main-window', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
// PT Settings Window
|
// PT Settings Window
|
||||||
ipcMain.on('open-ptsettings-window', function () {
|
function openPTSettings(){
|
||||||
if (settingsWindow.isVisible()) {
|
if (settingsWindow.isVisible()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -229,8 +236,12 @@ ipcMain.on('open-ptsettings-window', function () {
|
||||||
settingsWindow.on('closed', function () {
|
settingsWindow.on('closed', function () {
|
||||||
settingsWindow.hide()
|
settingsWindow.hide()
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
ipcMain.on('open-ptsettings-window', function () {
|
||||||
|
openPTSettings()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
ipcMain.on('close-ptsettings-window', function () {
|
ipcMain.on('close-ptsettings-window', function () {
|
||||||
settingsWindow.reload();
|
settingsWindow.reload();
|
||||||
settingsWindow.hide()
|
settingsWindow.hide()
|
||||||
|
@ -312,6 +323,7 @@ ipcMain.on('home-tab-initialize', function(event){
|
||||||
}
|
}
|
||||||
event.sender.send('home-tab-initialize-result',plex.user.username
|
event.sender.send('home-tab-initialize-result',plex.user.username
|
||||||
,plex.clients,plex.servers);
|
,plex.clients,plex.servers);
|
||||||
|
|
||||||
});
|
});
|
||||||
ipcMain.on('home-tab-me-avatar',function(){
|
ipcMain.on('home-tab-me-avatar',function(){
|
||||||
var path = getAppDataDir() + '/' + plex.user.username
|
var path = getAppDataDir() + '/' + plex.user.username
|
||||||
|
@ -474,8 +486,6 @@ ipcMain.on('join-ptroom',function(event,userData){
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Handlers for once were in a room
|
//Handlers for once were in a room
|
||||||
ipcMain.on('join-room-ok',function(event,data,details,currentUsers){
|
ipcMain.on('join-room-ok',function(event,data,details,currentUsers){
|
||||||
mainWindow.send('pt-server-showInfo')
|
mainWindow.send('pt-server-showInfo')
|
||||||
|
|
Loading…
Reference in New Issue