Skip to content

Commit

Permalink
Merge branch 'release-v0.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
Antelle committed Nov 22, 2015
2 parents f155245 + 8407c76 commit bd4e4f4
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 9 deletions.
5 changes: 4 additions & 1 deletion app/scripts/comp/launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if (window.process && window.process.versions && window.process.versions.electro
return false;
},
exit: function() {
Launcher.exitRequested = true;
this.exitRequested = true;
this.requestExit();
},
requestExit: function() {
Expand Down Expand Up @@ -85,6 +85,9 @@ if (window.process && window.process.versions && window.process.versions.electro
return process.platform === 'win32';
}
};
Backbone.on('launcher-exit-request', function() {
setTimeout(function() { Launcher.exit(); }, 0);
});
window.launcherOpen = function(path) {
Backbone.trigger('launcher-open-file', path);
};
Expand Down
26 changes: 21 additions & 5 deletions electron/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var app = require('app'),
Tray = require('tray');

var mainWindow = null,
appIcon = null,
openFile = process.argv.filter(function(arg) { return /\.kdbx$/i.test(arg); })[0],
ready = false,
restartPending = false,
Expand Down Expand Up @@ -65,15 +66,30 @@ app.minimizeApp = function() {
if (process.platform === 'win32') {
mainWindow.minimize();
mainWindow.setSkipTaskbar(true);
var appIcon = new Tray(path.join(__dirname, 'icon.png'));
appIcon.on('clicked', function () {
mainWindow.restore();
mainWindow.setSkipTaskbar(false);
});
appIcon = new Tray(path.join(__dirname, 'icon.png'));
appIcon.on('clicked', restoreMainWindow);
var contextMenu = Menu.buildFromTemplate([
{ label: 'Open KeeWeb', click: restoreMainWindow },
{ label: 'Quit KeeWeb', click: closeMainWindow }
]);
appIcon.setContextMenu(contextMenu);
appIcon.setToolTip('KeeWeb');
}
};

function restoreMainWindow() {
appIcon.destroy();
appIcon = null;
mainWindow.restore();
mainWindow.setSkipTaskbar(false);
}

function closeMainWindow() {
appIcon.destroy();
appIcon = null;
mainWindow.webContents.executeJavaScript('Backbone.trigger("launcher-exit-request");');
}

function setMenu() {
if (process.platform === 'darwin') {
var name = require('app').getName();
Expand Down
2 changes: 1 addition & 1 deletion electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "KeeWeb",
"version": "0.4.2",
"version": "0.4.3",
"description": "KeePass web app",
"main": "main.js",
"repository": "https://github.com/antelle/keeweb",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "keeweb",
"version": "0.4.2",
"version": "0.4.3",
"description": "KeePass web app",
"main": "Gruntfile.js",
"repository": "https://github.com/antelle/keeweb",
Expand Down
5 changes: 4 additions & 1 deletion release-notes.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
Release notes
-------------
##### v0.4.3 (2015-11-22)
Windows minimize to tray bugfix

##### v0.4.1, v0.4.2 (2015-11-22)
Auto-update bugfixes
Auto-update and bugfixes

##### v0.4.0 (2015-11-22)
Locking, better Dropbox, custom icons, security enhancements, bugfixes
Expand Down

0 comments on commit bd4e4f4

Please sign in to comment.