From ee991f617741b6bb8f135c7f4e53f995f191af36 Mon Sep 17 00:00:00 2001 From: sidneys Date: Fri, 20 Jan 2017 17:08:58 +0100 Subject: [PATCH] v3.3.0 --- .travis.yml | 1 + app/scripts/menus/tray-menu.js | 6 +++-- app/scripts/windows/main-window.js | 28 +++++++++++++++++++++--- lib/deploy-github.js | 2 +- package.json | 35 +++++++++++++++++++++++++----- 5 files changed, 60 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 229a9c84..b3d32eec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,7 @@ cache: addons: apt: packages: + - bsdtar - icnsutils - gcc-multilib - g++-multilib diff --git a/app/scripts/menus/tray-menu.js b/app/scripts/menus/tray-menu.js index 1996e10d..c8cde98c 100644 --- a/app/scripts/menus/tray-menu.js +++ b/app/scripts/menus/tray-menu.js @@ -197,9 +197,11 @@ class TrayMenu extends Tray { this.on('click', () => { logger.debug('tray-menu', 'Tray:click'); - let mainWindow = BrowserWindow.getAllWindows()[0]; - if (platformHelper.isWindows) { + let mainWindow = BrowserWindow.getAllWindows()[0]; + + if (!mainWindow) { return; } + if (mainWindow.isVisible()) { mainWindow.hide(); } else { diff --git a/app/scripts/windows/main-window.js b/app/scripts/windows/main-window.js index 26984d37..ad089df1 100644 --- a/app/scripts/windows/main-window.js +++ b/app/scripts/windows/main-window.js @@ -59,7 +59,7 @@ const appIcon = path.join(appRootPath, 'icons', platformHelper.type, 'icon' + pl /** * @global */ -let mainWindow = {}; +let mainWindow; /** @@ -173,6 +173,28 @@ class MainWindow extends BrowserWindow { } } + +/** + * Create Window + */ +let createMainWindow = () => { + logger.debug('main-window', 'createMainWindow()'); + + if (mainWindow) { return; } + + mainWindow = new MainWindow(); +}; + +/** + * Get Window + */ +let getMainWindow = () => { + logger.debug('main-window', 'getMainWindow()'); + + return mainWindow; +}; + + /** @listens Electron.App#on */ app.on('activate', () => { logger.debug('main-window', 'App:activate'); @@ -184,11 +206,11 @@ app.on('activate', () => { app.on('ready', () => { logger.debug('main-window', 'App:ready'); - mainWindow = new MainWindow(); + createMainWindow(); }); /** * @exports */ -module.exports = mainWindow; +module.exports = getMainWindow(); diff --git a/lib/deploy-github.js b/lib/deploy-github.js index 45ca546f..3b21fef6 100644 --- a/lib/deploy-github.js +++ b/lib/deploy-github.js @@ -67,7 +67,7 @@ let getArtifactsList = function(directory) { return; } - let installerFilePathPattern = path.join(path.resolve(directoryOutput), '**', '*.{dmg,exe,deb,zip,json}'); + let installerFilePathPattern = path.join(path.resolve(directoryOutput), '**', '*.{AppImage,deb,dmg,exe,json,pacman,zip}'); let installerIgnorePatternList = [ path.join(path.resolve(directoryOutput), 'mac', '*.app', '**', '*'), path.join(path.resolve(directoryOutput), '*-unpacked', '**', '*'), diff --git a/package.json b/package.json index 1c1ce046..abb7c876 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pb-for-desktop", "productName": "PB for Desktop", - "version": "3.2.1", + "version": "3.3.0", "description": "PushBullet desktop application for macOS, Windows and Linux", "license": "MIT", "homepage": "https://sidneys.github.io/pb-for-desktop", @@ -47,11 +47,11 @@ "app-root-path": "^2.0.1", "appdirectory": "^0.1.0", "auto-launch": "^5.0.1", - "babel-cli": "^6.18.0", + "babel-cli": "^6.22.2", "babel-preset-electron": "^0.37.8", "chalk": "^1.1.3", "electron-auto-updater": "^1.0.0", - "electron-compile": "^5.1.2", + "electron-compile": "^5.1.3", "electron-compilers": "^5.3.2", "electron-connect": "^0.6.1", "electron-editor-context-menu": "^1.1.1", @@ -69,9 +69,9 @@ "semver-regex": "^1.0.0" }, "devDependencies": { - "electron": "^1.4.14", + "electron": "^1.4.15", "electron-builder": "^11.4.4", - "electron-builder-squirrel-windows": "^11.4.0", + "electron-builder-squirrel-windows": "^11.5.0", "fkill": "^4.1.0", "glob": "^7.1.1", "gulp": "^3.9.1", @@ -126,14 +126,37 @@ }, "linux": { "target": [ - "deb" + "AppImage", + "deb", + "pacman" ], "category": "Utility" }, + "AppImage": { + "includeRequiredLib": true + }, + "deb": { + "depends": [ + "libappindicator1", + "libnotify-bin", + "libnotify4" + ] + }, + "appImage": { + "includeRequiredLib": true + }, "dmg": { "background": "./icons/darwin/background-setup.png", "icon": "./icons/darwin/icon-setup.icns" }, + "pacman": { + "depends": [ + "libappindicator-gtk2", + "libappindicator-gtk3", + "libappindicator-sharp", + "libnotify" + ] + }, "squirrelWindows": { "iconUrl": "https://raw.githubusercontent.com/sidneys/pb-for-desktop/release/icons/win32/icon.ico", "loadingGif": "./icons/win32/background-setup.gif"