remove unused code

This commit is contained in:
Chris Monahan
2026-08-01 13:11:04 -04:00
parent e8176c1823
commit c8a39fefd2
7 changed files with 2 additions and 66 deletions
-16
View File
@@ -13,9 +13,7 @@ import * as Sensors from './sensors.js';
import {Extension, gettext as _} from 'resource:///org/gnome/shell/extensions/extension.js';
import * as MessageTray from 'resource:///org/gnome/shell/ui/messageTray.js';
import * as Values from './values.js';
import * as Config from 'resource:///org/gnome/shell/misc/config.js';
import * as MenuItem from './menuItem.js';
import * as SensorCatalog from './helpers/catalog.js';
@@ -36,7 +34,6 @@ var VitalsMenuButton = GObject.registerClass({
// item must match the index on the combo box
this._sensorsIconPathPrefix = ['/icons/original/', '/icons/gnome/'];
this._warnings = [];
this._sensorMenuItems = {};
this._hotLabels = {};
this._hotItems = {};
@@ -637,19 +634,6 @@ var VitalsMenuButton = GObject.registerClass({
if(this._newGpuDetected) this._newGpuDetectedCount++;
else this._newGpuDetectedCount = 0;
this._newGpuDetected = false;
if (this._warnings.length > 0) {
this._notify('Vitals', this._warnings.join("\n"), 'folder-symbolic');
this._warnings = [];
}
}
_notify(msg, details, icon) {
let source = new MessageTray.Source('MyApp Information', icon);
Main.messageTray.add(source);
let notification = new MessageTray.Notification(source, msg, details);
notification.setTransient(true);
source.notify(notification);
}
destroy() {
-6
View File
@@ -271,12 +271,6 @@ export function sensorGroupFromType(type) {
return group.replace(/#\d+$/, '');
}
export function colorsKeyForGroup(group) {
if (group && sensorCatalog[group]?.colorFormats)
return `${group}-colors`;
return null;
}
export function colorSettingsKeys() {
return Object.keys(sensorCatalog)
.filter(group => sensorCatalog[group].colorFormats)
-4
View File
@@ -1,4 +0,0 @@
.vitals-preferences preferencesgroup label.heading {
font-size: 1.5em;
font-weight: 700;
}
-21
View File
@@ -35,23 +35,6 @@ function sanitizeAndSortColorEntries(colorsArray) {
.sort((a, b) => a.threshold - b.threshold);
}
/*
if (sensor == 'show-storage' && this._settings.get_boolean(sensor)) {
let val = true;
try {
let GTop = imports.gi.GTop;
} catch (e) {
val = false;
}
let now = new Date().getTime();
this._notify("Vitals", "Please run sudo apt install gir1.2-gtop-2.0", 'folder-symbolic');
}
*/
const Settings = new GObject.Class({
Name: 'Vitals.Settings',
@@ -332,10 +315,6 @@ const Settings = new GObject.Class({
});
},
_bind_threshold_colors: function() {
// kept for compatibility; pages initialize lazily via ensure_threshold_colors_for_page()
},
// Runtime matching is `value >= threshold` (see values.js), so each band is
// [low, high). Integer breakpoints use high-1 in the label (039, 4059, …).
// Float breakpoints keep an explicit half-open label (0 <0.5).
-1
View File
@@ -29,7 +29,6 @@ import GObject from 'gi://GObject';
import * as SubProcessModule from './helpers/subprocess.js';
import * as FileModule from './helpers/file.js';
import { gettext as _ } from 'resource:///org/gnome/shell/extensions/extension.js';
import NM from 'gi://NM';
let GTop, hasGTop = true;
try {
-4
View File
@@ -1,8 +1,5 @@
.vitals-icon { icon-size: 16px; }
.vitals-menu-button-container {}
.vitals-panel-item{spacing: 0;}
.vitals-panel-menu{spacing: 11px; padding: 3px; }
.vitals-panel-icon-default {}
.vitals-panel-icon-temperature { margin: 0 1px 0 0; padding: 0; }
.vitals-panel-icon-voltage { margin: 0 0 0 0; padding: 0; }
.vitals-panel-icon-fan { margin: 0 4px 0 0; padding: 0; }
@@ -12,7 +9,6 @@
.vitals-panel-icon-network { margin: 0 3px 0 0; padding: 0; }
.vitals-panel-icon-storage { margin: 0 2px 0 0; padding: 0; }
.vitals-panel-icon-battery { margin: 0 4px 0 0; padding: 0; }
.vitals-panel-label {}
.vitals-button-action { -st-icon-style: symbolic; border-radius: 32px; margin: 0px; min-height: 22px; min-width: 22px; padding: 10px; font-size: 100%; border: 1px solid transparent; }
.vitals-button-action:hover, .vitals-button-action:focus { border-color: #777; }
.vitals-button-action > StIcon { icon-size: 16px; }
+2 -14
View File
@@ -24,7 +24,6 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import GLib from 'gi://GLib';
import GObject from 'gi://GObject';
import {sensorCatalog, sensorGroupFromType} from './helpers/catalog.js';
@@ -62,14 +61,7 @@ function normalizeColorComponent(component) {
}
function getUsageColor(value, colors) {
if (!colors || colors.length === 0)
return '';
const normalizedValue = Array.isArray(value)
? Math.max(...value.filter(Number.isFinite))
: value;
if (!Number.isFinite(normalizedValue))
if (!colors || colors.length === 0 || !Number.isFinite(value))
return '';
const thresholds = colors
@@ -94,7 +86,7 @@ function getUsageColor(value, colors) {
return '';
for (let index = thresholds.length - 1; index >= 0; index--) {
if (normalizedValue >= thresholds[index].threshold)
if (value >= thresholds[index].threshold)
return thresholds[index].style;
}
@@ -127,7 +119,6 @@ export const Values = GObject.registerClass({
this._history = {};
this._lastNumeric = null;
//this._history2 = {};
this.resetHistory();
}
@@ -412,7 +403,6 @@ export const Values = GObject.registerClass({
// appends total upload and download for all interfaces for #216
let vals = Object.values(this._history[type]).map(x => parseFloat(x[1]));
let sum = vals.reduce((partialSum, a) => partialSum + a, 0);
const memUnit = this._settings.get_int('memory-measurement') ? 1000 : 1024;
let bootText = this._legible(sum, format);
output.push({
label: 'Boot ' + direction,
@@ -495,8 +485,6 @@ export const Values = GObject.registerClass({
this._history[sensor] = {};
this._history[sensor + '-group'] = {};
//this._history2[sensor] = {};
//this._history2[sensor + '-group'] = {};
}
for(let i = 1; i <= numGpus; i++){