Skip to content

Commit

Permalink
[DDW-781] Blank Screen Fix - Default Selection. (#1488)
Browse files Browse the repository at this point in the history
* [DDW-781] Blank Screen Fix - Default Selection.

* [DDW-711] Replaces button No by Cancel

* [DDW-781] Fixes buttons focus

* DDW-781 CHANGELOG
  • Loading branch information
thedanheller committed Jul 30, 2019
1 parent 92333f8 commit c8a96fe
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 77 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Changelog

- Implemented guided manual updates ([PR 1410](https://github.com/input-output-hk/daedalus/pull/1410), [PR 1423](https://github.com/input-output-hk/daedalus/pull/1423))
- Application menu improvements:
- Implemented "Help" application menu item with "Known Issues", "Blank Screen Fix", "Feature Request", "Support Request", "Download Logs", "Block Consolidation Status" and "Daedalus Diagnostics" options ([PR 1382](https://github.com/input-output-hk/daedalus/pull/1382), [PR 1459](https://github.com/input-output-hk/daedalus/pull/1459), [PR 1487](https://github.com/input-output-hk/daedalus/issues/1487))
- Implemented "Help" application menu item with "Known Issues", "Blank Screen Fix", "Feature Request", "Support Request", "Download Logs", "Block Consolidation Status" and "Daedalus Diagnostics" options ([PR 1382](https://github.com/input-output-hk/daedalus/pull/1382), [PR 1459](https://github.com/input-output-hk/daedalus/pull/1459), [PR 1487](https://github.com/input-output-hk/daedalus/issues/1487), [PR 1488](https://github.com/input-output-hk/daedalus/pull/1488))
- Improved the "Ada redemption" menu item UX by disabling the option while Daedalus is not fully synced ([PR 1458](https://github.com/input-output-hk/daedalus/pull/1458))
- Application dialogs improvements:
- Implemented new "About Us" dialog design ([PR 1369](https://github.com/input-output-hk/daedalus/pull/1369), [PR 1450](https://github.com/input-output-hk/daedalus/pull/1450))
Expand Down
1 change: 0 additions & 1 deletion source/main/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"menu.helpSupport.gpuSafeModeDialogCancel": "Cancel",
"menu.helpSupport.gpuSafeModeDialogConfirm": "Yes",
"menu.helpSupport.gpuSafeModeDialogMessage": "Turn off 'Blank screen fix'? \n \nDisabling the blank screen fix setting will improve the performance of user interface rendering by enabling graphics acceleration, however, some users may find that Daedalus runs better with this setting enabled. If you see a blank screen instead of the Daedalus user interface after disabling this setting and restarting Daedalus, please turn this setting back on. \n \nDo you want to disable this setting and restart Daedalus?",
"menu.helpSupport.gpuSafeModeDialogNo": "No",
"menu.helpSupport.gpuSafeModeDialogTitle": "Turn off 'Blank screen fix'?",
"menu.helpSupport.knownIssues": "Known Issues",
"menu.helpSupport.knownIssuesUrl": "https://daedaluswallet.io/known-issues/",
Expand Down
1 change: 0 additions & 1 deletion source/main/locales/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"menu.helpSupport.gpuSafeModeDialogCancel": "キャンセル",
"menu.helpSupport.gpuSafeModeDialogConfirm": "はい",
"menu.helpSupport.gpuSafeModeDialogMessage": "「ブランク画面修正」を無効にしますか? \n \nブランク画面修正設定を無効にすると、グラフィックアクセラレーションが有効化されてユーザーインターフェイスのレンダリングパフォーマンスが向上しますが、この設定を有効にした方がDaedalusがスムーズに作動する場合があります。この設定を無効にしてDaedalusを再起動した際にDaedalusユーザーインターフェイスの代わりにブランク画面が表示される場合は、この設定をもう一度有効にしてください。 \n \nこの設定を無効にしてDaedalusを再起動しますか。",
"menu.helpSupport.gpuSafeModeDialogNo": "いいえ",
"menu.helpSupport.gpuSafeModeDialogTitle": "「ブランク画面修正」を無効にしますか?",
"menu.helpSupport.knownIssues": "既知の問題",
"menu.helpSupport.knownIssuesUrl": "https://daedaluswallet.io/ja/known-issues/",
Expand Down
3 changes: 1 addition & 2 deletions source/main/menus/MenuActions.types.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @flow
export type MenuActions = {
restartInSafeMode: Function,
restartWithoutSafeMode: Function,
toggleOnSafeMode: Function,
openAboutDialog: Function,
openAdaRedemptionScreen: Function,
openBlockConsolidationStatusDialog: Function,
Expand Down
29 changes: 2 additions & 27 deletions source/main/menus/osx.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow
import { compact } from 'lodash';
import { dialog, shell } from 'electron';
import { shell } from 'electron';
import type { App, BrowserWindow } from 'electron';
import type { MenuActions } from './MenuActions.types';
import { getTranslation } from '../utils/getTranslation';
Expand Down Expand Up @@ -131,32 +131,7 @@ export const osxMenu = (
type: 'checkbox',
checked: isInSafeMode,
click(item) {
const gpuSafeModeDialogOptions = {
buttons: [
translation('helpSupport.gpuSafeModeDialogConfirm'),
translation('helpSupport.gpuSafeModeDialogNo'),
translation('helpSupport.gpuSafeModeDialogCancel'),
],
type: 'warning',
title: isInSafeMode
? translation('helpSupport.gpuSafeModeDialogTitle')
: translation('helpSupport.nonGpuSafeModeDialogTitle'),
message: isInSafeMode
? translation('helpSupport.gpuSafeModeDialogMessage')
: translation('helpSupport.nonGpuSafeModeDialogMessage'),
defaultId: 2,
cancelId: 2,
};
dialog.showMessageBox(window, gpuSafeModeDialogOptions, buttonId => {
if (buttonId === 0) {
if (isInSafeMode) {
actions.restartWithoutSafeMode();
} else {
actions.restartInSafeMode();
}
}
item.checked = isInSafeMode;
});
actions.toggleOnSafeMode(item);
},
},
{ type: 'separator' },
Expand Down
30 changes: 2 additions & 28 deletions source/main/menus/win-linux.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow
import { compact } from 'lodash';
import { dialog, shell } from 'electron';
import { shell } from 'electron';
import type { App, BrowserWindow } from 'electron';
import type { MenuActions } from './MenuActions.types';
import { getTranslation } from '../utils/getTranslation';
Expand Down Expand Up @@ -137,33 +137,7 @@ export const winLinuxMenu = (
type: 'checkbox',
checked: isInSafeMode,
click(item) {
const gpuSafeModeDialogOptions = {
buttons: [
translation('helpSupport.gpuSafeModeDialogConfirm'),
translation('helpSupport.gpuSafeModeDialogNo'),
translation('helpSupport.gpuSafeModeDialogCancel'),
],
type: 'warning',
title: isInSafeMode
? translation('helpSupport.gpuSafeModeDialogTitle')
: translation('helpSupport.nonGpuSafeModeDialogTitle'),
message: isInSafeMode
? translation('helpSupport.gpuSafeModeDialogMessage')
: translation('helpSupport.nonGpuSafeModeDialogMessage'),
defaultId: isWindows ? 1 : 2,
cancelId: 2,
noLink: true,
};
dialog.showMessageBox(window, gpuSafeModeDialogOptions, buttonId => {
if (buttonId === 0) {
if (isInSafeMode) {
actions.restartWithoutSafeMode();
} else {
actions.restartInSafeMode();
}
}
item.checked = isInSafeMode;
});
actions.toggleOnSafeMode(item);
},
},
{ type: 'separator' },
Expand Down
64 changes: 47 additions & 17 deletions source/main/utils/buildAppMenus.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import { app, globalShortcut, Menu, BrowserWindow } from 'electron';
import { app, globalShortcut, Menu, BrowserWindow, dialog } from 'electron';
import { get } from 'lodash';
import { environment } from '../environment';
import { winLinuxMenu } from '../menus/win-linux';
Expand All @@ -10,6 +10,7 @@ import { CardanoNode } from '../cardano/CardanoNode';
import { DIALOGS, SCREENS } from '../../common/ipc/constants';
import { showUiPartChannel } from '../ipc/control-ui-parts';
import { getLocale } from './getLocale';
import { getTranslation } from './getTranslation';

const localesFillForm = {
'en-US': 'English',
Expand All @@ -24,6 +25,21 @@ export const buildAppMenus = async (
const { ADA_REDEMPTION } = SCREENS;
const { ABOUT, BLOCK_CONSOLIDATION, DAEDALUS_DIAGNOSTICS } = DIALOGS;

const {
isMacOS,
version,
apiVersion,
network,
build,
installerVersion,
os,
buildNumber,
isWindows,
isInSafeMode,
} = environment;
const translations = require(`../locales/${locale}`);
const networkLocale = getLocale(network);

const openAboutDialog = () => {
if (mainWindow) showUiPartChannel.send(ABOUT, mainWindow);
};
Expand Down Expand Up @@ -54,20 +70,35 @@ export const buildAppMenus = async (
safeExitWithCode(22);
};

const {
isMacOS,
version,
apiVersion,
network,
build,
installerVersion,
os,
buildNumber,
} = environment;

const translations = require(`../locales/${locale}`);

const networkLocale = getLocale(network);
const toggleOnSafeMode = item => {
const translation = getTranslation(translations, 'menu');
const gpuSafeModeDialogOptions = {
buttons: [
translation('helpSupport.gpuSafeModeDialogConfirm'),
translation('helpSupport.gpuSafeModeDialogCancel'),
],
type: 'warning',
title: isInSafeMode
? translation('helpSupport.gpuSafeModeDialogTitle')
: translation('helpSupport.nonGpuSafeModeDialogTitle'),
message: isInSafeMode
? translation('helpSupport.gpuSafeModeDialogMessage')
: translation('helpSupport.nonGpuSafeModeDialogMessage'),
defaultId: isWindows ? 0 : 1,
cancelId: 1,
noLink: true,
};
dialog.showMessageBox(mainWindow, gpuSafeModeDialogOptions, buttonId => {
if (buttonId === 0) {
if (isInSafeMode) {
restartWithoutSafeMode();
} else {
restartInSafeMode();
}
}
item.checked = isInSafeMode;
});
};

const supportRequestData = {
frontendVersion: version,
Expand All @@ -86,8 +117,7 @@ export const buildAppMenus = async (
openAboutDialog,
openDaedalusDiagnosticsDialog,
openAdaRedemptionScreen,
restartInSafeMode,
restartWithoutSafeMode,
toggleOnSafeMode,
openBlockConsolidationStatusDialog,
};

Expand Down

0 comments on commit c8a96fe

Please sign in to comment.