[Goodies-commits] r3612 - in xfce4-sensors-plugin/trunk: . panel-plugin po
Fabian Nowak
timystery at xfce.org
Wed Nov 21 01:30:55 CET 2007
Author: timystery
Date: 2007-11-21 00:30:55 +0000 (Wed, 21 Nov 2007)
New Revision: 3612
Modified:
xfce4-sensors-plugin/trunk/ChangeLog
xfce4-sensors-plugin/trunk/Makefile.am
xfce4-sensors-plugin/trunk/configure.in.in
xfce4-sensors-plugin/trunk/panel-plugin/acpi.c
xfce4-sensors-plugin/trunk/panel-plugin/acpi.h
xfce4-sensors-plugin/trunk/panel-plugin/configuration.c
xfce4-sensors-plugin/trunk/panel-plugin/hddtemp.c
xfce4-sensors-plugin/trunk/panel-plugin/hddtemp.h
xfce4-sensors-plugin/trunk/panel-plugin/lmsensors.c
xfce4-sensors-plugin/trunk/panel-plugin/middlelayer.c
xfce4-sensors-plugin/trunk/panel-plugin/middlelayer.h
xfce4-sensors-plugin/trunk/panel-plugin/sensors.c
xfce4-sensors-plugin/trunk/panel-plugin/sensors.h
xfce4-sensors-plugin/trunk/panel-plugin/types.h
xfce4-sensors-plugin/trunk/panel-plugin/xfce4-sensors-plugin.desktop.in.in
xfce4-sensors-plugin/trunk/po/ca.po
xfce4-sensors-plugin/trunk/po/cs.po
xfce4-sensors-plugin/trunk/po/de.po
xfce4-sensors-plugin/trunk/po/el.po
xfce4-sensors-plugin/trunk/po/en_GB.po
xfce4-sensors-plugin/trunk/po/eu.po
xfce4-sensors-plugin/trunk/po/fr.po
xfce4-sensors-plugin/trunk/po/hu.po
xfce4-sensors-plugin/trunk/po/ja.po
xfce4-sensors-plugin/trunk/po/ko.po
xfce4-sensors-plugin/trunk/po/lt.po
xfce4-sensors-plugin/trunk/po/lv.po
xfce4-sensors-plugin/trunk/po/pl.po
xfce4-sensors-plugin/trunk/po/pt_BR.po
xfce4-sensors-plugin/trunk/po/pt_PT.po
xfce4-sensors-plugin/trunk/po/ru.po
xfce4-sensors-plugin/trunk/po/sq.po
xfce4-sensors-plugin/trunk/po/ur.po
xfce4-sensors-plugin/trunk/po/vi.po
xfce4-sensors-plugin/trunk/po/zh_TW.po
Log:
more changes to the ACPI insertion. battery roughly working.
hddtemp currently borked with the setuid-message and the results from spawning hddtemp.
Modified: xfce4-sensors-plugin/trunk/ChangeLog
===================================================================
--- xfce4-sensors-plugin/trunk/ChangeLog 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/ChangeLog 2007-11-21 00:30:55 UTC (rev 3612)
@@ -1,3 +1,15 @@
+2007-11-18 timystery
+ * Hddtemp can be specified at configure-time now and now longer relies
+ statically on /usr/sbin .
+ * acpi implementation going on.
+
+2007-11-15 timystery
+ * Rewrote big parts of configure.in.in to better support enable/disable.
+
+2007-11-10 timystery
+ * Went through the plugin with valgrind and removed lots of sources for
+ data accumulation.
+
2006-10 - 2007-11 timystery
* New internal structure being able to run with ACPI, hddtemp and lm
Modified: xfce4-sensors-plugin/trunk/Makefile.am
===================================================================
--- xfce4-sensors-plugin/trunk/Makefile.am 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/Makefile.am 2007-11-21 00:30:55 UTC (rev 3612)
@@ -44,4 +44,15 @@
--with-hddtemp \
--with-acpi
+checksums: distcheck
+ sha1sum $(PACKAGE)-$(VERSION).tar.bz2 > $(PACKAGE)-$(VERSION).tar.bz2.sha1.asc
+
+gpg-sign: checksums
+ gpg -b --armor $(PACKAGE)-$(VERSION).tar.bz2
+
+release: gpg-sign
+ -mkdir releases/
+ mv $(PACKAGE)-$(VERSION).tar.bz2* releases/
+ -rm $(PACKAGE)-$(VERSION).tar.gz
+
# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
Modified: xfce4-sensors-plugin/trunk/configure.in.in
===================================================================
--- xfce4-sensors-plugin/trunk/configure.in.in 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/configure.in.in 2007-11-21 00:30:55 UTC (rev 3612)
@@ -64,7 +64,7 @@
AC_SUBST([LIBSENSORS_CFLAGS])
AC_SUBST([LIBSENSORS_LDFLAGS])
-AM_CONDITIONAL([HAVE_LIBSENSORS], [test x"enable_libsensors" = x"yes"])
+AM_CONDITIONAL([HAVE_LIBSENSORS], [test x$enable_libsensors = x"yes"])
dnl Check for hddtemp depending on whether it is disabled upon user request
@@ -102,7 +102,7 @@
AC_SUBST([PATH_HDDTEMP])
fi
-AM_CONDITIONAL([HAVE_HDDTEMP], [test x"$enable_hddtemp=" = x"yes"])
+AM_CONDITIONAL([HAVE_HDDTEMP], [test x$enable_hddtemp = x"yes"])
dnl Check for interface for /proc/acpi to be used
Modified: xfce4-sensors-plugin/trunk/panel-plugin/acpi.c
===================================================================
--- xfce4-sensors-plugin/trunk/panel-plugin/acpi.c 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/panel-plugin/acpi.c 2007-11-21 00:30:55 UTC (rev 3612)
@@ -31,21 +31,287 @@
#include <unistd.h>
-int initialize_ACPI (GPtrArray *chips)
+
+static char *
+strip_key_colon_spaces (char *buf)
{
+ char *p;
+ p = buf;
+
+ /* Skip everything before the ':' */
+ while (*(p++)) {
+ if (*p == ':') {
+ break;
+ }
+ }
+ p++;
+ /* Skip all the spaces */
+ while (*(p++)) {
+ if (*p != ' ') {
+ break;
+ }
+ }
+
+ return p;
+}
+
+
+int
+read_thermal_zone (t_chip *chip)
+{
DIR *d;
+ FILE *file;
+ char *zone, *filename;
struct dirent *de;
- int entries = 0;
- t_chip *chip;
+ t_chipfeature *chipfeature;
+
+ TRACE ("enters read_thermal_zone");
+
+ if ((chdir (ACPI_PATH) == 0) && (chdir (ACPI_DIR_THERMAL) == 0))
+ {
+ d = opendir (".");
+ if (!d) {
+ closedir (d);
+ return -1;
+ }
+
+ while ((de = readdir (d)))
+ {
+ //printf ("reading %s\n", de->d_name);
+ if (strncmp(de->d_name, ".", 1)==0)
+ continue;
+
+ filename = g_strdup_printf ("%s/%s/%s/%s", ACPI_PATH,
+ ACPI_DIR_THERMAL, de->d_name,
+ ACPI_FILE_THERMAL);
+ file = fopen (filename, "r");
+ if (file)
+ {
+ //printf ("parsing temperature file...\n");
+ /* if (acpi_ignore_directory_entry (de))
+ continue; */
+
+ chipfeature = g_new0 (t_chipfeature, 1);
+
+ chipfeature->color = "#0000B0";
+ chipfeature->name = g_strdup (de->d_name);
+ chipfeature->formatted_value = NULL; /* Gonna refresh it in
+ sensors_get_wrapper or some
+ other functions */
+ zone = g_strdup_printf ("%s/%s", ACPI_DIR_THERMAL, de->d_name);
+ chipfeature->raw_value = get_acpi_zone_value (zone, ACPI_FILE_THERMAL);
+ //printf ("got value %f\n", chipfeature->raw_value);
+ g_free (zone);
+
+ chipfeature->valid = TRUE;
+ chipfeature->min_value = 20.0;
+ chipfeature->max_value = 60.0;
+ chipfeature->class = TEMPERATURE;
+
+ g_ptr_array_add (chip->chip_features, chipfeature);
+
+ chip->num_features++; /* FIXME: actually I am just the same like
+ chip->chip_features->len */
+
+ fclose(file);
+ }
+ //else
+ //printf ("not parsing temperature file...\n");
+
+ g_free (filename);
+ }
+
+ closedir (d);
+ TRACE ("leaves read_thermal_zone");
+
+ return 0;
+ }
+ else {
+ TRACE ("leaves read_thermal_zone");
+ return -2;
+ }
+}
+
+
+double get_battery_zone_value (char *zone)
+{
double value;
+
+ FILE *file;
+ char buf [1024], *filename, *tmp;
+
+ TRACE ("enters get_battery_zone_value for %s", zone);
+
+ value = 0.0;
+
+ filename = g_strdup_printf ("%s/%s/%s/%s", ACPI_PATH, ACPI_DIR_BATTERY,
+ zone, ACPI_FILE_BATTERY_STATE);
+ file = fopen (filename, "r");
+ if (file) {
+ while (fgets (buf, 1024, file)!=NULL)
+ {
+ if (strncmp (buf, "remaining capacity:", 19)==0)
+ {
+ //printf ("remaining=");
+ tmp = strip_key_colon_spaces(buf);
+ value = strtod (tmp, NULL);
+ //printf ("%f\n", value);
+ break;
+ }
+ }
+ /* g_free (tmp); */ /* points to inside the buffer! */
+ fclose (file);
+ }
+
+ g_free (filename);
+
+ return value;
+}
+
+
+int read_battery_zone (t_chip *chip)
+{
+ DIR *d;
+ FILE *file;
+ char *filename, *tmp, buf[1024];
+ struct dirent *de;
t_chipfeature *chipfeature;
+ TRACE ("enters read_battery_zone");
+
+ if ((chdir (ACPI_PATH) == 0) && (chdir (ACPI_DIR_BATTERY) == 0)) {
+ d = opendir (".");
+ if (!d) {
+ closedir (d);
+ return -1;
+ }
+
+ while ((de = readdir (d)))
+ {
+ if (strncmp(de->d_name, "BAT", 3)==0)
+ { /* have a battery subdirectory */
+
+ filename = g_strdup_printf ("%s/%s/%s/%s", ACPI_PATH,
+ ACPI_DIR_BATTERY, de->d_name,
+ ACPI_FILE_BATTERY_STATE);
+ file = fopen (filename, "r");
+ if (file) {
+ chipfeature = g_new0 (t_chipfeature, 1);
+ chipfeature->name = g_strdup (de->d_name);
+ chipfeature->valid = TRUE;
+ chipfeature->min_value = 0.0;
+ chipfeature->class = ENERGY;
+ chipfeature->formatted_value = NULL;
+ chipfeature->color = "#0000B0";
+ while (fgets (buf, 1024, file)!=NULL)
+ {
+ if (strncmp (buf, "design capacity low:", 20)==0)
+ {
+ tmp = strip_key_colon_spaces(buf);
+ chipfeature->min_value = strtod (tmp, NULL);
+ }
+ else if (strncmp (buf, "remaining capacity:", 19)==0)
+ {
+ printf ("remaining=");
+ tmp = strip_key_colon_spaces(buf);
+ chipfeature->raw_value = strtod (tmp, NULL);
+ printf ("%f\n", chipfeature->raw_value);
+ }
+ }
+ /* g_free (tmp); */ /* points to inside of the buffer */
+ fclose (file);
+
+ /* chipfeature->raw_value = get_battery_zone_value (de->d_name); */
+ g_ptr_array_add (chip->chip_features, chipfeature);
+ chip->num_features++; /* FIXME: actually I am just the same
+ as chip->chip_features->len */
+ }
+ else {
+ g_free (filename);
+ continue; /* because, what would we want to do with only
+ a maxval and no real value inside? */
+ }
+
+ g_free (filename);
+
+ get_battery_max_value (de->d_name, chipfeature);
+
+ }
+
+ }
+
+ closedir (d);
+ TRACE ("leaves read_battery_zone");
+
+ return 0;
+
+ }
+ else
+ {
+ TRACE ("leaves read_battery_zone");
+ return -2;
+ }
+}
+
+
+void
+get_battery_max_value (char *name, t_chipfeature *chipfeature)
+{
+ FILE *file;
+ char *filename, *tmp, buf[1024];
+
+ TRACE ("enters get_battery_max_value");
+
+ filename = g_strdup_printf ("%s/%s/%s/%s", ACPI_PATH,
+ ACPI_DIR_BATTERY, name,
+ ACPI_FILE_BATTERY_INFO);
+ file = fopen (filename, "r");
+ if (file)
+ {
+ while (fgets (buf, 1024, file)!=NULL)
+ {
+ printf ("reading %s\n", buf);
+ if (strncmp (buf, "last full capacity:", 19)==0)
+ {
+ printf ("last full");
+ tmp = strip_key_colon_spaces(buf);
+ printf ("=%s\n", tmp);
+ chipfeature->max_value = strtod (tmp, NULL);
+ }
+ }
+ fclose (file);
+ }
+
+ g_free (filename);
+
+ TRACE ("leaves get_battery_max_value");
+}
+
+
+int read_fan_zone (t_chip *chip)
+{
+ /*DIR *d;
+ struct dirent *de;
+ t_chipfeature *chipfeature; */
+
+ TRACE ("enters read_fan_zone");
+
+ TRACE ("leaves read_fan_zone");
+ return -7;
+}
+
+
+int initialize_ACPI (GPtrArray *chips)
+{
+ t_chip *chip;
+
TRACE ("enters initialize_ACPI");
chip = g_new0 (t_chip, 1);
- chip->name = g_strdup (_("ACPI"));
- chip->description = g_strdup (_("Advanced Configuration and Power Interface"));
- chip->sensorId = g_strdup("ACPI");
+ chip->name = _("ACPI"); /* to be displayed */
+ /* chip->description = _("Advanced Configuration and Power Interface"); */
+ chip->description = g_strdup_printf (_("ACPI v%s zones"), get_acpi_info());
+ chip->sensorId = "ACPI"; /* used internally */
chip->type = ACPI;
@@ -56,32 +322,13 @@
chip->num_features = 0;
- if ((chdir (ACPI_PATH) == 0) && (chdir ("thermal_zone") == 0)) {
- d = opendir (".");
- if (!d) return -1;
+ read_battery_zone (chip);
+ read_thermal_zone (chip);
+ read_fan_zone (chip);
- while ((de = readdir (d))) {
- if (acpi_ignore_directory_entry (de))
- continue;
- entries++;
+ printf ("len= %d\n", chip->chip_features->len);
+ printf ("num_features = %d\n", chip->num_features);
- chipfeature = g_new0 (t_chipfeature, 1);
- value = get_acpi_zone_value (de->d_name);
- chipfeature->raw_value = value;
- chipfeature->color = "#0000B0";
- chipfeature->formatted_value = g_strdup_printf ("%+5.1f", value);
- chipfeature->name = g_strdup (de->d_name);
- chipfeature->valid = TRUE;
- chipfeature->min_value = 20.0;
- chipfeature->max_value = 60.0;
- chipfeature->class = TEMPERATURE;
-
- g_ptr_array_add (chip->chip_features, chipfeature);
-
- chip->num_features++;
- }
- }
-
g_ptr_array_add (chips, chip);
TRACE ("leaves initialize_ACPI");
@@ -92,6 +339,7 @@
void
refresh_acpi (gpointer chip_feature, gpointer data)
{
+ char *file, *zone;
t_chipfeature *cf;
TRACE ("enters refresh_acpi");
@@ -100,6 +348,36 @@
cf = (t_chipfeature *) chip_feature;
+ switch (cf->class) {
+ case TEMPERATURE:
+ zone = g_strdup_printf ("%s/%s", ACPI_DIR_THERMAL, cf->name);
+ cf->raw_value = get_acpi_zone_value (zone, ACPI_FILE_THERMAL);
+ g_free (zone);
+ /* g_free (cf->formatted_value);
+ cf->formatted_value = g_strdup_printf (_("%+5.1f °C"), cf->raw_value); */
+ break;
+
+ case ENERGY:
+ zone = g_strdup_printf ("%s/%s", ACPI_DIR_BATTERY, cf->name);
+ cf->raw_value = get_battery_zone_value (zone);
+ g_free (zone);
+ /* g_free (cf->formatted_value);
+ cf->formatted_value = g_strdup_printf (_("%.0f mWh"), cf->raw_value); */
+ break;
+
+ case STATE:
+ file = g_strdup_printf ("%s/%s/state", ACPI_DIR_FAN, cf->name);
+ cf->raw_value = strcmp(get_acpi_value(file), "on")==0 ? 1.0 : 0.0;
+ g_free (file);
+ /* g_free (cf->formatted_value);
+ cf->formatted_value = g_strdup_printf (_("%.0f"), cf->raw_value); */
+ break;
+
+ default:
+ printf ("Unknown ACPI type. Please check your ACPI installation "
+ "and restart the plugin.\n");
+ }
+
TRACE ("leaves refresh_acpi");
}
@@ -109,79 +387,75 @@
{
TRACE ("enters and leaves acpi_ignore_directory_entry");
- return !strcmp(de->d_name, ".") || !strcmp(de->d_name, "..");
+ /*return !strcmp(de->d_name, ".") || !strcmp(de->d_name, ".."); */
+ return strcmp (de->d_name, "temperature");
}
char *
-get_acpi_value (char *filename)
+get_acpi_info ()
{
- FILE *file;
- char buf [1024];
- char *p;
+ char *filename, *version;
- TRACE ("enters get_acpi_value for %s", filename);
+ TRACE ("enters get_acpi_info");
- file = fopen (filename, "r");
- if (!file) return NULL;
+ filename = g_strdup_printf ("%s/%s", ACPI_PATH, ACPI_INFO);
- fgets (buf, 1024, file);
- fclose (file);
+ TRACE ("leaves get_acpi_info");
- p = buf;
+ version = get_acpi_value (filename);
+ version = g_strchomp (version);
+ if (version==NULL)
+ version = _("<Unknown>");
- /* Skip everything before the ':' */
- while (*(p++)) {
- if (*p == ':') {
- break;
- }
- }
- p++;
- /* Skip all the spaces */
- while (*(p++)) {
- if (*p != ' ') {
- break;
- }
- }
-
- TRACE ("leaves get_acpi_value with %s", p);
-
- /* Have read the data */
- return g_strdup (p);
+ return version;
}
-char *
-get_acpi_info ()
+/* Note that zone will have to consist of two paths, e.g.
+ * thermal_zone and THRM.
+ */
+double
+get_acpi_zone_value (char *zone, char *file)
{
- char *filename;
+ char *filename, *value;
+ double retval;
- TRACE ("enters get_acpi_info");
+ TRACE ("enters get_acpi_zone_value for %s/%s", zone, file);
- filename = g_strdup_printf ("%s/%s", ACPI_PATH, ACPI_INFO);
+ filename = g_strdup_printf ("%s/%s/%s", ACPI_PATH, zone, file);
+ value = get_acpi_value (filename);
- TRACE ("leaves get_acpi_info");
+ TRACE ("leaves get_acpi_zone_value with correctly converted value");
- return get_acpi_value (filename);
+ /* Return it as a double */
+ retval = strtod (value, NULL);
+ g_free (value);
+
+ return retval;
}
-double
-get_acpi_zone_value (char *zone)
+char *
+get_acpi_value (char *filename)
{
- char *filename, *value;
+ FILE *file;
+ char buf [1024], *p;
- TRACE ("enters get_acpi_zone_value for %s", zone);
+ TRACE ("enters get_acpi_value for %s", filename);
- filename = g_strdup_printf ("%s/%s/%s/%s", ACPI_PATH, ACPI_DIR,
- zone, ACPI_FILE);
- value = get_acpi_value (filename);
+ file = fopen (filename, "r");
+ if (!file)
+ return NULL;
- if (!value) return 0.0;
+ fgets (buf, 1024, file);
+ fclose (file);
- TRACE ("leaves get_acpi_zone_value");
+ p = strip_key_colon_spaces (buf);
- /* Return it as a double */
- return strtod (value, NULL);
+ TRACE ("leaves get_acpi_value with %s", p);
+
+ /* Have read the data */
+ return g_strdup (p);
}
Modified: xfce4-sensors-plugin/trunk/panel-plugin/acpi.h
===================================================================
--- xfce4-sensors-plugin/trunk/panel-plugin/acpi.h 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/panel-plugin/acpi.h 2007-11-21 00:30:55 UTC (rev 3612)
@@ -20,15 +20,23 @@
#ifndef XFCE4_SENSORS_ACPI_H
#define XFCE4_SENSORS_ACPI_H
-#define ACPI_PATH "/proc/acpi"
-#define ACPI_DIR "thermal_zone"
-#define ACPI_FILE "temperature"
-#define ACPI_INFO "info"
+#define ACPI_PATH "/home/tim/acpi" /* FIXME: /proc/acpi */
+#define ACPI_DIR_THERMAL "thermal_zone"
+#define ACPI_DIR_BATTERY "battery"
+#define ACPI_DIR_FAN "fan"
+#define ACPI_FILE_THERMAL "temperature"
+#define ACPI_FILE_BATTERY_STATE "state"
+#define ACPI_FILE_BATTERY_INFO "info"
+#define ACPI_FILE_FAN "state"
+#define ACPI_INFO "info"
+
#include <glib/garray.h>
#include <dirent.h> /* directory listing and reading */
+#include "types.h"
+
/*
* Initialize ACPI by ?
* @Return: Number of initialized chips
@@ -44,15 +52,76 @@
void refresh_acpi (gpointer chip_feature, gpointer data);
-double get_acpi_zone_value (char *zone);
+/*
+ * Read a double value from zone. Calls get_acpi_value with prolonged path.
+ * @Param zone: zone name under /proc/acpi including the subdir for one zone.
+ * @Param file: file to read information from, e.g. info.
+ * @Return: value read in firt line of file after keyword and colon.
+ */
+double get_acpi_zone_value (char *zone, char *file);
-char *get_acpi_info ();
+/*
+ * Read a double value from special subzone denoted by name.
+ * @Param name: name in the /pro/acpi/battery directory.
+ * @Param chipfeature: pointer to chipfeature to get a max value.
+ */
+void get_battery_max_value (char *name, t_chipfeature *chipfeature);
+/*
+ * Read information from the thermal zone.
+ * @Param chip: Pointer to already allocated chip, where values can be added.
+ * @Return: 0 on success
+ */
+int read_thermal_zone (t_chip *chip);
-char *get_acpi_value (char *filename);
+/*
+ * Read information from the battery zone.
+ * @Param chip: Pointer to already allocated chip, where values can be added.
+ * @Return: 0 on success
+ */
+int read_battery_zone (t_chip *chip);
+
+/*
+ * Read information from the fan zone.
+ * @Param chip: Pointer to already allocated chip, where values can be added.
+ * @Return: 0 on success
+ */
+int read_fan_zone (t_chip *chip);
+
+
+/*
+ * Returns the ACPI version number from /proc/acpi/info file.
+ * @Return: versionnumber as string!
+ */
+char * get_acpi_info ();
+
+
+/*
+ * Get the string found in filename after the colon. To make a double out of
+ * it, strtod is suitable.
+ * @Param filename: Complete path to file to be inspected.
+ * @Return: String of value found, "<Unknown>" otherwise.
+ */
+char * get_acpi_value (char *filename);
+
+
+/*
+ * Get the battery percentage from the battery information.
+ * @Param zone: Complete zone path including both e.g. "battery" and "BAT0"
+ * @Return double value of current battery power
+ */
+double get_battery_zone_value (char *zone);
+
+
+/*
+ * Indicates whether a given directory entry should be ignored as it's not
+ * "temperature".
+ * @Param de: pointer to directory entry.
+ * @Return: 1 on ignore, else 0
+ */
int acpi_ignore_directory_entry (struct dirent *de);
#endif /* XFCE4_SENSORS_ACPI_H */
Modified: xfce4-sensors-plugin/trunk/panel-plugin/configuration.c
===================================================================
--- xfce4-sensors-plugin/trunk/panel-plugin/configuration.c 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/panel-plugin/configuration.c 2007-11-21 00:30:55 UTC (rev 3612)
@@ -139,11 +139,13 @@
xfce_rc_write_bool_entry (rc, "Show", chipfeature->show);
- tmp = g_strdup_printf("%.2f", chipfeature->min_value);
+ tmp = g_strdup_printf("%.2f", chipfeature->min_value);
xfce_rc_write_entry (rc, "Min", tmp);
+ g_free (tmp);
tmp = g_strdup_printf("%.2f", chipfeature->max_value);
xfce_rc_write_entry (rc, "Max", tmp);
+ g_free (tmp);
} /* end if */
} /* end for j */
Modified: xfce4-sensors-plugin/trunk/panel-plugin/hddtemp.c
===================================================================
--- xfce4-sensors-plugin/trunk/panel-plugin/hddtemp.c 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/panel-plugin/hddtemp.c 2007-11-21 00:30:55 UTC (rev 3612)
@@ -17,7 +17,9 @@
/* Note for programmers and editors: Try to use 4 spaces instead of Tab! */
+#include "config.h"
#include "hddtemp.h"
+#include "middlelayer.h"
#include "types.h"
#include <glib/garray.h>
@@ -29,22 +31,60 @@
#include <glib/gspawn.h>
#include <glib/gstrfuncs.h>
+#include <gtk/gtkmessagedialog.h>
+#include <gtk/gtklabel.h>
+#include <gtk/gtkstock.h>
+
/* #include <stdio.h> */
#include <stdlib.h>
#include <string.h>
#include <sys/utsname.h>
+#include <unistd.h>
+
+
+void quick_message (gchar *message) {
+
+ GtkWidget *dialog; /*, *label; */
+
+ TRACE ("enters quick_message");
+
+ dialog = gtk_message_dialog_new (NULL,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_INFO,
+ GTK_BUTTONS_CLOSE,
+ message);
+
+ /* dialog = gtk_dialog_new_with_buttons (_("Could not run \"hddtemp\""),
+ NULL, 0, // GTK DIALOG NO MODAL ;-)
+ GTK_STOCK_CLOSE, GTK_RESPONSE_NONE,
+ NULL);
+ label = gtk_label_new (message);
+ gtk_label_set_line_wrap (GTK_LABEL(label), TRUE);
+ gtk_label_set_width_chars (GTK_LABEL(label), 60); */
+
+ g_signal_connect_swapped (dialog, "response",
+ G_CALLBACK (gtk_widget_destroy), dialog);
+
+ /*
+ gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), label);
+ gtk_widget_show_all (dialog); */
+ gtk_dialog_run(GTK_DIALOG(dialog));
+
+ TRACE ("leaves quick_message");
+}
+
+
void
-read_disks_linux24 (t_chip *chip)
+read_disks_fallback (t_chip *chip)
{
GError *error;
GDir *gdir;
- gchar * disk;
t_chipfeature *chipfeature;
const gchar* dirname;
- TRACE ("enters read_disks_linux24");
+ TRACE ("enters read_disks_fallback");
/* read from /proc/ide */
error = NULL;
@@ -52,46 +92,47 @@
while ( (dirname = g_dir_read_name (gdir))!=NULL ) {
if ( strncmp (dirname, "hd", 2)==0 || strncmp (dirname, "sd", 2)==0) {
- disk = g_strconcat ("/dev/", dirname, NULL);
/* TODO: look, if /dev/dirname exists? */
chipfeature = g_new0 (t_chipfeature, 1);
- chipfeature->name = disk;
+ chipfeature->name = g_strconcat ("/dev/", dirname, NULL);;
g_ptr_array_add (chip->chip_features, chipfeature);
chip->num_features++;
}
}
+
+ g_dir_close (gdir);
+
/* FIXME: read SCSI info from where? SATA? */
- TRACE ("leaves read_disks_linux24");
+ TRACE ("leaves read_disks_fallback");
}
void
read_disks_linux26 (t_chip *chip)
{
- GError *error;
GDir *gdir;
- gchar * disk;
t_chipfeature *chipfeature;
const gchar* dirname;
TRACE ("enters read_disks_linux26");
/* read from /sys/block */
- error = NULL;
- gdir = g_dir_open ("/sys/block/", 0, &error);
+ gdir = g_dir_open ("/sys/block/", 0, NULL);
while ( (dirname = g_dir_read_name (gdir))!=NULL ) {
if ( strncmp (dirname, "ram", 3)!=0 &&
- strncmp (dirname, "loop", 4)!=0 ) {
- disk = g_strconcat ("/dev/", dirname, NULL);
+ strncmp (dirname, "loop", 4)!=0 &&
+ strncmp (dirname, "dm-", 3)!=0 ) {
/* TODO: look, if /dev/dirname exists? */
chipfeature = g_new0 (t_chipfeature, 1);
- chipfeature->name = disk; /* /proc/ide/hda/model ?? */
+ chipfeature->name = g_strconcat ("/dev/", dirname, NULL); /* /proc/ide/hda/model ?? */
g_ptr_array_add (chip->chip_features, chipfeature);
chip->num_features++;
}
}
+ g_dir_close (gdir);
+
TRACE ("leaves read_disks_linux26");
}
@@ -99,18 +140,34 @@
void
remove_unmonitored_drives (t_chip *chip)
{
- int i;
+ int i, result;
t_chipfeature *chipfeature;
TRACE ("enters remove_unmonitored_drives");
- for (i=0; i<chip->num_features; i++) {
+ for (i=0; i<chip->num_features; i++)
+ {
chipfeature = g_ptr_array_index (chip->chip_features, i);
- if ( get_hddtemp_value (chipfeature->name)==0.0) {
+ result = get_hddtemp_value (chipfeature->name);
+ if (result == 0.0)
+ {
+ free_chipfeature ( (gpointer) chipfeature, NULL);
g_ptr_array_remove_index (chip->chip_features, i);
i--;
chip->num_features--;
}
+ else if (result == ZERO_KELVIN)
+ {
+ for (i=0; i < chip->num_features; i++) {
+ // printf("remove %d\n", i);
+ chipfeature = g_ptr_array_index (chip->chip_features, i);
+ free_chipfeature ( (gpointer) chipfeature, NULL);
+ }
+ g_ptr_array_free (chip->chip_features, TRUE);
+ // chip->chip_features = g_ptr_array_new();
+ chip->num_features=0;
+ return;
+ }
}
TRACE ("leaves remove_unmonitored_drives");
@@ -165,18 +222,21 @@
chip = g_new (t_chip, 1);
chip->chip_name = (const sensors_chip_name *)
- ( g_strdup(_("Hard disks")), 0, 0, g_strdup(_("Hard disks")) );
+ ( _("Hard disks"), 0, 0, _("Hard disks") );
chip->chip_features = g_ptr_array_new ();
chip->num_features = 0;
- chip->description = g_strdup (_("S.M.A.R.T. harddisk temperatures"));
- chip->name = g_strdup (_("Hard disks"));
+ chip->description = _("S.M.A.R.T. harddisk temperatures");
+ chip->name = _("Hard disks");
+ chip->sensorId = "Hard disks";
chip->type = HDD;
p_uname = (struct utsname *) malloc (sizeof(struct utsname));
result = uname (p_uname);
- if (result!=0)
+ if (result!=0) {
+ g_free(p_uname);
return -1;
+ }
generation = atoi ( p_uname->release ); /* this might cause trouble on */
major = atoi ( p_uname->release+2 ); /* other systems than Linux! */
@@ -187,8 +247,10 @@
if (strcmp(p_uname->sysname, "Linux")==0 && major>=5)
read_disks_linux26 (chip);
else
- read_disks_linux24 (chip); /* hopefully, that's a safe variant */
+ read_disks_fallback (chip); /* hopefully, that's a safe variant */
+ g_free(p_uname);
+
remove_unmonitored_drives (chip);
if ( chip->num_features>0 ) { /* if (1) */
@@ -216,20 +278,32 @@
TRACE ("enters get_hddtemp_value for %s", disk);
- /* FIXME: On self-installed systems, this is /usr/local/sbin! */
- cmd_line = g_strdup_printf ( "/usr/sbin/hddtemp -n -q %s", disk);
+ cmd_line = g_strdup_printf ( "%s -n -q %s", PATH_HDDTEMP, disk);
result = g_spawn_command_line_sync (cmd_line,
&standard_output, &standard_error, &exit_status, NULL);
/* filter those with no sensors out */
if (!result || exit_status!=0 /* || error!=NULL */ ) {
- return 0.0;
+ if (exit_status!=0 && access (PATH_HDDTEMP, X_OK)==0) {
+ quick_message ("\"hddtemp\" was not executed correctly, although it is "
+ "executable. This is most probably due to the disks "
+ "requiring root privileges to read their temperatures, "
+ "and \"hddtemp\" not being setuid root.\n\n"
+ "An easy but dirty solution is to run \"chmod u+s "
+ PATH_HDDTEMP "\" as root user and restart this plugin "
+ "or its panel.");
+ value = ZERO_KELVIN;
+ }
+ else
+ value = 0.0;
}
+ else {
+ /* hddtemp does not return floating values, but only integer ones.
+ So have an easier life with atoi.
+ FIXME: Use strtod() instead?*/
+ value = (double) (atoi ( (const char*) standard_output) );
+ }
- /* hddtemp does not return floating values, but only integer ones.
- So have an easier life with atoi. */
- value = (double) (atoi ( (const char*) standard_output) );
-
g_free (cmd_line);
g_free (standard_output);
g_free (standard_error);
@@ -254,7 +328,12 @@
value = get_hddtemp_value (cf->name);
- cf->formatted_value = g_strdup_printf("%+5.2f", value);
+ g_free (cf->formatted_value);
+ /* if (scale == FAHRENHEIT) {
+ cf->formatted_value = g_strdup_printf(_("%5.1f °F"), (float) (value * 9/5 + 32) );
+ } else { // Celsius */
+ cf->formatted_value = g_strdup_printf(_("%5.1f °C"), value);
+ /* } */
cf->raw_value = value;
TRACE ("leaves refresh_hddtemp");
Modified: xfce4-sensors-plugin/trunk/panel-plugin/hddtemp.h
===================================================================
--- xfce4-sensors-plugin/trunk/panel-plugin/hddtemp.h 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/panel-plugin/hddtemp.h 2007-11-21 00:30:55 UTC (rev 3612)
@@ -22,6 +22,10 @@
#include <glib/garray.h>
+
+#define ZERO_KELVIN -273 /*.15 */
+
+
/*
* Initialize hddtemp by finding disks to monitor
* @Return: Number of initialized chips
Modified: xfce4-sensors-plugin/trunk/panel-plugin/lmsensors.c
===================================================================
--- xfce4-sensors-plugin/trunk/panel-plugin/lmsensors.c 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/panel-plugin/lmsensors.c 2007-11-21 00:30:55 UTC (rev 3612)
@@ -49,7 +49,7 @@
chip->sensorId = g_strdup_printf ("%s-%x-%x", name->prefix, name->bus, name->addr);
chip->num_features=0;
- chip->name = g_strdup (_("LM Sensors"));
+ chip->name = _("LM Sensors");
chip->chip_features = g_ptr_array_new();
chip->description = g_strdup (sensors_get_adapter_name (num_sensorchips-1));
@@ -66,7 +66,8 @@
chipfeature->color = "#00B000";
chipfeature->valid = TRUE;
- chipfeature->formatted_value = g_strdup_printf("%+5.1f", sensorFeature);
+ g_free (chipfeature->formatted_value);
+ chipfeature->formatted_value = g_strdup_printf ("%+5.1f", sensorFeature);
chipfeature->raw_value = sensorFeature;
chipfeature->address = number;
chipfeature->show = FALSE;
@@ -88,8 +89,8 @@
chipfeature = g_new0 (t_chipfeature, 1);
if (sensors_get_ignored (*(name), number)==1) {
- res = sensors_get_label(*(name), number,
- &(chipfeature->name));
+ g_free (chipfeature->name); /* ? */
+ res = sensors_get_label (*(name), number, &(chipfeature->name));
if (res==0) {
res = sensors_get_feature (*(name), number,
@@ -105,6 +106,7 @@
}
TRACE("leaves find_chipfeature with null");
+ g_free (chipfeature);
return NULL;
}
@@ -125,11 +127,12 @@
if (errno != ENOENT) /* the file actually exists */
{
- sensorsInit = sensors_init(file);
+ sensorsInit = sensors_init (file);
if (sensorsInit != 0)
{
g_printf(_("Error: Could not connect to sensors!"));
/* FIXME: better popup window? write to special logfile? */
+ fclose (file);
return -2;
}
Modified: xfce4-sensors-plugin/trunk/panel-plugin/middlelayer.c
===================================================================
--- xfce4-sensors-plugin/trunk/panel-plugin/middlelayer.c 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/panel-plugin/middlelayer.c 2007-11-21 00:30:55 UTC (rev 3612)
@@ -18,12 +18,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+ #include "config.h"
+#endif
+
#ifdef HAVE_LINUX
#include <sys/utsname.h>
#endif
+
#include "middlelayer.h"
#ifdef HAVE_LIBSENSORS
@@ -133,6 +137,11 @@
chipfeature->class = SPEED;
chipfeature->min_value = 1000.0;
chipfeature->max_value = 3500.0;
+ } else if ( strstr(chipfeature->name, "alarm")!=NULL
+ || strstr(chipfeature->name, "Alarm")!=NULL ) {
+ chipfeature->class = STATE;
+ chipfeature->min_value = 0.0;
+ chipfeature->max_value = 1.0;
} else {
chipfeature->class = OTHER;
chipfeature->min_value = 0.0;
@@ -164,6 +173,9 @@
feature = (t_chipfeature *) g_ptr_array_index (chip->chip_features, number);
g_assert (feature!=NULL);
*value = get_hddtemp_value (feature->name);
+ if (*value==ZERO_KELVIN) {
+ return NO_VALID_HDDTEMP;
+ }
return 0;
#else
return -1;
@@ -174,7 +186,9 @@
g_assert (number<chip->num_features);
feature = (t_chipfeature *) g_ptr_array_index (chip->chip_features, number);
g_assert (feature!=NULL);
- *value = get_acpi_zone_value (feature->name);
+ /* *value = get_acpi_zone_value (feature->name); */
+ /* refresh_acpi ((gpointer) feature); */
+ *value = feature->raw_value;
return 0; /* HERE I AM, I WANNA BE FIXED */
#else
return -1;
@@ -186,7 +200,39 @@
}
}
+
void
+free_chipfeature (gpointer chipfeature, gpointer data)
+{
+ t_chipfeature *cf;
+ cf = (t_chipfeature *) chipfeature;
+
+ g_free (cf->name);
+ g_free (cf->formatted_value);
+ g_free (cf->color);
+}
+
+
+void
+free_chip (gpointer chip, gpointer data)
+{
+ t_chip *c;
+ c = (t_chip *) chip;
+ if (c->type==LMSENSOR)
+ g_free (c->name);
+ g_free (c->sensorId);
+ g_free (c->description);
+ if (c->type==LMSENSOR) {
+ g_free (c->chip_name->prefix);
+ g_free (c->chip_name->busname);
+ }
+ /* g_free (c->chip_name); */ /* is a _copied_ structure of libsensors */
+ g_ptr_array_foreach (c->chip_features, free_chipfeature, NULL);
+ g_ptr_array_free (c->chip_features, TRUE);
+}
+
+
+void
sensor_interface_cleanup()
{
#ifdef HAVE_LIBSENSORS
Modified: xfce4-sensors-plugin/trunk/panel-plugin/middlelayer.h
===================================================================
--- xfce4-sensors-plugin/trunk/panel-plugin/middlelayer.h 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/panel-plugin/middlelayer.h 2007-11-21 00:30:55 UTC (rev 3612)
@@ -34,6 +34,8 @@
#include <string.h>
+#define NO_VALID_HDDTEMP -2
+
/*
* Initialize all sensors detected by iterating and calling init-routines
* @Return: Number of initialized features
@@ -73,6 +75,15 @@
*/
int sensors_get_feature_wrapper (t_chip *chip, int number, double *value);
+
+/* Free data in chipfeatures */
+void free_chipfeature (gpointer chipfeature, gpointer data);
+
+
+/* Free reamining structures in chips and associated chipfeatures */
+void free_chip (gpointer chip, gpointer data);
+
+
/* Clean up structures and call library routines for ending "session".
*/
void sensor_interface_cleanup ();
Modified: xfce4-sensors-plugin/trunk/panel-plugin/sensors.c
===================================================================
--- xfce4-sensors-plugin/trunk/panel-plugin/sensors.c 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/panel-plugin/sensors.c 2007-11-21 00:30:55 UTC (rev 3612)
@@ -498,7 +498,6 @@
sensors_show_text_display (t_sensors *sensors)
{
gint itemsToDisplay, numRows, numCols;
- gchar *myLabelText;
TRACE ("enters sensors_show_text_display");
@@ -509,12 +508,8 @@
numRows = determine_number_of_rows (sensors);
- if (sensors->show_title == TRUE || itemsToDisplay==0) {
- myLabelText = g_strdup (_("<span foreground=\"#000000\"><b>Sensors"
- "</b></span>"));
- gtk_label_set_markup(GTK_LABEL(sensors->panel_label_text), myLabelText);
+ if (sensors->show_title == TRUE || itemsToDisplay==0)
gtk_widget_show (sensors->panel_label_text);
- }
else
gtk_widget_hide (sensors->panel_label_text);
@@ -537,18 +532,25 @@
switch (chipfeature->class) {
case TEMPERATURE:
if (scale == FAHRENHEIT) {
- *help = g_strdup_printf("%5.1f °F",
+ *help = g_strdup_printf(_("%5.1f °F"),
(float) (sensorFeature * 9/5 + 32) );
} else { /* Celsius */
- *help = g_strdup_printf("%5.1f °C", sensorFeature);
+ *help = g_strdup_printf(_("%5.1f °C"), sensorFeature);
}
break;
case VOLTAGE:
- *help = g_strdup_printf("%+5.2f V", sensorFeature);
+ *help = g_strdup_printf(_("%+5.2f V"), sensorFeature);
break;
+ case ENERGY:
+ *help = g_strdup_printf(_("%.0f mWh"), sensorFeature);
+ break;
+ case STATE:
+ *help = g_strdup_printf("%.0f", sensorFeature);
+ break;
+
case SPEED:
*help = g_strdup_printf(_("%5.0f rpm"), sensorFeature);
break;
@@ -574,7 +576,7 @@
int i, index_feature, res;
double sensorFeature;
gboolean first, prependedChipName;
- gchar *myToolTipText, *tmp;
+ gchar *myToolTipText, *myToolTipText2, *tmp;
t_chipfeature *chipfeature;
t_chip *chip;
@@ -586,13 +588,13 @@
first = TRUE;
for (i=0; i < sensors->num_sensorchips; i++) {
- chip = (t_chip *) g_ptr_array_index(sensors->chips, i);
+ chip = (t_chip *) g_ptr_array_index (sensors->chips, i);
g_assert (chip!=NULL);
prependedChipName = FALSE;
for (index_feature = 0; index_feature<chip->num_features; index_feature++) {
- chipfeature = g_ptr_array_index(chip->chip_features, index_feature);
+ chipfeature = g_ptr_array_index (chip->chip_features, index_feature);
g_assert (chipfeature!=NULL);
if ( chipfeature->valid == TRUE && chipfeature->show == TRUE ) {
@@ -603,9 +605,12 @@
myToolTipText = g_strdup (chip->sensorId);
first = FALSE;
}
- else
- myToolTipText = g_strconcat (myToolTipText, " \n",
+ else {
+ myToolTipText2 = g_strconcat (myToolTipText, " \n",
chip->sensorId, NULL);
+ g_free (myToolTipText);
+ myToolTipText = myToolTipText2;
+ }
prependedChipName = TRUE;
}
@@ -623,10 +628,13 @@
format_sensor_value (sensors->scale, chipfeature,
sensorFeature, &tmp);
- myToolTipText = g_strconcat (myToolTipText, "\n ",
+ myToolTipText2 = g_strconcat (myToolTipText, "\n ",
chipfeature->name, ": ", tmp,
NULL);
+ g_free (myToolTipText);
+ myToolTipText = myToolTipText2;
+ g_free (chipfeature->formatted_value);
chipfeature->formatted_value = g_strdup (tmp);
chipfeature->raw_value = sensorFeature;
@@ -730,6 +738,7 @@
static void
create_panel_widget (t_sensors * sensors)
{
+ gchar *myLabelText;
TRACE ("enters create_panel_widget");
/* initialize a new vbox widget */
@@ -744,6 +753,10 @@
sensors->panel_label_text = gtk_label_new (NULL);
gtk_misc_set_padding (GTK_MISC(sensors->panel_label_text), INNER_BORDER, 0);
gtk_misc_set_alignment(GTK_MISC(sensors->panel_label_text), 0.0, 0.5);
+
+ myLabelText = g_strdup (_("<span foreground=\"#000000\"><b>Sensors"
+ "</b></span>"));
+ gtk_label_set_markup(GTK_LABEL(sensors->panel_label_text), myLabelText);
gtk_widget_show (sensors->panel_label_text);
sensors->panel_label_data = gtk_label_new (NULL);
@@ -856,7 +869,8 @@
chipfeature->color = "#000000";
chipfeature->name = "No sensor";
chipfeature->valid = TRUE;
- chipfeature->formatted_value = g_strdup_printf("%+5.2f", 0.0);
+ g_free (chipfeature->formatted_value);
+ chipfeature->formatted_value = g_strdup_printf("0.0");
chipfeature->raw_value = 0.0;
chipfeature->min_value = 0;
chipfeature->max_value = 7000;
@@ -909,6 +923,7 @@
g_source_remove (sensors->doubleclick_id);
/* free structures and arrays */
+ g_ptr_array_foreach (sensors->chips, free_chip, NULL);
g_ptr_array_free (sensors->chips, TRUE);
g_free (sensors);
@@ -927,7 +942,7 @@
/* update the panel widget */
sensors_show_panel ((gpointer) sensors);
- TRACE ("leaves sensors_free");
+ TRACE ("leaves sensors_set_size");
}
@@ -1075,6 +1090,7 @@
"guaranteed.\n") );
break;
}
+ g_free (chipfeature->formatted_value);
chipfeature->formatted_value = g_new (gchar, 0);
format_sensor_value (scale, chipfeature, sensorFeature,
&(chipfeature->formatted_value));
@@ -1357,9 +1373,12 @@
gtk_tree_store_set (GTK_TREE_STORE (model), &iter, 0, new_text, -1);
chip = (t_chip *) g_ptr_array_index(sd->sensors->chips, gtk_combo_box_active);
- chipfeature = (t_chipfeature *) g_ptr_array_index(chip->chip_features, atoi(path_str));
- chipfeature->name =
- g_strdup (new_text);
+ if (chip->type==LMSENSOR) { /* No Bug. The cryptic filesystem names are
+ needed for the update in ACPI and hddtemp. */
+ chipfeature = (t_chipfeature *) g_ptr_array_index (chip->chip_features,
+ atoi(path_str));
+ chipfeature->name = g_strdup (new_text);
+ }
/* clean up */
gtk_tree_path_free (path);
@@ -1639,7 +1658,7 @@
( chip->chip_name->bus) );
else */
sd->mySensorLabel =
- gtk_label_new (chip->sensorId);
+ gtk_label_new (chip->description);
gtk_widget_show (sd->mySensorLabel);
gtk_box_pack_start (GTK_BOX (hbox), sd->mySensorLabel, FALSE, FALSE, 0);
Modified: xfce4-sensors-plugin/trunk/panel-plugin/sensors.h
===================================================================
--- xfce4-sensors-plugin/trunk/panel-plugin/sensors.h 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/panel-plugin/sensors.h 2007-11-21 00:30:55 UTC (rev 3612)
@@ -36,6 +36,7 @@
#include <string.h>
#include "middlelayer.h"
+#include "types.h"
#define APP_NAME N_("Sensors Plugin")
@@ -49,15 +50,6 @@
/*
- * temperature scale to show values in
- */
-typedef enum {
- CELSIUS,
- FAHRENHEIT
-} t_tempscale;
-
-
-/*
* compound widget displaying a progressbar and optional label
*/
typedef struct {
Modified: xfce4-sensors-plugin/trunk/panel-plugin/types.h
===================================================================
--- xfce4-sensors-plugin/trunk/panel-plugin/types.h 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/panel-plugin/types.h 2007-11-21 00:30:55 UTC (rev 3612)
@@ -38,11 +38,20 @@
char *prefix;
int bus;
int addr;
- char *busname; /* if dummy */
+ char *busname; /* if dummy */
} sensors_chip_name;
#endif
+/*
+ * temperature scale to show values in
+ */
+typedef enum {
+ CELSIUS,
+ FAHRENHEIT
+} t_tempscale;
+
+
/* #define NUM_SENSOR_CHIPS 10
#define FEATURES_PER_SENSOR 256 */
@@ -60,6 +69,8 @@
TEMPERATURE,
VOLTAGE,
SPEED,
+ ENERGY,
+ STATE,
OTHER
} t_chipfeature_class;
Modified: xfce4-sensors-plugin/trunk/panel-plugin/xfce4-sensors-plugin.desktop.in.in
===================================================================
--- xfce4-sensors-plugin/trunk/panel-plugin/xfce4-sensors-plugin.desktop.in.in 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/panel-plugin/xfce4-sensors-plugin.desktop.in.in 2007-11-21 00:30:55 UTC (rev 3612)
@@ -4,5 +4,5 @@
_Name=Sensor plugin
_Comment=Show sensor values.
Icon=xfce-sensors
-X-XFCE-Exec=@PLUGIN_PATH@/xfce4-sensors-plugin
+X-XFCE-Exec=@PLUGIN_PATH@/xfce4-sensors-plugin.valgrind
Modified: xfce4-sensors-plugin/trunk/po/ca.po
===================================================================
--- xfce4-sensors-plugin/trunk/po/ca.po 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/po/ca.po 2007-11-21 00:30:55 UTC (rev 3612)
@@ -210,10 +210,12 @@
msgstr "No s’ha pogut connectar als sensors"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:1
+#, fuzzy
msgid "Sensor plugin "
msgstr "Connector de sensors"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:2
+#, fuzzy
msgid "Show sensor values."
msgstr "Mostra els valors dels sensors"
Modified: xfce4-sensors-plugin/trunk/po/cs.po
===================================================================
--- xfce4-sensors-plugin/trunk/po/cs.po 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/po/cs.po 2007-11-21 00:30:55 UTC (rev 3612)
@@ -210,10 +210,12 @@
msgstr "Chyba: Nelze se připojit k senzorům!"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:1
+#, fuzzy
msgid "Sensor plugin "
msgstr "Zásuvný modul senzor"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:2
+#, fuzzy
msgid "Show sensor values."
msgstr "Zobrazovat hodnoty senzorů."
Modified: xfce4-sensors-plugin/trunk/po/de.po
===================================================================
--- xfce4-sensors-plugin/trunk/po/de.po 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/po/de.po 2007-11-21 00:30:55 UTC (rev 3612)
@@ -138,7 +138,7 @@
#: ../panel-plugin/sensors.c:1866
msgid "E_xecute on double click:"
-msgstr "Bei _Doppel-Klick ausführen:"
+msgstr "Bei _Doppelklick ausführen:"
#: ../panel-plugin/sensors.c:1909
msgid "_View"
@@ -183,7 +183,7 @@
#: ../panel-plugin/lmsensors.c:52
msgid "LM Sensors"
-msgstr "LM Sensoren"
+msgstr "LM-Sensoren"
#: ../panel-plugin/lmsensors.c:131
#, c-format
@@ -192,7 +192,7 @@
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:1
msgid "Sensor plugin "
-msgstr "Sensor Plugin"
+msgstr "Sensor-Plugin"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:2
msgid "Show sensor values."
Modified: xfce4-sensors-plugin/trunk/po/el.po
===================================================================
--- xfce4-sensors-plugin/trunk/po/el.po 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/po/el.po 2007-11-21 00:30:55 UTC (rev 3612)
@@ -210,10 +210,12 @@
msgstr "Σφάλμα: Δεν ήταν δυνατή η σύνδεση με τους αισθητήρες!"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:1
+#, fuzzy
msgid "Sensor plugin "
msgstr "Πρόσθετο αισθητήρων"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:2
+#, fuzzy
msgid "Show sensor values."
msgstr "Εμφάνιση τιμών αισθητήρων."
Modified: xfce4-sensors-plugin/trunk/po/en_GB.po
===================================================================
--- xfce4-sensors-plugin/trunk/po/en_GB.po 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/po/en_GB.po 2007-11-21 00:30:55 UTC (rev 3612)
@@ -211,10 +211,12 @@
msgstr "Error: Could not connect to sensors!"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:1
+#, fuzzy
msgid "Sensor plugin "
msgstr "Sensor plugin "
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:2
+#, fuzzy
msgid "Show sensor values."
msgstr "Show sensor values."
Modified: xfce4-sensors-plugin/trunk/po/eu.po
===================================================================
--- xfce4-sensors-plugin/trunk/po/eu.po 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/po/eu.po 2007-11-21 00:30:55 UTC (rev 3612)
@@ -200,10 +200,12 @@
msgstr "Errorea: Ezin da sentsoreetara konektatu!"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:1
+#, fuzzy
msgid "Sensor plugin "
msgstr "Sentsore plugin-a "
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:2
+#, fuzzy
msgid "Show sensor values."
msgstr "Sentsore balioak bistarazi."
Modified: xfce4-sensors-plugin/trunk/po/fr.po
===================================================================
--- xfce4-sensors-plugin/trunk/po/fr.po 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/po/fr.po 2007-11-21 00:30:55 UTC (rev 3612)
@@ -195,10 +195,12 @@
msgstr "Erreur : ne peut pas se connecter aux senseurs !"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:1
+#, fuzzy
msgid "Sensor plugin "
msgstr "Greffon senseur"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:2
+#, fuzzy
msgid "Show sensor values."
msgstr "Afficher les valeurs du senseur."
Modified: xfce4-sensors-plugin/trunk/po/hu.po
===================================================================
--- xfce4-sensors-plugin/trunk/po/hu.po 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/po/hu.po 2007-11-21 00:30:55 UTC (rev 3612)
@@ -193,10 +193,12 @@
msgstr "Hiba: nem lehet érzékelőkhöz kapcsolódni!"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:1
+#, fuzzy
msgid "Sensor plugin "
msgstr "Érzékelő"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:2
+#, fuzzy
msgid "Show sensor values."
msgstr "Értékek mutatása"
Modified: xfce4-sensors-plugin/trunk/po/ja.po
===================================================================
--- xfce4-sensors-plugin/trunk/po/ja.po 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/po/ja.po 2007-11-21 00:30:55 UTC (rev 3612)
@@ -208,10 +208,12 @@
msgstr "エラー: センサーに接続できませんでした!"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:1
+#, fuzzy
msgid "Sensor plugin "
msgstr "センサー"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:2
+#, fuzzy
msgid "Show sensor values."
msgstr "センサーの値を表示します。"
Modified: xfce4-sensors-plugin/trunk/po/ko.po
===================================================================
--- xfce4-sensors-plugin/trunk/po/ko.po 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/po/ko.po 2007-11-21 00:30:55 UTC (rev 3612)
@@ -200,10 +200,12 @@
msgstr "오류: 선세에 연결하지 못 했습니다."
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:1
+#, fuzzy
msgid "Sensor plugin "
msgstr "센서 플러그인"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:2
+#, fuzzy
msgid "Show sensor values."
msgstr "센서 값 보이기"
Modified: xfce4-sensors-plugin/trunk/po/lt.po
===================================================================
--- xfce4-sensors-plugin/trunk/po/lt.po 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/po/lt.po 2007-11-21 00:30:55 UTC (rev 3612)
@@ -201,8 +201,9 @@
msgstr ""
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:1
+#, fuzzy
msgid "Sensor plugin "
-msgstr ""
+msgstr "Sensorių tipas:"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:2
msgid "Show sensor values."
Modified: xfce4-sensors-plugin/trunk/po/lv.po
===================================================================
--- xfce4-sensors-plugin/trunk/po/lv.po 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/po/lv.po 2007-11-21 00:30:55 UTC (rev 3612)
@@ -15,8 +15,7 @@
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: ../panel-plugin/sensors.c:202
-#: ../panel-plugin/sensors.c:514
+#: ../panel-plugin/sensors.c:202 ../panel-plugin/sensors.c:514
msgid "<span foreground=\"#000000\"><b>Sensors</b></span>"
msgstr "<span foreground=\"#000000\"><b>Sensors</b></span>"
@@ -29,8 +28,7 @@
msgid "No sensors selected!"
msgstr "Neviens sensors nav izvēlēts!"
-#: ../panel-plugin/sensors.c:618
-#: ../panel-plugin/sensors.c:1073
+#: ../panel-plugin/sensors.c:618 ../panel-plugin/sensors.c:1073
#, c-format
msgid ""
"Xfce Hardware Sensors Plugin:\n"
@@ -158,25 +156,20 @@
msgid "Edit Properties"
msgstr "Rediģēt Rekvizītus"
-#: ../panel-plugin/sensors.c:2022
-#: ../panel-plugin/sensors.h:40
+#: ../panel-plugin/sensors.c:2022 ../panel-plugin/sensors.h:40
msgid "Sensors Plugin"
msgstr "Sensoru Spraudnis"
#. only use this if no hddtemp sensor
#. FIXME: compare strings, or also have hddtmep and acpi store numeric values
#. assert correctly saved file
-#: ../panel-plugin/configuration.c:133
-#: ../panel-plugin/configuration.c:275
-#: ../panel-plugin/configuration.c:281
-#: ../panel-plugin/hddtemp.c:129
-#: ../panel-plugin/hddtemp.c:168
-#: ../panel-plugin/hddtemp.c:173
+#: ../panel-plugin/configuration.c:133 ../panel-plugin/configuration.c:275
+#: ../panel-plugin/configuration.c:281 ../panel-plugin/hddtemp.c:129
+#: ../panel-plugin/hddtemp.c:168 ../panel-plugin/hddtemp.c:173
msgid "Hard disks"
msgstr "Cietie Diski"
-#: ../panel-plugin/acpi.c:46
-#: ../panel-plugin/acpi.c:53
+#: ../panel-plugin/acpi.c:46 ../panel-plugin/acpi.c:53
msgid "ACPI"
msgstr "ACPI"
@@ -204,4 +197,3 @@
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:2
msgid "Show sensor values."
msgstr "Rādīt sensora vērtības."
-
Modified: xfce4-sensors-plugin/trunk/po/pl.po
===================================================================
--- xfce4-sensors-plugin/trunk/po/pl.po 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/po/pl.po 2007-11-21 00:30:55 UTC (rev 3612)
@@ -210,10 +210,12 @@
msgstr "Błąd: nie mogę połączyć się z czujnikiem!"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:1
+#, fuzzy
msgid "Sensor plugin "
msgstr "Wtyczka czujników "
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:2
+#, fuzzy
msgid "Show sensor values."
msgstr "Pokazuj wartości z czujników"
Modified: xfce4-sensors-plugin/trunk/po/pt_BR.po
===================================================================
--- xfce4-sensors-plugin/trunk/po/pt_BR.po 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/po/pt_BR.po 2007-11-21 00:30:55 UTC (rev 3612)
@@ -193,10 +193,12 @@
msgstr "Erro: Não foi possível conectar-se aos sensores!"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:1
+#, fuzzy
msgid "Sensor plugin "
msgstr "Plug-in de sensor"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:2
+#, fuzzy
msgid "Show sensor values."
msgstr "Mostrar valores do sensor."
Modified: xfce4-sensors-plugin/trunk/po/pt_PT.po
===================================================================
--- xfce4-sensors-plugin/trunk/po/pt_PT.po 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/po/pt_PT.po 2007-11-21 00:30:55 UTC (rev 3612)
@@ -209,10 +209,12 @@
msgstr "Erro: Impossível ligar aos sensores!"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:1
+#, fuzzy
msgid "Sensor plugin "
msgstr "Sensor Plugin"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:2
+#, fuzzy
msgid "Show sensor values."
msgstr "Mostrar valores de sensor."
Modified: xfce4-sensors-plugin/trunk/po/ru.po
===================================================================
--- xfce4-sensors-plugin/trunk/po/ru.po 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/po/ru.po 2007-11-21 00:30:55 UTC (rev 3612)
@@ -204,10 +204,12 @@
msgstr "Ошибка: Не удается соединиться с сенсорами!"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:1
+#, fuzzy
msgid "Sensor plugin "
msgstr "Сенсоры"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:2
+#, fuzzy
msgid "Show sensor values."
msgstr "Отображает значения сенсоров."
Modified: xfce4-sensors-plugin/trunk/po/sq.po
===================================================================
--- xfce4-sensors-plugin/trunk/po/sq.po 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/po/sq.po 2007-11-21 00:30:55 UTC (rev 3612)
@@ -209,10 +209,12 @@
msgstr "Gabim: Nuk u lidha dot me ndijuesat!"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:1
+#, fuzzy
msgid "Sensor plugin "
msgstr "Shtojcë ndijuesi"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:2
+#, fuzzy
msgid "Show sensor values."
msgstr "Shfaq vlera ndijuesish."
Modified: xfce4-sensors-plugin/trunk/po/ur.po
===================================================================
--- xfce4-sensors-plugin/trunk/po/ur.po 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/po/ur.po 2007-11-21 00:30:55 UTC (rev 3612)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: xfce4-sensors-plugin\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2006-09-10 21:29+0200\n"
+"POT-Creation-Date: 2007-11-05 23:42+0100\n"
"PO-Revision-Date: 2007-10-27 16:37+0500\n"
"Last-Translator: Muhammad Ali Makki <makk.ma at gmail.com>\n"
"Language-Team: Urdu <makki.ma at gmail.com>\n"
@@ -18,32 +18,25 @@
"X-Poedit-Country: PAKISTAN\n"
"X-Poedit-SourceCharset: utf-8\n"
-#: ../panel-plugin/sensors.c:153
-#: ../panel-plugin/sensors.c:2162
-msgid "<b>Sensors</b>"
-msgstr "<b>سینسرز</b>"
+#: ../panel-plugin/sensors.c:202 ../panel-plugin/sensors.c:514
+#, fuzzy
+msgid "<span foreground=\"#000000\"><b>Sensors</b></span>"
+msgstr "<span foreground=\"#000000\" size=\"%s\"><b>سینسرز</b></span>"
-#: ../panel-plugin/sensors.c:272
+#: ../panel-plugin/sensors.c:554
#, c-format
-msgid "<span foreground=\"#000000\" size=\"%s\"><b>Sensors</b></span>\n"
-msgstr "<span foreground=\"#000000\" size=\"%s\"><b>سینسرز</b></span>\n"
+msgid "%5.0f rpm"
+msgstr "%5.0f rpm"
-#: ../panel-plugin/sensors.c:334
-#, c-format
-msgid "<span foreground=\"#000000\" size=\"%s\"><b>Sensors</b></span>"
-msgstr "<span foreground=\"#000000\" size=\"%s\"><b>سینسرز</b></span>"
-
-#. circumvent empty char pointer
-#: ../panel-plugin/sensors.c:441
+#: ../panel-plugin/sensors.c:586
msgid "No sensors selected!"
msgstr "کوئی سینسر منتخب نہیں!"
-#: ../panel-plugin/sensors.c:479
-#: ../panel-plugin/sensors.c:1677
+#: ../panel-plugin/sensors.c:618 ../panel-plugin/sensors.c:1073
+#, fuzzy, c-format
msgid ""
-" \n"
-"Xfce Hardware Sensors Plugin: \n"
-"Seems like there was a problem reading a sensor feature value. \n"
+"Xfce Hardware Sensors Plugin:\n"
+"Seems like there was a problem reading a sensor feature value.\n"
"Proper proceeding cannot be guaranteed.\n"
msgstr ""
" \n"
@@ -51,138 +44,171 @@
"معلوم ہوتا ہے کہ سینسر خاصیت ویلیو پڑھنے میں مسئلہ ہے. \n"
"درست کاروائی کی ضمانت نہیں دی جاسکتی.\n"
-#: ../panel-plugin/sensors.c:500
-#, c-format
-msgid "%5.0f rpm"
-msgstr "%5.0f rpm"
-
-#: ../panel-plugin/sensors.c:723
-msgid "Error: Could not connect to sensors!"
-msgstr "غلطی: سینسر سے رابطہ نہیں ہوسکا!"
-
-#: ../panel-plugin/sensors.c:813
-#: ../panel-plugin/sensors.c:887
-msgid "Hard disks"
-msgstr "ہارڈ ڈسکس"
-
-#: ../panel-plugin/sensors.c:923
+#: ../panel-plugin/sensors.c:855
msgid "No sensors found!"
msgstr "کوئی سینسر نہیں ملا!"
-#: ../panel-plugin/sensors.c:1356
-msgid "Hard disk temperature sensors"
-msgstr "ہارڈ ڈسک ٹمپریچر سینسرز"
-
-#: ../panel-plugin/sensors.c:1772
+#: ../panel-plugin/sensors.c:1496
msgid "UI style:"
msgstr "مواجہ انداز:"
-#: ../panel-plugin/sensors.c:1773
-msgid "text"
+#: ../panel-plugin/sensors.c:1497
+#, fuzzy
+msgid "_text"
msgstr "متن"
-#: ../panel-plugin/sensors.c:1775
-msgid "graphical"
+#: ../panel-plugin/sensors.c:1499
+#, fuzzy
+msgid "g_raphical"
msgstr "گریفکل"
-#: ../panel-plugin/sensors.c:1812
-msgid "Show labels in graphical UI"
+#: ../panel-plugin/sensors.c:1536
+#, fuzzy
+msgid "Show _labels in graphical UI"
msgstr "گریفکل مواجہ میں لیبل ظاہر کریں"
-#: ../panel-plugin/sensors.c:1837
-msgid "Show title"
+#: ../panel-plugin/sensors.c:1566
+msgid "Show colored _bars"
+msgstr ""
+
+#: ../panel-plugin/sensors.c:1594
+#, fuzzy
+msgid "_Show title"
msgstr "عنوان ظاہر کریں"
-#: ../panel-plugin/sensors.c:1863
-msgid "Sensors type:"
+#: ../panel-plugin/sensors.c:1622
+#, fuzzy
+msgid "Sensors t_ype:"
msgstr "سینسر قسم:"
-#: ../panel-plugin/sensors.c:1910
+#: ../panel-plugin/sensors.c:1674
msgid "Name"
msgstr "نام"
-#: ../panel-plugin/sensors.c:1919
+#: ../panel-plugin/sensors.c:1683
msgid "Value"
msgstr "ویلیو"
-#: ../panel-plugin/sensors.c:1925
+#: ../panel-plugin/sensors.c:1689
msgid "Show"
msgstr "دکھائیں"
-#: ../panel-plugin/sensors.c:1934
+#: ../panel-plugin/sensors.c:1698
msgid "Color"
msgstr "رنگ"
-#: ../panel-plugin/sensors.c:1944
+#: ../panel-plugin/sensors.c:1708
msgid "Min"
msgstr "کم"
-#: ../panel-plugin/sensors.c:1953
+#: ../panel-plugin/sensors.c:1717
msgid "Max"
msgstr "زیادہ"
-#: ../panel-plugin/sensors.c:1981
-msgid "Font size:"
+#: ../panel-plugin/sensors.c:1750
+#, fuzzy
+msgid "F_ont size:"
msgstr "فونٹ حجم:"
-#: ../panel-plugin/sensors.c:1988
+#. gtk_widget_set_sensitive(myFontBox, !sd->sensors->display_values_graphically);
+#: ../panel-plugin/sensors.c:1757
msgid "x-small"
msgstr "x-چھوٹا"
-#: ../panel-plugin/sensors.c:1989
+#: ../panel-plugin/sensors.c:1758
msgid "small"
msgstr "چھوٹا"
-#: ../panel-plugin/sensors.c:1990
+#: ../panel-plugin/sensors.c:1759
msgid "medium"
msgstr "درمیانہ"
-#: ../panel-plugin/sensors.c:1991
+#: ../panel-plugin/sensors.c:1760
msgid "large"
msgstr "بڑا"
-#: ../panel-plugin/sensors.c:1992
+#: ../panel-plugin/sensors.c:1761
msgid "x-large"
msgstr "x-بڑا"
-#: ../panel-plugin/sensors.c:2020
+#: ../panel-plugin/sensors.c:1793
msgid "Temperature scale:"
msgstr "ٹمپریچر قیاس:"
-#: ../panel-plugin/sensors.c:2022
-msgid "Celsius"
+#: ../panel-plugin/sensors.c:1795
+#, fuzzy
+msgid "_Celsius"
msgstr "Celsius"
-#: ../panel-plugin/sensors.c:2024
-msgid "Fahrenheit"
+#: ../panel-plugin/sensors.c:1797
+#, fuzzy
+msgid "_Fahrenheit"
msgstr "فارن ہائیٹ"
-#: ../panel-plugin/sensors.c:2063
-msgid "Update interval (seconds):"
+#: ../panel-plugin/sensors.c:1836
+#, fuzzy
+msgid "U_pdate interval (seconds):"
msgstr "تجدید وقفہ (سیکنڈ):"
-#: ../panel-plugin/sensors.c:2090
-msgid "Execute on double click:"
+#: ../panel-plugin/sensors.c:1866
+#, fuzzy
+msgid "E_xecute on double click:"
msgstr "دہرے کلک پر چلائیں:"
-#: ../panel-plugin/sensors.c:2132
-msgid "<b>View</b>"
-msgstr "<b>منظر</b>"
+#: ../panel-plugin/sensors.c:1909
+msgid "_View"
+msgstr ""
-#: ../panel-plugin/sensors.c:2190
-msgid "<b>Miscellaneous</b>"
+#: ../panel-plugin/sensors.c:1939
+#, fuzzy
+msgid "_Sensors"
+msgstr "سینسر قسم:"
+
+#: ../panel-plugin/sensors.c:1967
+#, fuzzy
+msgid "_Miscellaneous"
msgstr "<b>متفرق</b>"
-#: ../panel-plugin/sensors.c:2237
+#: ../panel-plugin/sensors.c:2015
msgid "Edit Properties"
msgstr "خصوصیات مدون کریں"
-#. #include <unistd.h>
-#: ../panel-plugin/sensors.c:2244
-#: ../panel-plugin/sensors.h:51
+#: ../panel-plugin/sensors.c:2022 ../panel-plugin/sensors.h:40
msgid "Sensors Plugin"
msgstr "سینسرز پلگ ان"
+#. only use this if no hddtemp sensor
+#. FIXME: compare strings, or also have hddtmep and acpi store numeric values
+#. assert correctly saved file
+#: ../panel-plugin/configuration.c:133 ../panel-plugin/configuration.c:275
+#: ../panel-plugin/configuration.c:281 ../panel-plugin/hddtemp.c:129
+#: ../panel-plugin/hddtemp.c:168 ../panel-plugin/hddtemp.c:173
+msgid "Hard disks"
+msgstr "ہارڈ ڈسکس"
+
+#: ../panel-plugin/acpi.c:46 ../panel-plugin/acpi.c:53
+msgid "ACPI"
+msgstr ""
+
+#: ../panel-plugin/acpi.c:47
+msgid "Advanced Configuration and Power Interface"
+msgstr ""
+
+#: ../panel-plugin/hddtemp.c:172
+#, fuzzy
+msgid "S.M.A.R.T. harddisk temperatures"
+msgstr "ہارڈ ڈسک ٹمپریچر سینسرز"
+
+#: ../panel-plugin/lmsensors.c:52
+#, fuzzy
+msgid "LM Sensors"
+msgstr "سینسر قسم:"
+
+#: ../panel-plugin/lmsensors.c:131
+#, c-format
+msgid "Error: Could not connect to sensors!"
+msgstr "غلطی: سینسر سے رابطہ نہیں ہوسکا!"
+
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:1
msgid "Sensor plugin "
msgstr "سینسر پلگ ان"
@@ -191,3 +217,11 @@
msgid "Show sensor values."
msgstr "سینسر ویلیو دکھائیں:"
+#~ msgid "<b>Sensors</b>"
+#~ msgstr "<b>سینسرز</b>"
+
+#~ msgid "<span foreground=\"#000000\" size=\"%s\"><b>Sensors</b></span>\n"
+#~ msgstr "<span foreground=\"#000000\" size=\"%s\"><b>سینسرز</b></span>\n"
+
+#~ msgid "<b>View</b>"
+#~ msgstr "<b>منظر</b>"
Modified: xfce4-sensors-plugin/trunk/po/vi.po
===================================================================
--- xfce4-sensors-plugin/trunk/po/vi.po 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/po/vi.po 2007-11-21 00:30:55 UTC (rev 3612)
@@ -208,10 +208,12 @@
msgstr "Lỗi: Không thể kết nối tới bộ cảm ứng!"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:1
+#, fuzzy
msgid "Sensor plugin "
msgstr "Plugin cảm ứng "
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:2
+#, fuzzy
msgid "Show sensor values."
msgstr "Hiển thị các giá trị cảm ứng."
Modified: xfce4-sensors-plugin/trunk/po/zh_TW.po
===================================================================
--- xfce4-sensors-plugin/trunk/po/zh_TW.po 2007-11-19 23:06:36 UTC (rev 3611)
+++ xfce4-sensors-plugin/trunk/po/zh_TW.po 2007-11-21 00:30:55 UTC (rev 3612)
@@ -208,10 +208,12 @@
msgstr "錯誤:無法連線至感測器!"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:1
+#, fuzzy
msgid "Sensor plugin "
msgstr "感測器外掛程式"
#: ../panel-plugin/xfce4-sensors-plugin.desktop.in.in.h:2
+#, fuzzy
msgid "Show sensor values."
msgstr "顯示感測器數值。"
More information about the Goodies-commits
mailing list