diff options
Diffstat (limited to 'src/components/services/tabs/TabItem.js')
-rw-r--r-- | src/components/services/tabs/TabItem.js | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/components/services/tabs/TabItem.js b/src/components/services/tabs/TabItem.js index 9e03d2e21..a7136c43f 100644 --- a/src/components/services/tabs/TabItem.js +++ b/src/components/services/tabs/TabItem.js | |||
@@ -28,10 +28,22 @@ const messages = defineMessages({ | |||
28 | id: 'tabs.item.enableNotification', | 28 | id: 'tabs.item.enableNotification', |
29 | defaultMessage: '!!!Enable notifications', | 29 | defaultMessage: '!!!Enable notifications', |
30 | }, | 30 | }, |
31 | disableAudio: { | ||
32 | id: 'tabs.item.disableAudio', | ||
33 | defaultMessage: '!!!Disable audio', | ||
34 | }, | ||
35 | enableAudio: { | ||
36 | id: 'tabs.item.enableAudio', | ||
37 | defaultMessage: '!!!Enable audio', | ||
38 | }, | ||
31 | disableService: { | 39 | disableService: { |
32 | id: 'tabs.item.disableService', | 40 | id: 'tabs.item.disableService', |
33 | defaultMessage: '!!!Disable Service', | 41 | defaultMessage: '!!!Disable Service', |
34 | }, | 42 | }, |
43 | enableService: { | ||
44 | id: 'tabs.item.enableService', | ||
45 | defaultMessage: '!!!Enable Service', | ||
46 | }, | ||
35 | deleteService: { | 47 | deleteService: { |
36 | id: 'tabs.item.deleteService', | 48 | id: 'tabs.item.deleteService', |
37 | defaultMessage: '!!!Delete Service', | 49 | defaultMessage: '!!!Delete Service', |
@@ -46,9 +58,11 @@ class TabItem extends Component { | |||
46 | shortcutIndex: PropTypes.number.isRequired, | 58 | shortcutIndex: PropTypes.number.isRequired, |
47 | reload: PropTypes.func.isRequired, | 59 | reload: PropTypes.func.isRequired, |
48 | toggleNotifications: PropTypes.func.isRequired, | 60 | toggleNotifications: PropTypes.func.isRequired, |
61 | toggleAudio: PropTypes.func.isRequired, | ||
49 | openSettings: PropTypes.func.isRequired, | 62 | openSettings: PropTypes.func.isRequired, |
50 | deleteService: PropTypes.func.isRequired, | 63 | deleteService: PropTypes.func.isRequired, |
51 | disableService: PropTypes.func.isRequired, | 64 | disableService: PropTypes.func.isRequired, |
65 | enableService: PropTypes.func.isRequired, | ||
52 | }; | 66 | }; |
53 | 67 | ||
54 | static contextTypes = { | 68 | static contextTypes = { |
@@ -62,8 +76,10 @@ class TabItem extends Component { | |||
62 | shortcutIndex, | 76 | shortcutIndex, |
63 | reload, | 77 | reload, |
64 | toggleNotifications, | 78 | toggleNotifications, |
79 | toggleAudio, | ||
65 | deleteService, | 80 | deleteService, |
66 | disableService, | 81 | disableService, |
82 | enableService, | ||
67 | openSettings, | 83 | openSettings, |
68 | } = this.props; | 84 | } = this.props; |
69 | const { intl } = this.context; | 85 | const { intl } = this.context; |
@@ -90,8 +106,13 @@ class TabItem extends Component { | |||
90 | : intl.formatMessage(messages.enableNotifications), | 106 | : intl.formatMessage(messages.enableNotifications), |
91 | click: () => toggleNotifications(), | 107 | click: () => toggleNotifications(), |
92 | }, { | 108 | }, { |
93 | label: intl.formatMessage(messages.disableService), | 109 | label: service.isMuted |
94 | click: () => disableService(), | 110 | ? intl.formatMessage(messages.enableAudio) |
111 | : intl.formatMessage(messages.disableAudio), | ||
112 | click: () => toggleAudio(), | ||
113 | }, { | ||
114 | label: intl.formatMessage(service.isEnabled ? messages.disableService : messages.enableService), | ||
115 | click: () => (service.isEnabled ? disableService() : enableService()), | ||
95 | }, { | 116 | }, { |
96 | type: 'separator', | 117 | type: 'separator', |
97 | }, { | 118 | }, { |
@@ -106,6 +127,7 @@ class TabItem extends Component { | |||
106 | 'tab-item': true, | 127 | 'tab-item': true, |
107 | 'is-active': service.isActive, | 128 | 'is-active': service.isActive, |
108 | 'has-custom-icon': service.hasCustomIcon, | 129 | 'has-custom-icon': service.hasCustomIcon, |
130 | 'is-disabled': !service.isEnabled, | ||
109 | })} | 131 | })} |
110 | onClick={clickHandler} | 132 | onClick={clickHandler} |
111 | onContextMenu={() => menu.popup(remote.getCurrentWindow())} | 133 | onContextMenu={() => menu.popup(remote.getCurrentWindow())} |