mirror of
https://github.com/pierre42100/ComunicDesktop
synced 2024-12-25 18:38:51 +00:00
Add version 0.2.0
This commit is contained in:
parent
01ced676a6
commit
5ac9adefd4
75
index.js
75
index.js
@ -1,28 +1,69 @@
|
||||
const electron = require('electron');
|
||||
const app = electron.app;
|
||||
const BrowserWindow = electron.BrowserWindow;
|
||||
const {app, Menu, Tray} = require('electron')
|
||||
|
||||
let mainWindow
|
||||
let tray = null
|
||||
|
||||
function createWindow() {
|
||||
function main(){
|
||||
mainWindow = new BrowserWindow({
|
||||
icon:'resources/app/icon.png',
|
||||
webPreferences: {
|
||||
nodeIntegration: false,
|
||||
preload: './preload.js'
|
||||
}
|
||||
icon:'icon.png',
|
||||
webPreferences :{
|
||||
nodeIntegration :false
|
||||
},
|
||||
show: false
|
||||
});
|
||||
mainWindow.setIco
|
||||
mainWindow.loadURL('https://beta.communiquons.org/');
|
||||
|
||||
mainWindow.maximize();
|
||||
//createWindow --> create the window
|
||||
mainWindow.loadURL('https://comunic.io');
|
||||
//set the url who must be open
|
||||
|
||||
mainWindow.on('closed', () =>{
|
||||
mainWindow = null;
|
||||
});
|
||||
}
|
||||
app.on('window-all-closed', () =>{
|
||||
if(process.platform !== 'darwin'){
|
||||
app.quit();
|
||||
}
|
||||
});
|
||||
//To close the window
|
||||
|
||||
app.on('ready', createWindow);
|
||||
tray = new Tray('./icon.png');
|
||||
|
||||
tray.setToolTip('Comunic');
|
||||
|
||||
|
||||
tray.setContextMenu(menu_1);
|
||||
|
||||
console.log("Started succesfully");
|
||||
|
||||
mainWindow.once('ready-to-show', () => {
|
||||
mainWindow.show()
|
||||
})
|
||||
};
|
||||
const menu_1 = Menu.buildFromTemplate([{
|
||||
label: "Ouvrir la version stable",
|
||||
click: () => {
|
||||
mainWindow.loadURL('https://communiquons.org');
|
||||
tray.setContextMenu(menu_2)
|
||||
}
|
||||
},
|
||||
{
|
||||
label : 'Quit',
|
||||
click: () => {
|
||||
app.quit();
|
||||
console.log("Closed");
|
||||
}
|
||||
}]);
|
||||
const menu_2 = Menu.buildFromTemplate([{
|
||||
label: "Ouvrir la nouvelle version",
|
||||
click: () =>{
|
||||
mainWindow.loadURL('https://comunic.io');
|
||||
tray.setContextMenu(menu_1)
|
||||
}
|
||||
},
|
||||
{
|
||||
label:'Quit',
|
||||
click: () => {
|
||||
app.quit();
|
||||
console.log("Closed");
|
||||
}
|
||||
}]);
|
||||
|
||||
console.log("Starting...");
|
||||
app.on('ready', main);
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "communic-desktop",
|
||||
"version": "0.1.0",
|
||||
"version": "0.2.0",
|
||||
"description": "A client-desktop for communiquons.org",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
Loading…
Reference in New Issue
Block a user