Skip to content

Commit cf5f2db

Browse files
committed
Pref appindicator only if lib installed
1 parent 32c56a6 commit cf5f2db

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/chrome/content/options.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var firetrayUIOptions = {
4040
]);
4141
} else if (firetray.AppIndicator) {
4242
this.hideUnsupportedOptions([
43-
'app_icon_default',
43+
'app_icon_default',
4444
'newmail_icon_names'
4545
]);
4646
} else {
@@ -66,6 +66,12 @@ var firetrayUIOptions = {
6666
this.removePrefPane("pref-pane-chat");
6767
};
6868

69+
if (!firetray.Handler.canAppind) {
70+
this.hideUnsupportedOptions([
71+
'ui_use_appindicator_icon'
72+
]);
73+
}
74+
6975
window.sizeToContent();
7076
},
7177

src/modules/FiretrayHandler.jsm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ firetray.Handler = {
3838
appHasChat: false,
3939
appStarted: false,
4040
useAppind: false, // initialized in StatusIcon
41+
canAppind: false, // initialized in StatusIcon
4142
windows: {},
4243
get windowsCount() {return Object.keys(this.windows).length;},
4344
get visibleWindowsCount() {

src/modules/linux/FiretrayStatusIcon.jsm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ firetray.StatusIcon = {
2929
prefNewMailIconNames: null,
3030
defaultAppIconName: null,
3131
defaultNewMailIconName: null,
32+
canAppind: false,
3233

3334
init: function() {
3435
this.defineIconNames();
@@ -110,11 +111,11 @@ firetray.StatusIcon = {
110111
return false;
111112
}
112113

113-
let canAppIndicator = (appind.available() &&
114+
this.canAppind = (appind.available() &&
114115
this.dbusNotificationWatcherReady());
115116

116117
return (firetray.Utils.prefService.getBoolPref('with_appindicator') &&
117-
canAppIndicator && isAppindDesktop);
118+
this.canAppind && isAppindDesktop);
118119
},
119120

120121
getDesktop: function() {
@@ -223,6 +224,7 @@ firetray.StatusIcon = {
223224

224225

225226
firetray.Handler.useAppind = firetray.StatusIcon.appindEnable();
227+
firetray.Handler.canAppind = firetray.StatusIcon.canAppind;
226228

227229
firetray.Handler.setIconTooltipDefault = function() {
228230
if (!this.app.name)

0 commit comments

Comments
 (0)