mirror of
https://github.com/morgan9e/gnome-shell-extension-freon
synced 2026-04-14 00:14:14 +09:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -169,20 +169,19 @@ class FreonMenuButton extends PanelMenu.Button {
|
|||||||
|
|
||||||
this.connect('destroy', this._onButtonDestroy.bind(this));
|
this.connect('destroy', this._onButtonDestroy.bind(this));
|
||||||
|
|
||||||
// don't postprone the first call by update-time.
|
// don't postpone the first call by update-time.
|
||||||
this._querySensors();
|
this._querySensors();
|
||||||
|
|
||||||
this._addTimer();
|
this._addTimer();
|
||||||
this._updateUI(true);
|
this._updateUI(true);
|
||||||
this._updateUITimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 250, () => {
|
this._updateUITimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 250, () => {
|
||||||
this._updateUI();
|
this._updateUI();
|
||||||
// readd to update queue
|
// read to update queue
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
this._positionInPanelChangedTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 500, () => {
|
||||||
GLib.timeout_add(GLib.PRIORITY_DEFAULT, 500, () => {
|
|
||||||
this._positionInPanelChanged();
|
this._positionInPanelChanged();
|
||||||
return false; // 只执行一次
|
return false; // execute only once
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -564,6 +563,7 @@ class FreonMenuButton extends PanelMenu.Button {
|
|||||||
|
|
||||||
GLib.Source.remove(this._timeoutId);
|
GLib.Source.remove(this._timeoutId);
|
||||||
GLib.Source.remove(this._updateUITimeoutId);
|
GLib.Source.remove(this._updateUITimeoutId);
|
||||||
|
GLib.Source.remove(this._positionInPanelChangedTimeoutId);
|
||||||
|
|
||||||
for (let signal of this._settingChangedSignals){
|
for (let signal of this._settingChangedSignals){
|
||||||
this._settings.disconnect(signal);
|
this._settings.disconnect(signal);
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export default class SensorsUtil extends CommandLineUtil {
|
|||||||
let lineRemoved = this._output.filter(l => l.trim() !== ',').join('\n');
|
let lineRemoved = this._output.filter(l => l.trim() !== ',').join('\n');
|
||||||
let errorRemoved = lineRemoved.replace(/ERROR.*Can't read/, "");
|
let errorRemoved = lineRemoved.replace(/ERROR.*Can't read/, "");
|
||||||
errorRemoved = errorRemoved.replace(/ERROR.*I\/O error/, "");
|
errorRemoved = errorRemoved.replace(/ERROR.*I\/O error/, "");
|
||||||
|
errorRemoved = errorRemoved.replace(/NaN/, "0");
|
||||||
data = JSON.parse(errorRemoved);
|
data = JSON.parse(errorRemoved);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logError(e);
|
logError(e);
|
||||||
|
|||||||
Reference in New Issue
Block a user