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