mirror of
https://github.com/morgan9e/gnome-shell-extension-freon
synced 2026-04-15 00:44:22 +09:00
Fix problem with hdd temperature setting, rename conf
This commit is contained in:
@@ -35,7 +35,7 @@ const FreonItem = new Lang.Class({
|
||||
},
|
||||
|
||||
getPanelString: function() {
|
||||
if(settings.get_boolean('display-label'))
|
||||
if(settings.get_boolean('show-label'))
|
||||
return '%s: %s'.format(this._label, this._value);
|
||||
else
|
||||
return this._value;
|
||||
@@ -71,10 +71,7 @@ const FreonMenuButton = new Lang.Class({
|
||||
this.actor.add_actor(this.statusLabel);
|
||||
|
||||
this.sensorsArgv = Utilities.detectSensors();
|
||||
|
||||
if (settings.get_boolean('display-hdd-temp')){
|
||||
this.hddtempArgv = Utilities.detectHDDTemp();
|
||||
}
|
||||
this.hddtempArgv = Utilities.detectHDDTemp();
|
||||
|
||||
this.udisksProxies = [];
|
||||
Utilities.UDisks.get_drive_ata_proxies(Lang.bind(this, function(proxies) {
|
||||
@@ -119,7 +116,7 @@ const FreonMenuButton = new Lang.Class({
|
||||
}));
|
||||
}
|
||||
|
||||
if (this.hddtempArgv){
|
||||
if (settings.get_boolean('show-hdd-temp') && this.hddtempArgv){
|
||||
this._hddtempFuture = new Utilities.Future(this.hddtempArgv, Lang.bind(this,function(stdout){
|
||||
this._hddtempOutput = stdout;
|
||||
this._updateDisplay(this._sensorsOutput, this._hddtempOutput);
|
||||
@@ -129,8 +126,8 @@ const FreonMenuButton = new Lang.Class({
|
||||
},
|
||||
|
||||
_updateDisplay: function(sensors_output, hddtemp_output){
|
||||
let display_fan_rpm = settings.get_boolean('display-fan-rpm');
|
||||
let display_voltage = settings.get_boolean('display-voltage');
|
||||
let display_fan_rpm = settings.get_boolean('show-fan-rpm');
|
||||
let display_voltage = settings.get_boolean('show-voltage');
|
||||
|
||||
let tempInfo = Array();
|
||||
let fanInfo = Array();
|
||||
@@ -146,7 +143,7 @@ const FreonMenuButton = new Lang.Class({
|
||||
voltageInfo = Utilities.parseSensorsOutput(sensors_output,Utilities.parseVoltageLine);
|
||||
}
|
||||
|
||||
if(this.hddtempArgv)
|
||||
if(settings.get_boolean('show-hdd-temp') && this.hddtempArgv)
|
||||
tempInfo = tempInfo.concat(Utilities.parseHddTempOutput(hddtemp_output, !(/nc$/.exec(this.hddtempArgv[0])) ? ': ' : '|'));
|
||||
|
||||
tempInfo = tempInfo.concat(Utilities.UDisks.create_list_from_proxies(this.udisksProxies));
|
||||
@@ -243,7 +240,7 @@ const FreonMenuButton = new Lang.Class({
|
||||
value = this._toFahrenheit(value);
|
||||
}
|
||||
let format = '%.1f';
|
||||
if (!settings.get_boolean('display-decimal-value')){
|
||||
if (!settings.get_boolean('show-decimal-value')){
|
||||
//ret = Math.round(value);
|
||||
format = '%d';
|
||||
}
|
||||
|
||||
@@ -35,10 +35,10 @@ const FreonPrefsWidget = new GObject.Class({
|
||||
this.attach(updateTime, 1, i, 1, 1);
|
||||
this._settings.bind('update-time', updateTime, 'value', Gio.SettingsBindFlags.DEFAULT);
|
||||
|
||||
this._addSwitch({key : 'display-label', y : i++, x : 2,
|
||||
this._addSwitch({key : 'show-label', y : i++, x : 2,
|
||||
label : _('Show Sensor Label')});
|
||||
|
||||
this._addSwitch({key : 'display-decimal-value', y : i, x : 0,
|
||||
this._addSwitch({key : 'show-decimal-value', y : i, x : 0,
|
||||
label : _('Show Decimal Value'),
|
||||
help : _("Show one digit after decimal")});
|
||||
|
||||
@@ -71,13 +71,13 @@ const FreonPrefsWidget = new GObject.Class({
|
||||
//
|
||||
|
||||
|
||||
this._addSwitch({key : 'display-hdd-temp', y : i, x : 0,
|
||||
this._addSwitch({key : 'show-hdd-temp', y : i, x : 0,
|
||||
label : _('Show Drive Temperature')});
|
||||
|
||||
this._addSwitch({key : 'display-fan-rpm', y : i++, x : 2,
|
||||
this._addSwitch({key : 'show-fan-rpm', y : i++, x : 2,
|
||||
label : _('Show Fan Speed')});
|
||||
|
||||
this._addSwitch({key : 'display-voltage', y : i, x : 0,
|
||||
this._addSwitch({key : 'show-voltage', y : i, x : 0,
|
||||
label : _('Show Power Supply Voltage')});
|
||||
|
||||
},
|
||||
|
||||
Binary file not shown.
@@ -15,7 +15,7 @@
|
||||
<description>The unit ('centigrade' or 'fahrenheit') the extension should display the temperature in.</description>
|
||||
</key>
|
||||
|
||||
<key type="b" name="display-label">
|
||||
<key type="b" name="show-label">
|
||||
<default>false</default>
|
||||
<summary>Display label</summary>
|
||||
<description>Display also the label of the sensor in the panel</description>
|
||||
@@ -27,25 +27,25 @@
|
||||
<description>Select the sensor whose value has to be shown in the panel</description>
|
||||
</key>
|
||||
|
||||
<key type="b" name="display-decimal-value">
|
||||
<key type="b" name="show-decimal-value">
|
||||
<default>false</default>
|
||||
<summary>Show decimal value</summary>
|
||||
<description>Show one digit after decimal</description>
|
||||
</key>
|
||||
|
||||
<key type="b" name="display-hdd-temp">
|
||||
<key type="b" name="show-hdd-temp">
|
||||
<default>true</default>
|
||||
<summary>Display HDD Temp</summary>
|
||||
<description>Display hard disk drive temperature. Requires hddtemp installed.</description>
|
||||
</key>
|
||||
|
||||
<key type="b" name="display-fan-rpm">
|
||||
<key type="b" name="show-fan-rpm">
|
||||
<default>true</default>
|
||||
<summary>Display Fan RPM</summary>
|
||||
<description>Display fan rotation per minute.</description>
|
||||
</key>
|
||||
|
||||
<key type="b" name="display-voltage">
|
||||
<key type="b" name="show-voltage">
|
||||
<default>true</default>
|
||||
<summary>Display voltage</summary>
|
||||
<description>Display voltage of various components.</description>
|
||||
|
||||
Reference in New Issue
Block a user