refactored project name, configuration etc. from cpu-temperature to sensors [#57]

This commit is contained in:
Dipesh Acharya
2013-03-12 20:38:15 +05:45
parent 070b1650ba
commit 4bf9e0d9b5
5 changed files with 22 additions and 21 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
gschemas.compiled gschemas.compiled
*~

View File

@@ -13,19 +13,19 @@ const Shell = imports.gi.Shell;
let settings; let settings;
let metadata = Me.metadata; let metadata = Me.metadata;
function CpuTemperature() { function Sensors() {
this._init.apply(this, arguments); this._init.apply(this, arguments);
} }
CpuTemperature.prototype = { Sensors.prototype = {
__proto__: PanelMenu.SystemStatusButton.prototype, __proto__: PanelMenu.SystemStatusButton.prototype,
_init: function(){ _init: function(){
PanelMenu.SystemStatusButton.prototype._init.call(this, 'temperature'); PanelMenu.SystemStatusButton.prototype._init.call(this, 'sensors');
this.statusLabel = new St.Label({ this.statusLabel = new St.Label({
text: "--", text: "--",
style_class: "temperature-label" style_class: "sensors-label"
}); });
// destroy all previously created children, and add our statusLabel // destroy all previously created children, and add our statusLabel
@@ -43,7 +43,7 @@ CpuTemperature.prototype = {
if (display_hdd_temp){ if (display_hdd_temp){
this.hddtempPath = this._detectHDDTemp(); this.hddtempPath = this._detectHDDTemp();
} }
this.command=["xdg-open", "http://github.com/xtranophilist/gnome-shell-extension-cpu-temperature/issues/"]; this.command=["xdg-open", "http://github.com/xtranophilist/gnome-shell-extension-sensors/issues/"];
if(this.sensorsPath){ if(this.sensorsPath){
this.title='Error'; this.title='Error';
this.content='Run sensors-detect as root. If it doesn\'t help, click here to report with your sensors output!'; this.content='Run sensors-detect as root. If it doesn\'t help, click here to report with your sensors output!';
@@ -388,7 +388,7 @@ CpuTemperature.prototype = {
} }
let format = '%.1f'; let format = '%.1f';
if (!settings.get_boolean('display-decimal-value')){ if (!settings.get_boolean('display-decimal-value')){
ret = Math.round(value); //ret = Math.round(value);
format = '%d'; format = '%d';
} }
if (settings.get_boolean('display-degree-sign')) { if (settings.get_boolean('display-degree-sign')) {
@@ -406,8 +406,8 @@ let indicator;
let event=null; let event=null;
function enable() { function enable() {
indicator = new CpuTemperature(); indicator = new Sensors();
Main.panel.addToStatusArea('temperature', indicator); Main.panel.addToStatusArea('sensors', indicator);
//TODO catch preference change signals with settings.connect('changed:: //TODO catch preference change signals with settings.connect('changed::
} }

View File

@@ -1,13 +1,13 @@
{ {
"description": "Shows CPU (and HDD) Temperature on Gnome Shell", "description": "Shows CPU temperature, HDD temperature, voltage and fan RPM",
"name": "CPU Temperature Indicator", "name": "Sensors",
"settings-schema": "org.gnome.shell.extensions.cpu-temperature", "settings-schema": "org.gnome.shell.extensions.sensors",
"gettext-domain": "cpu-temperature", "gettext-domain": "gse-sensors",
"shell-version": [ "shell-version": [
"3.2", "3.2",
"3.4", "3.4",
"3.6" "3.6"
], ],
"url": "http://motorscript.com/gnome-shell-extension-cpu-temperature/", "url": "https://github.com/xtranophilist/gnome-shell-extension-sensors",
"uuid": "temperature@xtranophilist" "uuid": "temperature@xtranophilist"
} }

View File

@@ -5,7 +5,7 @@ const Gtk = imports.gi.Gtk;
const Lang = imports.lang; const Lang = imports.lang;
const Gettext = imports.gettext.domain('cpu-temperature'); const Gettext = imports.gettext.domain('gse-sensors');
const _ = Gettext.gettext; const _ = Gettext.gettext;
const ExtensionUtils = imports.misc.extensionUtils; const ExtensionUtils = imports.misc.extensionUtils;
@@ -16,9 +16,9 @@ function init() {
Convenience.initTranslations(); Convenience.initTranslations();
} }
const CPUTemperaturePrefsWidget = new GObject.Class({ const SensorsPrefsWidget = new GObject.Class({
Name: 'CPUTemperature.Prefs.Widget', Name: 'Sensors.Prefs.Widget',
GTypeName: 'CPUTemperaturePrefsWidget', GTypeName: 'SensorsPrefsWidget',
Extends: Gtk.Grid, Extends: Gtk.Grid,
_init: function(params) { _init: function(params) {
@@ -217,7 +217,7 @@ const CPUTemperaturePrefsWidget = new GObject.Class({
}); });
function buildPrefsWidget() { function buildPrefsWidget() {
let widget = new CPUTemperaturePrefsWidget(); let widget = new SensorsPrefsWidget();
widget.show_all(); widget.show_all();
return widget; return widget;
} }

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="cpu-temperature"> <schemalist gettext-domain="gse-sensors">
<schema path="/org/gnome/shell/extensions/cpu-temperature/" id="org.gnome.shell.extensions.cpu-temperature"> <schema path="/org/gnome/shell/extensions/sensors/" id="org.gnome.shell.extensions.sensors">
<key type="i" name="update-time"> <key type="i" name="update-time">
<default>15</default> <default>15</default>