mirror of
https://github.com/morgan9e/gnome-shell-extension-freon
synced 2026-04-14 00:14:14 +09:00
bikeshedding: fix some indentation discrepancies (#222)
This commit is contained in:
@@ -385,9 +385,9 @@ const FreonMenuButton = GObject.registerClass(class Freon_FreonMenuButton extend
|
||||
for (let i of tempInfo){
|
||||
if(i.temp !== null && i.temp >= 0){
|
||||
total++;
|
||||
sum += i.temp;
|
||||
if (i.temp > max)
|
||||
max = i.temp;
|
||||
sum += i.temp;
|
||||
if (i.temp > max)
|
||||
max = i.temp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -613,13 +613,13 @@ const FreonMenuButton = GObject.registerClass(class Freon_FreonMenuButton extend
|
||||
if(!temperatureGroup) {
|
||||
temperatureGroup = new PopupMenu.PopupSubMenuMenuItem(_('Temperature Sensors'), true);
|
||||
temperatureGroup.icon.gicon = this._sensorIcons['temperature'];
|
||||
if(!temperatureGroup.status) { // gnome 3.18 and hight
|
||||
if(!temperatureGroup.status) { // gnome 3.18 and hight
|
||||
temperatureGroup.status = new St.Label({
|
||||
style_class: 'popup-status-menu-item',
|
||||
style_class: 'popup-status-menu-item',
|
||||
y_expand: true,
|
||||
y_align: Clutter.ActorAlign.CENTER });
|
||||
temperatureGroup.actor.insert_child_at_index(temperatureGroup.status, 4);
|
||||
}
|
||||
}
|
||||
this.menu.addMenuItem(temperatureGroup);
|
||||
}
|
||||
temperatureGroup.menu.addMenuItem(item);
|
||||
@@ -654,7 +654,7 @@ const FreonMenuButton = GObject.registerClass(class Freon_FreonMenuButton extend
|
||||
format = '%.0f';
|
||||
}
|
||||
format += '%s';
|
||||
|
||||
|
||||
if(this._settings.get_boolean('show-degrees-on-panel')){
|
||||
return format.format(value, (this._settings.get_string('unit')=='fahrenheit') ? "\u00b0F" : "\u00b0C" );
|
||||
} else {
|
||||
|
||||
@@ -14,7 +14,7 @@ var nvmecliUtil = class {
|
||||
this._nvmeDevices = getNvmeData("list")["Devices"]
|
||||
} catch (e) {
|
||||
global.log('[FREON] Unable to find nvme devices: ' + e);
|
||||
}
|
||||
}
|
||||
this._updated = true;
|
||||
}
|
||||
|
||||
@@ -34,8 +34,8 @@ var nvmecliUtil = class {
|
||||
let sensors = [];
|
||||
for (let device of this._nvmeDevices) {
|
||||
var smart_log = getNvmeData(`smart-log ${device["DevicePath"]}`);
|
||||
if( smart_log.hasOwnProperty('temperature_sensor_2') ){
|
||||
sensors.push({ label: device["ModelNumber"] + " S1",
|
||||
if( smart_log.hasOwnProperty('temperature_sensor_2') ){
|
||||
sensors.push({ label: device["ModelNumber"] + " S1",
|
||||
temp: parseFloat(smart_log.temperature_sensor_1) - 273.15 });
|
||||
sensors.push({ label: device["ModelNumber"] + " S2",
|
||||
temp: parseFloat(smart_log.temperature_sensor_2) - 273.15 });
|
||||
|
||||
@@ -51,10 +51,10 @@ var FreonPrefsWidget = new GObject.registerClass(class Freon_FreonPrefsWidget ex
|
||||
let panelBoxIndex = Gtk.SpinButton.new_with_range (-1, 20, 1);
|
||||
this.attach(panelBoxIndex, 2, i, 1, 1);
|
||||
this._settings.bind('panel-box-index', panelBoxIndex, 'value', Gio.SettingsBindFlags.DEFAULT);
|
||||
|
||||
|
||||
this._addSwitch({key : 'show-degrees-on-panel', y : i++, x : 3,
|
||||
label : _('Show \u00b0C/\u00b0F on Panel')});
|
||||
|
||||
|
||||
this._addSwitch({key : 'show-icon-on-panel', y : i++, x : 3,
|
||||
label : _('Show Icon on Panel')});
|
||||
|
||||
@@ -73,7 +73,7 @@ var FreonPrefsWidget = new GObject.registerClass(class Freon_FreonPrefsWidget ex
|
||||
help : _("Works if you have more than three voltage sensors")});
|
||||
|
||||
this._addComboBox({
|
||||
items : {none : 'None', hddtemp : 'Hddtemp', udisks2 : 'UDisks2', smartctl : 'smartctl', nvmecli : 'nvme-cli'},
|
||||
items : {none : _('None'), hddtemp : 'Hddtemp', udisks2 : 'UDisks2', smartctl : 'smartctl', nvmecli : 'nvme-cli'},
|
||||
key: 'drive-utility', y : i, x : 0,
|
||||
label: _('HDD/SSD Temperature Utility')
|
||||
});
|
||||
@@ -119,7 +119,7 @@ var FreonPrefsWidget = new GObject.registerClass(class Freon_FreonPrefsWidget ex
|
||||
}
|
||||
|
||||
combobox.set_active(Object.keys(params.items).indexOf(this._settings.get_string(params.key)));
|
||||
|
||||
|
||||
combobox.connect('changed', (entry) => {
|
||||
let [success, iter] = combobox.get_active_iter();
|
||||
if (!success)
|
||||
@@ -130,7 +130,6 @@ var FreonPrefsWidget = new GObject.registerClass(class Freon_FreonPrefsWidget ex
|
||||
this.attach(new Gtk.Label({ label: params.label, halign : Gtk.Align.END}), params.x, params.y, 1, 1);
|
||||
this.attach(combobox, params.x + 1, params.y, 1, 1);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function buildPrefsWidget() {
|
||||
|
||||
Reference in New Issue
Block a user