mirror of
https://github.com/pierre42100/ComunicDesktop
synced 2024-12-26 02:48: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 electron = require('electron');
|
||||||
const app = electron.app;
|
|
||||||
const BrowserWindow = electron.BrowserWindow;
|
const BrowserWindow = electron.BrowserWindow;
|
||||||
|
const {app, Menu, Tray} = require('electron')
|
||||||
|
|
||||||
let mainWindow
|
let mainWindow
|
||||||
|
let tray = null
|
||||||
|
|
||||||
function createWindow() {
|
function main(){
|
||||||
mainWindow = new BrowserWindow({
|
mainWindow = new BrowserWindow({
|
||||||
icon:'resources/app/icon.png',
|
icon:'icon.png',
|
||||||
webPreferences: {
|
webPreferences :{
|
||||||
nodeIntegration: false,
|
nodeIntegration :false
|
||||||
preload: './preload.js'
|
},
|
||||||
}
|
show: false
|
||||||
});
|
});
|
||||||
mainWindow.setIco
|
mainWindow.maximize();
|
||||||
mainWindow.loadURL('https://beta.communiquons.org/');
|
//createWindow --> create the window
|
||||||
|
mainWindow.loadURL('https://comunic.io');
|
||||||
|
//set the url who must be open
|
||||||
|
|
||||||
mainWindow.on('closed', () =>{
|
mainWindow.on('closed', () =>{
|
||||||
mainWindow = null;
|
mainWindow = null;
|
||||||
});
|
});
|
||||||
}
|
//To close the window
|
||||||
app.on('window-all-closed', () =>{
|
|
||||||
if(process.platform !== 'darwin'){
|
|
||||||
app.quit();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
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",
|
"name": "communic-desktop",
|
||||||
"version": "0.1.0",
|
"version": "0.2.0",
|
||||||
"description": "A client-desktop for communiquons.org",
|
"description": "A client-desktop for communiquons.org",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Loading…
Reference in New Issue
Block a user