Compare commits

..

1 Commits

Author SHA1 Message Date
Michael Telatynski
0acb44d696 Wire up electron download progress to toasts 2021-04-14 10:58:11 +01:00
8 changed files with 70 additions and 41 deletions

View File

@@ -1,22 +1,3 @@
Changes in [1.7.26](https://github.com/vector-im/element-desktop/releases/tag/v1.7.26) (2021-04-26)
===================================================================================================
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.26-rc.1...v1.7.26)
* No changes since rc.1
Changes in [1.7.26-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.26-rc.1) (2021-04-21)
=============================================================================================================
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.25...v1.7.26-rc.1)
* Remove Debian dependency libappindicator3-1
[\#170](https://github.com/vector-im/element-desktop/pull/170)
* Fix exit shortcuts for non QWERTY keyboards
[\#185](https://github.com/vector-im/element-desktop/pull/185)
* Fix using yarn run fetch with a specific version
[\#182](https://github.com/vector-im/element-desktop/pull/182)
* Switch nightly to not-staging Scalar by default
[\#181](https://github.com/vector-im/element-desktop/pull/181)
Changes in [1.7.25](https://github.com/vector-im/element-desktop/releases/tag/v1.7.25) (2021-04-12)
===================================================================================================
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.25-rc.1...v1.7.25)

View File

@@ -3,8 +3,7 @@ License: Apache-2.0
Vendor: support@element.io
Architecture: amd64
Maintainer: support@element.io
Depends: libgtk-3-0, libnotify4, libnss3, libxss1, libxtst6, xdg-utils, libatspi2.0-0, libuuid1, libsecret-1-0, libsqlcipher0
Recommends: libappindicator3-1
Depends: libgtk-3-0, libnotify4, libnss3, libxss1, libxtst6, xdg-utils, libatspi2.0-0, libuuid1, libappindicator3-1, libsecret-1-0, libsqlcipher0
Section: net
Priority: extra
Homepage: https://element.io/

View File

@@ -3,8 +3,7 @@ License: Apache-2.0
Vendor: support@element.io
Architecture: amd64
Maintainer: support@element.io
Depends: libgtk-3-0, libnotify4, libnss3, libxss1, libxtst6, xdg-utils, libatspi2.0-0, libuuid1, libsecret-1-0, libsqlcipher0
Recommends: libappindicator3-1
Depends: libgtk-3-0, libnotify4, libnss3, libxss1, libxtst6, xdg-utils, libatspi2.0-0, libuuid1, libappindicator3-1, libsecret-1-0, libsqlcipher0
Replaces: riot-desktop (<< 1.7.0), riot-web (<< 1.7.0)
Breaks: riot-desktop (<< 1.7.0), riot-web (<< 1.7.0)
Section: net

View File

@@ -2,7 +2,7 @@
"name": "element-desktop",
"productName": "Element",
"main": "src/electron-main.js",
"version": "1.7.26",
"version": "1.7.25",
"description": "A feature-rich client for Matrix.org",
"author": "Element",
"repository": {

View File

@@ -15,7 +15,7 @@ const PUB_KEY_URL = "https://packages.riot.im/element-release-key.asc";
const PACKAGE_URL_PREFIX = "https://github.com/vector-im/element-web/releases/download/";
const ASAR_PATH = 'webapp.asar';
const {setPackageVersion} = require('./set-version.js');
const {setPackageVersion, setDebVersion} = require('./set-version.js');
async function getLatestDevelopUrl(bkToken) {
const buildsResult = await needle('get',
@@ -283,6 +283,7 @@ async function main() {
const semVer = targetVersion.slice(1);
console.log("Updating version to " + semVer);
await setPackageVersion(semVer);
await setDebVersion(semVer);
}
console.log("Done!");

View File

@@ -256,9 +256,9 @@ let mainWindow = null;
global.appQuitting = false;
const exitShortcuts = [
(input, platform) => platform !== 'darwin' && input.alt && input.key.toUpperCase() === 'F4',
(input, platform) => platform !== 'darwin' && input.control && input.key.toUpperCase() === 'Q',
(input, platform) => platform === 'darwin' && input.meta && input.key.toUpperCase() === 'Q',
(input, platform) => platform !== 'darwin' && input.alt && input.code === 'F4',
(input, platform) => platform !== 'darwin' && input.control && input.code === 'KeyQ',
(input, platform) => platform === 'darwin' && input.meta && input.code === 'KeyQ',
];
const warnBeforeExit = (event, input) => {

View File

@@ -32,8 +32,7 @@ const CHANNELS = [
"seshatReply",
"setBadgeCount",
"update-downloaded",
"userDownloadCompleted",
"userDownloadOpen",
"userDownload",
];
contextBridge.exposeInMainWorld(
@@ -46,6 +45,13 @@ contextBridge.exposeInMainWorld(
}
ipcRenderer.on(channel, listener);
},
removeListener(channel, listener) {
if (!CHANNELS.includes(channel)) {
console.error(`Unknown IPC channel ${channel} ignored`);
return;
}
ipcRenderer.removeListener(channel, listener);
},
send(channel, ...args) {
if (!CHANNELS.includes(channel)) {
console.error(`Unknown IPC channel ${channel} ignored`);

View File

@@ -206,10 +206,6 @@ function onEditableContextMenu(ev, params) {
ev.preventDefault();
}
ipcMain.on('userDownloadOpen', function(ev, {path}) {
shell.openPath(path);
});
module.exports = (webContents) => {
webContents.on('new-window', onWindowOrNavigate);
webContents.on('will-navigate', (ev, target) => {
@@ -228,13 +224,60 @@ module.exports = (webContents) => {
});
webContents.session.on('will-download', (event, item) => {
item.once('done', (event, state) => {
if (state === 'completed') {
const savePath = item.getSavePath();
webContents.send('userDownloadCompleted', {
path: savePath,
name: path.basename(savePath),
});
let started = false;
const ipcHandler = function(ev, {action, path}) {
if (path !== item.savePath) return;
switch (action) {
case "download":
shell.openPath(path);
ipcMain.off("userDownload", ipcHandler);
break;
case "pause":
item.pause();
break;
case "resume":
item.resume();
break;
case "cancel":
item.cancel();
ipcMain.off("userDownload", ipcHandler);
break;
case "done":
ipcMain.off("userDownload", ipcHandler);
break;
}
};
ipcMain.on("userDownload", ipcHandler);
item.on("updated", (event, state) => {
if (!item.savePath) return;
webContents.send("userDownload", {
state,
path: item.savePath,
name: path.basename(item.savePath),
totalBytes: item.getTotalBytes(),
receivedBytes: item.getReceivedBytes(),
begin: !started,
});
if (!started) started = true;
});
item.once("done", (event, state) => {
if (!item.savePath) return;
webContents.send("userDownload", {
state,
path: item.savePath,
name: path.basename(item.savePath),
totalBytes: item.getTotalBytes(),
receivedBytes: item.getReceivedBytes(),
terminal: true,
});
if (state === "interrupted") {
ipcMain.off("userDownload", ipcHandler);
}
});
});