diff --git a/electron_app/package.json b/electron_app/package.json index 8da35d8438..0b6113e772 100644 --- a/electron_app/package.json +++ b/electron_app/package.json @@ -6,7 +6,8 @@ "description": "A feature-rich client for Matrix.org", "author": "Vector Creations Ltd.", "dependencies": { + "electron-window-state": "^4.1.0", "auto-launch": "^5.0.1", - "electron-window-state": "^4.1.0" + "minimist": "^1.2.0" } } diff --git a/electron_app/src/electron-main.js b/electron_app/src/electron-main.js index f21fe1c01a..ef0d173c00 100644 --- a/electron_app/src/electron-main.js +++ b/electron_app/src/electron-main.js @@ -21,6 +21,7 @@ limitations under the License. const checkSquirrelHooks = require('./squirrelhooks'); if (checkSquirrelHooks()) return; +const argv = require('minimist')(process.argv); const electron = require('electron'); const AutoLaunch = require('auto-launch'); @@ -30,6 +31,10 @@ const webContentsHandler = require('./webcontents-handler'); const windowStateKeeper = require('electron-window-state'); +if (argv.profile) { + electron.app.setPath('userData', `${electron.app.getPath('userData')}-${argv.profile}`); +} + let vectorConfig = {}; try { vectorConfig = require('../../webapp/config.json'); @@ -119,19 +124,19 @@ electron.ipcMain.on('install_update', installUpdate); let focusHandlerAttached = false; electron.ipcMain.on('setBadgeCount', function(ev, count) { electron.app.setBadgeCount(count); - if (process.platform === 'win32' && mainWindow && !mainWindow.isFocused()) { - if (count > 0) { - if (!focusHandlerAttached) { - mainWindow.once('focus', () => { - mainWindow.flashFrame(false); - focusHandlerAttached = false; - }); - focusHandlerAttached = true; - } - mainWindow.flashFrame(true); - } else { + if (count === 0) { + mainWindow.flashFrame(false); + } +}); + +electron.ipcMain.on('loudNotification', function() { + if (process.platform === 'win32' && mainWindow && !mainWindow.isFocused() && !focusHandlerAttached) { + mainWindow.flashFrame(true); + mainWindow.once('focus', () => { mainWindow.flashFrame(false); - } + focusHandlerAttached = false; + }); + focusHandlerAttached = true; } }); @@ -166,7 +171,7 @@ const shouldQuit = electron.app.makeSingleInstance((commandLine, workingDirector if (shouldQuit) { console.log('Other instance detected: exiting'); - electron.app.quit(); + electron.app.exit(); } @@ -249,7 +254,7 @@ electron.app.on('ready', () => { brand: vectorConfig.brand || 'Riot', }); - if (!process.argv.includes('--hidden')) { + if (!argv.hidden) { mainWindow.once('ready-to-show', () => { mainWindow.show(); }); diff --git a/package.json b/package.json index 951a9fc5fd..52b0fd747b 100644 --- a/package.json +++ b/package.json @@ -65,8 +65,8 @@ "gfm.css": "^1.1.1", "highlight.js": "^9.0.0", "linkifyjs": "^2.1.3", - "matrix-js-sdk": "matrix-org/matrix-js-sdk#develop", - "matrix-react-sdk": "matrix-org/matrix-react-sdk#develop", + "matrix-js-sdk": "0.7.9", + "matrix-react-sdk": "0.9.0-rc.1", "modernizr": "^3.1.0", "pako": "^1.0.5", "q": "^1.4.1", diff --git a/scripts/fetch-develop.deps.sh b/scripts/fetch-develop.deps.sh index 29309f2117..b39e08399c 100755 --- a/scripts/fetch-develop.deps.sh +++ b/scripts/fetch-develop.deps.sh @@ -42,13 +42,13 @@ dodep matrix-org matrix-react-sdk mkdir -p node_modules cd node_modules -rm -r matrix-js-sdk 2> /dev/null +rm -r matrix-js-sdk 2> /dev/null || true ln -s ../matrix-js-sdk ./ pushd matrix-js-sdk npm install popd -rm -r matrix-react-sdk 2> /dev/null +rm -r matrix-react-sdk 2> /dev/null || true ln -s ../matrix-react-sdk ./ pushd matrix-react-sdk mkdir -p node_modules diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 5445fd4fb8..e3f4d14042 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -182,7 +182,7 @@ module.exports = React.createClass({ if (content.msgtype && content.msgtype !== 'm.bad.encrypted' && content.hasOwnProperty('body')) { forwardButton = (
- Forward Message + { _t('Forward Message') }
); } diff --git a/src/components/views/dialogs/BugReportDialog.js b/src/components/views/dialogs/BugReportDialog.js index 7a65ac587f..0db425e33f 100644 --- a/src/components/views/dialogs/BugReportDialog.js +++ b/src/components/views/dialogs/BugReportDialog.js @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import sdk from 'matrix-react-sdk'; import SdkConfig from 'matrix-react-sdk/lib/SdkConfig'; +import { _t } from 'matrix-react-sdk/lib/languageHandler'; export default class BugReportDialog extends React.Component { constructor(props, context) { @@ -49,12 +50,12 @@ export default class BugReportDialog extends React.Component { const userText = this.state.text; if (!sendLogs && userText.trim().length === 0) { this.setState({ - err: "Please describe the bug and/or send logs.", + err: _t("Please describe the bug and/or send logs."), }); return; } this.setState({ busy: true, progress: null, err: null }); - this._sendProgressCallback("Loading bug report module"); + this._sendProgressCallback(_t("Loading bug report module")); require(['../../../vector/submit-rageshake'], (s) => { s(SdkConfig.get().bug_report_endpoint_url, { @@ -69,8 +70,9 @@ export default class BugReportDialog extends React.Component { }, (err) => { if (!this._unmounted) { this.setState({ - busy: false, progress: null, - err: `Failed to send report: ${err.message}`, + busy: false, + progress: null, + err: _t("Failed to send report: ") + `${err.message}`, }); } }); @@ -105,7 +107,7 @@ export default class BugReportDialog extends React.Component { let cancelButton = null; if (!this.state.busy) { cancelButton = ; } @@ -122,25 +124,27 @@ export default class BugReportDialog extends React.Component { return (
- Report a bug + { _t("Report a bug") }
-

Please describe the bug. What did you do? - What did you expect to happen? - What actually happened?

+

+ { _t("Please describe the bug. What did you do? What did you expect to happen? What actually happened?") } +