Do not launch power statistics app from battery items
https://bugzilla.gnome.org/show_bug.cgi?id=640768
This commit is contained in:
parent
1c759384fa
commit
440b222664
@ -72,7 +72,7 @@ Indicator.prototype = {
|
|||||||
this._hasPrimary = false;
|
this._hasPrimary = false;
|
||||||
this._primaryDeviceId = null;
|
this._primaryDeviceId = null;
|
||||||
|
|
||||||
this._batteryItem = new PopupMenu.PopupMenuItem('');
|
this._batteryItem = new PopupMenu.PopupMenuItem('', { reactive: false });
|
||||||
this._primaryPercentage = new St.Label();
|
this._primaryPercentage = new St.Label();
|
||||||
this._batteryItem.addActor(this._primaryPercentage, { align: St.Align.END });
|
this._batteryItem.addActor(this._primaryPercentage, { align: St.Align.END });
|
||||||
this.menu.addMenuItem(this._batteryItem);
|
this.menu.addMenuItem(this._batteryItem);
|
||||||
@ -136,17 +136,6 @@ Indicator.prototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this._primaryDeviceId = device_id;
|
this._primaryDeviceId = device_id;
|
||||||
if (this._primaryDeviceId) {
|
|
||||||
this._batteryItem.actor.reactive = true;
|
|
||||||
this._batteryItem.actor.can_focus = true;
|
|
||||||
this._batteryItem.connect('activate', function(item) {
|
|
||||||
Util.spawn(['gnome-power-statistics', '--device', device_id]);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// virtual device
|
|
||||||
this._batteryItem.actor.reactive = false;
|
|
||||||
this._batteryItem.actor.can_focus = false;
|
|
||||||
}
|
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -168,9 +157,6 @@ Indicator.prototype = {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
let item = new DeviceItem (devices[i]);
|
let item = new DeviceItem (devices[i]);
|
||||||
item.connect('activate', function() {
|
|
||||||
Util.spawn(['gnome-power-statistics', '--device', device_id]);
|
|
||||||
});
|
|
||||||
this._deviceItems.push(item);
|
this._deviceItems.push(item);
|
||||||
this.menu.addMenuItem(item, this._otherDevicePosition + position);
|
this.menu.addMenuItem(item, this._otherDevicePosition + position);
|
||||||
position++;
|
position++;
|
||||||
@ -216,7 +202,7 @@ DeviceItem.prototype = {
|
|||||||
__proto__: PopupMenu.PopupBaseMenuItem.prototype,
|
__proto__: PopupMenu.PopupBaseMenuItem.prototype,
|
||||||
|
|
||||||
_init: function(device) {
|
_init: function(device) {
|
||||||
PopupMenu.PopupBaseMenuItem.prototype._init.call(this);
|
PopupMenu.PopupBaseMenuItem.prototype._init.call(this, { reactive: false });
|
||||||
|
|
||||||
let [device_id, device_type, icon, percentage, state, time] = device;
|
let [device_id, device_type, icon, percentage, state, time] = device;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user