Skip to content

Commit

Permalink
5.0.0 beta.18
Browse files Browse the repository at this point in the history
  • Loading branch information
adlk authored Apr 4, 2018
2 parents 0efa33b + 5e982f8 commit 1790b79
Show file tree
Hide file tree
Showing 50 changed files with 862 additions and 641 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<a name="5.0.0-beta.18"></a>
# [5.0.0-beta.18](https://github.com/meetfranz/franz/compare/v5.0.0-beta.16...v5.0.0-beta.18) (2018-04-03)

### General
* **Translations:** Improved translations. **[A million thanks to the amazing community. 🎉](http://i18n.meetfranz.com/)**

### Features

* **App:** Add option to enable/disable hardware acceleration ([f720d30](https://github.com/meetfranz/franz/commit/f720d30))

### Bug Fixes

* **Windows:** Fix shortcuts for closing, minimizing, quitting and toggling fullscreen ([f720d30](https://github.com/meetfranz/franz/commit/f720d30))
* **Windows:** Hide title bar when in fullscreen ([655a6ed](https://github.com/meetfranz/franz/commit/655a6ed))


<a name="5.0.0-beta.17"></a>
# [5.0.0-beta.17](https://github.com/meetfranz/franz/compare/v5.0.0-beta.16...v5.0.0-beta.17) (2018-03-20)

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ before_build:
- yarn lint

build_script:
- yarn build --x64 --ia32
- yarn build

notifications:
- provider: Slack
Expand Down
6 changes: 5 additions & 1 deletion electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ dmg:

win:
icon: ./build-helpers/images/icon.ico
target: nsis
target:
target: nsis
arch:
- x64
- ia32

linux:
icon: ./build-helpers/images/icons
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "franz",
"productName": "Franz",
"appId": "com.meetfranz.franz",
"version": "5.0.0-beta.17",
"version": "5.0.0-beta.18",
"description": "Messaging app for WhatsApp, Slack, Telegram, HipChat, Hangouts and many many more.",
"copyright": "adlk x franz - Stefan Malzner",
"main": "index.js",
Expand Down
4 changes: 3 additions & 1 deletion src/actions/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import PropTypes from 'prop-types';

export default {
update: {
settings: PropTypes.object.isRequired,
type: PropTypes.string.isRequired,
data: PropTypes.object.isRequired,
},
remove: {
type: PropTypes.string.isRequired,
key: PropTypes.string.isRequired,
},
};
8 changes: 8 additions & 0 deletions src/api/LocalApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ export default class LocalApi {
this.local = local;
}

getAppSettings() {
return this.local.getAppSettings();
}

updateAppSettings(data) {
return this.local.updateAppSettings(data);
}

getAppCacheSize() {
return this.local.getAppCacheSize();
}
Expand Down
19 changes: 18 additions & 1 deletion src/api/server/LocalApi.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { remote } from 'electron';
import { ipcRenderer, remote } from 'electron';
import du from 'du';

import { getServicePartitionsDirectory } from '../../helpers/service-helpers.js';
Expand All @@ -8,6 +8,23 @@ const debug = require('debug')('LocalApi');
const { session } = remote;

export default class LocalApi {
// Settings
getAppSettings() {
return new Promise((resolve) => {
ipcRenderer.once('appSettings', (event, data) => {
debug('LocalApi::getAppSettings resolves', data);
resolve(data);
});

ipcRenderer.send('getAppSettings');
});
}

async updateAppSettings(data) {
debug('LocalApi::updateAppSettings resolves', data);
ipcRenderer.send('updateAppSettings', data);
}

// Services
async getAppCacheSize() {
const partitionsDir = getServicePartitionsDirectory();
Expand Down
4 changes: 3 additions & 1 deletion src/components/layout/AppLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const messages = defineMessages({
@observer
export default class AppLayout extends Component {
static propTypes = {
isFullScreen: PropTypes.bool.isRequired,
sidebar: PropTypes.element.isRequired,
services: PropTypes.element.isRequired,
children: PropTypes.element,
Expand All @@ -69,6 +70,7 @@ export default class AppLayout extends Component {

render() {
const {
isFullScreen,
sidebar,
services,
children,
Expand All @@ -90,7 +92,7 @@ export default class AppLayout extends Component {
return (
<div>
<div className="app">
{isWindows && <TitleBar menu={window.franz.menu.template} icon={'assets/images/logo.svg'} />}
{isWindows && !isFullScreen && <TitleBar menu={window.franz.menu.template} icon={'assets/images/logo.svg'} />}
<div className="app__content">
{sidebar}
<div className="app__service">
Expand Down
6 changes: 6 additions & 0 deletions src/components/settings/settings/EditSettingsForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ const messages = defineMessages({
id: 'settings.app.currentVersion',
defaultMessage: '!!!Current version:',
},
enableGPUAccelerationInfo: {
id: 'settings.app.restartRequired',
defaultMessage: '!!!Changes require restart',
},
});

@observer
Expand Down Expand Up @@ -172,6 +176,8 @@ export default class EditSettingsForm extends Component {
{/* Advanced */}
<h2 id="advanced">{intl.formatMessage(messages.headlineAdvanced)}</h2>
<Toggle field={form.$('enableSpellchecking')} />
<Toggle field={form.$('enableGPUAcceleration')} />
<p className="settings__help">{intl.formatMessage(messages.enableGPUAccelerationInfo)}</p>
{/* <Select field={form.$('spellcheckingLanguage')} /> */}
<div className="settings__settings-group">
<h3>
Expand Down
10 changes: 8 additions & 2 deletions src/config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
import electron from 'electron';
import path from 'path';

const app = process.type === 'renderer' ? electron.remote.app : electron.app;

export const CHECK_INTERVAL = 1000 * 3600; // How often should we perform checks
export const LOCAL_API = 'http://localhost:3000';
export const DEV_API = 'https://dev.franzinfra.com';
export const LIVE_API = 'https://api.franzinfra.com';
export const GA_ID = 'UA-74126766-6';

export const DEFAULT_APP_SETTINGS = {
autoLaunchOnStart: true,
autoLaunchInBackground: false,
runInBackground: true,
enableSystemTray: true,
minimizeToSystemTray: false,
showDisabledServices: true,
showMessageBadgeWhenMuted: true,
enableSpellchecking: true,
// spellcheckingLanguage: 'auto',
locale: '',
fallbackLocale: 'en-US',
beta: false,
isAppMuted: false,
enableGPUAcceleration: true,
};

export const FRANZ_SERVICE_REQUEST = 'http://bit.ly/franz-service-request';
export const FRANZ_TRANSLATION = 'http://bit.ly/franz-translate';

export const SETTINGS_PATH = path.join(app.getPath('userData'), 'config', 'settings.json');
7 changes: 4 additions & 3 deletions src/containers/layout/AppLayoutContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default class AppLayoutContainer extends Component {
<Sidebar
services={services.allDisplayed}
setActive={setActive}
isAppMuted={settings.all.isAppMuted}
isAppMuted={settings.all.app.isAppMuted}
openSettings={openSettings}
closeSettings={closeSettings}
reorder={reorder}
Expand All @@ -87,7 +87,7 @@ export default class AppLayoutContainer extends Component {
deleteService={deleteService}
updateService={updateService}
toggleMuteApp={toggleMuteApp}
showMessageBadgeWhenMutedSetting={settings.all.showMessageBadgeWhenMuted}
showMessageBadgeWhenMutedSetting={settings.all.app.showMessageBadgeWhenMuted}
showMessageBadgesEvenWhenMuted={ui.showMessageBadgesEvenWhenMuted}
/>
);
Expand All @@ -99,13 +99,14 @@ export default class AppLayoutContainer extends Component {
setWebviewReference={setWebviewReference}
openWindow={openWindow}
reload={reload}
isAppMuted={settings.all.isAppMuted}
isAppMuted={settings.all.app.isAppMuted}
update={updateService}
/>
);

return (
<AppLayout
isFullScreen={app.isFullScreen}
isOnline={app.isOnline}
showServicesUpdatedInfoBar={ui.showServicesUpdatedInfoBar}
appUpdateIsDownloaded={app.updateStatus === app.updateStatusTypes.DOWNLOADED}
Expand Down
52 changes: 21 additions & 31 deletions src/containers/settings/EditSettingsScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ const messages = defineMessages({
id: 'settings.app.form.enableSpellchecking',
defaultMessage: '!!!Enable spell checking',
},
enableGPUAcceleration: {
id: 'settings.app.form.enableGPUAcceleration',
defaultMessage: '!!!Enable GPU Acceleration',
},
spellcheckingLanguage: {
id: 'settings.app.form.spellcheckingLanguage',
defaultMessage: '!!!Language for spell checking',
},
// spellcheckingAutomaticDetection: {
// id: 'settings.app.form.spellcheckingAutomaticDetection',
// defaultMessage: '!!!Detect language automatically',
// },
beta: {
id: 'settings.app.form.beta',
defaultMessage: '!!!Include beta versions',
Expand All @@ -84,22 +84,24 @@ export default class EditSettingsScreen extends Component {
});

settings.update({
settings: {
type: 'app',
data: {
runInBackground: settingsData.runInBackground,
enableSystemTray: settingsData.enableSystemTray,
minimizeToSystemTray: settingsData.minimizeToSystemTray,
enableGPUAcceleration: settingsData.enableGPUAcceleration,
showDisabledServices: settingsData.showDisabledServices,
showMessageBadgeWhenMuted: settingsData.showMessageBadgeWhenMuted,
enableSpellchecking: settingsData.enableSpellchecking,
// spellcheckingLanguage: settingsData.spellcheckingLanguage,
locale: settingsData.locale,
beta: settingsData.beta,
beta: settingsData.beta, // we need this info in the main process as well
locale: settingsData.locale, // we need this info in the main process as well
},
});

user.update({
userData: {
beta: settingsData.beta,
locale: settingsData.locale,
},
});
}
Expand All @@ -116,17 +118,6 @@ export default class EditSettingsScreen extends Component {
});
});

// const spellcheckerLocales = [{
// value: 'auto',
// label: intl.formatMessage(messages.spellcheckingAutomaticDetection),
// }];
// Object.keys(SPELLCHECKER_LOCALES).forEach((key) => {
// spellcheckerLocales.push({
// value: key,
// label: SPELLCHECKER_LOCALES[key],
// });
// });

const config = {
fields: {
autoLaunchOnStart: {
Expand All @@ -141,40 +132,39 @@ export default class EditSettingsScreen extends Component {
},
runInBackground: {
label: intl.formatMessage(messages.runInBackground),
value: settings.all.runInBackground,
value: settings.all.app.runInBackground,
default: DEFAULT_APP_SETTINGS.runInBackground,
},
enableSystemTray: {
label: intl.formatMessage(messages.enableSystemTray),
value: settings.all.enableSystemTray,
value: settings.all.app.enableSystemTray,
default: DEFAULT_APP_SETTINGS.enableSystemTray,
},
minimizeToSystemTray: {
label: intl.formatMessage(messages.minimizeToSystemTray),
value: settings.all.minimizeToSystemTray,
value: settings.all.app.minimizeToSystemTray,
default: DEFAULT_APP_SETTINGS.minimizeToSystemTray,
},
showDisabledServices: {
label: intl.formatMessage(messages.showDisabledServices),
value: settings.all.showDisabledServices,
value: settings.all.app.showDisabledServices,
default: DEFAULT_APP_SETTINGS.showDisabledServices,
},
showMessageBadgeWhenMuted: {
label: intl.formatMessage(messages.showMessageBadgeWhenMuted),
value: settings.all.showMessageBadgeWhenMuted,
value: settings.all.app.showMessageBadgeWhenMuted,
default: DEFAULT_APP_SETTINGS.showMessageBadgeWhenMuted,
},
enableSpellchecking: {
label: intl.formatMessage(messages.enableSpellchecking),
value: settings.all.enableSpellchecking,
value: settings.all.app.enableSpellchecking,
default: DEFAULT_APP_SETTINGS.enableSpellchecking,
},
// spellcheckingLanguage: {
// label: intl.formatMessage(messages.spellcheckingLanguage),
// value: settings.all.spellcheckingLanguage,
// options: spellcheckerLocales,
// default: DEFAULT_APP_SETTINGS.spellcheckingLanguage,
// },
enableGPUAcceleration: {
label: intl.formatMessage(messages.enableGPUAcceleration),
value: settings.all.app.enableGPUAcceleration,
default: DEFAULT_APP_SETTINGS.enableGPUAcceleration,
},
locale: {
label: intl.formatMessage(messages.language),
value: app.locale,
Expand Down
39 changes: 27 additions & 12 deletions src/electron/Settings.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
import { observable } from 'mobx';
import { observable, toJS } from 'mobx';
import { pathExistsSync, outputJsonSync, readJsonSync } from 'fs-extra';

import { DEFAULT_APP_SETTINGS } from '../config';
import { SETTINGS_PATH, DEFAULT_APP_SETTINGS } from '../config';

const debug = require('debug')('Settings');

export default class Settings {
@observable store = {
autoLaunchOnStart: DEFAULT_APP_SETTINGS.autoLaunchOnStart,
autoLaunchInBackground: DEFAULT_APP_SETTINGS.autoLaunchInBackground,
runInBackground: DEFAULT_APP_SETTINGS.runInBackground,
enableSystemTray: DEFAULT_APP_SETTINGS.enableSystemTray,
minimizeToSystemTray: DEFAULT_APP_SETTINGS.minimizeToSystemTray,
locale: DEFAULT_APP_SETTINGS.locale,
beta: DEFAULT_APP_SETTINGS.beta,
};
@observable store = DEFAULT_APP_SETTINGS;

constructor() {
if (!pathExistsSync(SETTINGS_PATH)) {
this._writeFile();
} else {
this._hydrate();
}
}

set(settings) {
this.store = Object.assign(this.store, settings);

this._writeFile();
}

all() {
get all() {
return this.store;
}

get(key) {
return this.store[key];
}

_hydrate() {
this.store = readJsonSync(SETTINGS_PATH);
debug('Hydrate store', toJS(this.store));
}

_writeFile() {
outputJsonSync(SETTINGS_PATH, this.store);
debug('Write settings file', toJS(this.store));
}
}
Loading

0 comments on commit 1790b79

Please sign in to comment.