git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kima@1088422 283d02a7-25f6-0310-bc7c-ecb5cbfe19dav3.5.13-sru
commit
da7847adb4
@ -0,0 +1,24 @@
|
|||||||
|
Authors:
|
||||||
|
========
|
||||||
|
Ken Werner <ken.werner@web.de>
|
||||||
|
Johannes Schaub <schaub-johannes@web.de>
|
||||||
|
Valentine Sinitsyn <e_val@inbox.ru> (cpufreqd control module)
|
||||||
|
|
||||||
|
Thanks to:
|
||||||
|
==========
|
||||||
|
Franziska Simmank (website)
|
||||||
|
Manfred Paul (debian support)
|
||||||
|
Rainer Dorsch (debian support)
|
||||||
|
Flavio Castelli (iBook G4 support)
|
||||||
|
Jocke Andersson (extended preferences)
|
||||||
|
Raoul Martin
|
||||||
|
Donnie Bhayangkara
|
||||||
|
Gonzalo Nemmi
|
||||||
|
Mariusz Ciesla
|
||||||
|
Mark Rosenstand
|
||||||
|
Santiago Bruno
|
||||||
|
Dark Apostrophe
|
||||||
|
Sascha Hoogen
|
||||||
|
Peter Avramucz
|
||||||
|
Oskar Ellström
|
||||||
|
Uğur Çetin
|
@ -0,0 +1,116 @@
|
|||||||
|
Kima 0.7.3.2:
|
||||||
|
- thread wakeups minimized which should lead to a better powertop result
|
||||||
|
- prevent i18n calls from within threads (it seems i18n isn't thread safe)
|
||||||
|
|
||||||
|
Kima 0.7.3.1:
|
||||||
|
- the 0.7.3 tag was inconsistent to the released tar.gz so we decided to release 0.7.3.1
|
||||||
|
- improvements regarding the dbus error handling
|
||||||
|
- XNVCtrl support fixed
|
||||||
|
- small autoconf/automake script improvements
|
||||||
|
|
||||||
|
Kima 0.7.3:
|
||||||
|
- more robust battery source in case of libhal/dbus errors
|
||||||
|
- since Kima 0.7.2 was already tagged we jump to 0.7.3 the changeog lists the never released 0.7.2 though
|
||||||
|
|
||||||
|
Kima 0.7.2:
|
||||||
|
- battery source added that displays the current state of charge of your batteries through libhal
|
||||||
|
- nvidia thermal source: optional configure switch added to query libXNVCtrl.a instead of nvidia-settings
|
||||||
|
- updated admin directory that supports automake 1.10
|
||||||
|
- swedish, turkish and indonesian translation added (thanks to Oskar Ellström, Uğur Çetin and Donnie S Bhayangkara)
|
||||||
|
- translation fixes
|
||||||
|
- processes started by kicker does not exit correctly because of kimas' use of QProcess. KProcess fixes the problem
|
||||||
|
|
||||||
|
Kima 0.7.1:
|
||||||
|
- uptime source added
|
||||||
|
- initial source scanning parallelized
|
||||||
|
- spanish translation added
|
||||||
|
- hungary translation added
|
||||||
|
- german translation fixes
|
||||||
|
- hddtemp source bugfix, in case reading from network failed
|
||||||
|
- preferences bugfix, an enabled source was not displayed on kicker
|
||||||
|
- cursor fixed if one drags a source and clicks right mouse button
|
||||||
|
- encoding of the degree sign is now UTF8
|
||||||
|
|
||||||
|
Kima 0.7:
|
||||||
|
- support for moving the sources via drag and drop added
|
||||||
|
- support for hddtemp daemon added (http://www.guzu.net/linux/hddtemp.php)
|
||||||
|
- german translation added
|
||||||
|
- repainting of the sources improved
|
||||||
|
|
||||||
|
Kima 0.6.3:
|
||||||
|
- fixes a bug that could crash kima (thanks to Johannes and Peter for debugging and testing)
|
||||||
|
|
||||||
|
Kima 0.6.2:
|
||||||
|
- support for the GPU thermal sensors of nvidia-settings (provided by the proprietary nVidia GPU card driver tools)
|
||||||
|
- the configuration is remebered even if the applets gets removed from the kicker and later added again (only one instance of Kima is allowed in the kicker)
|
||||||
|
upgrade note: to have your config persistent Kima needs to be removed from the kicker and added again (restart KDE or killing kicker won't work)
|
||||||
|
- performance improvements:
|
||||||
|
- ability to disable sources for performance reasons (don't pay for sources you don't use)
|
||||||
|
- tooltip speed improved by using cached values
|
||||||
|
- apply preferences immediately
|
||||||
|
- improved threading mechanism that results in faster source value updates (the source displays the value immediately after fetching)
|
||||||
|
|
||||||
|
Kima 0.6.1:
|
||||||
|
- lm_sensors capabilities improved by implementing hwmon support:
|
||||||
|
i.e. fan and thermal sensors provided by k8temp are now supported
|
||||||
|
i2c is used as a fall back if hwmon isn't available
|
||||||
|
thanks to Diego "Flameeyes" Petteno
|
||||||
|
|
||||||
|
Kima 0.6:
|
||||||
|
- CPU Info renamed to Kima (Kicker monitoring applet)
|
||||||
|
- uses threads to fetch values from the sensors (thanks to Johannes Schaub)
|
||||||
|
- i8k thermal and fan support for Dell Inspiron and Latitude notebooks added.
|
||||||
|
|
||||||
|
CPU Info 0.5.2:
|
||||||
|
- i2c (lm_sensors) fan support added
|
||||||
|
- ibm-acpi: support for the ibm_acpi-extra-thermal.patch added
|
||||||
|
|
||||||
|
CPU Info 0.5.1:
|
||||||
|
- fan support for the ibm-acpi kernel module added
|
||||||
|
- omnibook support fixed
|
||||||
|
|
||||||
|
CPU Info 0.5:
|
||||||
|
- 0.5 is able to display as many sources as you want
|
||||||
|
- cpufreq subsystem source is able to handle multiple CPUs
|
||||||
|
- a "Source" provides a QWidget to displays its values (not just a Label, this provides flexibility to do fancy things in future)
|
||||||
|
- the prefs dialog is reworked. every source has its own prefs dialog which could inherit the more general prefs dialog of the super class
|
||||||
|
- debian directory cleaned to make it easier for deb packagers (thanks to Manfred Paul)
|
||||||
|
|
||||||
|
CPU Info 0.4.3:
|
||||||
|
- let the user choose the alignment of the sources (thanks to Jocke Andersson)
|
||||||
|
|
||||||
|
CPU Info 0.4.2:
|
||||||
|
- support for the thermal sensors of the IBM Hard Drive Active Protection System (HDAPS) driver added. The corresponding kernel module is called hdaps.
|
||||||
|
- rounds frequencies more intelligent (i.e. 1333 MHz to 1.3 GHz but 860 MHz not to 900 MHz)
|
||||||
|
|
||||||
|
CPU Info 0.4.1:
|
||||||
|
- support for showing the degrees in Fahrenheit added (switch the to Imperial system per kcontrol: "Regional & Accessibility"->"Country/Region & Language"->"Other")
|
||||||
|
- cpufreq frequency source rounds its value to save space
|
||||||
|
- fixes a resize bug that prevents the applet from beeing relayouted if the user changed the prefs
|
||||||
|
|
||||||
|
CPU Info 0.4:
|
||||||
|
- cpufreqd control module added (thanks to Valentine Sinitsyn)
|
||||||
|
- support for iBook G4 CPU and GPU thermal zones added (thanks to Flavio Castelli)
|
||||||
|
- initial i2c (lm_sensors) thermal support added
|
||||||
|
- amount of resize events minimized (the applet is only resized if the width is greater than a previous cached value)
|
||||||
|
|
||||||
|
CPU Info 0.3.1:
|
||||||
|
- new layout manager implemented which is able to handle small kicker panels
|
||||||
|
|
||||||
|
CPU Info 0.3:
|
||||||
|
- ibm-acpi support added (http://ibm-acpi.sourceforge.net)
|
||||||
|
- proc frequency source: rounded value to save space
|
||||||
|
- tooltip shows the selected source italic
|
||||||
|
- extended context menu to let the user choose different sources
|
||||||
|
|
||||||
|
CPU Info 0.2:
|
||||||
|
- support for multiple sources added
|
||||||
|
- the source can now be choosen by the user
|
||||||
|
- omnibook support added (http://sourceforge.net/projects/omke)
|
||||||
|
- tool tip added that shows the values of all sensors
|
||||||
|
|
||||||
|
CPU Info 0.1:
|
||||||
|
- supports only the last sensor of the Linux ACPI Thermal Zone Driver
|
||||||
|
- supports the Linux kernel cpufreq subsystem
|
||||||
|
- supprtos the Linux /proc/cpuinfo interface (if cpufreq is not available)
|
||||||
|
- Font type and color configuration
|
@ -0,0 +1,167 @@
|
|||||||
|
Basic Installation
|
||||||
|
==================
|
||||||
|
|
||||||
|
These are generic installation instructions.
|
||||||
|
|
||||||
|
The `configure' shell script attempts to guess correct values for
|
||||||
|
various system-dependent variables used during compilation. It uses
|
||||||
|
those values to create a `Makefile' in each directory of the package.
|
||||||
|
It may also create one or more `.h' files containing system-dependent
|
||||||
|
definitions. Finally, it creates a shell script `config.status' that
|
||||||
|
you can run in the future to recreate the current configuration, a file
|
||||||
|
`config.cache' that saves the results of its tests to speed up
|
||||||
|
reconfiguring, and a file `config.log' containing compiler output
|
||||||
|
(useful mainly for debugging `configure').
|
||||||
|
|
||||||
|
If you need to do unusual things to compile the package, please try
|
||||||
|
to figure out how `configure' could check whether to do them, and mail
|
||||||
|
diffs or instructions to the address given in the `README' so they can
|
||||||
|
be considered for the next release. If at some point `config.cache'
|
||||||
|
contains results you don't want to keep, you may remove or edit it.
|
||||||
|
|
||||||
|
The file `configure.in' is used to create `configure' by a program
|
||||||
|
called `autoconf'. You only need `configure.in' if you want to change
|
||||||
|
it or regenerate `configure' using a newer version of `autoconf'.
|
||||||
|
|
||||||
|
The simplest way to compile this package is:
|
||||||
|
|
||||||
|
1. `cd' to the directory containing the package's source code and type
|
||||||
|
`./configure' to configure the package for your system. If you're
|
||||||
|
using `csh' on an old version of System V, you might need to type
|
||||||
|
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||||
|
`configure' itself.
|
||||||
|
|
||||||
|
Running `configure' takes a while. While running, it prints some
|
||||||
|
messages telling which features it is checking for.
|
||||||
|
|
||||||
|
2. Type `make' to compile the package.
|
||||||
|
|
||||||
|
3. Type `make install' to install the programs and any data files and
|
||||||
|
documentation.
|
||||||
|
|
||||||
|
4. You can remove the program binaries and object files from the
|
||||||
|
source code directory by typing `make clean'.
|
||||||
|
|
||||||
|
Compilers and Options
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Some systems require unusual options for compilation or linking that
|
||||||
|
the `configure' script does not know about. You can give `configure'
|
||||||
|
initial values for variables by setting them in the environment. Using
|
||||||
|
a Bourne-compatible shell, you can do that on the command line like
|
||||||
|
this:
|
||||||
|
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||||
|
|
||||||
|
Or on systems that have the `env' program, you can do it like this:
|
||||||
|
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||||
|
|
||||||
|
Compiling For Multiple Architectures
|
||||||
|
====================================
|
||||||
|
|
||||||
|
You can compile the package for more than one kind of computer at the
|
||||||
|
same time, by placing the object files for each architecture in their
|
||||||
|
own directory. To do this, you must use a version of `make' that
|
||||||
|
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||||
|
directory where you want the object files and executables to go and run
|
||||||
|
the `configure' script. `configure' automatically checks for the
|
||||||
|
source code in the directory that `configure' is in and in `..'.
|
||||||
|
|
||||||
|
If you have to use a `make' that does not supports the `VPATH'
|
||||||
|
variable, you have to compile the package for one architecture at a time
|
||||||
|
in the source code directory. After you have installed the package for
|
||||||
|
one architecture, use `make distclean' before reconfiguring for another
|
||||||
|
architecture.
|
||||||
|
|
||||||
|
Installation Names
|
||||||
|
==================
|
||||||
|
|
||||||
|
By default, `make install' will install the package's files in
|
||||||
|
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||||
|
installation prefix other than `/usr/local' by giving `configure' the
|
||||||
|
option `--prefix=PATH'.
|
||||||
|
|
||||||
|
You can specify separate installation prefixes for
|
||||||
|
architecture-specific files and architecture-independent files. If you
|
||||||
|
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||||
|
PATH as the prefix for installing programs and libraries.
|
||||||
|
Documentation and other data files will still use the regular prefix.
|
||||||
|
|
||||||
|
If the package supports it, you can cause programs to be installed
|
||||||
|
with an extra prefix or suffix on their names by giving `configure' the
|
||||||
|
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||||
|
|
||||||
|
Optional Features
|
||||||
|
=================
|
||||||
|
|
||||||
|
Some packages pay attention to `--enable-FEATURE' options to
|
||||||
|
`configure', where FEATURE indicates an optional part of the package.
|
||||||
|
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||||
|
is something like `gnu-as' or `x' (for the X Window System). The
|
||||||
|
`README' should mention any `--enable-' and `--with-' options that the
|
||||||
|
package recognizes.
|
||||||
|
|
||||||
|
For packages that use the X Window System, `configure' can usually
|
||||||
|
find the X include and library files automatically, but if it doesn't,
|
||||||
|
you can use the `configure' options `--x-includes=DIR' and
|
||||||
|
`--x-libraries=DIR' to specify their locations.
|
||||||
|
|
||||||
|
Specifying the System Type
|
||||||
|
==========================
|
||||||
|
|
||||||
|
There may be some features `configure' can not figure out
|
||||||
|
automatically, but needs to determine by the type of host the package
|
||||||
|
will run on. Usually `configure' can figure that out, but if it prints
|
||||||
|
a message saying it can not guess the host type, give it the
|
||||||
|
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||||
|
type, such as `sun4', or a canonical name with three fields:
|
||||||
|
CPU-COMPANY-SYSTEM
|
||||||
|
|
||||||
|
See the file `config.sub' for the possible values of each field. If
|
||||||
|
`config.sub' isn't included in this package, then this package doesn't
|
||||||
|
need to know the host type.
|
||||||
|
|
||||||
|
If you are building compiler tools for cross-compiling, you can also
|
||||||
|
use the `--target=TYPE' option to select the type of system they will
|
||||||
|
produce code for and the `--build=TYPE' option to select the type of
|
||||||
|
system on which you are compiling the package.
|
||||||
|
|
||||||
|
Sharing Defaults
|
||||||
|
================
|
||||||
|
|
||||||
|
If you want to set default values for `configure' scripts to share,
|
||||||
|
you can create a site shell script called `config.site' that gives
|
||||||
|
default values for variables like `CC', `cache_file', and `prefix'.
|
||||||
|
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||||
|
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||||
|
`CONFIG_SITE' environment variable to the location of the site script.
|
||||||
|
A warning: not all `configure' scripts look for a site script.
|
||||||
|
|
||||||
|
Operation Controls
|
||||||
|
==================
|
||||||
|
|
||||||
|
`configure' recognizes the following options to control how it
|
||||||
|
operates.
|
||||||
|
|
||||||
|
`--cache-file=FILE'
|
||||||
|
Use and save the results of the tests in FILE instead of
|
||||||
|
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||||
|
debugging `configure'.
|
||||||
|
|
||||||
|
`--help'
|
||||||
|
Print a summary of the options to `configure', and exit.
|
||||||
|
|
||||||
|
`--quiet'
|
||||||
|
`--silent'
|
||||||
|
`-q'
|
||||||
|
Do not print messages saying which checks are being made.
|
||||||
|
|
||||||
|
`--srcdir=DIR'
|
||||||
|
Look for the package's source code in directory DIR. Usually
|
||||||
|
`configure' can determine that directory automatically.
|
||||||
|
|
||||||
|
`--version'
|
||||||
|
Print the version of Autoconf used to generate the `configure'
|
||||||
|
script, and exit.
|
||||||
|
|
||||||
|
`configure' also accepts some other, not widely useful, options.
|
||||||
|
|
@ -0,0 +1,22 @@
|
|||||||
|
SUBDIRS = $(TOPSUBDIRS)
|
||||||
|
|
||||||
|
$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs
|
||||||
|
cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in ;
|
||||||
|
|
||||||
|
$(top_srcdir)/subdirs:
|
||||||
|
cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common subdirs
|
||||||
|
|
||||||
|
$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in
|
||||||
|
@cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4
|
||||||
|
|
||||||
|
MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files
|
||||||
|
|
||||||
|
package-messages:
|
||||||
|
cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common package-messages
|
||||||
|
$(MAKE) -C po merge
|
||||||
|
|
||||||
|
EXTRA_DIST = admin COPYING configure.in.in
|
||||||
|
|
||||||
|
dist-hook:
|
||||||
|
cd $(top_distdir) && perl admin/am_edit -padmin
|
||||||
|
cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs
|
@ -0,0 +1,10 @@
|
|||||||
|
all:
|
||||||
|
@echo "This Makefile is only for the CVS repository"
|
||||||
|
@echo "This will be deleted before making the distribution"
|
||||||
|
@echo ""
|
||||||
|
$(MAKE) -f admin/Makefile.common cvs
|
||||||
|
|
||||||
|
dist:
|
||||||
|
$(MAKE) -f admin/Makefile.common dist
|
||||||
|
|
||||||
|
.SILENT:
|
@ -0,0 +1,68 @@
|
|||||||
|
Description:
|
||||||
|
============
|
||||||
|
This applet monitors various temperature, frequency and fan sources in your kicker panel.
|
||||||
|
Make sure you have enabled a supported kernel module.
|
||||||
|
|
||||||
|
|
||||||
|
Licence:
|
||||||
|
========
|
||||||
|
GPLv2
|
||||||
|
|
||||||
|
|
||||||
|
Features:
|
||||||
|
=========
|
||||||
|
supported thermal sources:
|
||||||
|
- the Linux ACPI Thermal Zone driver. The corresponding kernel module is called thermal.
|
||||||
|
- the thermal sources of the Linux ACPI driver for the IBM ThinkPad laptops. The corresponding kernel module is called ibm-acpi.
|
||||||
|
- the IBM Hard Drive Active Protection System (HDAPS) driver. The corresponding kernel module is called hdaps.
|
||||||
|
- the Omnibook Configuration Tools & Patches. The corresponding kernel module is called omnibook.
|
||||||
|
- the iBook G4 CPU and GPU thermal zones. It may work on other Apple machines as well (please let me know).
|
||||||
|
- the thermal sensors available through hwmon (I2C, lm_sensors, ...).
|
||||||
|
- the CPU thermal sensor of the i8k kernel driver for Dell Inspiron and Latitude notebooks.
|
||||||
|
- the GPU thermal sensors of nvidia-settings (provided by the nVidia GPU card driver tools, see NVidia notes below)
|
||||||
|
- the termal sensors provided by hddtemp daemon (make sure hddtemp runs on 127.0.0.1 port 7634 before kima starts)
|
||||||
|
|
||||||
|
supported frequency sources:
|
||||||
|
- the Linux kernel /proc/cpuinfo interface
|
||||||
|
- the Linux kernel cpufreq subsystem
|
||||||
|
|
||||||
|
supported fan sources:
|
||||||
|
- the fan sensors available through hwmon (I2C, lm_sensors, ...).
|
||||||
|
- the fan sources of the Linux ACPI driver for the IBM ThinkPad laptops. The corresponding kernel module is called ibm-acpi.
|
||||||
|
- the fan sources of the i8k kernel driver for Dell Inspiron and Latitude notebooks.
|
||||||
|
|
||||||
|
misc sources:
|
||||||
|
- battery source that displays the state of charge of your batteries through libhal
|
||||||
|
- uptime source that displays the current system uptime
|
||||||
|
|
||||||
|
misc:
|
||||||
|
- cpufreqd control module to switch cpufreqd profiles via cpufreqd remote interface
|
||||||
|
|
||||||
|
|
||||||
|
installation:
|
||||||
|
=============
|
||||||
|
run configure:
|
||||||
|
./configure --prefix=$(kde-config --prefix)
|
||||||
|
|
||||||
|
build the sources:
|
||||||
|
make
|
||||||
|
|
||||||
|
install the applet (with appropriate rights):
|
||||||
|
su -c "make install"
|
||||||
|
|
||||||
|
finally add the applet to your KDE panel (RMB on kicker)
|
||||||
|
|
||||||
|
|
||||||
|
CPU Frequency Daemon Notes:
|
||||||
|
===========================
|
||||||
|
If you have cpufreqd configured and running on your machine, Kima will provide a sub-menu called "Performance Profiles" where you can choose one of the preconfigured profiles for cpufreqd. Choosing one of the profiles will automatically put cpufreqd in manual mode. You can use "Select dynamically" option from the menu to return back to the dynamic scaling. Please don't forget to enable cpufreqd remote controlling in cpufreqd.conf (enable_remote=1) and give enough permissions to cpufreqd socket ("remote_group" option in cpufreqd.conf, see man pages for details).
|
||||||
|
Known limitations:
|
||||||
|
- cpufreqd should be started before Kima (it's not a problem when you do everything from your startup scripts)
|
||||||
|
- Since cpufreqd does not provide means to detect its current mode (manual/dynamic), in rare cases "Select dynamically" check can be inconsistent with the real daemon state. This is inconvenient but does not affect program functionality.
|
||||||
|
|
||||||
|
|
||||||
|
NVidia thermal source notes:
|
||||||
|
============================
|
||||||
|
By default the nvidia-settings tool is used to obtain the GPU temperature. The configure switch "-with-nvcontrol=/absolute/path/to/libnvcontrol-dir" can be used to increase Kimas performance. Using this switch the libXNVCtrl.a gets statically compiled/linked into libkima.so and is used to query the temperature(s) of your NVidia card. The most recent nvidia-settings sourcecode can be downloaded from: ftp://download.nvidia.com/XFree86/nvidia-settings. Here is an usage example:
|
||||||
|
./configure --prefix=$(kde-config --prefix) --with-nvcontrol=/home/$USER/nvidia-settings-1.0/src/libXNVCtrl
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
- internationalization
|
||||||
|
- implement more sensors to provide broader hardware support
|
||||||
|
- tooltips/hints for gui elements within the prefs dialog
|
||||||
|
- improve existing sensors
|
||||||
|
- i.e. let the user define or/and predict thermal tresholds and actions if they are reached
|
||||||
|
- Bug fixes:
|
||||||
|
- The apply button always seems to be enabled. Instead, it should only be enabled when
|
||||||
|
changes have occurred and disabled in all other cases (grayed out).
|
||||||
|
- fix ibm-acpi sensor assignments (currently it assumes a T4x)
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,247 @@
|
|||||||
|
/* config.h.in. Generated from configure.in by autoheader. */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <Carbon/Carbon.h> header file. */
|
||||||
|
#undef HAVE_CARBON_CARBON_H
|
||||||
|
|
||||||
|
/* Define if you have the CoreAudio API */
|
||||||
|
#undef HAVE_COREAUDIO
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <crt_externs.h> header file. */
|
||||||
|
#undef HAVE_CRT_EXTERNS_H
|
||||||
|
|
||||||
|
/* Defines if your system has the crypt function */
|
||||||
|
#undef HAVE_CRYPT
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||||
|
#undef HAVE_DLFCN_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||||
|
#undef HAVE_INTTYPES_H
|
||||||
|
|
||||||
|
/* Define if you have libjpeg */
|
||||||
|
#undef HAVE_LIBJPEG
|
||||||
|
|
||||||
|
/* Define if you have libpng */
|
||||||
|
#undef HAVE_LIBPNG
|
||||||
|
|
||||||
|
/* Define if you have a working libpthread (will enable threaded code) */
|
||||||
|
#undef HAVE_LIBPTHREAD
|
||||||
|
|
||||||
|
/* Define if you have libz */
|
||||||
|
#undef HAVE_LIBZ
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <memory.h> header file. */
|
||||||
|
#undef HAVE_MEMORY_H
|
||||||
|
|
||||||
|
/* Define if your system needs _NSGetEnviron to set up the environment */
|
||||||
|
#undef HAVE_NSGETENVIRON
|
||||||
|
|
||||||
|
/* defined if compiling with NVControl support */
|
||||||
|
#undef HAVE_NVCONTROL
|
||||||
|
|
||||||
|
/* Define if you have res_init */
|
||||||
|
#undef HAVE_RES_INIT
|
||||||
|
|
||||||
|
/* Define if you have the res_init prototype */
|
||||||
|
#undef HAVE_RES_INIT_PROTO
|
||||||
|
|
||||||
|
/* Define if you have a STL implementation by SGI */
|
||||||
|
#undef HAVE_SGI_STL
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `snprintf' function. */
|
||||||
|
#undef HAVE_SNPRINTF
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <stdint.h> header file. */
|
||||||
|
#undef HAVE_STDINT_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||||
|
#undef HAVE_STDLIB_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <strings.h> header file. */
|
||||||
|
#undef HAVE_STRINGS_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <string.h> header file. */
|
||||||
|
#undef HAVE_STRING_H
|
||||||
|
|
||||||
|
/* Define if you have strlcat */
|
||||||
|
#undef HAVE_STRLCAT
|
||||||
|
|
||||||
|
/* Define if you have the strlcat prototype */
|
||||||
|
#undef HAVE_STRLCAT_PROTO
|
||||||
|
|
||||||
|
/* Define if you have strlcpy */
|
||||||
|
#undef HAVE_STRLCPY
|
||||||
|
|
||||||
|
/* Define if you have the strlcpy prototype */
|
||||||
|
#undef HAVE_STRLCPY_PROTO
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/bitypes.h> header file. */
|
||||||
|
#undef HAVE_SYS_BITYPES_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||||
|
#undef HAVE_SYS_STAT_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||||
|
#undef HAVE_SYS_TYPES_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <unistd.h> header file. */
|
||||||
|
#undef HAVE_UNISTD_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `vsnprintf' function. */
|
||||||
|
#undef HAVE_VSNPRINTF
|
||||||
|
|
||||||
|
/* Suffix for lib directories */
|
||||||
|
#undef KDELIBSUFF
|
||||||
|
|
||||||
|
/* Define a safe value for MAXPATHLEN */
|
||||||
|
#undef KDEMAXPATHLEN
|
||||||
|
|
||||||
|
/* Name of package */
|
||||||
|
#undef PACKAGE
|
||||||
|
|
||||||
|
/* Define to the address where bug reports for this package should be sent. */
|
||||||
|
#undef PACKAGE_BUGREPORT
|
||||||
|
|
||||||
|
/* Define to the full name of this package. */
|
||||||
|
#undef PACKAGE_NAME
|
||||||
|
|
||||||
|
/* Define to the full name and version of this package. */
|
||||||
|
#undef PACKAGE_STRING
|
||||||
|
|
||||||
|
/* Define to the one symbol short name of this package. */
|
||||||
|
#undef PACKAGE_TARNAME
|
||||||
|
|
||||||
|
/* Define to the version of this package. */
|
||||||
|
#undef PACKAGE_VERSION
|
||||||
|
|
||||||
|
/* The size of `char *', as computed by sizeof. */
|
||||||
|
#undef SIZEOF_CHAR_P
|
||||||
|
|
||||||
|
/* The size of `int', as computed by sizeof. */
|
||||||
|
#undef SIZEOF_INT
|
||||||
|
|
||||||
|
/* The size of `long', as computed by sizeof. */
|
||||||
|
#undef SIZEOF_LONG
|
||||||
|
|
||||||
|
/* The size of `short', as computed by sizeof. */
|
||||||
|
#undef SIZEOF_SHORT
|
||||||
|
|
||||||
|
/* The size of `size_t', as computed by sizeof. */
|
||||||
|
#undef SIZEOF_SIZE_T
|
||||||
|
|
||||||
|
/* The size of `unsigned long', as computed by sizeof. */
|
||||||
|
#undef SIZEOF_UNSIGNED_LONG
|
||||||
|
|
||||||
|
/* Define to 1 if you have the ANSI C header files. */
|
||||||
|
#undef STDC_HEADERS
|
||||||
|
|
||||||
|
/* Version number of package */
|
||||||
|
#undef VERSION
|
||||||
|
|
||||||
|
/* Defined if compiling without arts */
|
||||||
|
#undef WITHOUT_ARTS
|
||||||
|
|
||||||
|
/* Define to 1 if your processor stores words with the most significant byte
|
||||||
|
first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||||
|
#undef WORDS_BIGENDIAN
|
||||||
|
|
||||||
|
/*
|
||||||
|
* jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
|
||||||
|
* headers and I'm too lazy to write a configure test as long as only
|
||||||
|
* unixware is related
|
||||||
|
*/
|
||||||
|
#ifdef _UNIXWARE
|
||||||
|
#define HAVE_BOOLEAN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
|
||||||
|
* that defines bzero.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined(_AIX)
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
|
||||||
|
# include <sys/time.h>
|
||||||
|
# include <crt_externs.h>
|
||||||
|
# define environ (*_NSGetEnviron())
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined(HAVE_RES_INIT_PROTO)
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
int res_init(void);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined(HAVE_STRLCAT_PROTO)
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
unsigned long strlcat(char*, const char*, unsigned long);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined(HAVE_STRLCPY_PROTO)
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
unsigned long strlcpy(char*, const char*, unsigned long);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* On HP-UX, the declaration of vsnprintf() is needed every time !
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if !defined(HAVE_VSNPRINTF) || defined(hpux)
|
||||||
|
#if __STDC__
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#else
|
||||||
|
#include <varargs.h>
|
||||||
|
#endif
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
#endif
|
||||||
|
int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
#endif
|
||||||
|
int snprintf(char *str, size_t n, char const *fmt, ...);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(__SVR4) && !defined(__svr4__)
|
||||||
|
#define __svr4__ 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* type to use in place of socklen_t if not defined */
|
||||||
|
#undef kde_socklen_t
|
||||||
|
|
||||||
|
/* type to use in place of socklen_t if not defined (deprecated, use
|
||||||
|
kde_socklen_t) */
|
||||||
|
#undef ksize_t
|
@ -0,0 +1,372 @@
|
|||||||
|
This file contains any messages produced by compilers while
|
||||||
|
running configure, to aid debugging if configure makes a mistake.
|
||||||
|
|
||||||
|
It was created by configure, which was
|
||||||
|
generated by GNU Autoconf 2.61. Invocation command line was
|
||||||
|
|
||||||
|
$ /mnt/xdata/builds/kima.uncompiled/kima-kde3-0.7.3.2/./configure --build=x86_64-linux-gnu --prefix=/opt/kde3 --includedir=/opt/kde3/include/kde --mandir=/opt/kde3/share/man --infodir=/opt/kde3/share/info --sysconfdir=/etc --localstatedir=/var --libexecdir=${prefix}/lib/kima-kde3 --disable-maintainer-mode --disable-dependency-tracking --srcdir=. --with-qt-dir=/usr/share/qt3 --disable-rpath --with-xinerama --disable-rpath
|
||||||
|
|
||||||
|
## --------- ##
|
||||||
|
## Platform. ##
|
||||||
|
## --------- ##
|
||||||
|
|
||||||
|
hostname = argus4
|
||||||
|
uname -m = x86_64
|
||||||
|
uname -r = 2.6.31-16-generic
|
||||||
|
uname -s = Linux
|
||||||
|
uname -v = #53-Ubuntu SMP Tue Dec 8 04:02:15 UTC 2009
|
||||||
|
|
||||||
|
/usr/bin/uname -p = unknown
|
||||||
|
/bin/uname -X = unknown
|
||||||
|
|
||||||
|
/bin/arch = unknown
|
||||||
|
/usr/bin/arch -k = unknown
|
||||||
|
/usr/convex/getsysinfo = unknown
|
||||||
|
/usr/bin/hostinfo = unknown
|
||||||
|
/bin/machine = unknown
|
||||||
|
/usr/bin/oslevel = unknown
|
||||||
|
/bin/universe = unknown
|
||||||
|
|
||||||
|
PATH: /opt/kde3/bin
|
||||||
|
PATH: /opt/kde3/games
|
||||||
|
PATH: /opt/kde3/bin
|
||||||
|
PATH: /home/eldarion/bin
|
||||||
|
PATH: /usr/local/sbin
|
||||||
|
PATH: /usr/local/bin
|
||||||
|
PATH: /usr/sbin
|
||||||
|
PATH: /usr/bin
|
||||||
|
PATH: /sbin
|
||||||
|
PATH: /bin
|
||||||
|
PATH: /usr/games
|
||||||
|
|
||||||
|
|
||||||
|
## ----------- ##
|
||||||
|
## Core tests. ##
|
||||||
|
## ----------- ##
|
||||||
|
|
||||||
|
configure:2151: checking build system type
|
||||||
|
configure:2169: result: x86_64-pc-linux-gnu
|
||||||
|
configure:2191: checking host system type
|
||||||
|
configure:2206: result: x86_64-pc-linux-gnu
|
||||||
|
configure:2228: checking target system type
|
||||||
|
configure:2243: result: x86_64-pc-linux-gnu
|
||||||
|
configure:2304: checking for a BSD-compatible install
|
||||||
|
configure:2360: result: /usr/bin/install -c
|
||||||
|
configure:2375: checking for -p flag to install
|
||||||
|
configure:2388: result: yes
|
||||||
|
configure:2399: checking whether build environment is sane
|
||||||
|
|
||||||
|
## ---------------- ##
|
||||||
|
## Cache variables. ##
|
||||||
|
## ---------------- ##
|
||||||
|
|
||||||
|
ac_cv_build=x86_64-pc-linux-gnu
|
||||||
|
ac_cv_env_CCC_set=
|
||||||
|
ac_cv_env_CCC_value=
|
||||||
|
ac_cv_env_CC_set=
|
||||||
|
ac_cv_env_CC_value=
|
||||||
|
ac_cv_env_CFLAGS_set=set
|
||||||
|
ac_cv_env_CFLAGS_value='-g -O2 -g -Wall -O2'
|
||||||
|
ac_cv_env_CPPFLAGS_set=set
|
||||||
|
ac_cv_env_CPPFLAGS_value=
|
||||||
|
ac_cv_env_CPP_set=
|
||||||
|
ac_cv_env_CPP_value=
|
||||||
|
ac_cv_env_CXXCPP_set=
|
||||||
|
ac_cv_env_CXXCPP_value=
|
||||||
|
ac_cv_env_CXXFLAGS_set=set
|
||||||
|
ac_cv_env_CXXFLAGS_value='-g -O2 -g -Wall -O2'
|
||||||
|
ac_cv_env_CXX_set=
|
||||||
|
ac_cv_env_CXX_value=
|
||||||
|
ac_cv_env_F77_set=
|
||||||
|
ac_cv_env_F77_value=
|
||||||
|
ac_cv_env_FFLAGS_set=set
|
||||||
|
ac_cv_env_FFLAGS_value='-g -O2'
|
||||||
|
ac_cv_env_LDFLAGS_set=set
|
||||||
|
ac_cv_env_LDFLAGS_value=-Wl,-Bsymbolic-functions
|
||||||
|
ac_cv_env_LIBS_set=
|
||||||
|
ac_cv_env_LIBS_value=
|
||||||
|
ac_cv_env_PKG_CONFIG_set=
|
||||||
|
ac_cv_env_PKG_CONFIG_value=
|
||||||
|
ac_cv_env_XMKMF_set=
|
||||||
|
ac_cv_env_XMKMF_value=
|
||||||
|
ac_cv_env_build_alias_set=set
|
||||||
|
ac_cv_env_build_alias_value=x86_64-linux-gnu
|
||||||
|
ac_cv_env_host_alias_set=
|
||||||
|
ac_cv_env_host_alias_value=
|
||||||
|
ac_cv_env_libhal_CFLAGS_set=
|
||||||
|
ac_cv_env_libhal_CFLAGS_value=
|
||||||
|
ac_cv_env_libhal_LIBS_set=
|
||||||
|
ac_cv_env_libhal_LIBS_value=
|
||||||
|
ac_cv_env_target_alias_set=
|
||||||
|
ac_cv_env_target_alias_value=
|
||||||
|
ac_cv_host=x86_64-pc-linux-gnu
|
||||||
|
ac_cv_path_install='/usr/bin/install -c'
|
||||||
|
ac_cv_target=x86_64-pc-linux-gnu
|
||||||
|
|
||||||
|
## ----------------- ##
|
||||||
|
## Output variables. ##
|
||||||
|
## ----------------- ##
|
||||||
|
|
||||||
|
ACLOCAL=''
|
||||||
|
AMDEPBACKSLASH=''
|
||||||
|
AMDEP_FALSE=''
|
||||||
|
AMDEP_TRUE=''
|
||||||
|
AMTAR=''
|
||||||
|
AR=''
|
||||||
|
ARTSCCONFIG=''
|
||||||
|
AUTOCONF=''
|
||||||
|
AUTODIRS=''
|
||||||
|
AUTOHEADER=''
|
||||||
|
AUTOMAKE=''
|
||||||
|
AWK=''
|
||||||
|
CC=''
|
||||||
|
CCDEPMODE=''
|
||||||
|
CFLAGS='-g -O2 -g -Wall -O2'
|
||||||
|
CONF_FILES=''
|
||||||
|
CPP=''
|
||||||
|
CPPFLAGS=''
|
||||||
|
CXX=''
|
||||||
|
CXXCPP=''
|
||||||
|
CXXDEPMODE=''
|
||||||
|
CXXFLAGS='-g -O2 -g -Wall -O2'
|
||||||
|
CYGPATH_W=''
|
||||||
|
DCOPIDL2CPP=''
|
||||||
|
DCOPIDL=''
|
||||||
|
DCOPIDLNG=''
|
||||||
|
DCOP_DEPENDENCIES=''
|
||||||
|
DEFS=''
|
||||||
|
DEPDIR=''
|
||||||
|
ECHO='echo'
|
||||||
|
ECHO_C=''
|
||||||
|
ECHO_N='-n'
|
||||||
|
ECHO_T=''
|
||||||
|
EGREP=''
|
||||||
|
ENABLE_PERMISSIVE_FLAG=''
|
||||||
|
EXEEXT=''
|
||||||
|
F77=''
|
||||||
|
FFLAGS='-g -O2'
|
||||||
|
FRAMEWORK_COREAUDIO=''
|
||||||
|
GMSGFMT=''
|
||||||
|
GREP=''
|
||||||
|
HAVE_GCC_VISIBILITY=''
|
||||||
|
INSTALL_DATA='${INSTALL} -m 644'
|
||||||
|
INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
|
||||||
|
INSTALL_SCRIPT='${INSTALL}'
|
||||||
|
INSTALL_STRIP_PROGRAM=''
|
||||||
|
KCFG_DEPENDENCIES=''
|
||||||
|
KCONFIG_COMPILER=''
|
||||||
|
KDECONFIG=''
|
||||||
|
KDE_CHECK_PLUGIN=''
|
||||||
|
KDE_EXTRA_RPATH=''
|
||||||
|
KDE_INCLUDES=''
|
||||||
|
KDE_LDFLAGS=''
|
||||||
|
KDE_MT_LDFLAGS=''
|
||||||
|
KDE_MT_LIBS=''
|
||||||
|
KDE_NO_UNDEFINED=''
|
||||||
|
KDE_PLUGIN=''
|
||||||
|
KDE_RPATH=''
|
||||||
|
KDE_USE_CLOSURE_FALSE=''
|
||||||
|
KDE_USE_CLOSURE_TRUE=''
|
||||||
|
KDE_USE_FINAL_FALSE=''
|
||||||
|
KDE_USE_FINAL_TRUE=''
|
||||||
|
KDE_USE_FPIE=''
|
||||||
|
KDE_USE_NMCHECK_FALSE=''
|
||||||
|
KDE_USE_NMCHECK_TRUE=''
|
||||||
|
KDE_USE_PIE=''
|
||||||
|
KDE_XSL_STYLESHEET=''
|
||||||
|
LDFLAGS='-Wl,-Bsymbolic-functions'
|
||||||
|
LDFLAGS_AS_NEEDED=''
|
||||||
|
LDFLAGS_NEW_DTAGS=''
|
||||||
|
LIBCOMPAT=''
|
||||||
|
LIBCRYPT=''
|
||||||
|
LIBDL=''
|
||||||
|
LIBJPEG=''
|
||||||
|
LIBOBJS=''
|
||||||
|
LIBPNG=''
|
||||||
|
LIBPTHREAD=''
|
||||||
|
LIBRESOLV=''
|
||||||
|
LIBS=''
|
||||||
|
LIBSM=''
|
||||||
|
LIBSOCKET=''
|
||||||
|
LIBTOOL=''
|
||||||
|
LIBUCB=''
|
||||||
|
LIBUTIL=''
|
||||||
|
LIBZ=''
|
||||||
|
LIB_KAB=''
|
||||||
|
LIB_KABC=''
|
||||||
|
LIB_KDECORE=''
|
||||||
|
LIB_KDED=''
|
||||||
|
LIB_KDEPIM=''
|
||||||
|
LIB_KDEPRINT=''
|
||||||
|
LIB_KDEUI=''
|
||||||
|
LIB_KDNSSD=''
|
||||||
|
LIB_KFILE=''
|
||||||
|
LIB_KFM=''
|
||||||
|
LIB_KHTML=''
|
||||||
|
LIB_KIMPROXY=''
|
||||||
|
LIB_KIO=''
|
||||||
|
LIB_KJS=''
|
||||||
|
LIB_KNEWSTUFF=''
|
||||||
|
LIB_KPARTS=''
|
||||||
|
LIB_KSPELL=''
|
||||||
|
LIB_KSYCOCA=''
|
||||||
|
LIB_KUNITTEST=''
|
||||||
|
LIB_KUTILS=''
|
||||||
|
LIB_POLL=''
|
||||||
|
LIB_QPE=''
|
||||||
|
LIB_QT=''
|
||||||
|
LIB_SMB=''
|
||||||
|
LIB_X11=''
|
||||||
|
LIB_XEXT=''
|
||||||
|
LIB_XRENDER=''
|
||||||
|
LN_S=''
|
||||||
|
LTLIBOBJS=''
|
||||||
|
MAKEINFO=''
|
||||||
|
MAKEKDEWIDGETS=''
|
||||||
|
MCOPIDL=''
|
||||||
|
MEINPROC=''
|
||||||
|
MOC=''
|
||||||
|
MSGFMT=''
|
||||||
|
NOOPT_CFLAGS=''
|
||||||
|
NOOPT_CXXFLAGS=''
|
||||||
|
OBJEXT=''
|
||||||
|
PACKAGE=''
|
||||||
|
PACKAGE_BUGREPORT=''
|
||||||
|
PACKAGE_NAME=''
|
||||||
|
PACKAGE_STRING=''
|
||||||
|
PACKAGE_TARNAME=''
|
||||||
|
PACKAGE_VERSION=''
|
||||||
|
PATH_SEPARATOR=':'
|
||||||
|
PERL=''
|
||||||
|
PKG_CONFIG=''
|
||||||
|
QTE_NORTTI=''
|
||||||
|
QT_INCLUDES=''
|
||||||
|
QT_LDFLAGS=''
|
||||||
|
RANLIB=''
|
||||||
|
SET_MAKE=''
|
||||||
|
SHELL='/bin/bash'
|
||||||
|
STRIP=''
|
||||||
|
TOPSUBDIRS=''
|
||||||
|
UIC=''
|
||||||
|
UIC_TR=''
|
||||||
|
USER_INCLUDES=''
|
||||||
|
USER_LDFLAGS=''
|
||||||
|
USE_EXCEPTIONS=''
|
||||||
|
USE_RTTI=''
|
||||||
|
USE_THREADS=''
|
||||||
|
VERSION=''
|
||||||
|
WOVERLOADED_VIRTUAL=''
|
||||||
|
XGETTEXT=''
|
||||||
|
XMKMF=''
|
||||||
|
XMLLINT=''
|
||||||
|
X_EXTRA_LIBS=''
|
||||||
|
X_INCLUDES=''
|
||||||
|
X_LDFLAGS=''
|
||||||
|
X_PRE_LIBS=''
|
||||||
|
X_RPATH=''
|
||||||
|
ac_ct_CC=''
|
||||||
|
ac_ct_CXX=''
|
||||||
|
ac_ct_F77=''
|
||||||
|
all_includes=''
|
||||||
|
all_libraries=''
|
||||||
|
am__fastdepCC_FALSE=''
|
||||||
|
am__fastdepCC_TRUE=''
|
||||||
|
am__fastdepCXX_FALSE=''
|
||||||
|
am__fastdepCXX_TRUE=''
|
||||||
|
am__include=''
|
||||||
|
am__leading_dot=''
|
||||||
|
am__quote=''
|
||||||
|
am__tar=''
|
||||||
|
am__untar=''
|
||||||
|
bindir='${exec_prefix}/bin'
|
||||||
|
build='x86_64-pc-linux-gnu'
|
||||||
|
build_alias='x86_64-linux-gnu'
|
||||||
|
build_cpu='x86_64'
|
||||||
|
build_os='linux-gnu'
|
||||||
|
build_vendor='pc'
|
||||||
|
datadir='${datarootdir}'
|
||||||
|
datarootdir='${prefix}/share'
|
||||||
|
docdir='${datarootdir}/doc/${PACKAGE}'
|
||||||
|
dvidir='${docdir}'
|
||||||
|
exec_prefix='NONE'
|
||||||
|
host='x86_64-pc-linux-gnu'
|
||||||
|
host_alias=''
|
||||||
|
host_cpu='x86_64'
|
||||||
|
host_os='linux-gnu'
|
||||||
|
host_vendor='pc'
|
||||||
|
htmldir='${docdir}'
|
||||||
|
include_ARTS_FALSE=''
|
||||||
|
include_ARTS_TRUE=''
|
||||||
|
include_x11_FALSE=''
|
||||||
|
include_x11_TRUE=''
|
||||||
|
includedir='/opt/kde3/include/kde'
|
||||||
|
infodir='/opt/kde3/share/info'
|
||||||
|
install_sh=''
|
||||||
|
kde_appsdir=''
|
||||||
|
kde_bindir=''
|
||||||
|
kde_confdir=''
|
||||||
|
kde_datadir=''
|
||||||
|
kde_htmldir=''
|
||||||
|
kde_icondir=''
|
||||||
|
kde_includes=''
|
||||||
|
kde_kcfgdir=''
|
||||||
|
kde_libraries=''
|
||||||
|
kde_libs_htmldir=''
|
||||||
|
kde_libs_prefix=''
|
||||||
|
kde_locale=''
|
||||||
|
kde_mimedir=''
|
||||||
|
kde_moduledir=''
|
||||||
|
kde_qtver=''
|
||||||
|
kde_servicesdir=''
|
||||||
|
kde_servicetypesdir=''
|
||||||
|
kde_sounddir=''
|
||||||
|
kde_styledir=''
|
||||||
|
kde_templatesdir=''
|
||||||
|
kde_wallpaperdir=''
|
||||||
|
kde_widgetdir=''
|
||||||
|
kdeinitdir=''
|
||||||
|
libdir='${exec_prefix}/lib'
|
||||||
|
libexecdir='${prefix}/lib/kima-kde3'
|
||||||
|
libhal_CFLAGS=''
|
||||||
|
libhal_LIBS=''
|
||||||
|
localedir='${datarootdir}/locale'
|
||||||
|
localstatedir='/var'
|
||||||
|
mandir='/opt/kde3/share/man'
|
||||||
|
mkdir_p=''
|
||||||
|
nvcontrol_CFLAGS=''
|
||||||
|
nvcontrol_LIBS=''
|
||||||
|
oldincludedir='/usr/include'
|
||||||
|
pdfdir='${docdir}'
|
||||||
|
prefix='/opt/kde3'
|
||||||
|
program_transform_name='s,x,x,'
|
||||||
|
psdir='${docdir}'
|
||||||
|
qt_includes=''
|
||||||
|
qt_libraries=''
|
||||||
|
sbindir='${exec_prefix}/sbin'
|
||||||
|
sharedstatedir='${prefix}/com'
|
||||||
|
sysconfdir='/etc'
|
||||||
|
target='x86_64-pc-linux-gnu'
|
||||||
|
target_alias=''
|
||||||
|
target_cpu='x86_64'
|
||||||
|
target_os='linux-gnu'
|
||||||
|
target_vendor='pc'
|
||||||
|
unsermake_enable_pch_FALSE=''
|
||||||
|
unsermake_enable_pch_TRUE=''
|
||||||
|
x_includes='NONE'
|
||||||
|
x_libraries='NONE'
|
||||||
|
xdg_appsdir=''
|
||||||
|
xdg_directorydir=''
|
||||||
|
xdg_menudir=''
|
||||||
|
|
||||||
|
## ----------- ##
|
||||||
|
## confdefs.h. ##
|
||||||
|
## ----------- ##
|
||||||
|
|
||||||
|
#define PACKAGE_NAME ""
|
||||||
|
#define PACKAGE_TARNAME ""
|
||||||
|
#define PACKAGE_VERSION ""
|
||||||
|
#define PACKAGE_STRING ""
|
||||||
|
#define PACKAGE_BUGREPORT ""
|
||||||
|
|
||||||
|
configure: caught signal 2
|
||||||
|
configure: exit 1
|
@ -0,0 +1,2 @@
|
|||||||
|
./admin/configure.in.min
|
||||||
|
configure.in.in
|
@ -0,0 +1,140 @@
|
|||||||
|
dnl =======================================================
|
||||||
|
dnl FILE: ./admin/configure.in.min
|
||||||
|
dnl =======================================================
|
||||||
|
|
||||||
|
dnl This file is part of the KDE libraries/packages
|
||||||
|
dnl Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
|
||||||
|
|
||||||
|
dnl This file is free software; you can redistribute it and/or
|
||||||
|
dnl modify it under the terms of the GNU Library General Public
|
||||||
|
dnl License as published by the Free Software Foundation; either
|
||||||
|
dnl version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
dnl This library is distributed in the hope that it will be useful,
|
||||||
|
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
dnl Library General Public License for more details.
|
||||||
|
|
||||||
|
dnl You should have received a copy of the GNU Library General Public License
|
||||||
|
dnl along with this library; see the file COPYING.LIB. If not, write to
|
||||||
|
dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
dnl Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
# Original Author was Kalle@kde.org
|
||||||
|
# I lifted it in some mater. (Stephan Kulow)
|
||||||
|
# I used much code from Janos Farkas
|
||||||
|
|
||||||
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
|
AC_INIT(acinclude.m4) dnl a source file from your sub dir
|
||||||
|
|
||||||
|
dnl This is so we can use kde-common
|
||||||
|
AC_CONFIG_AUX_DIR(admin)
|
||||||
|
|
||||||
|
dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
|
||||||
|
unset CDPATH
|
||||||
|
|
||||||
|
dnl Checking host/target/build systems, for make, install etc.
|
||||||
|
AC_CANONICAL_SYSTEM
|
||||||
|
dnl Perform program name transformation
|
||||||
|
AC_ARG_PROGRAM
|
||||||
|
|
||||||
|
dnl Automake doc recommends to do this only here. (Janos)
|
||||||
|
AM_INIT_AUTOMAKE(kima, 0.7.3.2) dnl searches for some needed programs
|
||||||
|
|
||||||
|
KDE_SET_PREFIX
|
||||||
|
|
||||||
|
dnl generate the config header
|
||||||
|
AM_CONFIG_HEADER(config.h) dnl at the distribution this done
|
||||||
|
|
||||||
|
dnl Checks for programs.
|
||||||
|
AC_CHECK_COMPILERS
|
||||||
|
AC_ENABLE_SHARED(yes)
|
||||||
|
AC_ENABLE_STATIC(no)
|
||||||
|
KDE_PROG_LIBTOOL
|
||||||
|
|
||||||
|
dnl for NLS support. Call them in this order!
|
||||||
|
dnl WITH_NLS is for the po files
|
||||||
|
AM_KDE_WITH_NLS
|
||||||
|
|
||||||
|
KDE_USE_QT(3.0.0)
|
||||||
|
AC_PATH_KDE
|
||||||
|
dnl =======================================================
|
||||||
|
dnl FILE: configure.in.in
|
||||||
|
dnl =======================================================
|
||||||
|
|
||||||
|
#MIN_CONFIG(3.0.0)
|
||||||
|
|
||||||
|
dnl PACKAGE set before
|
||||||
|
AC_C_BIGENDIAN
|
||||||
|
AC_CHECK_KDEMAXPATHLEN
|
||||||
|
|
||||||
|
dnl check for (optional) nvcontrol
|
||||||
|
AC_ARG_WITH(nvcontrol,
|
||||||
|
AC_HELP_STRING([--with-nvcontrol=nvcontrol-dir],[uses libXNVCtrl.a instead of nvidia-settings for the NVidia thermal source]),
|
||||||
|
[with_nvcontrol=yes
|
||||||
|
nvcontrol_CFLAGS=-I$withval
|
||||||
|
nvcontrol_LIBS="-L$withval -lXNVCtrl"
|
||||||
|
AC_CHECK_FILE([$withval/NVCtrlLib.h], , AC_MSG_ERROR([Did not find NVCtrlLib.h. Make sure that you passed the correct path for NVControl. See README for details.]))
|
||||||
|
AC_DEFINE(HAVE_NVCONTROL, , [defined if compiling with NVControl support])])
|
||||||
|
AC_SUBST(nvcontrol_CFLAGS)
|
||||||
|
AC_SUBST(nvcontrol_LIBS)
|
||||||
|
|
||||||
|
dnl check for required hal minimal version 0.5.5
|
||||||
|
PKG_CHECK_MODULES(libhal, hal >= 0.5.5)
|
||||||
|
AC_SUBST(libhal_CFLAGS)
|
||||||
|
AC_SUBST(libhal_LIBS)
|
||||||
|
KDE_CREATE_SUBDIRSLIST
|
||||||
|
AC_CONFIG_FILES([ Makefile ])
|
||||||
|
AC_CONFIG_FILES([ doc/Makefile ])
|
||||||
|
AC_CONFIG_FILES([ doc/en/Makefile ])
|
||||||
|
AC_CONFIG_FILES([ po/Makefile ])
|
||||||
|
AC_CONFIG_FILES([ src/Makefile ])
|
||||||
|
AC_CONFIG_FILES([ src/cpufreqd/Makefile ])
|
||||||
|
AC_CONFIG_FILES([ src/sources/Makefile ])
|
||||||
|
AC_OUTPUT
|
||||||
|
# Check if KDE_SET_PREFIX was called, and --prefix was passed to configure
|
||||||
|
if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then
|
||||||
|
# And if so, warn when they don't match
|
||||||
|
if test "$kde_libs_prefix" != "$given_prefix"; then
|
||||||
|
# And if kde doesn't know about the prefix yet
|
||||||
|
echo ":"`kde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null
|
||||||
|
if test $? -ne 0; then
|
||||||
|
echo ""
|
||||||
|
echo "Warning: you chose to install this package in $given_prefix,"
|
||||||
|
echo "but KDE was found in $kde_libs_prefix."
|
||||||
|
echo "For this to work, you will need to tell KDE about the new prefix, by ensuring"
|
||||||
|
echo "that KDEDIRS contains it, e.g. export KDEDIRS=$given_prefix:$kde_libs_prefix"
|
||||||
|
echo "Then restart KDE."
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test x$GXX = "xyes" -a x$kde_have_gcc_visibility = "xyes" -a x$kde_cv_val_qt_gcc_visibility_patched = "xno"; then
|
||||||
|
echo ""
|
||||||
|
echo "Your GCC supports symbol visibility, but the patch for Qt supporting visibility"
|
||||||
|
echo "was not included. Therefore, GCC symbol visibility support remains disabled."
|
||||||
|
echo ""
|
||||||
|
echo "For better performance, consider including the Qt visibility supporting patch"
|
||||||
|
echo "located at:"
|
||||||
|
echo ""
|
||||||
|
echo "http://bugs.kde.org/show_bug.cgi?id=109386"
|
||||||
|
echo ""
|
||||||
|
echo "and recompile all of Qt and KDE. Note, this is entirely optional and"
|
||||||
|
echo "everything will continue to work just fine without it."
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$all_tests" = "bad"; then
|
||||||
|
if test ! "$cache_file" = "/dev/null"; then
|
||||||
|
echo ""
|
||||||
|
echo "Please remove the file $cache_file after changing your setup"
|
||||||
|
echo "so that configure will find the changes next time."
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
echo "Good - your configure finished. Start make now"
|
||||||
|
echo ""
|
||||||
|
fi
|
@ -0,0 +1,21 @@
|
|||||||
|
#MIN_CONFIG(3.0.0)
|
||||||
|
|
||||||
|
AM_INIT_AUTOMAKE(kima, 0.7.3.2)
|
||||||
|
AC_C_BIGENDIAN
|
||||||
|
AC_CHECK_KDEMAXPATHLEN
|
||||||
|
|
||||||
|
dnl check for (optional) nvcontrol
|
||||||
|
AC_ARG_WITH(nvcontrol,
|
||||||
|
AC_HELP_STRING([--with-nvcontrol=nvcontrol-dir],[uses libXNVCtrl.a instead of nvidia-settings for the NVidia thermal source]),
|
||||||
|
[with_nvcontrol=yes
|
||||||
|
nvcontrol_CFLAGS=-I$withval
|
||||||
|
nvcontrol_LIBS="-L$withval -lXNVCtrl"
|
||||||
|
AC_CHECK_FILE([$withval/NVCtrlLib.h], , AC_MSG_ERROR([Did not find NVCtrlLib.h. Make sure that you passed the correct path for NVControl. See README for details.]))
|
||||||
|
AC_DEFINE(HAVE_NVCONTROL, , [defined if compiling with NVControl support])])
|
||||||
|
AC_SUBST(nvcontrol_CFLAGS)
|
||||||
|
AC_SUBST(nvcontrol_LIBS)
|
||||||
|
|
||||||
|
dnl check for required hal minimal version 0.5.5
|
||||||
|
PKG_CHECK_MODULES(libhal, hal >= 0.5.5)
|
||||||
|
AC_SUBST(libhal_CFLAGS)
|
||||||
|
AC_SUBST(libhal_LIBS)
|
@ -0,0 +1,6 @@
|
|||||||
|
# the SUBDIRS is filled automatically by am_edit. If files are
|
||||||
|
# in this directory they are installed into the english dir
|
||||||
|
|
||||||
|
KDE_LANG = en
|
||||||
|
KDE_DOCS = kima
|
||||||
|
SUBDIRS = $(AUTODIRS)
|
@ -0,0 +1,2 @@
|
|||||||
|
KDE_DOCS = kima
|
||||||
|
KDE_LANG = en
|
@ -0,0 +1,555 @@
|
|||||||
|
<?xml version="1.0" ?>
|
||||||
|
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.1.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
|
||||||
|
<!ENTITY kima "<application>Kima 0.6</application>">
|
||||||
|
<!ENTITY kappname "&kima;"><!-- Do *not* replace kappname-->
|
||||||
|
<!ENTITY package "kde-module"><!-- kdebase, kdeadmin, etc -->
|
||||||
|
<!ENTITY % addindex "IGNORE">
|
||||||
|
<!ENTITY % English "INCLUDE"><!-- change language only here -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Do not define any other entities; instead, use the entities
|
||||||
|
from kde-genent.entities and $LANG/user.entities. -->
|
||||||
|
]>
|
||||||
|
<!-- kdoctemplate v0.8 October 1 1999
|
||||||
|
Minor update to "Credits and Licenses" section on August 24, 2000
|
||||||
|
Removed "Revision history" section on 22 January 2001
|
||||||
|
Changed to Installation/Help menu entities 18 October 2001
|
||||||
|
Other minor cleanup and changes 18 October 2001 -->
|
||||||
|
|
||||||
|
|
||||||
|
<!--
|
||||||
|
This template was designed by: David Rugge davidrugge@mindspring.com
|
||||||
|
with lots of help from: Eric Bischoff ebisch@cybercable.tm.fr
|
||||||
|
and Frederik Fouvry fouvry@sfs.nphil.uni-tuebingen.de
|
||||||
|
of the KDE DocBook team.
|
||||||
|
|
||||||
|
You may freely use this template for writing any sort of KDE documentation.
|
||||||
|
If you have any changes or improvements, please let us know.
|
||||||
|
|
||||||
|
Remember:
|
||||||
|
- in XML, the case of the <tags> and attributes is relevant ;
|
||||||
|
- also, quote all attributes.
|
||||||
|
|
||||||
|
Please don't forget to remove all these comments in your final documentation,
|
||||||
|
thanks ;-).
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- ................................................................ -->
|
||||||
|
|
||||||
|
<!-- The language must NOT be changed here. -->
|
||||||
|
|
||||||
|
<book lang="&language;">
|
||||||
|
|
||||||
|
<!-- This header contains all of the meta-information for the document such
|
||||||
|
as Authors, publish date, the abstract, and Keywords -->
|
||||||
|
|
||||||
|
<bookinfo>
|
||||||
|
<title>The &kima; Handbook</title>
|
||||||
|
|
||||||
|
<authorgroup>
|
||||||
|
<author>
|
||||||
|
<firstname></firstname>
|
||||||
|
<othername></othername>
|
||||||
|
<surname>Ken Werner</surname>
|
||||||
|
<affiliation>
|
||||||
|
<address><email>ken.werner@web.de</email></address>
|
||||||
|
</affiliation>
|
||||||
|
</author>
|
||||||
|
</authorgroup>
|
||||||
|
|
||||||
|
<!-- TRANS:ROLES_OF_TRANSLATORS -->
|
||||||
|
|
||||||
|
<copyright>
|
||||||
|
<year>1999</year>
|
||||||
|
<year>%{YEAR}</year>
|
||||||
|
<holder>Ken Werner</holder>
|
||||||
|
</copyright>
|
||||||
|
<!-- Translators: put here the copyright notice of the translation -->
|
||||||
|
<!-- Put here the FDL notice. Read the explanation in fdl-notice.docbook
|
||||||
|
and in the FDL itself on how to use it. -->
|
||||||
|
<legalnotice>&FDLNotice;</legalnotice>
|
||||||
|
|
||||||
|
<!-- Date and version information of the documentation
|
||||||
|
Don't forget to include this last date and this last revision number, we
|
||||||
|
need them for translation coordination !
|
||||||
|
Please respect the format of the date (YYYY-MM-DD) and of the version
|
||||||
|
(V.MM.LL), it could be used by automation scripts.
|
||||||
|
Do NOT change these in the translation. -->
|
||||||
|
|
||||||
|
<date>2001-10-18</date>
|
||||||
|
<releaseinfo>0.1</releaseinfo>
|
||||||
|
|
||||||
|
<!-- Abstract about this handbook -->
|
||||||
|
|
||||||
|
<abstract>
|
||||||
|
<para>
|
||||||
|
&kima; is an application specially designed to do nothing you would
|
||||||
|
ever want.
|
||||||
|
</para>
|
||||||
|
</abstract>
|
||||||
|
|
||||||
|
<!-- This is a set of Keywords for indexing by search engines.
|
||||||
|
Please at least include KDE, the KDE package it is in, the name
|
||||||
|
of your application, and a few relevant keywords. -->
|
||||||
|
|
||||||
|
<keywordset>
|
||||||
|
<keyword>KDE</keyword>
|
||||||
|
<keyword>Kima</keyword>
|
||||||
|
<keyword>nothing</keyword>
|
||||||
|
<keyword>nothing else</keyword>
|
||||||
|
</keywordset>
|
||||||
|
|
||||||
|
</bookinfo>
|
||||||
|
|
||||||
|
<!-- The contents of the documentation begin here. Label
|
||||||
|
each chapter so with the id attribute. This is necessary for two reasons: it
|
||||||
|
allows you to easily reference the chapter from other chapters of your
|
||||||
|
document, and if there is no ID, the name of the generated HTML files will vary
|
||||||
|
from time to time making it hard to manage for maintainers and for the CVS
|
||||||
|
system. Any chapter labelled (OPTIONAL) may be left out at the author's
|
||||||
|
discretion. Other chapters should not be left out in order to maintain a
|
||||||
|
consistent documentation style across all KDE apps. -->
|
||||||
|
|
||||||
|
<chapter id="introduction">
|
||||||
|
<title>Introduction</title>
|
||||||
|
|
||||||
|
<!-- The introduction chapter contains a brief introduction for the
|
||||||
|
application that explains what it does and where to report
|
||||||
|
problems. Basically a long version of the abstract. Don't include a
|
||||||
|
revision history. (see installation appendix comment) -->
|
||||||
|
|
||||||
|
<para>
|
||||||
|
&kima; is a program that lets you do absolutely nothing. Please report
|
||||||
|
any problems or feature requests to the &kde; mailing lists.
|
||||||
|
</para>
|
||||||
|
</chapter>
|
||||||
|
|
||||||
|
<chapter id="using-kima">
|
||||||
|
<title>Using &kima;</title>
|
||||||
|
|
||||||
|
<!-- This chapter should tell the user how to use your app. You should use as
|
||||||
|
many sections (Chapter, Sect1, Sect3, etc...) as is necessary to fully document
|
||||||
|
your application. -->
|
||||||
|
|
||||||
|
<para>
|
||||||
|
|
||||||
|
<!-- Note that all graphics should be in .png format. Use no gifs because of
|
||||||
|
patent issues. -->
|
||||||
|
|
||||||
|
<screenshot>
|
||||||
|
<screeninfo>Here's a screenshot of &kima;</screeninfo>
|
||||||
|
<mediaobject>
|
||||||
|
<imageobject>
|
||||||
|
<imagedata fileref="screenshot.png" format="PNG"/>
|
||||||
|
</imageobject>
|
||||||
|
<imageobject>
|
||||||
|
<imagedata fileref="screenshot.eps" format="EPS"/>
|
||||||
|
</imageobject>
|
||||||
|
<textobject>
|
||||||
|
<phrase>Screenshot</phrase>
|
||||||
|
</textobject>
|
||||||
|
</mediaobject>
|
||||||
|
</screenshot>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
|
||||||
|
<sect1 id="kima-features">
|
||||||
|
<title>More &kima; features</title>
|
||||||
|
|
||||||
|
<para>It slices! It dices! and it comes with a free toaster!</para>
|
||||||
|
<para>
|
||||||
|
The Squiggle Tool <guiicon><inlinemediaobject>
|
||||||
|
<imageobject>
|
||||||
|
<imagedata fileref="squiggle.png" format="PNG"/>
|
||||||
|
</imageobject>
|
||||||
|
<imageobject>
|
||||||
|
<imagedata fileref="squiggle.eps" format="EPS"/>
|
||||||
|
</imageobject>
|
||||||
|
<textobject>
|
||||||
|
<phrase>Squiggle</phrase>
|
||||||
|
</textobject>
|
||||||
|
</inlinemediaobject></guiicon> is used to draw squiggly lines all over
|
||||||
|
the &kima; main window. It's not a bug, it's a feature!
|
||||||
|
</para>
|
||||||
|
|
||||||
|
</sect1>
|
||||||
|
</chapter>
|
||||||
|
|
||||||
|
<chapter id="commands">
|
||||||
|
<title>Command Reference</title>
|
||||||
|
|
||||||
|
<!-- (OPTIONAL, BUT RECOMMENDED) This chapter should list all of the
|
||||||
|
application windows and their menubar and toolbar commands for easy reference.
|
||||||
|
Also include any keys that have a special function but have no equivalent in the
|
||||||
|
menus or toolbars. This may not be necessary for small apps or apps with no tool
|
||||||
|
or menu bars. -->
|
||||||
|
|
||||||
|
<sect1 id="kima-mainwindow">
|
||||||
|
<title>The main &kima; window</title>
|
||||||
|
|
||||||
|
<sect2>
|
||||||
|
<title>The File Menu</title>
|
||||||
|
<para>
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><menuchoice>
|
||||||
|
<shortcut>
|
||||||
|
<keycombo action="simul">&Ctrl;<keycap>N</keycap></keycombo>
|
||||||
|
</shortcut>
|
||||||
|
<guimenu>File</guimenu>
|
||||||
|
<guimenuitem>New</guimenuitem>
|
||||||
|
</menuchoice></term>
|
||||||
|
<listitem><para><action>Creates a new document</action></para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><menuchoice>
|
||||||
|
<shortcut>
|
||||||
|
<keycombo action="simul">&Ctrl;<keycap>S</keycap></keycombo>
|
||||||
|
</shortcut>
|
||||||
|
<guimenu>File</guimenu>
|
||||||
|
<guimenuitem>Save</guimenuitem>
|
||||||
|
</menuchoice></term>
|
||||||
|
<listitem><para><action>Saves the document</action></para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><menuchoice>
|
||||||
|
<shortcut>
|
||||||
|
<keycombo action="simul">&Ctrl;<keycap>Q</keycap></keycombo>
|
||||||
|
</shortcut>
|
||||||
|
<guimenu>File</guimenu>
|
||||||
|
<guimenuitem>Quit</guimenuitem>
|
||||||
|
</menuchoice></term>
|
||||||
|
<listitem><para><action>Quits</action> &kima;</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
</sect2>
|
||||||
|
|
||||||
|
<sect2>
|
||||||
|
<title>The <guimenu>Help</guimenu> Menu</title>
|
||||||
|
|
||||||
|
<!-- Assuming you have a standard help menu (help, what's this, about -->
|
||||||
|
<!-- &kima;, about KDE) then the documentation is already written. -->
|
||||||
|
<!-- The following entity is valid anywhere that a variablelist is -->
|
||||||
|
<!-- valid. -->
|
||||||
|
|
||||||
|
&help.menu.documentation;
|
||||||
|
|
||||||
|
</sect2>
|
||||||
|
|
||||||
|
</sect1>
|
||||||
|
</chapter>
|
||||||
|
|
||||||
|
<chapter id="developers">
|
||||||
|
<title>Developer's Guide to &kima;</title>
|
||||||
|
|
||||||
|
<!-- (OPTIONAL) A Programming/Scripting reference chapter should be
|
||||||
|
used for apps that use plugins or that provide their own scripting hooks
|
||||||
|
and/or development libraries. -->
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Programming &kima; plugins is a joy to behold. Just read through the next
|
||||||
|
66 pages of API's to learn how!
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<!-- Use refentries to describe APIs. Refentries are fairly complicated and you
|
||||||
|
should consult the docbook reference for further details. The example below was
|
||||||
|
taken from that reference and shortened a bit for readability. -->
|
||||||
|
|
||||||
|
<refentry id="re-1007-unmanagechildren-1">
|
||||||
|
<refmeta>
|
||||||
|
<refentrytitle>XtUnmanageChildren</refentrytitle>
|
||||||
|
<refmiscinfo>Xt - Geometry Management</refmiscinfo>
|
||||||
|
</refmeta>
|
||||||
|
<refnamediv>
|
||||||
|
<refname>XtUnmanageChildren
|
||||||
|
</refname>
|
||||||
|
<refpurpose>remove a list of children from a parent widget's managed
|
||||||
|
list.
|
||||||
|
<indexterm id="ix-1007-unmanagechildren-1"><primary>widgets</primary><secondary>removing</secondary></indexterm>
|
||||||
|
<indexterm id="ix-1007-unmanagechildren-2"><primary>XtUnmanageChildren</primary></indexterm>
|
||||||
|
</refpurpose>
|
||||||
|
|
||||||
|
</refnamediv>
|
||||||
|
<refsynopsisdiv>
|
||||||
|
<refsynopsisdivinfo>
|
||||||
|
<date>4 March 1996</date>
|
||||||
|
</refsynopsisdivinfo>
|
||||||
|
<synopsis>
|
||||||
|
void XtUnmanageChildren(<replaceable class="parameter">children</replaceable>, <replaceable class="parameter">num_children</replaceable>)
|
||||||
|
WidgetList <replaceable class="parameter">children</replaceable>;
|
||||||
|
Cardinal <replaceable class="parameter">num_children</replaceable>;
|
||||||
|
</synopsis>
|
||||||
|
|
||||||
|
<refsect2 id="r2-1007-unmanagechildren-1">
|
||||||
|
<title>Inputs</title>
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">children</replaceable>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Specifies an array of child widgets. Each child must be of
|
||||||
|
class RectObj or any subclass thereof.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">num_children</replaceable>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Specifies the number of elements in <replaceable class="parameter">children</replaceable>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</refsect2></refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="r1-1007-unmanagechildren-1">
|
||||||
|
<title>Description
|
||||||
|
</title>
|
||||||
|
<para><function>XtUnmanageChildren()</function> unmaps the specified widgets
|
||||||
|
and removes them from their parent's geometry management.
|
||||||
|
The widgets will disappear from the screen, and (depending
|
||||||
|
on its parent) may no longer have screen space allocated for
|
||||||
|
them.
|
||||||
|
</para>
|
||||||
|
<para>Each of the widgets in the <replaceable class="parameter">children</replaceable> array must have
|
||||||
|
the same parent.
|
||||||
|
</para>
|
||||||
|
<para>See the “Algorithm” section below for full details of the
|
||||||
|
widget unmanagement procedure.
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="r1-1007-unmanagechildren-2">
|
||||||
|
<title>Usage</title>
|
||||||
|
<para>Unmanaging widgets is the usual method for temporarily
|
||||||
|
making them invisible. They can be re-managed with
|
||||||
|
<function>XtManageChildren()</function>.
|
||||||
|
</para>
|
||||||
|
<para>You can unmap a widget, but leave it under geometry
|
||||||
|
management by calling <function>XtUnmapWidget()</function>. You can
|
||||||
|
destroy a widget's window without destroying the widget by
|
||||||
|
calling <function>XtUnrealizeWidget()</function>. You can destroy a
|
||||||
|
widget completely with <function>XtDestroyWidget()</function>.
|
||||||
|
</para>
|
||||||
|
<para>If you are only going to unmanage a single widget, it is
|
||||||
|
more convenient to call <function>XtUnmanageChild()</function>. It is
|
||||||
|
often more convenient to call <function>XtUnmanageChild()</function>
|
||||||
|
several times than it is to declare and initialize an array
|
||||||
|
of widgets to pass to <function>XtUnmanageChildren()</function>. Calling
|
||||||
|
<function>XtUnmanageChildren()</function> is more efficient, however,
|
||||||
|
because it only calls the parent's <function>change_managed()</function>
|
||||||
|
method once.
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="r1-1007-unmanagechildren-3">
|
||||||
|
<title>Algorithm
|
||||||
|
</title>
|
||||||
|
<para><function>XtUnmanageChildren()</function> performs the following:
|
||||||
|
</para>
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term>-
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Ignores the child if it already is unmanaged or is being
|
||||||
|
destroyed.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>-
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Otherwise, if the child is realized, it makes it nonvisible
|
||||||
|
by unmapping it.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
<para>
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="r1-1007-unmanagechildren-4">
|
||||||
|
<title>Structures</title>
|
||||||
|
<para>The <type>WidgetList</type> type is simply an array of widgets:
|
||||||
|
</para>
|
||||||
|
<screen id="sc-1007-unmanagechildren-1">typedef Widget *WidgetList;
|
||||||
|
</screen>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
|
</chapter>
|
||||||
|
|
||||||
|
<chapter id="faq">
|
||||||
|
<title>Questions and Answers</title>
|
||||||
|
|
||||||
|
<!-- (OPTIONAL but recommended) This chapter should include all of the silly
|
||||||
|
(and not-so-silly) newbie questions that fill up your mailbox. This chapter
|
||||||
|
should be reserved for BRIEF questions and answers! If one question uses more
|
||||||
|
than a page or so then it should probably be part of the
|
||||||
|
"Using this Application" chapter instead. You should use links to
|
||||||
|
cross-reference questions to the parts of your documentation that answer them.
|
||||||
|
This is also a great place to provide pointers to other FAQ's if your users
|
||||||
|
must do some complicated configuration on other programs in order for your
|
||||||
|
application work. -->
|
||||||
|
|
||||||
|
&reporting.bugs;
|
||||||
|
&updating.documentation;
|
||||||
|
|
||||||
|
<qandaset id="faqlist">
|
||||||
|
<qandaentry>
|
||||||
|
<question>
|
||||||
|
<para>My Mouse doesn't work. How do I quit &kima;?</para>
|
||||||
|
</question>
|
||||||
|
<answer>
|
||||||
|
<para>You silly goose! Check out the <link linkend="commands">Commands
|
||||||
|
Section</link> for the answer.</para>
|
||||||
|
</answer>
|
||||||
|
</qandaentry>
|
||||||
|
<qandaentry>
|
||||||
|
<question>
|
||||||
|
<para>Why can't I twiddle my documents?</para>
|
||||||
|
</question>
|
||||||
|
<answer>
|
||||||
|
<para>You can only twiddle your documents if you have the foobar.lib
|
||||||
|
installed.</para>
|
||||||
|
</answer>
|
||||||
|
</qandaentry>
|
||||||
|
</qandaset>
|
||||||
|
</chapter>
|
||||||
|
|
||||||
|
<chapter id="credits">
|
||||||
|
|
||||||
|
<!-- Include credits for the programmers, documentation writers, and
|
||||||
|
contributors here. The license for your software should then be included below
|
||||||
|
the credits with a reference to the appropriate license file included in the KDE
|
||||||
|
distribution. -->
|
||||||
|
|
||||||
|
<title>Credits and License</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
&kima;
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Program copyright %{YEAR} Ken Werner <email>ken.werner@web.de</email>
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Contributors:
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem><para>Konqui the KDE Dragon <email>konqui@kde.org</email></para>
|
||||||
|
</listitem>
|
||||||
|
<listitem><para>Tux the Linux Penguin <email>tux@linux.org</email></para>
|
||||||
|
</listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Documentation copyright %{YEAR} Ken Werner <email>ken.werner@web.de</email>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<!-- TRANS:CREDIT_FOR_TRANSLATORS -->
|
||||||
|
|
||||||
|
&underFDL; <!-- FDL: do not remove -->
|
||||||
|
|
||||||
|
<!-- Determine which license your application is licensed under,
|
||||||
|
and delete all the remaining licenses below:
|
||||||
|
|
||||||
|
(NOTE: All documentation are licensed under the FDL,
|
||||||
|
regardless of what license the application uses) -->
|
||||||
|
|
||||||
|
&underGPL; <!-- GPL License -->
|
||||||
|
&underBSDLicense; <!-- BSD License -->
|
||||||
|
&underArtisticLicense; <!-- BSD Artistic License -->
|
||||||
|
&underX11License; <!-- X11 License -->
|
||||||
|
|
||||||
|
</chapter>
|
||||||
|
|
||||||
|
<appendix id="installation">
|
||||||
|
<title>Installation</title>
|
||||||
|
|
||||||
|
<sect1 id="getting-kima">
|
||||||
|
<title>How to obtain &kima;</title>
|
||||||
|
|
||||||
|
<!-- This first entity contains boiler plate for applications that are
|
||||||
|
part of KDE CVS. You should remove it if you are releasing your
|
||||||
|
application -->
|
||||||
|
|
||||||
|
&install.intro.documentation;
|
||||||
|
|
||||||
|
</sect1>
|
||||||
|
|
||||||
|
<sect1 id="requirements">
|
||||||
|
<title>Requirements</title>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
List any special requirements for your application here. This should include:
|
||||||
|
.Libraries or other software that is not included in kdesupport,
|
||||||
|
kdelibs, or kdebase.
|
||||||
|
.Hardware requirements like amount of RAM, disk space, graphics card
|
||||||
|
capabilities, screen resolution, special expansion cards, etc.
|
||||||
|
.Operating systems the app will run on. If your app is designed only for a
|
||||||
|
specific OS, (you wrote a graphical LILO configurator for example) put this
|
||||||
|
information here.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<para>
|
||||||
|
In order to successfully use &kima;, you need &kde; 1.1. Foobar.lib is
|
||||||
|
required in order to support the advanced &kima; features. &kima; uses
|
||||||
|
about 5 megs of memory to run, but this may vary depending on your
|
||||||
|
platform and configuration.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
All required libraries as well as &kima; itself can be found
|
||||||
|
on <ulink url="ftp://ftp.kima.org">The &kima; home page</ulink>.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<!-- For a list of updates, you may refer to the application web site
|
||||||
|
or the ChangeLog file, or ... -->
|
||||||
|
<para>
|
||||||
|
You can find a list of changes at <ulink
|
||||||
|
url="http://apps.kde.org/kima">http://apps.kde.org/kima</ulink>.
|
||||||
|
</para>
|
||||||
|
</sect1>
|
||||||
|
|
||||||
|
<sect1 id="compilation">
|
||||||
|
<title>Compilation and Installation</title>
|
||||||
|
|
||||||
|
<!-- This entity contains the boilerplate text for standard -->
|
||||||
|
<!-- compilation instructions. If your application requires any -->
|
||||||
|
<!-- special handling, remove it, and replace with your own text. -->
|
||||||
|
|
||||||
|
&install.compile.documentation;
|
||||||
|
|
||||||
|
</sect1>
|
||||||
|
|
||||||
|
<sect1 id="configuration">
|
||||||
|
<title>Configuration</title>
|
||||||
|
|
||||||
|
<para>Don't forget to tell your system to start the <filename>dtd</filename>
|
||||||
|
dicer-toaster daemon first, or &kima; won't work !</para>
|
||||||
|
|
||||||
|
</sect1>
|
||||||
|
|
||||||
|
</appendix>
|
||||||
|
|
||||||
|
&documentation.index;
|
||||||
|
</book>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Local Variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-general-insert-case:lower
|
||||||
|
sgml-indent-step:0
|
||||||
|
sgml-indent-data:nil
|
||||||
|
End:
|
||||||
|
|
||||||
|
vim:tabstop=2:shiftwidth=2:expandtab
|
||||||
|
-->
|
||||||
|
|
@ -0,0 +1,2 @@
|
|||||||
|
#POFILES = AUTO
|
||||||
|
POFILES = de.po es.po hu.po sv.po tr.po id.po
|
@ -0,0 +1,215 @@
|
|||||||
|
# translation of de.po to
|
||||||
|
# Header entry was created by KBabel!
|
||||||
|
#
|
||||||
|
# ken <ken.werner@web.de>, 2007.
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: de\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2007-03-19 18:43+0100\n"
|
||||||
|
"PO-Revision-Date: 2007-03-19 18:53+0100\n"
|
||||||
|
"Last-Translator: ken <ken.werner@web.de>\n"
|
||||||
|
"Language-Team: <de@li.org>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"X-Generator: KBabel 1.11.4\n"
|
||||||
|
|
||||||
|
#: _translatorinfo.cpp:1
|
||||||
|
msgid ""
|
||||||
|
"_: NAME OF TRANSLATORS\n"
|
||||||
|
"Your names"
|
||||||
|
msgstr "Ken Werner"
|
||||||
|
|
||||||
|
#: _translatorinfo.cpp:3
|
||||||
|
msgid ""
|
||||||
|
"_: EMAIL OF TRANSLATORS\n"
|
||||||
|
"Your emails"
|
||||||
|
msgstr "ken.werner@web.de"
|
||||||
|
|
||||||
|
#: kima.cpp:152
|
||||||
|
msgid "Kima"
|
||||||
|
msgstr "Kima"
|
||||||
|
|
||||||
|
#: kima.cpp:155
|
||||||
|
msgid "&Performance Profiles"
|
||||||
|
msgstr "&Performance Profile"
|
||||||
|
|
||||||
|
#: kima.cpp:161
|
||||||
|
msgid "&Preferences"
|
||||||
|
msgstr "&Einstellungen"
|
||||||
|
|
||||||
|
#: kima.cpp:165
|
||||||
|
msgid "&About Kima"
|
||||||
|
msgstr "&Über Kima"
|
||||||
|
|
||||||
|
#: kima.cpp:206
|
||||||
|
msgid ""
|
||||||
|
"Kicker monitoring applet.\n"
|
||||||
|
"\n"
|
||||||
|
"This applet monitors various temperature, frequency and fan sources.\n"
|
||||||
|
"Make sure you have enabled a supported kernel module.\n"
|
||||||
|
msgstr ""
|
||||||
|
"Kicker Monitoring Applet.\n"
|
||||||
|
"\n"
|
||||||
|
"Dieses Applet zeigt Werte verschiedenee Temperatur-, Frequenz- und "
|
||||||
|
"Lüftersensoren an.\n"
|
||||||
|
"Bitte stellen Sie sicher, dass ein entsprechendes Kernelmodul aktiviert "
|
||||||
|
"ist.\n"
|
||||||
|
|
||||||
|
#: kima.cpp:213
|
||||||
|
msgid "cpufreqd control module"
|
||||||
|
msgstr "CPUFreqd Kontrollmodul"
|
||||||
|
|
||||||
|
#: kima.cpp:234
|
||||||
|
msgid "This is a help box"
|
||||||
|
msgstr "Das ist eine Helpbox"
|
||||||
|
|
||||||
|
#: kima.cpp:468
|
||||||
|
msgid "Sources:"
|
||||||
|
msgstr "Quellen: "
|
||||||
|
|
||||||
|
#. i18n: file prefs.ui line 36
|
||||||
|
#: prefs.cpp:38 prefs.cpp:68 rc.cpp:6
|
||||||
|
#, no-c-format
|
||||||
|
msgid "Source"
|
||||||
|
msgstr "Quelle"
|
||||||
|
|
||||||
|
#. i18n: file prefs.ui line 17
|
||||||
|
#: prefs.cpp:67 rc.cpp:3
|
||||||
|
#, no-c-format
|
||||||
|
msgid "Preferences"
|
||||||
|
msgstr "Einstellungen"
|
||||||
|
|
||||||
|
#: cpufreqd/cpufreqd.cpp:41
|
||||||
|
msgid "Select dynamically"
|
||||||
|
msgstr "automatisch wählen"
|
||||||
|
|
||||||
|
#: cpufreqd/cpufreqd.cpp:123
|
||||||
|
msgid "Can't talk to cpufreqd"
|
||||||
|
msgstr "keine cpufreqd Kommunikation möglich"
|
||||||
|
|
||||||
|
#: sources/acpithermalsrc.cpp:32
|
||||||
|
msgid "This source is provided by the Linux ACPI Thermal Zone driver."
|
||||||
|
msgstr "Diese Quelle wird vom Linux ACPI Thermal Zone Treiber bereit gestellt."
|
||||||
|
|
||||||
|
#: sources/acpithermalsrc.cpp:55 sources/cpuinfofreqsrc.cpp:47
|
||||||
|
#: sources/hddtempsrc.cpp:78 sources/hwmonfansrc.cpp:82
|
||||||
|
#: sources/hwmonthermalsrc.cpp:82 sources/i8ksrc.cpp:62
|
||||||
|
#: sources/ibmacpifansrc.cpp:47 sources/ibmacpithermalsrc.cpp:58
|
||||||
|
#: sources/ibmhdaps.cpp:55 sources/ibookg4thermalsrc.cpp:54
|
||||||
|
#: sources/labelsource.cpp:130 sources/nvidiathermalsrc.cpp:87
|
||||||
|
#: sources/nvidiathermalsrc.cpp:99 sources/omnibookthermalsrc.cpp:48
|
||||||
|
#: sources/sysfreqsrc.cpp:58 sources/uptimesrc.cpp:47
|
||||||
|
msgid "n/a"
|
||||||
|
msgstr "n.v."
|
||||||
|
|
||||||
|
#: sources/cpuinfofreqsrc.cpp:32
|
||||||
|
msgid "This source is provided by the Linux kernel proc vfs interface."
|
||||||
|
msgstr "Diese Quelle wird vom proc VFS des Linux Kernels bereit gestellt."
|
||||||
|
|
||||||
|
#: sources/hddtempsrc.cpp:41
|
||||||
|
msgid "This source is provided by hddtemp. (%1, %2)"
|
||||||
|
msgstr "Diese Quelle wird vom HDDTemp-Daemon Treiber bereit gestellt. (%1, %2)"
|
||||||
|
|
||||||
|
#: sources/hwmonfansrc.cpp:33
|
||||||
|
msgid "This fan source is provided by hwmon. (%1)"
|
||||||
|
msgstr "Diese Quelle wird von hwmon bereit gestellt. (%1)"
|
||||||
|
|
||||||
|
#: sources/hwmonthermalsrc.cpp:33
|
||||||
|
msgid "This thermal source is provided by hwmon. (%1)"
|
||||||
|
msgstr "Diese Quelle wird von hwmon bereit gestellt. (%1)"
|
||||||
|
|
||||||
|
#: sources/i8ksrc.cpp:33
|
||||||
|
msgid "This source is provided by i8k kernel module."
|
||||||
|
msgstr "Diese Quelle wird vom i8k Kernelmodul bereit gestellt."
|
||||||
|
|
||||||
|
#: sources/ibmacpifansrc.cpp:32 sources/ibmacpithermalsrc.cpp:34
|
||||||
|
msgid "This source is provided by the ACPI driver for IBM ThinkPads."
|
||||||
|
msgstr "Diese Quelle wird vom ACPI Kerneltreiber für ThinkPads bereit gestellt."
|
||||||
|
|
||||||
|
#: sources/ibmhdaps.cpp:32
|
||||||
|
msgid "This thermal source is provided by the IBM HDAPS driver."
|
||||||
|
msgstr "Diese Quelle wird vom IBM HDAPS-Treiber bereit gestellt."
|
||||||
|
|
||||||
|
#: sources/ibookg4thermalsrc.cpp:32
|
||||||
|
msgid "This source shows a thermal sensor of your iBook."
|
||||||
|
msgstr "Diese Quelle zeigt einen Themperatursensor eines iBooks."
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:97
|
||||||
|
msgid "LabelSourcePrefs"
|
||||||
|
msgstr "LabelSourcePrefs"
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:98
|
||||||
|
msgid ""
|
||||||
|
"<br>\n"
|
||||||
|
"Taskbar visual settings"
|
||||||
|
msgstr ""
|
||||||
|
"<br>\n"
|
||||||
|
"Visuelle Einstellungen für das Aussehen der Quelle im Kicker"
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:100
|
||||||
|
msgid "Foreground color:"
|
||||||
|
msgstr "Vordergrundfarbe:"
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:102
|
||||||
|
msgid "Font:"
|
||||||
|
msgstr "Schriftwart:"
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:103
|
||||||
|
msgid "Alignment:"
|
||||||
|
msgstr "Ausrichtung:"
|
||||||
|
|
||||||
|
#: sources/nvidiathermalsrc.cpp:33
|
||||||
|
#, fuzzy
|
||||||
|
msgid "This source is provided by the nVidia GPU card driver tools"
|
||||||
|
msgstr "Diese Quelle wird von den nVdia Grafikkartentreiber-Tools bereit gestellt."
|
||||||
|
|
||||||
|
#: sources/omnibookthermalsrc.cpp:32
|
||||||
|
msgid "This source is provided by the Omnibook Configuration Tools & Patches."
|
||||||
|
msgstr ""
|
||||||
|
"Diese Quelle wird von den Omnibook Configuration Tools & Patches bereit "
|
||||||
|
"gestellt."
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:80
|
||||||
|
#, fuzzy
|
||||||
|
msgid "SourcePrefs"
|
||||||
|
msgstr "Quellen: "
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:81
|
||||||
|
msgid "description"
|
||||||
|
msgstr "Beschreibung"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:82
|
||||||
|
msgid "Name:"
|
||||||
|
msgstr "Name:"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:83
|
||||||
|
msgid "Show this source in Taskbar"
|
||||||
|
msgstr "Zeige diese Quelle in der Taskleiste"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:84
|
||||||
|
msgid "Show name in Taskbar"
|
||||||
|
msgstr "Zeige Namen in der Taskleiste"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:85
|
||||||
|
msgid "Show this source in ToolTip"
|
||||||
|
msgstr "Diese Quelle im ToolTip anzeigen"
|
||||||
|
|
||||||
|
#: sources/sysfreqsrc.cpp:33
|
||||||
|
msgid "This source is provided by the Linux kernel cpufreq subsystem."
|
||||||
|
msgstr "Diese Quelle wird vom cpufreq-Subsystem des Linux Kernels bereit gestellt ."
|
||||||
|
|
||||||
|
#: sources/uptimesrc.cpp:32
|
||||||
|
#, fuzzy
|
||||||
|
msgid "This source is provided by /proc/uptime."
|
||||||
|
msgstr "Diese Quelle wird vom i8k Kernelmodul bereit gestellt."
|
||||||
|
|
||||||
|
#: sources/uptimesrc.cpp:61
|
||||||
|
msgid "%1d %2:%3"
|
||||||
|
msgstr "%1d %2:%3"
|
||||||
|
|
||||||
|
#: sources/uptimesrc.cpp:63
|
||||||
|
msgid "%1:%2"
|
||||||
|
msgstr "%1:%2"
|
||||||
|
|
@ -0,0 +1,210 @@
|
|||||||
|
# translation of es.po to
|
||||||
|
# translation of kima.po to
|
||||||
|
# This file is put in the public domain.
|
||||||
|
#
|
||||||
|
# Gonzalo Nemmi <gnemmi@gmail.com>, 2007.
|
||||||
|
# ken <ken.werner@web.de>, 2007.
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: es\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2007-03-19 18:43+0100\n"
|
||||||
|
"PO-Revision-Date: 2007-03-20 21:15-0300\n"
|
||||||
|
"Last-Translator: Gonzalo Nemmi <gnemmi@gmail.com>\n"
|
||||||
|
"Language-Team: <es@li.org>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"X-Generator: KBabel 1.11.4\n"
|
||||||
|
|
||||||
|
#: _translatorinfo.cpp:1
|
||||||
|
msgid ""
|
||||||
|
"_: NAME OF TRANSLATORS\n"
|
||||||
|
"Your names"
|
||||||
|
msgstr "Gonzalo Nemmi"
|
||||||
|
|
||||||
|
#: _translatorinfo.cpp:3
|
||||||
|
msgid ""
|
||||||
|
"_: EMAIL OF TRANSLATORS\n"
|
||||||
|
"Your emails"
|
||||||
|
msgstr "gnemmi@gmail.com"
|
||||||
|
|
||||||
|
#: kima.cpp:152
|
||||||
|
msgid "Kima"
|
||||||
|
msgstr "Kima"
|
||||||
|
|
||||||
|
#: kima.cpp:155
|
||||||
|
msgid "&Performance Profiles"
|
||||||
|
msgstr "&Perfiles de rendimiento"
|
||||||
|
|
||||||
|
#: kima.cpp:161
|
||||||
|
msgid "&Preferences"
|
||||||
|
msgstr "&Preferencias"
|
||||||
|
|
||||||
|
#: kima.cpp:165
|
||||||
|
msgid "&About Kima"
|
||||||
|
msgstr "&Acerca de Kima"
|
||||||
|
|
||||||
|
#: kima.cpp:206
|
||||||
|
msgid ""
|
||||||
|
"Kicker monitoring applet.\n"
|
||||||
|
"\n"
|
||||||
|
"This applet monitors various temperature, frequency and fan sources.\n"
|
||||||
|
"Make sure you have enabled a supported kernel module.\n"
|
||||||
|
msgstr ""
|
||||||
|
"Kicker monitoring applet.\n"
|
||||||
|
"\n"
|
||||||
|
"Este applet le permite monitorear la temperatura y la frecuencia de el/los procesadores presentes en su sistema, y las velocidades de los coolers .\n"
|
||||||
|
"Asegúrese de tener habilitados algunos de los módulos del kernel soportados.\n"
|
||||||
|
|
||||||
|
#: kima.cpp:213
|
||||||
|
msgid "cpufreqd control module"
|
||||||
|
msgstr "Modulo de control de cpufreqd"
|
||||||
|
|
||||||
|
#: kima.cpp:234
|
||||||
|
msgid "This is a help box"
|
||||||
|
msgstr "Este es un cuadro de ayuda"
|
||||||
|
|
||||||
|
#: kima.cpp:468
|
||||||
|
msgid "Sources:"
|
||||||
|
msgstr "Datos:"
|
||||||
|
|
||||||
|
#. i18n: file prefs.ui line 36
|
||||||
|
#: prefs.cpp:38 prefs.cpp:68 rc.cpp:6
|
||||||
|
#, no-c-format
|
||||||
|
msgid "Source"
|
||||||
|
msgstr "Datos"
|
||||||
|
|
||||||
|
#. i18n: file prefs.ui line 17
|
||||||
|
#: prefs.cpp:67 rc.cpp:3
|
||||||
|
#, no-c-format
|
||||||
|
msgid "Preferences"
|
||||||
|
msgstr "Preferencias"
|
||||||
|
|
||||||
|
#: cpufreqd/cpufreqd.cpp:41
|
||||||
|
msgid "Select dynamically"
|
||||||
|
msgstr "Seleccionar automáticamente"
|
||||||
|
|
||||||
|
#: cpufreqd/cpufreqd.cpp:123
|
||||||
|
msgid "Can't talk to cpufreqd"
|
||||||
|
msgstr "No puedo comunicarme con cpufreqd"
|
||||||
|
|
||||||
|
#: sources/acpithermalsrc.cpp:32
|
||||||
|
msgid "This source is provided by the Linux ACPI Thermal Zone driver."
|
||||||
|
msgstr "Estos son los datos provistos por el módulo ACPI del kernel de Linux."
|
||||||
|
|
||||||
|
#: sources/acpithermalsrc.cpp:55 sources/cpuinfofreqsrc.cpp:47
|
||||||
|
#: sources/hddtempsrc.cpp:78 sources/hwmonfansrc.cpp:82
|
||||||
|
#: sources/hwmonthermalsrc.cpp:82 sources/i8ksrc.cpp:62
|
||||||
|
#: sources/ibmacpifansrc.cpp:47 sources/ibmacpithermalsrc.cpp:58
|
||||||
|
#: sources/ibmhdaps.cpp:55 sources/ibookg4thermalsrc.cpp:54
|
||||||
|
#: sources/labelsource.cpp:130 sources/nvidiathermalsrc.cpp:87
|
||||||
|
#: sources/nvidiathermalsrc.cpp:99 sources/omnibookthermalsrc.cpp:48
|
||||||
|
#: sources/sysfreqsrc.cpp:58 sources/uptimesrc.cpp:47
|
||||||
|
msgid "n/a"
|
||||||
|
msgstr "n/d"
|
||||||
|
|
||||||
|
#: sources/cpuinfofreqsrc.cpp:32
|
||||||
|
msgid "This source is provided by the Linux kernel proc vfs interface."
|
||||||
|
msgstr "Estos son los datos provistos por la interface proc del kernel de Linux."
|
||||||
|
|
||||||
|
#: sources/hddtempsrc.cpp:41
|
||||||
|
msgid "This source is provided by hddtemp. (%1, %2)"
|
||||||
|
msgstr "Estos son los datos provistos por hddtemp. (%1, %2)"
|
||||||
|
|
||||||
|
#: sources/hwmonfansrc.cpp:33
|
||||||
|
msgid "This fan source is provided by hwmon. (%1)"
|
||||||
|
msgstr "Estos son los datos sobre el cooler provistos por hwmon. (%1)"
|
||||||
|
|
||||||
|
#: sources/hwmonthermalsrc.cpp:33
|
||||||
|
msgid "This thermal source is provided by hwmon. (%1)"
|
||||||
|
msgstr "Estos son los datos sobre temperatura provistos por hwmon. (%1)"
|
||||||
|
|
||||||
|
#: sources/i8ksrc.cpp:33
|
||||||
|
msgid "This source is provided by i8k kernel module."
|
||||||
|
msgstr "Estos son los datos provistos por el módulo i8k del kernel de Linux."
|
||||||
|
|
||||||
|
#: sources/ibmacpifansrc.cpp:32 sources/ibmacpithermalsrc.cpp:34
|
||||||
|
msgid "This source is provided by the ACPI driver for IBM ThinkPads."
|
||||||
|
msgstr "Estos son los datos provistos por el driver ACPI para ThinkPads de IBM."
|
||||||
|
|
||||||
|
#: sources/ibmhdaps.cpp:32
|
||||||
|
msgid "This thermal source is provided by the IBM HDAPS driver."
|
||||||
|
msgstr "Estos son los datos sobre temperatura provistos por el driver IBM HDAPS."
|
||||||
|
|
||||||
|
#: sources/ibookg4thermalsrc.cpp:32
|
||||||
|
msgid "This source shows a thermal sensor of your iBook."
|
||||||
|
msgstr "Estos son los datos de temperatura en su iBook."
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:97
|
||||||
|
msgid "LabelSourcePrefs"
|
||||||
|
msgstr "LabelSourcePrefs"
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:98
|
||||||
|
msgid ""
|
||||||
|
"<br>\n"
|
||||||
|
"Taskbar visual settings"
|
||||||
|
msgstr ""
|
||||||
|
"<br>\n"
|
||||||
|
"Configuración visual"
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:100
|
||||||
|
msgid "Foreground color:"
|
||||||
|
msgstr "Color de primer plano:"
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:102
|
||||||
|
msgid "Font:"
|
||||||
|
msgstr "Fuente:"
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:103
|
||||||
|
msgid "Alignment:"
|
||||||
|
msgstr "Alineación:"
|
||||||
|
|
||||||
|
#: sources/nvidiathermalsrc.cpp:33
|
||||||
|
msgid "This source is provided by the nVidia GPU card driver tools"
|
||||||
|
msgstr "Estos son los datos provistos por las herramientas del driver nVidia."
|
||||||
|
|
||||||
|
#: sources/omnibookthermalsrc.cpp:32
|
||||||
|
msgid "This source is provided by the Omnibook Configuration Tools & Patches."
|
||||||
|
msgstr "Estos son los datos provistos por Omnibook Configuration Tools & Patches."
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:80
|
||||||
|
msgid "SourcePrefs"
|
||||||
|
msgstr "SourcePrefs"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:81
|
||||||
|
msgid "description"
|
||||||
|
msgstr "descripción"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:82
|
||||||
|
msgid "Name:"
|
||||||
|
msgstr "Nombre:"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:83
|
||||||
|
msgid "Show this source in Taskbar"
|
||||||
|
msgstr "Mostrar estos datos en la barra de herramientas"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:84
|
||||||
|
msgid "Show name in Taskbar"
|
||||||
|
msgstr "Mostrar nombre en la barra de herramientas"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:85
|
||||||
|
msgid "Show this source in ToolTip"
|
||||||
|
msgstr "Mostrar estos datos en el ToolTip"
|
||||||
|
|
||||||
|
#: sources/sysfreqsrc.cpp:33
|
||||||
|
msgid "This source is provided by the Linux kernel cpufreq subsystem."
|
||||||
|
msgstr "Estos son los datos provistos por el subsistema cpufreqd del kernel de Linux."
|
||||||
|
|
||||||
|
#: sources/uptimesrc.cpp:32
|
||||||
|
msgid "This source is provided by /proc/uptime."
|
||||||
|
msgstr "Estos son los datos provistos por /proc/uptime."
|
||||||
|
|
||||||
|
#: sources/uptimesrc.cpp:61
|
||||||
|
msgid "%1d %2:%3"
|
||||||
|
msgstr "%1d %2:%3"
|
||||||
|
|
||||||
|
#: sources/uptimesrc.cpp:63
|
||||||
|
msgid "%1:%2"
|
||||||
|
msgstr "%1:%2"
|
||||||
|
|
@ -0,0 +1,209 @@
|
|||||||
|
# translation of hu.po to Hungarian
|
||||||
|
# This file is put in the public domain.
|
||||||
|
#
|
||||||
|
# Avramucz Péter <muczy@freestart.hu>, 2007.
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: hu\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2007-03-19 18:43+0100\n"
|
||||||
|
"PO-Revision-Date: 2007-03-19 17:48+0100\n"
|
||||||
|
"Last-Translator: Avramucz Péter <muczy@freestart.hu>\n"
|
||||||
|
"Language-Team: Hungarian <hu@li.org>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"X-Generator: KBabel 1.11.4\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#: _translatorinfo.cpp:1
|
||||||
|
msgid ""
|
||||||
|
"_: NAME OF TRANSLATORS\n"
|
||||||
|
"Your names"
|
||||||
|
msgstr "Avramucz Péter"
|
||||||
|
|
||||||
|
#: _translatorinfo.cpp:3
|
||||||
|
msgid ""
|
||||||
|
"_: EMAIL OF TRANSLATORS\n"
|
||||||
|
"Your emails"
|
||||||
|
msgstr "muczy@freestart.hu"
|
||||||
|
|
||||||
|
#: kima.cpp:152
|
||||||
|
msgid "Kima"
|
||||||
|
msgstr "Kima"
|
||||||
|
|
||||||
|
#: kima.cpp:155
|
||||||
|
msgid "&Performance Profiles"
|
||||||
|
msgstr "&Teljesítmény profilok"
|
||||||
|
|
||||||
|
#: kima.cpp:161
|
||||||
|
msgid "&Preferences"
|
||||||
|
msgstr "&Beállítások"
|
||||||
|
|
||||||
|
#: kima.cpp:165
|
||||||
|
msgid "&About Kima"
|
||||||
|
msgstr "&Névjegy"
|
||||||
|
|
||||||
|
#: kima.cpp:206
|
||||||
|
msgid ""
|
||||||
|
"Kicker monitoring applet.\n"
|
||||||
|
"\n"
|
||||||
|
"This applet monitors various temperature, frequency and fan sources.\n"
|
||||||
|
"Make sure you have enabled a supported kernel module.\n"
|
||||||
|
msgstr ""
|
||||||
|
"Kicker monitorozó kisalkalmazás.\n"
|
||||||
|
"\n"
|
||||||
|
"Ez a kisalkalmazás számos hőmérsékletet, frekvenciát és ventillátor forrást "
|
||||||
|
"figyel.\n"
|
||||||
|
"Bizonyosodjon meg róla, hogy engedélyezte a szükséges kernel modulokat. \n"
|
||||||
|
|
||||||
|
#: kima.cpp:213
|
||||||
|
msgid "cpufreqd control module"
|
||||||
|
msgstr "cpufreqd ellenőrző modul"
|
||||||
|
|
||||||
|
#: kima.cpp:234
|
||||||
|
msgid "This is a help box"
|
||||||
|
msgstr "Ez egy segítség ablak"
|
||||||
|
|
||||||
|
#: kima.cpp:468
|
||||||
|
msgid "Sources:"
|
||||||
|
msgstr "Források:"
|
||||||
|
|
||||||
|
#. i18n: file prefs.ui line 36
|
||||||
|
#: prefs.cpp:38 prefs.cpp:68 rc.cpp:6
|
||||||
|
#, no-c-format
|
||||||
|
msgid "Source"
|
||||||
|
msgstr "Forrás"
|
||||||
|
|
||||||
|
#. i18n: file prefs.ui line 17
|
||||||
|
#: prefs.cpp:67 rc.cpp:3
|
||||||
|
#, no-c-format
|
||||||
|
msgid "Preferences"
|
||||||
|
msgstr "Beállítások"
|
||||||
|
|
||||||
|
#: cpufreqd/cpufreqd.cpp:41
|
||||||
|
msgid "Select dynamically"
|
||||||
|
msgstr "Dinamikusan választott"
|
||||||
|
|
||||||
|
#: cpufreqd/cpufreqd.cpp:123
|
||||||
|
msgid "Can't talk to cpufreqd"
|
||||||
|
msgstr "Nem tudok kommunikálni a cpufreqd-vel"
|
||||||
|
|
||||||
|
#: sources/acpithermalsrc.cpp:32
|
||||||
|
msgid "This source is provided by the Linux ACPI Thermal Zone driver."
|
||||||
|
msgstr "Ezt a forrást a Linux ACPI Thermal Zone driver szolgáltatja."
|
||||||
|
|
||||||
|
#: sources/acpithermalsrc.cpp:55 sources/cpuinfofreqsrc.cpp:47
|
||||||
|
#: sources/hddtempsrc.cpp:78 sources/hwmonfansrc.cpp:82
|
||||||
|
#: sources/hwmonthermalsrc.cpp:82 sources/i8ksrc.cpp:62
|
||||||
|
#: sources/ibmacpifansrc.cpp:47 sources/ibmacpithermalsrc.cpp:58
|
||||||
|
#: sources/ibmhdaps.cpp:55 sources/ibookg4thermalsrc.cpp:54
|
||||||
|
#: sources/labelsource.cpp:130 sources/nvidiathermalsrc.cpp:87
|
||||||
|
#: sources/nvidiathermalsrc.cpp:99 sources/omnibookthermalsrc.cpp:48
|
||||||
|
#: sources/sysfreqsrc.cpp:58 sources/uptimesrc.cpp:47
|
||||||
|
msgid "n/a"
|
||||||
|
msgstr "n/a"
|
||||||
|
|
||||||
|
#: sources/cpuinfofreqsrc.cpp:32
|
||||||
|
msgid "This source is provided by the Linux kernel proc vfs interface."
|
||||||
|
msgstr "Ezt a forrást a Linux kernel proc vfs interfész szolgáltatja."
|
||||||
|
|
||||||
|
#: sources/hddtempsrc.cpp:41
|
||||||
|
msgid "This source is provided by hddtemp. (%1, %2)"
|
||||||
|
msgstr "Ezt a forrást a hddtemp szolgáltatja. (%1, %2)"
|
||||||
|
|
||||||
|
#: sources/hwmonfansrc.cpp:33
|
||||||
|
msgid "This fan source is provided by hwmon. (%1)"
|
||||||
|
msgstr "Ezt a forrást a hwmon szolgáltatja. (%1)"
|
||||||
|
|
||||||
|
#: sources/hwmonthermalsrc.cpp:33
|
||||||
|
msgid "This thermal source is provided by hwmon. (%1)"
|
||||||
|
msgstr "Ezt a hőmérő forrást a hwmon szolgáltatja. (%1)"
|
||||||
|
|
||||||
|
#: sources/i8ksrc.cpp:33
|
||||||
|
msgid "This source is provided by i8k kernel module."
|
||||||
|
msgstr "Ezt a forrást az i8k kernel modul szolgáltatja."
|
||||||
|
|
||||||
|
#: sources/ibmacpifansrc.cpp:32 sources/ibmacpithermalsrc.cpp:34
|
||||||
|
msgid "This source is provided by the ACPI driver for IBM ThinkPads."
|
||||||
|
msgstr "Ezt a forrást az IBM ThinkPad ACPI meghajtója szolgáltatja."
|
||||||
|
|
||||||
|
#: sources/ibmhdaps.cpp:32
|
||||||
|
msgid "This thermal source is provided by the IBM HDAPS driver."
|
||||||
|
msgstr "Ezt a hőmérő forrást az IBM HDAPS meghajtó szolgáltatja."
|
||||||
|
|
||||||
|
#: sources/ibookg4thermalsrc.cpp:32
|
||||||
|
msgid "This source shows a thermal sensor of your iBook."
|
||||||
|
msgstr "Ez a forrás az Ön iBook-jának egy hőmérő szenzorát mutatja."
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:97
|
||||||
|
msgid "LabelSourcePrefs"
|
||||||
|
msgstr "LabelSourcePrefs"
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:98
|
||||||
|
msgid ""
|
||||||
|
"<br>\n"
|
||||||
|
"Taskbar visual settings"
|
||||||
|
msgstr ""
|
||||||
|
"<br>\n"
|
||||||
|
"Tálca kinézeti beállítások"
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:100
|
||||||
|
msgid "Foreground color:"
|
||||||
|
msgstr "Előtérszín:"
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:102
|
||||||
|
msgid "Font:"
|
||||||
|
msgstr "Betűtípus:"
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:103
|
||||||
|
msgid "Alignment:"
|
||||||
|
msgstr "Rendezés:"
|
||||||
|
|
||||||
|
#: sources/nvidiathermalsrc.cpp:33
|
||||||
|
msgid "This source is provided by the nVidia GPU card driver tools"
|
||||||
|
msgstr "Ezt a forrást az nVidia GPU meghajtó eszközök szolgáltatják."
|
||||||
|
|
||||||
|
#: sources/omnibookthermalsrc.cpp:32
|
||||||
|
msgid "This source is provided by the Omnibook Configuration Tools & Patches."
|
||||||
|
msgstr "Ezt a forrást az Omnibook Configuration Tools & Patches szolgáltatja."
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:80
|
||||||
|
msgid "SourcePrefs"
|
||||||
|
msgstr "Források:"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:81
|
||||||
|
msgid "description"
|
||||||
|
msgstr "leírás"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:82
|
||||||
|
msgid "Name:"
|
||||||
|
msgstr "Név:"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:83
|
||||||
|
msgid "Show this source in Taskbar"
|
||||||
|
msgstr "Mutassa a forrást a tálcán"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:84
|
||||||
|
msgid "Show name in Taskbar"
|
||||||
|
msgstr "Mutassa a nevet a tálcán"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:85
|
||||||
|
msgid "Show this source in ToolTip"
|
||||||
|
msgstr "Mutassa ezt a forrást a ToolTip-en."
|
||||||
|
|
||||||
|
#: sources/sysfreqsrc.cpp:33
|
||||||
|
msgid "This source is provided by the Linux kernel cpufreq subsystem."
|
||||||
|
msgstr "Ezt a forrást a Linux kernel cpufreq alrendszer szolgáltatja."
|
||||||
|
|
||||||
|
#: sources/uptimesrc.cpp:32
|
||||||
|
msgid "This source is provided by /proc/uptime."
|
||||||
|
msgstr "Ezt a forrást a /proc/uptime szolgáltatja."
|
||||||
|
|
||||||
|
#: sources/uptimesrc.cpp:61
|
||||||
|
msgid "%1d %2:%3"
|
||||||
|
msgstr "%1d %2:%3"
|
||||||
|
|
||||||
|
#: sources/uptimesrc.cpp:63
|
||||||
|
msgid "%1:%2"
|
||||||
|
msgstr "%1:%2"
|
@ -0,0 +1,208 @@
|
|||||||
|
# translation of id.po to Bahasa Indonesia
|
||||||
|
# This file is put in the public domain.
|
||||||
|
#
|
||||||
|
# Donnie S Bhayangkara <dsbhayangkara@gmail.com>, 2007.
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: id\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2007-03-19 18:43+0100\n"
|
||||||
|
"PO-Revision-Date: 2007-05-19 19:25+0700\n"
|
||||||
|
"Last-Translator: Donnie S Bhayangkara <dsbhayangkara@gmail.com>\n"
|
||||||
|
"Language-Team: Bahasa Indonesia <id@li.org>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"X-Generator: KBabel 1.11.4\n"
|
||||||
|
|
||||||
|
#: _translatorinfo.cpp:1
|
||||||
|
msgid ""
|
||||||
|
"_: NAME OF TRANSLATORS\n"
|
||||||
|
"Your names"
|
||||||
|
msgstr "Donnie S Bhayangkara"
|
||||||
|
|
||||||
|
#: _translatorinfo.cpp:3
|
||||||
|
msgid ""
|
||||||
|
"_: EMAIL OF TRANSLATORS\n"
|
||||||
|
"Your emails"
|
||||||
|
msgstr "dsbhayangkara@gmail.com"
|
||||||
|
|
||||||
|
#: kima.cpp:152
|
||||||
|
msgid "Kima"
|
||||||
|
msgstr "Kima"
|
||||||
|
|
||||||
|
#: kima.cpp:155
|
||||||
|
msgid "&Performance Profiles"
|
||||||
|
msgstr "Profil &Kinerja"
|
||||||
|
|
||||||
|
#: kima.cpp:161
|
||||||
|
msgid "&Preferences"
|
||||||
|
msgstr "&Preferensi"
|
||||||
|
|
||||||
|
#: kima.cpp:165
|
||||||
|
msgid "&About Kima"
|
||||||
|
msgstr "&Tentang Kima"
|
||||||
|
|
||||||
|
#: kima.cpp:206
|
||||||
|
msgid ""
|
||||||
|
"Kicker monitoring applet.\n"
|
||||||
|
"\n"
|
||||||
|
"This applet monitors various temperature, frequency and fan sources.\n"
|
||||||
|
"Make sure you have enabled a supported kernel module.\n"
|
||||||
|
msgstr ""
|
||||||
|
"Applet pemantau untuk Kicker.\n"
|
||||||
|
"\n"
|
||||||
|
"Applet ini memantau berbagai sumber temperatur, frekuensi dan putaran kipas.\n"
|
||||||
|
"Pastikan anda telah menyalakan modul kernel terkait.\n"
|
||||||
|
|
||||||
|
#: kima.cpp:213
|
||||||
|
msgid "cpufreqd control module"
|
||||||
|
msgstr "modul pengendali cpufreqd"
|
||||||
|
|
||||||
|
#: kima.cpp:234
|
||||||
|
msgid "This is a help box"
|
||||||
|
msgstr "Ini adalah kotak bantuan"
|
||||||
|
|
||||||
|
#: kima.cpp:468
|
||||||
|
msgid "Sources:"
|
||||||
|
msgstr "Sumber-sumber:"
|
||||||
|
|
||||||
|
#. i18n: file prefs.ui line 36
|
||||||
|
#: prefs.cpp:38 prefs.cpp:68 rc.cpp:6
|
||||||
|
#, no-c-format
|
||||||
|
msgid "Source"
|
||||||
|
msgstr "Sumber"
|
||||||
|
|
||||||
|
#. i18n: file prefs.ui line 17
|
||||||
|
#: prefs.cpp:67 rc.cpp:3
|
||||||
|
#, no-c-format
|
||||||
|
msgid "Preferences"
|
||||||
|
msgstr "Preferensi"
|
||||||
|
|
||||||
|
#: cpufreqd/cpufreqd.cpp:41
|
||||||
|
msgid "Select dynamically"
|
||||||
|
msgstr "Pilih secara dinamis"
|
||||||
|
|
||||||
|
#: cpufreqd/cpufreqd.cpp:123
|
||||||
|
msgid "Can't talk to cpufreqd"
|
||||||
|
msgstr "Tidak dapat menghubungi cpufreqd"
|
||||||
|
|
||||||
|
#: sources/acpithermalsrc.cpp:32
|
||||||
|
msgid "This source is provided by the Linux ACPI Thermal Zone driver."
|
||||||
|
msgstr "Sumber ini didapat dari penggerak Linux ACPI Thermal Zone."
|
||||||
|
|
||||||
|
#: sources/acpithermalsrc.cpp:55 sources/cpuinfofreqsrc.cpp:47
|
||||||
|
#: sources/hddtempsrc.cpp:78 sources/hwmonfansrc.cpp:82
|
||||||
|
#: sources/hwmonthermalsrc.cpp:82 sources/i8ksrc.cpp:62
|
||||||
|
#: sources/ibmacpifansrc.cpp:47 sources/ibmacpithermalsrc.cpp:58
|
||||||
|
#: sources/ibmhdaps.cpp:55 sources/ibookg4thermalsrc.cpp:54
|
||||||
|
#: sources/labelsource.cpp:130 sources/nvidiathermalsrc.cpp:87
|
||||||
|
#: sources/nvidiathermalsrc.cpp:99 sources/omnibookthermalsrc.cpp:48
|
||||||
|
#: sources/sysfreqsrc.cpp:58 sources/uptimesrc.cpp:47
|
||||||
|
msgid "n/a"
|
||||||
|
msgstr "tidak tersedia"
|
||||||
|
|
||||||
|
#: sources/cpuinfofreqsrc.cpp:32
|
||||||
|
msgid "This source is provided by the Linux kernel proc vfs interface."
|
||||||
|
msgstr "Sumber ini didapat dari antar muka proc vfs kernel Linux."
|
||||||
|
|
||||||
|
#: sources/hddtempsrc.cpp:41
|
||||||
|
msgid "This source is provided by hddtemp. (%1, %2)"
|
||||||
|
msgstr "Sumber ini didapat dari hddtemp. (%1, %2)"
|
||||||
|
|
||||||
|
#: sources/hwmonfansrc.cpp:33
|
||||||
|
msgid "This fan source is provided by hwmon. (%1)"
|
||||||
|
msgstr "Sumber putaran kipas ini didapat dari hwmon. (%1)"
|
||||||
|
|
||||||
|
#: sources/hwmonthermalsrc.cpp:33
|
||||||
|
msgid "This thermal source is provided by hwmon. (%1)"
|
||||||
|
msgstr "Sumber suhu ini didapat dari hwmon. (%1)"
|
||||||
|
|
||||||
|
#: sources/i8ksrc.cpp:33
|
||||||
|
msgid "This source is provided by i8k kernel module."
|
||||||
|
msgstr "Sumber ini didapat dari modul kernel i8k."
|
||||||
|
|
||||||
|
#: sources/ibmacpifansrc.cpp:32 sources/ibmacpithermalsrc.cpp:34
|
||||||
|
msgid "This source is provided by the ACPI driver for IBM ThinkPads."
|
||||||
|
msgstr "Sumber ini didapat dari penggerak ACPI untuk IBM ThinkPads."
|
||||||
|
|
||||||
|
#: sources/ibmhdaps.cpp:32
|
||||||
|
msgid "This thermal source is provided by the IBM HDAPS driver."
|
||||||
|
msgstr "Sumber suhu ini didapat dari penggerak IBM HDAPS."
|
||||||
|
|
||||||
|
#: sources/ibookg4thermalsrc.cpp:32
|
||||||
|
msgid "This source shows a thermal sensor of your iBook."
|
||||||
|
msgstr "Sumber ini menunjukkan sensor suhu iBook anda."
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:97
|
||||||
|
msgid "LabelSourcePrefs"
|
||||||
|
msgstr "LabelSourcePrefs"
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:98
|
||||||
|
msgid ""
|
||||||
|
"<br>\n"
|
||||||
|
"Taskbar visual settings"
|
||||||
|
msgstr ""
|
||||||
|
"<br>\n"
|
||||||
|
"Pengaturan visual untuk Taskbar"
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:100
|
||||||
|
msgid "Foreground color:"
|
||||||
|
msgstr "Warna latar depan:"
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:102
|
||||||
|
msgid "Font:"
|
||||||
|
msgstr "Huruf:"
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:103
|
||||||
|
msgid "Alignment:"
|
||||||
|
msgstr "Penjajaran:"
|
||||||
|
|
||||||
|
#: sources/nvidiathermalsrc.cpp:33
|
||||||
|
msgid "This source is provided by the nVidia GPU card driver tools"
|
||||||
|
msgstr "Sumber ini didapat dari peralatan penggerak kartu nVidia GPU"
|
||||||
|
|
||||||
|
#: sources/omnibookthermalsrc.cpp:32
|
||||||
|
msgid "This source is provided by the Omnibook Configuration Tools & Patches."
|
||||||
|
msgstr "Sumber ini didapat dari peralatan & tambalan konfigurasi Omnibook."
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:80
|
||||||
|
msgid "SourcePrefs"
|
||||||
|
msgstr "SourcePrefs"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:81
|
||||||
|
msgid "description"
|
||||||
|
msgstr "deskripsi"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:82
|
||||||
|
msgid "Name:"
|
||||||
|
msgstr "Nama:"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:83
|
||||||
|
msgid "Show this source in Taskbar"
|
||||||
|
msgstr "Tunjukkan sumber ini pada Taskbar"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:84
|
||||||
|
msgid "Show name in Taskbar"
|
||||||
|
msgstr "Tunjukkan nama pada Taskbar"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:85
|
||||||
|
msgid "Show this source in ToolTip"
|
||||||
|
msgstr "Tunjukkan sumber ini pada ToolTip"
|
||||||
|
|
||||||
|
#: sources/sysfreqsrc.cpp:33
|
||||||
|
msgid "This source is provided by the Linux kernel cpufreq subsystem."
|
||||||
|
msgstr "Sumber ini didapat dari subsistem cpufreq kernel Linux."
|
||||||
|
|
||||||
|
#: sources/uptimesrc.cpp:32
|
||||||
|
msgid "This source is provided by /proc/uptime."
|
||||||
|
msgstr "Sumber ini didapat dari /proc/uptime."
|
||||||
|
|
||||||
|
#: sources/uptimesrc.cpp:61
|
||||||
|
msgid "%1d %2:%3"
|
||||||
|
msgstr "%1d %2:%3"
|
||||||
|
|
||||||
|
#: sources/uptimesrc.cpp:63
|
||||||
|
msgid "%1:%2"
|
||||||
|
msgstr "%1:%2"
|
||||||
|
|
@ -0,0 +1,201 @@
|
|||||||
|
# SOME DESCRIPTIVE TITLE.
|
||||||
|
# This file is put in the public domain.
|
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
|
#
|
||||||
|
#, fuzzy
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2007-03-19 18:43+0100\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#: _translatorinfo.cpp:1
|
||||||
|
msgid ""
|
||||||
|
"_: NAME OF TRANSLATORS\n"
|
||||||
|
"Your names"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: _translatorinfo.cpp:3
|
||||||
|
msgid ""
|
||||||
|
"_: EMAIL OF TRANSLATORS\n"
|
||||||
|
"Your emails"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kima.cpp:152
|
||||||
|
msgid "Kima"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kima.cpp:155
|
||||||
|
msgid "&Performance Profiles"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kima.cpp:161
|
||||||
|
msgid "&Preferences"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kima.cpp:165
|
||||||
|
msgid "&About Kima"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kima.cpp:206
|
||||||
|
msgid ""
|
||||||
|
"Kicker monitoring applet.\n"
|
||||||
|
"\n"
|
||||||
|
"This applet monitors various temperature, frequency and fan sources.\n"
|
||||||
|
"Make sure you have enabled a supported kernel module.\n"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kima.cpp:213
|
||||||
|
msgid "cpufreqd control module"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kima.cpp:234
|
||||||
|
msgid "This is a help box"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kima.cpp:468
|
||||||
|
msgid "Sources:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. i18n: file prefs.ui line 36
|
||||||
|
#: prefs.cpp:38 prefs.cpp:68 rc.cpp:6
|
||||||
|
#, no-c-format
|
||||||
|
msgid "Source"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. i18n: file prefs.ui line 17
|
||||||
|
#: prefs.cpp:67 rc.cpp:3
|
||||||
|
#, no-c-format
|
||||||
|
msgid "Preferences"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: cpufreqd/cpufreqd.cpp:41
|
||||||
|
msgid "Select dynamically"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: cpufreqd/cpufreqd.cpp:123
|
||||||
|
msgid "Can't talk to cpufreqd"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/acpithermalsrc.cpp:32
|
||||||
|
msgid "This source is provided by the Linux ACPI Thermal Zone driver."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/acpithermalsrc.cpp:55 sources/cpuinfofreqsrc.cpp:47
|
||||||
|
#: sources/hddtempsrc.cpp:78 sources/hwmonfansrc.cpp:82
|
||||||
|
#: sources/hwmonthermalsrc.cpp:82 sources/i8ksrc.cpp:62
|
||||||
|
#: sources/ibmacpifansrc.cpp:47 sources/ibmacpithermalsrc.cpp:58
|
||||||
|
#: sources/ibmhdaps.cpp:55 sources/ibookg4thermalsrc.cpp:54
|
||||||
|
#: sources/labelsource.cpp:130 sources/nvidiathermalsrc.cpp:87
|
||||||
|
#: sources/nvidiathermalsrc.cpp:99 sources/omnibookthermalsrc.cpp:48
|
||||||
|
#: sources/sysfreqsrc.cpp:58 sources/uptimesrc.cpp:47
|
||||||
|
msgid "n/a"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/cpuinfofreqsrc.cpp:32
|
||||||
|
msgid "This source is provided by the Linux kernel proc vfs interface."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/hddtempsrc.cpp:41
|
||||||
|
msgid "This source is provided by hddtemp. (%1, %2)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/hwmonfansrc.cpp:33
|
||||||
|
msgid "This fan source is provided by hwmon. (%1)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/hwmonthermalsrc.cpp:33
|
||||||
|
msgid "This thermal source is provided by hwmon. (%1)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/i8ksrc.cpp:33
|
||||||
|
msgid "This source is provided by i8k kernel module."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/ibmacpifansrc.cpp:32 sources/ibmacpithermalsrc.cpp:34
|
||||||
|
msgid "This source is provided by the ACPI driver for IBM ThinkPads."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/ibmhdaps.cpp:32
|
||||||
|
msgid "This thermal source is provided by the IBM HDAPS driver."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/ibookg4thermalsrc.cpp:32
|
||||||
|
msgid "This source shows a thermal sensor of your iBook."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:97
|
||||||
|
msgid "LabelSourcePrefs"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:98
|
||||||
|
msgid ""
|
||||||
|
"<br>\n"
|
||||||
|
"Taskbar visual settings"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:100
|
||||||
|
msgid "Foreground color:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:102
|
||||||
|
msgid "Font:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:103
|
||||||
|
msgid "Alignment:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/nvidiathermalsrc.cpp:33
|
||||||
|
msgid "This source is provided by the nVidia GPU card driver tools"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/omnibookthermalsrc.cpp:32
|
||||||
|
msgid "This source is provided by the Omnibook Configuration Tools & Patches."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:80
|
||||||
|
msgid "SourcePrefs"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:81
|
||||||
|
msgid "description"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:82
|
||||||
|
msgid "Name:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:83
|
||||||
|
msgid "Show this source in Taskbar"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:84
|
||||||
|
msgid "Show name in Taskbar"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:85
|
||||||
|
msgid "Show this source in ToolTip"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/sysfreqsrc.cpp:33
|
||||||
|
msgid "This source is provided by the Linux kernel cpufreq subsystem."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/uptimesrc.cpp:32
|
||||||
|
msgid "This source is provided by /proc/uptime."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/uptimesrc.cpp:61
|
||||||
|
msgid "%1d %2:%3"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sources/uptimesrc.cpp:63
|
||||||
|
msgid "%1:%2"
|
||||||
|
msgstr ""
|
@ -0,0 +1,209 @@
|
|||||||
|
# translation of sv.po to Svenska
|
||||||
|
# This file is put in the public domain.
|
||||||
|
#
|
||||||
|
# Oskar Ellström <logge@shell.linux.se>, 2007.
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: sv\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2007-03-19 18:43+0100\n"
|
||||||
|
"PO-Revision-Date: 2007-04-04 17:40+0200\n"
|
||||||
|
"Last-Translator: Oskar Ellström <logge@shell.linux.se>\n"
|
||||||
|
"Language-Team: Svenska\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"X-Generator: KBabel 1.11.4\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#: _translatorinfo.cpp:1
|
||||||
|
msgid ""
|
||||||
|
"_: NAME OF TRANSLATORS\n"
|
||||||
|
"Your names"
|
||||||
|
msgstr "Oskar Ellström"
|
||||||
|
|
||||||
|
#: _translatorinfo.cpp:3
|
||||||
|
msgid ""
|
||||||
|
"_: EMAIL OF TRANSLATORS\n"
|
||||||
|
"Your emails"
|
||||||
|
msgstr "logge@shell.linux.se"
|
||||||
|
|
||||||
|
#: kima.cpp:152
|
||||||
|
msgid "Kima"
|
||||||
|
msgstr "Kima"
|
||||||
|
|
||||||
|
#: kima.cpp:155
|
||||||
|
msgid "&Performance Profiles"
|
||||||
|
msgstr "&Prestanda Profiler"
|
||||||
|
|
||||||
|
#: kima.cpp:161
|
||||||
|
msgid "&Preferences"
|
||||||
|
msgstr "&Egenskaper"
|
||||||
|
|
||||||
|
#: kima.cpp:165
|
||||||
|
msgid "&About Kima"
|
||||||
|
msgstr "&Om Kima"
|
||||||
|
|
||||||
|
#: kima.cpp:206
|
||||||
|
msgid ""
|
||||||
|
"Kicker monitoring applet.\n"
|
||||||
|
"\n"
|
||||||
|
"This applet monitors various temperature, frequency and fan sources.\n"
|
||||||
|
"Make sure you have enabled a supported kernel module.\n"
|
||||||
|
msgstr ""
|
||||||
|
"Övervaknings-miniprogram för Kicker.\n"
|
||||||
|
"\n"
|
||||||
|
"Detta miniprogram övervakar olika temperatur-, frekvens- och fläktkällor.\n"
|
||||||
|
"Kontrollera att rätt moduler i kärnan är laddade.\n"
|
||||||
|
|
||||||
|
#: kima.cpp:213
|
||||||
|
msgid "cpufreqd control module"
|
||||||
|
msgstr "cpufreqd kontrol modul"
|
||||||
|
|
||||||
|
#: kima.cpp:234
|
||||||
|
msgid "This is a help box"
|
||||||
|
msgstr "Det här är en hjälpruta"
|
||||||
|
|
||||||
|
#: kima.cpp:468
|
||||||
|
msgid "Sources:"
|
||||||
|
msgstr "Källor:"
|
||||||
|
|
||||||
|
#. i18n: file prefs.ui line 36
|
||||||
|
#: prefs.cpp:38 prefs.cpp:68 rc.cpp:6
|
||||||
|
#, no-c-format
|
||||||
|
msgid "Source"
|
||||||
|
msgstr "Källa"
|
||||||
|
|
||||||
|
#. i18n: file prefs.ui line 17
|
||||||
|
#: prefs.cpp:67 rc.cpp:3
|
||||||
|
#, no-c-format
|
||||||
|
msgid "Preferences"
|
||||||
|
msgstr "Egenskaper"
|
||||||
|
|
||||||
|
#: cpufreqd/cpufreqd.cpp:41
|
||||||
|
msgid "Select dynamically"
|
||||||
|
msgstr "Välj dynamiskt"
|
||||||
|
|
||||||
|
#: cpufreqd/cpufreqd.cpp:123
|
||||||
|
msgid "Can't talk to cpufreqd"
|
||||||
|
msgstr "Kan inte prata med cpufreqd"
|
||||||
|
|
||||||
|
#: sources/acpithermalsrc.cpp:32
|
||||||
|
msgid "This source is provided by the Linux ACPI Thermal Zone driver."
|
||||||
|
msgstr "Den här källan förses av drivrutinen för Linux ACPI Thermal Zone."
|
||||||
|
|
||||||
|
#: sources/acpithermalsrc.cpp:55 sources/cpuinfofreqsrc.cpp:47
|
||||||
|
#: sources/hddtempsrc.cpp:78 sources/hwmonfansrc.cpp:82
|
||||||
|
#: sources/hwmonthermalsrc.cpp:82 sources/i8ksrc.cpp:62
|
||||||
|
#: sources/ibmacpifansrc.cpp:47 sources/ibmacpithermalsrc.cpp:58
|
||||||
|
#: sources/ibmhdaps.cpp:55 sources/ibookg4thermalsrc.cpp:54
|
||||||
|
#: sources/labelsource.cpp:130 sources/nvidiathermalsrc.cpp:87
|
||||||
|
#: sources/nvidiathermalsrc.cpp:99 sources/omnibookthermalsrc.cpp:48
|
||||||
|
#: sources/sysfreqsrc.cpp:58 sources/uptimesrc.cpp:47
|
||||||
|
msgid "n/a"
|
||||||
|
msgstr "n/a"
|
||||||
|
|
||||||
|
#: sources/cpuinfofreqsrc.cpp:32
|
||||||
|
msgid "This source is provided by the Linux kernel proc vfs interface."
|
||||||
|
msgstr "Den här källan förses av proc vfs-gränssnittet i Linux-kärnan"
|
||||||
|
|
||||||
|
#: sources/hddtempsrc.cpp:41
|
||||||
|
msgid "This source is provided by hddtemp. (%1, %2)"
|
||||||
|
msgstr "Den här källan förses av hddtemp. (%1, %2)"
|
||||||
|
|
||||||
|
#: sources/hwmonfansrc.cpp:33
|
||||||
|
msgid "This fan source is provided by hwmon. (%1)"
|
||||||
|
msgstr "Den här källan förses av hwmon. (%1)"
|
||||||
|
|
||||||
|
#: sources/hwmonthermalsrc.cpp:33
|
||||||
|
msgid "This thermal source is provided by hwmon. (%1)"
|
||||||
|
msgstr "Den här källan förses av hwmon. (%1)"
|
||||||
|
|
||||||
|
#: sources/i8ksrc.cpp:33
|
||||||
|
msgid "This source is provided by i8k kernel module."
|
||||||
|
msgstr "Den här källan förses av kärnmodulen i8k."
|
||||||
|
|
||||||
|
#: sources/ibmacpifansrc.cpp:32 sources/ibmacpithermalsrc.cpp:34
|
||||||
|
msgid "This source is provided by the ACPI driver for IBM ThinkPads."
|
||||||
|
msgstr "Den här källan förses av ACPI-drivrutinen för IBM ThinkPads."
|
||||||
|
|
||||||
|
#: sources/ibmhdaps.cpp:32
|
||||||
|
msgid "This thermal source is provided by the IBM HDAPS driver."
|
||||||
|
msgstr "Den här termiska källan förses av drivrutinen för IBM HDAPS."
|
||||||
|
|
||||||
|
#: sources/ibookg4thermalsrc.cpp:32
|
||||||
|
msgid "This source shows a thermal sensor of your iBook."
|
||||||
|
msgstr "Den här källan visar en termisk sensor i din iBook."
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:97
|
||||||
|
msgid "LabelSourcePrefs"
|
||||||
|
msgstr "LabelSourcePrefs"
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:98
|
||||||
|
msgid ""
|
||||||
|
"<br>\n"
|
||||||
|
"Taskbar visual settings"
|
||||||
|
msgstr ""
|
||||||
|
"<br>\n"
|
||||||
|
"Aktivitetsfältets visuella inställningar"
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:100
|
||||||
|
msgid "Foreground color:"
|
||||||
|
msgstr "Förgrundsfärg:"
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:102
|
||||||
|
msgid "Font:"
|
||||||
|
msgstr "Teckensnitt:"
|
||||||
|
|
||||||
|
#: sources/labelsourcePrefs.cpp:103
|
||||||
|
msgid "Alignment:"
|
||||||
|
msgstr "Justering:"
|
||||||
|
|
||||||
|
#: sources/nvidiathermalsrc.cpp:33
|
||||||
|
msgid "This source is provided by the nVidia GPU card driver tools"
|
||||||
|
msgstr "Den här källan förses av nVidia Grafikkortets drivrutinsverktyg"
|
||||||
|
|
||||||
|
#: sources/omnibookthermalsrc.cpp:32
|
||||||
|
msgid "This source is provided by the Omnibook Configuration Tools & Patches."
|
||||||
|
msgstr "Den här källan förses av Omnibook Configuration Tools & Patches."
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:80
|
||||||
|
msgid "SourcePrefs"
|
||||||
|
msgstr "Källegenskaper"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:81
|
||||||
|
msgid "description"
|
||||||
|
msgstr "beskrivning"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:82
|
||||||
|
msgid "Name:"
|
||||||
|
msgstr "Namn:"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:83
|
||||||
|
msgid "Show this source in Taskbar"
|
||||||
|
msgstr "Visa den här källan i Aktivitetsfältet"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:84
|
||||||
|
msgid "Show name in Taskbar"
|
||||||
|
msgstr "Visa namet i Aktivitetsfältet"
|
||||||
|
|
||||||
|
#: sources/sourceprefs.cpp:85
|
||||||
|
msgid "Show this source in ToolTip"
|
||||||
|
msgstr "Visa den här källan i ToolTip"
|
||||||
|
|
||||||
|
#: sources/sysfreqsrc.cpp:33
|
||||||
|
msgid "This source is provided by the Linux kernel cpufreq subsystem."
|
||||||
|
msgstr "Den här källan är försedd av Linux-kärnans subsystem för cpufreq."
|
||||||
|
|
||||||
|
#: sources/uptimesrc.cpp:32
|
||||||
|
msgid "This source is provided by /proc/uptime."
|
||||||
|
msgstr "Den här källan förses av /proc/uptime."
|
||||||
|
|
||||||
|
#: sources/uptimesrc.cpp:61
|
||||||
|
msgid "%1d %2:%3"
|
||||||
|
msgstr "%1d %2:%3"
|
||||||
|
|
||||||
|
#: sources/uptimesrc.cpp:63
|
||||||
|
msgid "%1:%2"
|
||||||
|
msgstr "%1:%2"
|
||||||
|
|
@ -0,0 +1,25 @@
|
|||||||
|
INCLUDES = -I$(top_srcdir)/src/cpufreqd -I$(top_srcdir)/src/sources \
|
||||||
|
$(all_includes)
|
||||||
|
METASOURCES = AUTO
|
||||||
|
|
||||||
|
kde_module_LTLIBRARIES = libkima.la
|
||||||
|
|
||||||
|
libkima_la_SOURCES = kima.cpp flowlayout.cpp sourcelistitem.cpp prefs.ui
|
||||||
|
libkima_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
|
||||||
|
libkima_la_LIBADD = $(top_builddir)/src/cpufreqd/libcpufreqd.la \
|
||||||
|
$(top_builddir)/src/sources/libsources.la $(LIB_KDEUI)
|
||||||
|
|
||||||
|
kima_DATA = kima.desktop
|
||||||
|
kimadir = $(kde_datadir)/kicker/applets
|
||||||
|
|
||||||
|
KDE_ICON = hwinfo
|
||||||
|
EXTRA_DIST = $(kima_DATA)
|
||||||
|
|
||||||
|
messages: rc.cpp
|
||||||
|
$(XGETTEXT) *.cpp */*.cpp -o $(podir)/kima.pot
|
||||||
|
noinst_HEADERS = kima.h flowlayout.h sourcelistitem.h
|
||||||
|
|
||||||
|
SUBDIRS = cpufreqd sources
|
||||||
|
|
||||||
|
AM_CXXFLAGS = @libhal_CFLAGS@
|
||||||
|
LIBS += @libhal_LIBS@
|
@ -0,0 +1,8 @@
|
|||||||
|
INCLUDES = -I$(top_srcdir)/src/cpufreqd -I$(top_srcdir)/src/sources $(all_includes)
|
||||||
|
METASOURCES = AUTO
|
||||||
|
libcpufreqd_la_LDFLAGS = $(all_libraries)
|
||||||
|
noinst_LTLIBRARIES = libcpufreqd.la
|
||||||
|
libcpufreqd_la_SOURCES = cpufreqd.cpp cpufreqdconnection.cpp \
|
||||||
|
cpufreqdprofile.cpp
|
||||||
|
noinst_HEADERS = cpufreqd.h cpufreqdconnection.h cpufreqdprofile.h cpufreqd.h \
|
||||||
|
cpufreqdconnection.h cpufreqdprofile.h
|
@ -0,0 +1,156 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Valentine Sinitsyn *
|
||||||
|
* e_val@inbox.ru *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "cpufreqd.h"
|
||||||
|
#include <qdir.h>
|
||||||
|
#include <qkeysequence.h>
|
||||||
|
#include <qstringlist.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
|
||||||
|
#define CHUNK_SIZE 4096
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cpufreqd control module main class
|
||||||
|
*@author: Valentine Sinitsyn (Valentine.Sinitsyn@usu.ru)
|
||||||
|
*@todo: We assume that cpufreqd is in dynamic mode when applet is started because as for now it has
|
||||||
|
* no means to detect mode. This could lead to inconsistency if, ex. applet is restarted after making
|
||||||
|
* some changes to cpufreqd state.
|
||||||
|
*/
|
||||||
|
|
||||||
|
CPUFreqd::CPUFreqd() {
|
||||||
|
m_menu = new QPopupMenu();
|
||||||
|
QObject::connect(m_menu, SIGNAL(aboutToShow()), this, SLOT(updateMenu()));
|
||||||
|
|
||||||
|
m_dynamic = new QAction(i18n("Select dynamically"), QKeySequence(), this);
|
||||||
|
QObject::connect(m_dynamic, SIGNAL(activated()), this, SLOT(setDynamic()));
|
||||||
|
m_dynamic->setToggleAction(true);
|
||||||
|
m_dynamic->setOn(true);
|
||||||
|
|
||||||
|
m_items = new QActionGroup(this);
|
||||||
|
m_items->setExclusive(true);
|
||||||
|
|
||||||
|
m_actions = new QPtrList<QAction>();
|
||||||
|
m_actions->setAutoDelete(true);
|
||||||
|
|
||||||
|
m_mapper = new QSignalMapper(this);
|
||||||
|
QObject::connect(m_mapper, SIGNAL(mapped(int)), this, SLOT(setProfile(int)));
|
||||||
|
}
|
||||||
|
|
||||||
|
CPUFreqd::~CPUFreqd() {
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CPUFreqd::enabled() const {
|
||||||
|
return m_conn.available();
|
||||||
|
}
|
||||||
|
|
||||||
|
QValueVector<CPUFreqdProfile> & CPUFreqd::getProfiles(bool reconnect) {
|
||||||
|
char chunk[CHUNK_SIZE];
|
||||||
|
QString buffer;
|
||||||
|
|
||||||
|
if (!m_profiles.empty())
|
||||||
|
m_profiles.clear();
|
||||||
|
|
||||||
|
if (!m_conn.open())
|
||||||
|
if (reconnect) {
|
||||||
|
m_dynamic->setOn(m_conn.lookup());
|
||||||
|
return getProfiles(false);
|
||||||
|
} else {
|
||||||
|
return m_profiles;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_conn.write(CMD_LIST_PROFILES, 0))
|
||||||
|
return m_profiles;
|
||||||
|
|
||||||
|
int bytes = 0;
|
||||||
|
while ( (bytes = m_conn.read(chunk, CHUNK_SIZE - 1)) ) {
|
||||||
|
chunk[bytes] = '\0';
|
||||||
|
buffer.append(chunk);
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList profiles = QStringList::split("\n", buffer);
|
||||||
|
for (QStringList::Iterator it = profiles.begin(); it != profiles.end(); it++)
|
||||||
|
m_profiles.push_back( CPUFreqdProfile(*it) );
|
||||||
|
|
||||||
|
m_conn.close();
|
||||||
|
|
||||||
|
return m_profiles;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPopupMenu* CPUFreqd::menu() {
|
||||||
|
return m_menu;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPUFreqd::updateMenu() {
|
||||||
|
QAction *cur;
|
||||||
|
|
||||||
|
m_menu->clear();
|
||||||
|
m_actions->clear();
|
||||||
|
|
||||||
|
getProfiles(true);
|
||||||
|
if (!m_profiles.isEmpty()) {
|
||||||
|
m_dynamic->addTo(m_menu);
|
||||||
|
m_menu->insertSeparator();
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i < m_profiles.count(); i++)
|
||||||
|
if (m_profiles[i].isValid()) {
|
||||||
|
cur = new QAction(m_profiles[i].name(), QKeySequence(), m_items);
|
||||||
|
QObject::connect(cur, SIGNAL(activated()), m_mapper, SLOT(map()));
|
||||||
|
cur->setToggleAction(true);
|
||||||
|
cur->setOn(m_profiles[i].active());
|
||||||
|
|
||||||
|
m_mapper->setMapping(cur, i+1);
|
||||||
|
m_actions->append(cur);
|
||||||
|
}
|
||||||
|
m_items->addTo(m_menu);
|
||||||
|
} else {
|
||||||
|
int errmsg = m_menu->insertItem(i18n("Can't talk to cpufreqd"), 0, 0);
|
||||||
|
m_menu->setItemEnabled(errmsg, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPUFreqd::setManual() {
|
||||||
|
setMode(ARG_MANUAL);
|
||||||
|
m_dynamic->setOn(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPUFreqd::setDynamic() {
|
||||||
|
setMode(ARG_DYNAMIC);
|
||||||
|
m_dynamic->setOn(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPUFreqd::setProfile(int id) {
|
||||||
|
//@fixme: make it return bool and bail out if it falis
|
||||||
|
if (m_dynamic->isOn())
|
||||||
|
setManual();
|
||||||
|
|
||||||
|
if (!m_conn.open())
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_conn.write(CMD_SET_PROFILE, (uint32_t)id);
|
||||||
|
m_conn.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPUFreqd::setMode(uint32_t mode) {
|
||||||
|
if (!m_conn.open())
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_conn.write(CMD_SET_MODE, mode);
|
||||||
|
m_conn.close();
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Valentine Sinitsyn *
|
||||||
|
* e_val@inbox.ru *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
#ifndef CPUFREQD_H
|
||||||
|
#define CPUFREQD_H
|
||||||
|
|
||||||
|
#include "cpufreqdconnection.h"
|
||||||
|
#include "cpufreqdprofile.h"
|
||||||
|
#include <qaction.h>
|
||||||
|
#include <qobject.h>
|
||||||
|
#include <qpopupmenu.h>
|
||||||
|
#include <qstring.h>
|
||||||
|
#include <qsignalmapper.h>
|
||||||
|
#include <qvaluevector.h>
|
||||||
|
#include <qptrlist.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
class CPUFreqd: public QObject {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
CPUFreqd();
|
||||||
|
virtual ~CPUFreqd();
|
||||||
|
|
||||||
|
bool enabled() const;
|
||||||
|
QValueVector<CPUFreqdProfile> & getProfiles(bool reconnect = false);
|
||||||
|
QPopupMenu* menu();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void setManual();
|
||||||
|
void setDynamic();
|
||||||
|
void setProfile(int id);
|
||||||
|
|
||||||
|
private:
|
||||||
|
CPUFreqdConnection m_conn;
|
||||||
|
QValueVector<CPUFreqdProfile> m_profiles;
|
||||||
|
QPopupMenu *m_menu;
|
||||||
|
QSignalMapper *m_mapper;
|
||||||
|
QAction* m_dynamic;
|
||||||
|
QActionGroup* m_items;
|
||||||
|
QPtrList<QAction>* m_actions;
|
||||||
|
|
||||||
|
void setMode(uint32_t mode);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void updateMenu();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,125 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Valentine Sinitsyn *
|
||||||
|
* e_val@inbox.ru *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "cpufreqdconnection.h"
|
||||||
|
|
||||||
|
#include <qdir.h>
|
||||||
|
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <sys/un.h>
|
||||||
|
|
||||||
|
/* Excerpt from cpufreqd_remote.h (cpufreqd-2.0.0)
|
||||||
|
*
|
||||||
|
* Copyright (C) 2005 Mattia Dongili <malattia@linux.it>
|
||||||
|
* Hrvoje Zeba <hrvoje@boo.mi2.hr>
|
||||||
|
*
|
||||||
|
* Format:
|
||||||
|
* it is an uint32_t used as bitmask
|
||||||
|
*
|
||||||
|
* 31-16 15-0
|
||||||
|
* <command> <arguments>
|
||||||
|
*
|
||||||
|
* The response may be longer than a single line and is
|
||||||
|
* terminated by the RESPONSE_END (see defines).
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define CMD_SHIFT 16
|
||||||
|
#define ARG_MASK 0x0000ffff
|
||||||
|
|
||||||
|
#define REMOTE_CMD(c) (c >> CMD_SHIFT)
|
||||||
|
#define REMOTE_ARG(c) (c & ARG_MASK)
|
||||||
|
#define MAKE_COMMAND(cmd, arg) ((cmd << CMD_SHIFT) | arg)
|
||||||
|
#define INVALID_CMD 0xffffffff
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class encapsulates cpufreqd connection performed via Unix sockets
|
||||||
|
*@author: Valentine Sinitsyn (Valentine.Sinitsyn@usu.ru)
|
||||||
|
*/
|
||||||
|
|
||||||
|
CPUFreqdConnection::CPUFreqdConnection(): m_fd(-1) {
|
||||||
|
lookup();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CPUFreqdConnection::~CPUFreqdConnection() {
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CPUFreqdConnection::open() {
|
||||||
|
struct sockaddr_un sck;
|
||||||
|
|
||||||
|
// socket name is too long - it can't be copied to to sun_path
|
||||||
|
if (m_socket.isEmpty() || m_socket.length() >= 108)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (m_fd > 0)
|
||||||
|
close();
|
||||||
|
|
||||||
|
if ((m_fd = socket(PF_UNIX, SOCK_STREAM, 0)) == -1)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
sck.sun_family = AF_UNIX;
|
||||||
|
//It is guaranted that socket.ascii() is shorter than 108 bytes, but we want to be sure
|
||||||
|
strncpy(sck.sun_path, m_socket.ascii(), 108);
|
||||||
|
|
||||||
|
if (::connect(m_fd, (struct sockaddr *)&sck, sizeof(sck)) == -1)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
ssize_t CPUFreqdConnection::read(void *buf, size_t size) {
|
||||||
|
return ::read(m_fd, buf, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CPUFreqdConnection::write(uint32_t cmd, uint32_t arg) {
|
||||||
|
uint32_t command;
|
||||||
|
|
||||||
|
command = MAKE_COMMAND(cmd, arg);
|
||||||
|
return (::write(m_fd, &command, sizeof(command)) == (int)sizeof(command));
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPUFreqdConnection::close() {
|
||||||
|
::close(m_fd);
|
||||||
|
m_fd = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CPUFreqdConnection::available() const {
|
||||||
|
return !m_socket.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CPUFreqdConnection::lookup() {
|
||||||
|
QString candidate;
|
||||||
|
QDir tmp("/tmp", "cpufreqd-*", QDir::Time, QDir::Dirs);
|
||||||
|
|
||||||
|
if (tmp.count())
|
||||||
|
candidate = "/tmp/" + tmp[0] + "/cpufreqd";
|
||||||
|
|
||||||
|
if (candidate != m_socket) {
|
||||||
|
m_socket = candidate;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Valentine Sinitsyn *
|
||||||
|
* e_val@inbox.ru *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
#ifndef CPUFREQDCONNECTION_H
|
||||||
|
#define CPUFREQDCONNECTION_H
|
||||||
|
|
||||||
|
#include <qstring.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
/* Excerpt from cpufreqd_remote.h (cpufreqd-2.0.0)
|
||||||
|
*
|
||||||
|
* Copyright (C) 2005 Mattia Dongili <malattia@linux.it>
|
||||||
|
* Hrvoje Zeba <hrvoje@boo.mi2.hr>
|
||||||
|
*
|
||||||
|
* Format:
|
||||||
|
* it is an uint32_t used as bitmask
|
||||||
|
*
|
||||||
|
* 31-16 15-0
|
||||||
|
* <command> <arguments>
|
||||||
|
*
|
||||||
|
* The response may be longer than a single line and is
|
||||||
|
* terminated by the RESPONSE_END (see defines).
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define CMD_UPDATE_STATE 1 /* no arguments */
|
||||||
|
#define CMD_SET_PROFILE 2 /* <profile index> */
|
||||||
|
#define CMD_LIST_PROFILES 3 /* no arguments */
|
||||||
|
#define CMD_SET_RULE 4 /* <rule index> */
|
||||||
|
#define CMD_LIST_RULES 5 /* no arguments */
|
||||||
|
#define CMD_SET_MODE 6 /* <mode> */
|
||||||
|
|
||||||
|
#define ARG_DYNAMIC (1)
|
||||||
|
#define ARG_MANUAL (2)
|
||||||
|
|
||||||
|
class CPUFreqdConnection{
|
||||||
|
public:
|
||||||
|
CPUFreqdConnection();
|
||||||
|
~CPUFreqdConnection();
|
||||||
|
|
||||||
|
bool open();
|
||||||
|
ssize_t read(void *buf, size_t size);
|
||||||
|
bool write(uint32_t cmd, uint32_t arg);
|
||||||
|
void close();
|
||||||
|
|
||||||
|
bool available() const;
|
||||||
|
bool lookup();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString m_socket;
|
||||||
|
int m_fd;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,67 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Valentine Sinitsyn *
|
||||||
|
* e_val@inbox.ru *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "cpufreqdprofile.h"
|
||||||
|
#include <qstringlist.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class encapsulates cpufreqd profile data: name, frequencies and governors
|
||||||
|
*@author: Valentine Sinitsyn (Valentine.Sinitsyn@usu.ru)
|
||||||
|
*/
|
||||||
|
|
||||||
|
CPUFreqdProfile::CPUFreqdProfile(QString & descr) {
|
||||||
|
QStringList fields = QStringList::split("/", descr);
|
||||||
|
|
||||||
|
//@fixme: if name contains a slash, the results will be incorrect
|
||||||
|
if (fields.count() == 5) {
|
||||||
|
m_active = fields[0].toInt();
|
||||||
|
m_name = fields[1];
|
||||||
|
m_minfreq = fields[2].toInt();
|
||||||
|
m_maxfreq = fields[3].toInt();
|
||||||
|
m_policy = fields[4];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CPUFreqdProfile::~ CPUFreqdProfile() {
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CPUFreqdProfile::isValid() const {
|
||||||
|
return (!m_name.isEmpty() && !m_policy.isEmpty() && m_minfreq <= m_maxfreq);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CPUFreqdProfile::active() const {
|
||||||
|
return (m_active == 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString & CPUFreqdProfile::name() const {
|
||||||
|
return m_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CPUFreqdProfile::minfreq() const {
|
||||||
|
return m_minfreq;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CPUFreqdProfile::maxfreq() const {
|
||||||
|
return m_maxfreq;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString & CPUFreqdProfile::policy() const {
|
||||||
|
return m_policy;
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Valentine Sinitsyn *
|
||||||
|
* e_val@inbox.ru *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
#ifndef CPUFREQDPROFILE_H
|
||||||
|
#define CPUFREQDPROFILE_H
|
||||||
|
|
||||||
|
#include <qstring.h>
|
||||||
|
|
||||||
|
class CPUFreqdProfile {
|
||||||
|
public:
|
||||||
|
CPUFreqdProfile() {};
|
||||||
|
CPUFreqdProfile(QString & descr);
|
||||||
|
virtual ~CPUFreqdProfile();
|
||||||
|
|
||||||
|
bool isValid() const;
|
||||||
|
|
||||||
|
bool active() const;
|
||||||
|
const QString & name() const;
|
||||||
|
int minfreq() const;
|
||||||
|
int maxfreq() const;
|
||||||
|
const QString & policy() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
int m_active;
|
||||||
|
QString m_name;
|
||||||
|
int m_id;
|
||||||
|
int m_minfreq;
|
||||||
|
int m_maxfreq;
|
||||||
|
QString m_policy;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,311 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2005 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
#include "flowlayout.h"
|
||||||
|
#include "sources/source.h"
|
||||||
|
|
||||||
|
//#include "kdebug.h"
|
||||||
|
//#include <qlabel.h> // debugging
|
||||||
|
|
||||||
|
class FlowLayoutIterator :public QGLayoutIterator{
|
||||||
|
public:
|
||||||
|
FlowLayoutIterator( QPtrList<QLayoutItem>* layoutItems ):
|
||||||
|
index(0),
|
||||||
|
mLayoutItems(layoutItems){
|
||||||
|
}
|
||||||
|
uint count() const;
|
||||||
|
QLayoutItem* current();
|
||||||
|
QLayoutItem* next();
|
||||||
|
QLayoutItem* takeCurrent();
|
||||||
|
private:
|
||||||
|
int index;
|
||||||
|
QPtrList<QLayoutItem>* mLayoutItems;
|
||||||
|
};
|
||||||
|
QLayoutItem* FlowLayoutIterator::current(){
|
||||||
|
return index < int(mLayoutItems->count()) ? mLayoutItems->at(index) : 0;
|
||||||
|
/*if(index < int(mLayoutItems->count())){
|
||||||
|
QLayoutItem* item = mLayoutItems->at(index);
|
||||||
|
kdDebug() << "FlowLayoutIterator::current(index " << index << ") returns: " << item << endl;
|
||||||
|
return item;
|
||||||
|
}else{
|
||||||
|
kdDebug() << "FlowLayoutIterator::current(index " << index << ") returns: NULL" << endl;
|
||||||
|
return 0;
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
QLayoutItem* FlowLayoutIterator::next(){
|
||||||
|
index++;
|
||||||
|
//kdDebug() << "FlowLayoutIterator::next, index: " << index << endl;
|
||||||
|
return current();
|
||||||
|
}
|
||||||
|
QLayoutItem* FlowLayoutIterator::takeCurrent(){
|
||||||
|
return index < int(mLayoutItems->count()) ? mLayoutItems->take(index) : 0;
|
||||||
|
/*if(index < int(mLayoutItems->count())){
|
||||||
|
QLayoutItem* item = mLayoutItems->take(index);
|
||||||
|
kdDebug() << "FlowLayoutIterator::takeCurrent(index " << index << ") returns: " << item << endl;
|
||||||
|
return item;
|
||||||
|
}else{
|
||||||
|
kdDebug() << "FlowLayoutIterator::takeCurrent(index " << index << ") returns: NULL" << endl;
|
||||||
|
return 0;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FlowLayout::FlowLayout( QWidget* parent, Qt::Orientation orientation, int border, int space, const char* name )
|
||||||
|
: QLayout( parent, border, space, name ),
|
||||||
|
mOrientation(orientation), mLastItem(NULL){
|
||||||
|
}
|
||||||
|
FlowLayout::FlowLayout( QLayout* parent, Qt::Orientation orientation, int space, const char* name )
|
||||||
|
: QLayout( parent, space, name ),
|
||||||
|
mOrientation(orientation), mLastItem(NULL){
|
||||||
|
}
|
||||||
|
FlowLayout::FlowLayout( Qt::Orientation orientation, int space, const char* name )
|
||||||
|
: QLayout( space, name ),
|
||||||
|
mOrientation(orientation), mLastItem(NULL){
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FlowLayout::~FlowLayout(){
|
||||||
|
deleteAllItems();
|
||||||
|
}
|
||||||
|
|
||||||
|
int FlowLayout::heightForWidth( int w ) const{
|
||||||
|
FlowLayout* mthis = (FlowLayout*)this;
|
||||||
|
int h = mthis->doLayout( QRect(0,0,w,0), TRUE );
|
||||||
|
return h;
|
||||||
|
}
|
||||||
|
|
||||||
|
int FlowLayout::widthForHeight( int h ) const{
|
||||||
|
FlowLayout* mthis = (FlowLayout*)this;
|
||||||
|
int w = mthis->doLayout( QRect(0,0,0,h), TRUE );
|
||||||
|
return w;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FlowLayout::addItem(QLayoutItem* item){
|
||||||
|
//kdDebug() << "FlowLayout::addItem: " << (static_cast<QLabel*>(item->widget()))->text() << ", width: " << item->widget()->width() << ", height: " << item->widget()->height()<< endl;
|
||||||
|
// we are indirectly called from addSource. this
|
||||||
|
// is a hint for addSource, to let it know which item
|
||||||
|
// was added.
|
||||||
|
mLastItem = item;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FlowLayout::addSource(Source* src){
|
||||||
|
add(src->getWidget());
|
||||||
|
mSources[mLastItem] = src;
|
||||||
|
src->getWidget()->show();
|
||||||
|
|
||||||
|
// step back until we find an item which has a
|
||||||
|
// smaller position stored in its config. then, we found
|
||||||
|
// the right position for the new item.
|
||||||
|
QLayoutItem * qli = mLayoutItems.last();
|
||||||
|
while(qli && mSources[qli]->getPosition() > src->getPosition())
|
||||||
|
qli = mLayoutItems.prev();
|
||||||
|
mLayoutItems.insert(mLayoutItems.at()+1, mLastItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FlowLayout::remove(QWidget* widget){
|
||||||
|
//kdDebug() << "FlowLayout::remove: " << (static_cast<QLabel*>(widget))->text() << endl;
|
||||||
|
widget->hide();
|
||||||
|
QPtrListIterator<QLayoutItem> it(mLayoutItems);
|
||||||
|
while(it.current() != NULL) {
|
||||||
|
if(it.current()->widget() == widget) {
|
||||||
|
mSources.erase(it.current());
|
||||||
|
mLayoutItems.remove(it.current());
|
||||||
|
// removes and deletes only the QLayoutItem
|
||||||
|
// (QWidgetItem)
|
||||||
|
QLayout::remove(widget);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uint FlowLayout::count(){
|
||||||
|
return mLayoutItems.count();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FlowLayout::moveItem(const QLayoutItem* which, const QLayoutItem* relate, DIRECTION direction){
|
||||||
|
int newPos = mLayoutItems.findRef(relate);
|
||||||
|
int oldPos = mLayoutItems.findRef(which);
|
||||||
|
|
||||||
|
// check whether the widget is already at a correct position
|
||||||
|
if(oldPos+1 == newPos && direction == ABOVE || oldPos-1 == newPos && direction == BELOW)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// remove the item
|
||||||
|
mLayoutItems.remove(which);
|
||||||
|
if(oldPos < newPos)
|
||||||
|
newPos--;
|
||||||
|
|
||||||
|
newPos += direction;
|
||||||
|
// actually reinsert the item
|
||||||
|
mLayoutItems.insert(newPos, which);
|
||||||
|
activate(); // relayout
|
||||||
|
// kdDebug() << "oldPos: " << oldPos << ", newPos: " << newPos << endl;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FlowLayout::updatePositions(KConfig * inKConfig){
|
||||||
|
//kdDebug() << "updating all positions..." << endl;
|
||||||
|
int pos = 0;
|
||||||
|
QPtrListIterator<QLayoutItem> it(mLayoutItems);
|
||||||
|
while(it.current() != NULL) {
|
||||||
|
mSources[it.current()]->setPosition(pos, inKConfig);
|
||||||
|
++it;
|
||||||
|
++pos;
|
||||||
|
}
|
||||||
|
//kdDebug() << "positions updated!" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FlowLayout::hasHeightForWidth() const{
|
||||||
|
return mOrientation != Qt::Horizontal;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FlowLayout::hasWidthForHeight() const{
|
||||||
|
return mOrientation == Qt::Horizontal;
|
||||||
|
}
|
||||||
|
|
||||||
|
QSize FlowLayout::sizeHint() const{
|
||||||
|
//return minimumSize();
|
||||||
|
QSize size(0,0);
|
||||||
|
QPtrListIterator<QLayoutItem> it(mLayoutItems);
|
||||||
|
QLayoutItem *o;
|
||||||
|
while((o=it.current()) != 0){
|
||||||
|
++it;
|
||||||
|
size = size.expandedTo( o->sizeHint() );
|
||||||
|
}
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
QSize FlowLayout::minimumSize() const{
|
||||||
|
QSize size(0,0);
|
||||||
|
QPtrListIterator<QLayoutItem> it(mLayoutItems);
|
||||||
|
QLayoutItem *o;
|
||||||
|
while((o=it.current()) != 0){
|
||||||
|
++it;
|
||||||
|
size = size.expandedTo(o->minimumSize());
|
||||||
|
}
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
QSizePolicy::ExpandData FlowLayout::expanding() const{
|
||||||
|
return QSizePolicy::NoDirection;
|
||||||
|
}
|
||||||
|
|
||||||
|
QLayoutIterator FlowLayout::iterator(){
|
||||||
|
return QLayoutIterator(new FlowLayoutIterator(&mLayoutItems));
|
||||||
|
}
|
||||||
|
|
||||||
|
Qt::Orientation FlowLayout::getOrientation() const{
|
||||||
|
return mOrientation;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FlowLayout::setOrientation(Qt::Orientation orientation){
|
||||||
|
mOrientation = orientation;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FlowLayout::setGeometry( const QRect& rect ){
|
||||||
|
QLayout::setGeometry( rect );
|
||||||
|
doLayout( rect );
|
||||||
|
}
|
||||||
|
|
||||||
|
int FlowLayout::doLayout( const QRect& rect, bool testonly ){
|
||||||
|
if(mOrientation == Qt::Horizontal)
|
||||||
|
return doLayoutHorizontal(rect, testonly);
|
||||||
|
else
|
||||||
|
return doLayoutVertical(rect, testonly);
|
||||||
|
}
|
||||||
|
|
||||||
|
int FlowLayout::doLayoutHorizontal( const QRect& rect, bool testOnly ){
|
||||||
|
//kdDebug() << "spacing: " << spacing() << endl;
|
||||||
|
|
||||||
|
int x = rect.x();
|
||||||
|
int y = rect.y();
|
||||||
|
int width = 0; // width of this column so far
|
||||||
|
int height = 0; // height of this column so far
|
||||||
|
QPtrListIterator<QLayoutItem> it(mLayoutItems);
|
||||||
|
QLayoutItem* layoutItem;
|
||||||
|
QPtrList<QLayoutItem> column; // stores the items of one column
|
||||||
|
while((layoutItem = it.current()) != 0){
|
||||||
|
++it;
|
||||||
|
//int nextY = y + layoutItem->sizeHint().height() + spacing(); // next y
|
||||||
|
int nextY = y + layoutItem->sizeHint().height(); // next y
|
||||||
|
//if( nextY - spacing() > rect.bottom() && width > 0 ) {
|
||||||
|
if( nextY > rect.bottom() && width > 0 ) {
|
||||||
|
// next column
|
||||||
|
y = rect.y(); // reset y
|
||||||
|
x = x + width + spacing(); // new x
|
||||||
|
//nextY = y + layoutItem->sizeHint().height() + spacing(); // next y with changed y
|
||||||
|
nextY = y + layoutItem->sizeHint().height(); // next y with changed y
|
||||||
|
width = 0; // reset width for the next column
|
||||||
|
}
|
||||||
|
if(!testOnly){
|
||||||
|
layoutItem->setGeometry( QRect( QPoint( x, y ), layoutItem->sizeHint() ) );
|
||||||
|
column.append(layoutItem);
|
||||||
|
height += layoutItem->sizeHint().height(); // add the height of the current item to the column height
|
||||||
|
if( it.current() == 0 || nextY + it.current()->sizeHint().height() > rect.bottom() ){ // test it it's the last item (of this column)
|
||||||
|
// calculate real needed width
|
||||||
|
int rWidth = 0;
|
||||||
|
for(QLayoutItem* item = column.first(); item; item = column.next()){
|
||||||
|
rWidth = QMAX( rWidth, item->widget()->sizeHint().width() );
|
||||||
|
}
|
||||||
|
// relayout the items of the former column
|
||||||
|
int space = (rect.height() - height) / (column.count() + 1);
|
||||||
|
int i = 0; // counts the items of this column
|
||||||
|
for(QLayoutItem* item = column.first(); item; item = column.next()){
|
||||||
|
QRect r = item->geometry();
|
||||||
|
item->setGeometry( QRect(r.left(), r.top() + ((++i) * space), rWidth, r.height()) );
|
||||||
|
}
|
||||||
|
column.clear(); // remove the items of the former column
|
||||||
|
height = 0; // reset height for the next column
|
||||||
|
}
|
||||||
|
}
|
||||||
|
y = nextY;
|
||||||
|
width = QMAX( width, layoutItem->sizeHint().width() );
|
||||||
|
}
|
||||||
|
return x + width - rect.x(); // width
|
||||||
|
}
|
||||||
|
|
||||||
|
int FlowLayout::doLayoutVertical( const QRect& rect, bool testOnly ){
|
||||||
|
int x = rect.x();
|
||||||
|
int y = rect.y();
|
||||||
|
int height = 0; // height of this line so far
|
||||||
|
QPtrListIterator<QLayoutItem> it(mLayoutItems);
|
||||||
|
QLayoutItem* layoutItem;
|
||||||
|
while((layoutItem = it.current() ) != 0){
|
||||||
|
++it;
|
||||||
|
//int nextX = x + layoutItem->sizeHint().width() + spacing();
|
||||||
|
int nextX = x + layoutItem->sizeHint().width();
|
||||||
|
if(nextX - spacing() > rect.right() && height > 0) {
|
||||||
|
// next line
|
||||||
|
x = rect.x(); // reset x
|
||||||
|
//y = y + height + spacing(); // new y
|
||||||
|
y = y + height; // new y
|
||||||
|
//nextX = x + layoutItem->sizeHint().width() + spacing(); // next x
|
||||||
|
nextX = x + layoutItem->sizeHint().width(); // next x
|
||||||
|
height = 0; // reset height for the next line
|
||||||
|
}
|
||||||
|
const int itemHeight = layoutItem->sizeHint().height();
|
||||||
|
if(!testOnly)
|
||||||
|
layoutItem->setGeometry(QRect(x, y, rect.right(), itemHeight));
|
||||||
|
x = nextX;
|
||||||
|
height = QMAX(height, itemHeight);
|
||||||
|
}
|
||||||
|
return y + height - rect.y(); // height
|
||||||
|
}
|
@ -0,0 +1,85 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2005 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
#ifndef FLOWLAYOUT_H
|
||||||
|
#define FLOWLAYOUT_H
|
||||||
|
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qptrlist.h>
|
||||||
|
|
||||||
|
class Source;
|
||||||
|
class KConfig;
|
||||||
|
|
||||||
|
class FlowLayout : public QLayout{
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* the direction for moveItem
|
||||||
|
*/
|
||||||
|
enum DIRECTION {
|
||||||
|
ABOVE = 0,
|
||||||
|
BELOW = 1
|
||||||
|
};
|
||||||
|
FlowLayout( QWidget* parent, Qt::Orientation orientation=Qt::Horizontal, int border=0, int space=-1, const char* name=0 );
|
||||||
|
FlowLayout( QLayout* parent, Qt::Orientation orientation=Qt::Horizontal, int space=-1, const char* name=0 );
|
||||||
|
FlowLayout( Qt::Orientation=Qt::Horizontal, int space=-1, const char* name=0 );
|
||||||
|
virtual ~FlowLayout();
|
||||||
|
/**
|
||||||
|
* tells all sources their positions
|
||||||
|
*/
|
||||||
|
void updatePositions(KConfig * inKConfig);
|
||||||
|
void addItem(QLayoutItem* item);
|
||||||
|
void addSource(Source* src);
|
||||||
|
void remove(QWidget* widget);
|
||||||
|
/**
|
||||||
|
* Returns the number of items in the layout
|
||||||
|
*/
|
||||||
|
uint count();
|
||||||
|
/**
|
||||||
|
* moves the item \c which above/beneath item \c relate
|
||||||
|
* \param dir ABOVE if above, BENEATH if beneath
|
||||||
|
* \return the new Position or -1 if no real move was made
|
||||||
|
*/
|
||||||
|
bool moveItem(const QLayoutItem* which, const QLayoutItem* relate, DIRECTION direction);
|
||||||
|
bool hasHeightForWidth() const;
|
||||||
|
int heightForWidth(int w) const;
|
||||||
|
bool hasWidthForHeight() const;
|
||||||
|
int widthForHeight(int h) const;
|
||||||
|
QSize sizeHint() const;
|
||||||
|
QSize minimumSize() const;
|
||||||
|
QLayoutIterator iterator();
|
||||||
|
QSizePolicy::ExpandData expanding() const;
|
||||||
|
Qt::Orientation getOrientation() const;
|
||||||
|
public slots:
|
||||||
|
void setOrientation(Qt::Orientation orientation);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void setGeometry(const QRect&);
|
||||||
|
|
||||||
|
private:
|
||||||
|
int doLayout( const QRect&, bool testOnly = FALSE );
|
||||||
|
int doLayoutHorizontal( const QRect&, bool testOnly );
|
||||||
|
int doLayoutVertical( const QRect&, bool testOnly );
|
||||||
|
Qt::Orientation mOrientation;
|
||||||
|
QPtrList<QLayoutItem> mLayoutItems;
|
||||||
|
// this is the connection between a layout item and its source.
|
||||||
|
QMap<QLayoutItem*, Source*> mSources;
|
||||||
|
QLayoutItem* mLastItem; // the item that was last added
|
||||||
|
};
|
||||||
|
#endif
|
@ -0,0 +1,432 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include <list>
|
||||||
|
|
||||||
|
// Qt
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qfile.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qcombobox.h>
|
||||||
|
#include <qtextedit.h>
|
||||||
|
#include <qtimer.h>
|
||||||
|
#include <qcursor.h>
|
||||||
|
#include <klistview.h>
|
||||||
|
#include <qlistview.h>
|
||||||
|
#include <qwidgetstack.h>
|
||||||
|
|
||||||
|
// KDE
|
||||||
|
#include <kmessagebox.h>
|
||||||
|
#include <kaboutapplication.h>
|
||||||
|
#include <kpopupmenu.h>
|
||||||
|
#include <kstdaction.h>
|
||||||
|
#include <kaction.h>
|
||||||
|
#include <kactioncollection.h>
|
||||||
|
#include <kactionclasses.h>
|
||||||
|
#include <kapplication.h>
|
||||||
|
#include <kdialogbase.h>
|
||||||
|
#include <kconfig.h>
|
||||||
|
//#include <kglobal.h>
|
||||||
|
#include <kiconloader.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
|
||||||
|
// Kima
|
||||||
|
#include "kima.h"
|
||||||
|
#include "flowlayout.h"
|
||||||
|
#include "sourcelistitem.h"
|
||||||
|
#include "prefs.h"
|
||||||
|
|
||||||
|
// Kima Soures
|
||||||
|
#include "sources/acpithermalsrc.h"
|
||||||
|
#include "sources/ibmacpithermalsrc.h"
|
||||||
|
#include "sources/ibmacpifansrc.h"
|
||||||
|
#include "sources/ibmhdaps.h"
|
||||||
|
#include "sources/omnibookthermalsrc.h"
|
||||||
|
#include "sources/ibookg4thermalsrc.h"
|
||||||
|
#include "sources/hwmonthermalsrc.h"
|
||||||
|
#include "sources/hwmonfansrc.h"
|
||||||
|
#include "sources/sysfreqsrc.h"
|
||||||
|
#include "sources/cpuinfofreqsrc.h"
|
||||||
|
#include "sources/i8ksrc.h"
|
||||||
|
#include "sources/nvidiathermalsrc.h"
|
||||||
|
#include "sources/hddtempsrc.h"
|
||||||
|
#include "sources/uptimesrc.h"
|
||||||
|
#include "sources/batterysrc.h"
|
||||||
|
|
||||||
|
//#include "kdebug.h"
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
KPanelApplet* init( QWidget* inParent, const QString& inConfigFile) {
|
||||||
|
KGlobal::locale()->insertCatalogue("kima");
|
||||||
|
return new Kima(inConfigFile, KPanelApplet::Normal,
|
||||||
|
//KPanelApplet::About | KPanelApplet::Help | KPanelApplet::Preferences,
|
||||||
|
KPanelApplet::About | KPanelApplet::Preferences,
|
||||||
|
inParent, "kima");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Kima::Kima(const QString& inConfigFile, Type inType, int inActions, QWidget* inParent, const char* inName):
|
||||||
|
KPanelApplet(inConfigFile, inType, inActions, inParent, inName),
|
||||||
|
QToolTip(this),
|
||||||
|
mCachedWFH(0),
|
||||||
|
mCachedHeight(0),
|
||||||
|
mDraggedSourceItem(NULL){
|
||||||
|
mAboutDialog = 0; // aboutData is created in the about() method
|
||||||
|
mPrefsDlg = 0; // the prefs dialog is created in the preferences() method
|
||||||
|
mPrefs = 0; // the prefs ui is created in the preferences() method
|
||||||
|
|
||||||
|
// Get the current application configuration handle
|
||||||
|
mKConfig = config();
|
||||||
|
mKConfig->setGroup("Kima");
|
||||||
|
|
||||||
|
// automatically delete pointers
|
||||||
|
mSources.setAutoDelete(TRUE);
|
||||||
|
|
||||||
|
// create layout
|
||||||
|
mLayout = new FlowLayout(this, orientation() );
|
||||||
|
mLayout->setSpacing(8);
|
||||||
|
|
||||||
|
|
||||||
|
// add the sources into the sources list
|
||||||
|
addSources(NVidiaThermalSrc::createInstances(this));
|
||||||
|
addSources(ACPIThermalSrc::createInstances(this));
|
||||||
|
addSources(IBMACPIThermalSrc::createInstances(this));
|
||||||
|
addSources(IBMACPIFanSrc::createInstances(this));
|
||||||
|
addSources(IBMHDAPSSrc::createInstances(this));
|
||||||
|
addSources(OmnibookThermalSrc::createInstances(this));
|
||||||
|
addSources(IbookG4ThermalSrc::createInstances(this));
|
||||||
|
addSources(HwMonThermalSrc::createInstances(this));
|
||||||
|
addSources(SysFreqSrc::createInstances(this));
|
||||||
|
addSources(CpuinfoFreqSrc::createInstances(this));
|
||||||
|
addSources(I8kSrc::createInstances(this));
|
||||||
|
addSources(HDDTempSrc::createInstances(this));
|
||||||
|
addSources(HwMonFanSrc::createInstances(this));
|
||||||
|
addSources(UptimeSrc::createInstances(this));
|
||||||
|
addSources(BatterySrc::createInstances(this));
|
||||||
|
|
||||||
|
|
||||||
|
QPtrListIterator<Source> itSync(mSources);
|
||||||
|
Source* source;
|
||||||
|
while((source = itSync.current()) != 0){
|
||||||
|
++itSync;
|
||||||
|
registerSource(source);
|
||||||
|
}
|
||||||
|
mLayout->updatePositions(mKConfig);
|
||||||
|
|
||||||
|
// create the menu
|
||||||
|
mMenu = new KPopupMenu(this);
|
||||||
|
mMenu->insertTitle(SmallIcon("hwinfo"), i18n("Kima"));
|
||||||
|
|
||||||
|
if (mCpufreqd.enabled()) {
|
||||||
|
mMenu->insertItem(i18n("&Performance Profiles"), mCpufreqd.menu());
|
||||||
|
}
|
||||||
|
|
||||||
|
KActionCollection* actionCollection = new KActionCollection(this, "actionCollection", kapp);
|
||||||
|
|
||||||
|
KAction* action = KStdAction::preferences(this, SLOT(preferences()), actionCollection);
|
||||||
|
action->setText(i18n("&Preferences"));
|
||||||
|
action->plug(mMenu);
|
||||||
|
|
||||||
|
action = KStdAction::aboutApp(this, SLOT(about()), actionCollection);
|
||||||
|
action->setText(i18n("&About Kima"));
|
||||||
|
action->plug(mMenu);
|
||||||
|
|
||||||
|
//menu->insertSeparator();
|
||||||
|
//KStdAction::quit( kapp, SLOT( quit() ), actionCollection )->plug( menu );
|
||||||
|
}
|
||||||
|
|
||||||
|
Kima::~Kima() {
|
||||||
|
// super class deletes the widgets
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kima::addSources(const std::list<Source*>& inList){
|
||||||
|
for(std::list<Source*>::const_iterator it = inList.begin(); it != inList.end(); ++it){
|
||||||
|
mSources.append(*it);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kima::displaySource(bool inDisplay, Source* inSource){
|
||||||
|
if(inDisplay){
|
||||||
|
//kdDebug() << "Kima::displaySource mLayout->add: " << inSource->getName() << endl;
|
||||||
|
mLayout->addSource(inSource); // add the source
|
||||||
|
//kdDebug() << "Pos of " << inSource->getID() << ": " << inSource->getPosition() << endl;
|
||||||
|
}else{
|
||||||
|
//kdDebug() << "Kima::displaySource mLayout->remove: " << inSource->getName() << endl;
|
||||||
|
mLayout->remove(inSource->getWidget());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kima::about() {
|
||||||
|
if(!mAboutDialog){
|
||||||
|
KAboutData* aboutData = new KAboutData("libkima",
|
||||||
|
"Kima",
|
||||||
|
"0.7.3.2",
|
||||||
|
I18N_NOOP("Kicker monitoring applet.\n\n"
|
||||||
|
"This applet monitors various temperature, frequency and fan sources.\n"
|
||||||
|
"Make sure you have enabled a supported kernel module.\n"),
|
||||||
|
KAboutData::License_GPL,
|
||||||
|
"(c) 2004-2007, Ken Werner");
|
||||||
|
aboutData->addAuthor("Ken Werner", 0, "ken.werner@web.de");
|
||||||
|
aboutData->addAuthor("Johannes Schaub", 0, "schaub-johannes@web.de");
|
||||||
|
aboutData->addAuthor("Valentine Sinitsyn", I18N_NOOP("cpufreqd control module"), "e_val@inbox.ru");
|
||||||
|
aboutData->addCredit("Franziska Simmank");
|
||||||
|
aboutData->addCredit("Manfred Paul");
|
||||||
|
aboutData->addCredit("Rainer Dorsch");
|
||||||
|
aboutData->addCredit("Flavio Castelli");
|
||||||
|
aboutData->addCredit("Jocke Andersson");
|
||||||
|
aboutData->addCredit("Raoul Martin");
|
||||||
|
aboutData->addCredit("Donnie Bhayangkara");
|
||||||
|
aboutData->addCredit("Gonzalo Nemmi");
|
||||||
|
aboutData->addCredit("Mariusz Ciesla");
|
||||||
|
aboutData->addCredit("Mark Rosenstand");
|
||||||
|
aboutData->addCredit("Santiago Bruno");
|
||||||
|
aboutData->addCredit("Dark Apostrophe");
|
||||||
|
aboutData->addCredit("Sascha Hoogen");
|
||||||
|
aboutData->addCredit("Peter Avramucz");
|
||||||
|
aboutData->addCredit("Oskar Ellström");
|
||||||
|
aboutData->addCredit("Uğur Çetin");
|
||||||
|
mAboutDialog = new KAboutApplication(aboutData, this, "aboutApp", false);
|
||||||
|
}
|
||||||
|
mAboutDialog->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kima::help() {
|
||||||
|
KMessageBox::information(0, i18n("This is a help box"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kima::preferences() {
|
||||||
|
//KMessageBox::information(0, i18n("This is a preferences box"));
|
||||||
|
if(!mPrefsDlg){
|
||||||
|
//create the prefs dialog
|
||||||
|
mPrefsDlg = new KDialogBase( this, "prefsDlg", false, i18n("Configuration"), KDialogBase::Ok|KDialogBase::Apply|KDialogBase::Cancel, KDialogBase::Ok, false );
|
||||||
|
//create the prefs ui
|
||||||
|
mPrefs = new Prefs( mPrefsDlg, "prefsui" ); //the uic generated class
|
||||||
|
|
||||||
|
//setup the dialog
|
||||||
|
//mPrefsDlg->setFixedSize(mPrefs->size());
|
||||||
|
mPrefsDlg->setMainWidget(mPrefs); //embed the uic generated class into the kde dialog
|
||||||
|
connect(mPrefsDlg, SIGNAL(applyClicked()), this, SLOT(savePreferences()));
|
||||||
|
connect(mPrefsDlg, SIGNAL(okClicked()), this, SLOT(savePreferences()));
|
||||||
|
connect(mPrefsDlg, SIGNAL(cancelClicked()), this, SLOT(cancelPreferences()));
|
||||||
|
|
||||||
|
// create new list items and the widgetStack widgets
|
||||||
|
QPtrListIterator<Source> it(mSources);
|
||||||
|
Source* source;
|
||||||
|
while((source = it.current()) != 0){
|
||||||
|
++it;
|
||||||
|
// create the specific source prefs and add them to the widgetStack
|
||||||
|
mPrefs->widgetStack->addWidget(source->createPrefs(mPrefs->widgetStack));
|
||||||
|
|
||||||
|
// create the SourceListItem to switch and to enable/disable the widgetstack item (the source)
|
||||||
|
// and connect the apply/ok signals to the item, so it can change it's text to a potentially
|
||||||
|
// new source name.
|
||||||
|
SourceListItem * item = new SourceListItem(source, mPrefs->sourceListView, QCheckListItem::CheckBox);
|
||||||
|
connect(mPrefsDlg, SIGNAL(applyClicked()), item, SLOT(updateText()));
|
||||||
|
connect(mPrefsDlg, SIGNAL(okClicked()), item, SLOT(updateText()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mPrefs->sourceListView->firstChild()){
|
||||||
|
mPrefs->sourceListView->setSelected(mPrefs->sourceListView->firstChild(), true); // select the first list item
|
||||||
|
raiseSourcePrefsWidget(mPrefs->sourceListView->firstChild()); // raise that item
|
||||||
|
}
|
||||||
|
|
||||||
|
connect(mPrefs->sourceListView, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(raiseSourcePrefsWidget(QListViewItem*)));
|
||||||
|
}
|
||||||
|
|
||||||
|
// update prefs gui
|
||||||
|
QPtrListIterator<Source> srcIt(mSources);
|
||||||
|
Source* source;
|
||||||
|
while((source = srcIt.current()) != 0){
|
||||||
|
++srcIt;
|
||||||
|
source->updatePrefsGUI();
|
||||||
|
}
|
||||||
|
|
||||||
|
// update the sourcelist checkbox
|
||||||
|
QPtrList<QListViewItem> lst;
|
||||||
|
QListViewItemIterator lvIt(mPrefs->sourceListView);
|
||||||
|
while(lvIt.current()){
|
||||||
|
SourceListItem* sli = static_cast<SourceListItem*>(lvIt.current());
|
||||||
|
sli->setOn(sli->getSource()->isEnabled());
|
||||||
|
++lvIt;
|
||||||
|
}
|
||||||
|
|
||||||
|
//show the dialog
|
||||||
|
mPrefsDlg->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kima::raiseSourcePrefsWidget(QListViewItem* inListViewItem){
|
||||||
|
mPrefs->widgetStack->raiseWidget(static_cast<SourceListItem*>(inListViewItem)->getSource()->getPrefs());
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kima::cancelPreferences(){
|
||||||
|
// update prefs gui
|
||||||
|
QPtrListIterator<Source> it(mSources);
|
||||||
|
Source* source;
|
||||||
|
while((source = it.current()) != 0){
|
||||||
|
++it;
|
||||||
|
source->updatePrefsGUI();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kima::savePreferences(){
|
||||||
|
// save prefs
|
||||||
|
QPtrListIterator<Source> it(mSources);
|
||||||
|
Source* source;
|
||||||
|
while((source = it.current()) != 0){
|
||||||
|
++it;
|
||||||
|
source->applyPrefs();
|
||||||
|
source->savePrefs(mKConfig);
|
||||||
|
}
|
||||||
|
// save the position of all sources because they might have changed.
|
||||||
|
mLayout->updatePositions(mKConfig);
|
||||||
|
// update the source widgets
|
||||||
|
updateSourceWidgets();
|
||||||
|
// write config
|
||||||
|
mKConfig->sync();
|
||||||
|
// reset cached witdh for height to force recalculation of the applets width
|
||||||
|
mCachedWFH = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int Kima::widthForHeight(int inHeight) const{
|
||||||
|
//kdDebug() << "widthForHeight: " << height << endl;
|
||||||
|
mLayout->setOrientation(Qt::Horizontal);
|
||||||
|
if(mCachedHeight != inHeight){
|
||||||
|
mCachedHeight = inHeight;
|
||||||
|
mCachedWFH = 0;
|
||||||
|
}
|
||||||
|
mCachedWFH = QMAX(mLayout->widthForHeight(inHeight), mCachedWFH);
|
||||||
|
return mCachedWFH;
|
||||||
|
}
|
||||||
|
|
||||||
|
int Kima::heightForWidth(int inWidth) const{
|
||||||
|
//kdDebug() << "heightForWidth: " << width << endl;
|
||||||
|
mLayout->setOrientation(Qt::Vertical);
|
||||||
|
return mLayout->heightForWidth(inWidth);
|
||||||
|
//return sizeHint().height();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kima::mousePressEvent(QMouseEvent* inEvent ){
|
||||||
|
if(inEvent->button() == QMouseEvent::RightButton){
|
||||||
|
mMenu->popup( inEvent->globalPos() );
|
||||||
|
if(mDraggedSourceItem)
|
||||||
|
mDraggedSourceItem->widget()->unsetCursor(); // unset drag cursor
|
||||||
|
}
|
||||||
|
else if(inEvent->button() == QMouseEvent::LeftButton){
|
||||||
|
QLayoutIterator it = mLayout->iterator();
|
||||||
|
while(it.current()){
|
||||||
|
QWidget * c = it.current()->widget();
|
||||||
|
if(c->rect().contains(c->mapFromGlobal(inEvent->globalPos()))){
|
||||||
|
mDraggedSourceItem = it.current(); // remenber the clicked source
|
||||||
|
c->setCursor(Qt::SizeAllCursor); // set drag cursor
|
||||||
|
mDragFactor = (c->rect().height()/2.0) / (double)c->mapFromGlobal(inEvent->globalPos()).y();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kima::mouseReleaseEvent(QMouseEvent* inEvent){
|
||||||
|
//if(inEvent->button() == QMouseEvent::LeftButton && mDraggedSourceItem){
|
||||||
|
if(mDraggedSourceItem){
|
||||||
|
mCachedWFH = 0; // reset cached witdh for height to force recalculation of the applets width
|
||||||
|
mDraggedSourceItem->widget()->unsetCursor(); // unset drag cursor
|
||||||
|
mDraggedSourceItem = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kima::mouseMoveEvent( QMouseEvent* inEvent ) {
|
||||||
|
if(!mDraggedSourceItem)
|
||||||
|
return;
|
||||||
|
QLayoutIterator it = mLayout->iterator();
|
||||||
|
while(it.current()){
|
||||||
|
QWidget * c = it.current()->widget();
|
||||||
|
if(c->rect().contains(c->mapFromGlobal(inEvent->globalPos()))){
|
||||||
|
if(it.current() == mDraggedSourceItem)
|
||||||
|
break;
|
||||||
|
// we are over a source-widget.
|
||||||
|
// move the dragged widget above / below that
|
||||||
|
// widget, depending where the cursor is.
|
||||||
|
QRect crect = c->rect();
|
||||||
|
double relPos = c->mapFromGlobal(inEvent->globalPos()).y() * mDragFactor;
|
||||||
|
if(mLayout->moveItem(mDraggedSourceItem, it.current(), crect.height()/2.0 > relPos ? FlowLayout::ABOVE : FlowLayout::BELOW)){
|
||||||
|
mLayout->updatePositions(mKConfig);
|
||||||
|
updateGeometry();
|
||||||
|
mKConfig->sync(); // write config
|
||||||
|
updateSourceWidgets();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
// outside kima?
|
||||||
|
if(!rect().contains(mapToParent(inEvent->pos())))
|
||||||
|
mDraggedSourceItem->widget()->setCursor(Qt::ForbiddenCursor);
|
||||||
|
else
|
||||||
|
mDraggedSourceItem->widget()->setCursor(Qt::SizeAllCursor);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kima::paintEvent(QPaintEvent* inEvent){
|
||||||
|
KPanelApplet::paintEvent(inEvent);
|
||||||
|
updateSourceWidgets();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kima::updateSourceWidgets(){
|
||||||
|
// repaint the source widgets
|
||||||
|
for(Source* source = mSources.first(); source; source = mSources.next())
|
||||||
|
if(source->showOnApplet())
|
||||||
|
source->getWidget()->update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kima::registerSource(Source* source) {
|
||||||
|
// then, tell the source to set up its widget
|
||||||
|
source->realizeWidget();
|
||||||
|
|
||||||
|
// enable transparency
|
||||||
|
source->getWidget()->setBackgroundMode(X11ParentRelative);
|
||||||
|
|
||||||
|
// load prefs from the configuration
|
||||||
|
// this call also emits enabledChanged
|
||||||
|
source->loadPrefs(mKConfig);
|
||||||
|
|
||||||
|
// add the source to the layout if necessary
|
||||||
|
displaySource(source->isEnabled() && source->showOnApplet(), source);
|
||||||
|
|
||||||
|
// connection to add and remove sources from mLayout
|
||||||
|
connect(source, SIGNAL(displaySource(bool, Source*)), this, SLOT(displaySource(bool, Source*)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kima::maybeTip(const QPoint& inPos){
|
||||||
|
if(!rect().contains(inPos))
|
||||||
|
return;
|
||||||
|
QString text = "<b>" + i18n("Sources:") + "</b><br><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
|
||||||
|
|
||||||
|
QPtrListIterator<Source> it(mSources);
|
||||||
|
Source* source;
|
||||||
|
while((source = it.current()) != 0){
|
||||||
|
++it;
|
||||||
|
if(source->isEnabled() && source->isToolTipEnabled())
|
||||||
|
text.append("<tr><td>" +
|
||||||
|
source->getName() + "</td><td>" +
|
||||||
|
source->getValue() + "</td><td>");
|
||||||
|
}
|
||||||
|
text.append("</table>");
|
||||||
|
tip(rect(), text);
|
||||||
|
}
|
@ -0,0 +1,220 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2005 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
#ifndef KIMA_H
|
||||||
|
#define KIMA_H
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <kpanelapplet.h>
|
||||||
|
#include "sources/source.h"
|
||||||
|
#include "cpufreqd/cpufreqd.h"
|
||||||
|
|
||||||
|
// Qt
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qfont.h>
|
||||||
|
#include <qcolor.h>
|
||||||
|
#include <qptrlist.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
|
||||||
|
// Forward Declarations
|
||||||
|
class FlowLayout;
|
||||||
|
class KAboutApplication;
|
||||||
|
class KPopupMenu;
|
||||||
|
class KSelectAction;
|
||||||
|
class QMouseEvent;
|
||||||
|
class KDialogBase;
|
||||||
|
class Prefs;
|
||||||
|
class QListViewItem;
|
||||||
|
class KConfig;
|
||||||
|
class QLayoutItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@author Ken Werner
|
||||||
|
*/
|
||||||
|
class Kima : public KPanelApplet, QToolTip {
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Construct a @ref KPanelApplet just like any other widget.
|
||||||
|
*
|
||||||
|
* @param configFile The configFile handed over in the factory function.
|
||||||
|
* @param Type The applet @ref type().
|
||||||
|
* @param actions Standard RMB menu actions supported by the applet (see @ref action() ).
|
||||||
|
* @param parent The pointer to the parent widget handed over in the factory function.
|
||||||
|
* @param name A Qt object name for your applet.
|
||||||
|
**/
|
||||||
|
Kima(const QString& inConfigFile, Type inType = Normal, int inActions = 0,
|
||||||
|
QWidget* inParent = 0, const char* inName = 0);
|
||||||
|
/** destructor */
|
||||||
|
virtual ~Kima();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve a suggested width for a given height.
|
||||||
|
*
|
||||||
|
* Every applet should reimplement this function.
|
||||||
|
*
|
||||||
|
* Depending on the panel orientation the height (horizontal panel) or the
|
||||||
|
* width (vertical panel) of the applets is fixed.
|
||||||
|
* The exact values of the fixed size component depend on the panel size.
|
||||||
|
*
|
||||||
|
* On a horizontal panel the applet height is fixed, the panel will
|
||||||
|
* call @ref widthForHeight(int height) with @p height
|
||||||
|
* equal to 'the fixed applet height'
|
||||||
|
* when laying out the applets.
|
||||||
|
*
|
||||||
|
* The applet can now choose the other size component (width)
|
||||||
|
* based on the given height.
|
||||||
|
*
|
||||||
|
* The width you return is granted.
|
||||||
|
**/
|
||||||
|
virtual int widthForHeight(int inHeight) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return A suggested height for a given width.
|
||||||
|
*
|
||||||
|
* Every applet should reimplement this function.
|
||||||
|
*
|
||||||
|
* Depending on the panel orientation the height (horizontal panel) or the
|
||||||
|
* width (vertical panel) of the applets is fixed.
|
||||||
|
* The exact values of the fixed size component depend on the panel size.
|
||||||
|
*
|
||||||
|
* On a vertical panel the applet width is fixed, the panel will
|
||||||
|
* call @ref heightForWidth(int width) with @p width
|
||||||
|
* equal to 'the fixed applet width'
|
||||||
|
* when laying out the applets.
|
||||||
|
*
|
||||||
|
* The applet can now choose the other size component (height)
|
||||||
|
* based on the given width.
|
||||||
|
*
|
||||||
|
* The height you return is granted.
|
||||||
|
**/
|
||||||
|
virtual int heightForWidth(int inWidth) const;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
/**
|
||||||
|
* called if the preferences dialog is cancelled
|
||||||
|
**/
|
||||||
|
void cancelPreferences();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Saves the preferences
|
||||||
|
**/
|
||||||
|
void savePreferences();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is called when the user selects "About" from the applets RMB menu.
|
||||||
|
* Reimplement this function to launch a about dialog.
|
||||||
|
*
|
||||||
|
* Note that this is called only when your applet supports the About action.
|
||||||
|
* See @ref Action and @ref KPanelApplet().
|
||||||
|
**/
|
||||||
|
virtual void about();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is called when the user selects "Help" from the applets RMB menu.
|
||||||
|
* Reimplement this function to launch a manual or help page.
|
||||||
|
*
|
||||||
|
* Note that this is called only when your applet supports the Help action.
|
||||||
|
* See @ref Action and @ref KPanelApplet().
|
||||||
|
**/
|
||||||
|
virtual void help();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is called when the user selects "Preferences" from the applets RMB menu.
|
||||||
|
* Reimplement this function to launch a preferences dialog or kcontrol module.
|
||||||
|
*
|
||||||
|
* Note that this is called only when your applet supports the preferences action.
|
||||||
|
* See @ref Action and @ref KPanelApplet().
|
||||||
|
**/
|
||||||
|
virtual void preferences();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* raises the preferences widgets of the given list item
|
||||||
|
*/
|
||||||
|
void raiseSourcePrefsWidget(QListViewItem* inListViewItem);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* adds or removes the given source from the display (layout) of the kicker applet
|
||||||
|
*/
|
||||||
|
void displaySource(bool inDisplay, Source* inSource);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void paintEvent(QPaintEvent* inEvent);
|
||||||
|
void mousePressEvent(QMouseEvent* inEvent);
|
||||||
|
void mouseMoveEvent(QMouseEvent* inEvent);
|
||||||
|
void mouseReleaseEvent(QMouseEvent* inEvent);
|
||||||
|
void maybeTip(const QPoint& inPos);
|
||||||
|
void registerSource(Source* source);
|
||||||
|
|
||||||
|
protected slots:
|
||||||
|
void updateSourceWidgets();
|
||||||
|
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* Adds the entries of given the STL to mSources
|
||||||
|
*/
|
||||||
|
void addSources(const std::list<Source*>& inList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Searches for the Source that has inWidget
|
||||||
|
* Returns the found Soucre, otherwise NULL
|
||||||
|
*/
|
||||||
|
Source* findSource(QWidget* inWidget);
|
||||||
|
/**
|
||||||
|
* Searches for the Source that has inPosition
|
||||||
|
* Returns the found Soucre, otherwise NULL
|
||||||
|
*/
|
||||||
|
Source* findSource(int inPosition);
|
||||||
|
|
||||||
|
KConfig* mKConfig;
|
||||||
|
FlowLayout* mLayout;
|
||||||
|
mutable int mCachedWFH;
|
||||||
|
mutable int mCachedHeight;
|
||||||
|
KAboutApplication* mAboutDialog;
|
||||||
|
KPopupMenu* mMenu;
|
||||||
|
KDialogBase* mPrefsDlg;
|
||||||
|
Prefs* mPrefs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* stores sources
|
||||||
|
*/
|
||||||
|
QPtrList<Source> mSources;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* points to the source which is currently
|
||||||
|
* dragged, otherwise NULL
|
||||||
|
*/
|
||||||
|
QLayoutItem* mDraggedSourceItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 'drag' threshold multiplier
|
||||||
|
*/
|
||||||
|
double mDragFactor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* contains the cpufreq support
|
||||||
|
*/
|
||||||
|
CPUFreqd mCpufreqd;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // KIMA_H
|
@ -0,0 +1,71 @@
|
|||||||
|
#include <kdialog.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file './prefs.ui'
|
||||||
|
**
|
||||||
|
** Created: Thu Jun 21 19:16:50 2007
|
||||||
|
** by: The User Interface Compiler ($Id: qt/main.cpp 3.3.7 edited Aug 31 2005 $)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "prefs.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qsplitter.h>
|
||||||
|
#include <qheader.h>
|
||||||
|
#include <klistview.h>
|
||||||
|
#include <qwidgetstack.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a Prefs as a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
Prefs::Prefs( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "Prefs" );
|
||||||
|
PrefsLayout = new QVBoxLayout( this, 0, 6, "PrefsLayout");
|
||||||
|
|
||||||
|
splitter3 = new QSplitter( this, "splitter3" );
|
||||||
|
splitter3->setOrientation( QSplitter::Horizontal );
|
||||||
|
|
||||||
|
sourceListView = new KListView( splitter3, "sourceListView" );
|
||||||
|
sourceListView->addColumn( tr2i18n( "Source" ) );
|
||||||
|
sourceListView->header()->setClickEnabled( FALSE, sourceListView->header()->count() - 1 );
|
||||||
|
sourceListView->header()->setResizeEnabled( FALSE, sourceListView->header()->count() - 1 );
|
||||||
|
sourceListView->setResizeMode( KListView::AllColumns );
|
||||||
|
|
||||||
|
widgetStack = new QWidgetStack( splitter3, "widgetStack" );
|
||||||
|
|
||||||
|
WStackPage = new QWidget( widgetStack, "WStackPage" );
|
||||||
|
widgetStack->addWidget( WStackPage, 0 );
|
||||||
|
PrefsLayout->addWidget( splitter3 );
|
||||||
|
languageChange();
|
||||||
|
resize( QSize(340, 73).expandedTo(minimumSizeHint()) );
|
||||||
|
clearWState( WState_Polished );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
Prefs::~Prefs()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sets the strings of the subwidgets using the current
|
||||||
|
* language.
|
||||||
|
*/
|
||||||
|
void Prefs::languageChange()
|
||||||
|
{
|
||||||
|
setCaption( tr2i18n( "Preferences" ) );
|
||||||
|
sourceListView->header()->setLabel( 0, tr2i18n( "Source" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "prefs.moc"
|
@ -0,0 +1,72 @@
|
|||||||
|
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||||
|
<class>Prefs</class>
|
||||||
|
<author>Ken Werner</author>
|
||||||
|
<widget class="QWidget">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>Prefs</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>340</width>
|
||||||
|
<height>73</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="caption">
|
||||||
|
<string>Preferences</string>
|
||||||
|
</property>
|
||||||
|
<vbox>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QSplitter">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>splitter3</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<widget class="KListView">
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Source</string>
|
||||||
|
</property>
|
||||||
|
<property name="clickable">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="resizable">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>sourceListView</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="resizeMode">
|
||||||
|
<enum>AllColumns</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidgetStack">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>widgetStack</cstring>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>WStackPage</cstring>
|
||||||
|
</property>
|
||||||
|
<attribute name="id">
|
||||||
|
<number>0</number>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</vbox>
|
||||||
|
</widget>
|
||||||
|
<layoutdefaults spacing="6" margin="11"/>
|
||||||
|
<includehints>
|
||||||
|
<includehint>klistview.h</includehint>
|
||||||
|
</includehints>
|
||||||
|
</UI>
|
@ -0,0 +1,97 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "sourcelistitem.h"
|
||||||
|
#include <qcheckbox.h>
|
||||||
|
|
||||||
|
//#include <kdebug.h>
|
||||||
|
|
||||||
|
SourceListItem::SourceListItem(Source* inSource, QCheckListItem* inParent, Type tt):
|
||||||
|
QCheckListItem(inParent, inSource->getName(), tt){
|
||||||
|
mSource = inSource;
|
||||||
|
initItem();
|
||||||
|
}
|
||||||
|
SourceListItem::SourceListItem(Source* inSource, QCheckListItem* inParent, QListViewItem* after, Type tt):
|
||||||
|
QCheckListItem(inParent, after, inSource->getName(), tt){
|
||||||
|
mSource = inSource;
|
||||||
|
initItem();
|
||||||
|
}
|
||||||
|
SourceListItem::SourceListItem(Source* inSource, QListViewItem* inParent, Type tt):
|
||||||
|
QCheckListItem(inParent, inSource->getName(), tt){
|
||||||
|
mSource = inSource;
|
||||||
|
initItem();
|
||||||
|
}
|
||||||
|
SourceListItem::SourceListItem(Source* inSource, QListViewItem* inParent, QListViewItem* after, Type tt):
|
||||||
|
QCheckListItem(inParent, after, inSource->getName(), tt){
|
||||||
|
mSource = inSource;
|
||||||
|
initItem();
|
||||||
|
}
|
||||||
|
SourceListItem::SourceListItem(Source* inSource, QListView* inParent, Type tt):
|
||||||
|
QCheckListItem(inParent, inSource->getName(), tt){
|
||||||
|
mSource = inSource;
|
||||||
|
initItem();
|
||||||
|
}
|
||||||
|
SourceListItem::SourceListItem(Source* inSource, QListView* inParent, QListViewItem* after, Type tt):
|
||||||
|
QCheckListItem(inParent, after, inSource->getName(), tt){
|
||||||
|
mSource = inSource;
|
||||||
|
initItem();
|
||||||
|
}
|
||||||
|
SourceListItem::SourceListItem(Source* inSource, QListViewItem* inParent, const QPixmap& p):
|
||||||
|
QCheckListItem(inParent, inSource->getName(), p){
|
||||||
|
mSource = inSource;
|
||||||
|
initItem();
|
||||||
|
}
|
||||||
|
SourceListItem::SourceListItem(Source* inSource, QListView* inParent, const QPixmap& p):
|
||||||
|
QCheckListItem(inParent, inSource->getName(), p){
|
||||||
|
mSource = inSource;
|
||||||
|
initItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
SourceListItem::~SourceListItem(){
|
||||||
|
}
|
||||||
|
|
||||||
|
void SourceListItem::initItem(){
|
||||||
|
//setText(1, mSource->getName());
|
||||||
|
//item->setText(2, source->getDescription());
|
||||||
|
|
||||||
|
connect(mSource, SIGNAL(enabledChanged(bool, Source*)), this, SLOT(setEnabled(bool)));
|
||||||
|
setOn(mSource->isEnabled());
|
||||||
|
}
|
||||||
|
|
||||||
|
void SourceListItem::updateText() {
|
||||||
|
setText(0, mSource->getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
Source* SourceListItem::getSource(){
|
||||||
|
return mSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SourceListItem::setName(const QString& inName){
|
||||||
|
setText(1, inName);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SourceListItem::setEnabled(bool inEnabled){
|
||||||
|
mSource->setMaybeEnabled(inEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SourceListItem::stateChange(bool inOn){
|
||||||
|
QCheckListItem::stateChange(inOn);
|
||||||
|
setEnabled(inOn);
|
||||||
|
}
|
@ -0,0 +1,92 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef SOURCELISTITEM_H
|
||||||
|
#define SOURCELISTITEM_H
|
||||||
|
|
||||||
|
#include <qlistview.h>
|
||||||
|
#include <qobject.h>
|
||||||
|
#include <sources/source.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SourceListItem
|
||||||
|
* @author Ken Werner
|
||||||
|
*/
|
||||||
|
class SourceListItem : public QObject, public QCheckListItem {
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new Source
|
||||||
|
*/
|
||||||
|
SourceListItem(Source* inSource, QCheckListItem* inParent, Type tt = RadioButtonController );
|
||||||
|
SourceListItem(Source* inSource, QCheckListItem* inParent, QListViewItem* after, Type tt = RadioButtonController );
|
||||||
|
SourceListItem(Source* inSource, QListViewItem* inParent, Type tt = RadioButtonController );
|
||||||
|
SourceListItem(Source* inSource, QListViewItem* v, QListViewItem* after, Type tt = RadioButtonController );
|
||||||
|
SourceListItem(Source* inSource, QListView* inParent, Type tt = RadioButtonController );
|
||||||
|
SourceListItem(Source* inSource, QListView* inParent, QListViewItem* after, Type tt = RadioButtonController );
|
||||||
|
SourceListItem(Source* inSource, QListViewItem* inParent, const QPixmap& p );
|
||||||
|
SourceListItem(Source* inSource, QListView* inParent, const QPixmap& p );
|
||||||
|
|
||||||
|
virtual ~SourceListItem();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* initializes the item (connects signals and slots)
|
||||||
|
*/
|
||||||
|
void initItem();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a pointer to the Source
|
||||||
|
*/
|
||||||
|
Source* getSource();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
/**
|
||||||
|
* Sets whether this source is enabled or not
|
||||||
|
*/
|
||||||
|
void setEnabled(bool inEnabled);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the Name of this source
|
||||||
|
*/
|
||||||
|
void setName(const QString& inName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* updates the text of the item
|
||||||
|
*/
|
||||||
|
void updateText();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
/**
|
||||||
|
* This signal is emitted whenever the "on" flag (setOn) of this Item has changed
|
||||||
|
*/
|
||||||
|
void toggled(bool inToggled);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* This virtual function is called when the item changes its state
|
||||||
|
*/
|
||||||
|
virtual void stateChange(bool inEnabled);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pointer to the Source
|
||||||
|
*/
|
||||||
|
Source* mSource;
|
||||||
|
};
|
||||||
|
#endif //SOURCELISTITEM_H
|
@ -0,0 +1,20 @@
|
|||||||
|
INCLUDES = -I$(top_srcdir)/src/cpufreqd -I$(top_srcdir)/src/sources $(all_includes)
|
||||||
|
METASOURCES = AUTO
|
||||||
|
libsources_la_LDFLAGS = $(all_libraries)
|
||||||
|
libsources_la_LIBADD = $(LIB_QT) $(LIB_KDECORE)
|
||||||
|
noinst_LTLIBRARIES = libsources.la
|
||||||
|
libsources_la_SOURCES = acpithermalsrc.cpp batterysrc.cpp cpuinfofreqsrc.cpp \
|
||||||
|
hddtempsrc.cpp hwmonfansrc.cpp hwmonthermalsrc.cpp i8ksrc.cpp ibmacpifansrc.cpp \
|
||||||
|
ibmacpithermalsrc.cpp ibmhdaps.cpp ibookg4thermalsrc.cpp labelsource.cpp labelsourcePrefs.ui \
|
||||||
|
nvidiathermalsrc.cpp omnibookthermalsrc.cpp source.cpp sourceprefs.ui \
|
||||||
|
sysfreqsrc.cpp threadedtrigger.cpp triggeredsource.cpp updateevent.cpp \
|
||||||
|
uptimesrc.cpp
|
||||||
|
|
||||||
|
noinst_HEADERS = acpithermalsrc.h batterysrc.h cpuinfofreqsrc.h hddtempsrc.h \
|
||||||
|
hwmonfansrc.h hwmonthermalsrc.h i8ksrc.h ibmacpifansrc.h ibmacpithermalsrc.h \
|
||||||
|
ibmhdaps.h ibookg4thermalsrc.h labelsource.h nvidiathermalsrc.h \
|
||||||
|
omnibookthermalsrc.h source.h sysfreqsrc.h \
|
||||||
|
threadedtrigger.h triggeredsource.h updateevent.h uptimesrc.h
|
||||||
|
|
||||||
|
AM_CXXFLAGS = @libhal_CFLAGS@ @nvcontrol_CFLAGS@
|
||||||
|
LIBS += @libhal_LIBS@ @nvcontrol_LIBS@
|
@ -0,0 +1,65 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "acpithermalsrc.h"
|
||||||
|
#include <qtextstream.h>
|
||||||
|
#include <qdir.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
|
||||||
|
ACPIThermalSrc::ACPIThermalSrc(QWidget* inParent, const QFile& inSourceFile):
|
||||||
|
LabelSource(inParent),
|
||||||
|
mSourceFile(inSourceFile.name()),
|
||||||
|
mTrigger(this){
|
||||||
|
mID = mSourceFile.name().section('/', -2, -2, QString::SectionSkipEmpty);
|
||||||
|
mName = mID;
|
||||||
|
mDescription = i18n("This source is provided by the Linux ACPI Thermal Zone driver.");
|
||||||
|
}
|
||||||
|
|
||||||
|
ACPIThermalSrc::~ACPIThermalSrc(){
|
||||||
|
}
|
||||||
|
|
||||||
|
std::list<Source*>ACPIThermalSrc::createInstances(QWidget* inParent){
|
||||||
|
std::list<Source*> list;
|
||||||
|
QDir d( "/proc/acpi/thermal_zone" );
|
||||||
|
if( d.exists() ){
|
||||||
|
d.setFilter( QDir::Dirs | QDir::NoSymLinks );
|
||||||
|
d.setSorting( QDir::Name);
|
||||||
|
for( unsigned int i = 0; i < d.count(); i++ ){
|
||||||
|
if((d[i] != ".") && (d[i] != "..")){
|
||||||
|
QFile acpiFile(d.canonicalPath() + "/" + d[i] + "/temperature");
|
||||||
|
list.push_back(new ACPIThermalSrc(inParent, acpiFile));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString ACPIThermalSrc::fetchValue() {
|
||||||
|
QString s = "n/a";
|
||||||
|
if(mSourceFile.open(IO_ReadOnly)){
|
||||||
|
QTextStream textStream(&mSourceFile);
|
||||||
|
s = textStream.readLine();
|
||||||
|
mSourceFile.close();
|
||||||
|
s = s.remove("temperature:").stripWhiteSpace();
|
||||||
|
s = formatTemperature(s.left(s.length()-1));
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef ACPITHERMALSRC_H
|
||||||
|
#define ACPITHERMALSRC_H
|
||||||
|
#include "labelsource.h"
|
||||||
|
#include "threadedtrigger.h"
|
||||||
|
#include <qfile.h>
|
||||||
|
#include <list>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ACPIThermalSrc reads temperature values from /proc/acpi/thermal/
|
||||||
|
* which is provided by the thermal.ko kernel module.
|
||||||
|
* @author Ken Werner
|
||||||
|
*/
|
||||||
|
class ACPIThermalSrc : public LabelSource {
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new Source from the given File
|
||||||
|
*/
|
||||||
|
ACPIThermalSrc(QWidget* inParent, const QFile& inSourceFile);
|
||||||
|
virtual ~ACPIThermalSrc();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates instances of that Source (and returns pointers to them)
|
||||||
|
*/
|
||||||
|
static std::list<Source*> createInstances(QWidget* inParent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches and returns the value of this source
|
||||||
|
* This method is called from a thread so don't call it directly
|
||||||
|
*/
|
||||||
|
virtual QString fetchValue();
|
||||||
|
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* The file from which the value is read
|
||||||
|
*/
|
||||||
|
QFile mSourceFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* triggers the fetchValue method
|
||||||
|
*/
|
||||||
|
ThreadedTrigger mTrigger;
|
||||||
|
};
|
||||||
|
#endif //ACPITHERMALSRC_H
|
@ -0,0 +1,141 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "batterysrc.h"
|
||||||
|
#include <klocale.h>
|
||||||
|
#include <kdebug.h>
|
||||||
|
|
||||||
|
#define DBUS_DEBUG_MESSAGE(func, _dbus_err_) \
|
||||||
|
kdDebug() << "error in " << func << ": " << _dbus_err_.name << ", " << _dbus_err_.message << endl
|
||||||
|
|
||||||
|
#define FREE_DBUS_ERROR(func, _dbus_err_) \
|
||||||
|
do { \
|
||||||
|
if(dbus_error_is_set(&_dbus_err_)) { \
|
||||||
|
DBUS_DEBUG_MESSAGE(func, _dbus_err_); \
|
||||||
|
dbus_error_free(&_dbus_err_); \
|
||||||
|
} \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
BatterySrc::BatterySrc(QWidget* inParent, QString inUDI):
|
||||||
|
LabelSource(inParent),
|
||||||
|
mTrigger(this, 5000),
|
||||||
|
mUDI(inUDI),
|
||||||
|
mLibHalContext(NULL){
|
||||||
|
mID = mUDI.section('/', -1);
|
||||||
|
mName = mID;
|
||||||
|
mDescription = i18n("This source displays the current state of charge of your battery.");
|
||||||
|
|
||||||
|
dbus_error_init(&mDBusError);
|
||||||
|
if((mLibHalContext = libhal_ctx_new()) == NULL){
|
||||||
|
kdDebug() << "error: libmLibHalContext_new" << endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(!libhal_ctx_set_dbus_connection(mLibHalContext, dbus_bus_get (DBUS_BUS_SYSTEM, &mDBusError))){
|
||||||
|
FREE_DBUS_ERROR("libhal_ctx_set_dbus_connection", mDBusError);
|
||||||
|
libhal_ctx_free(mLibHalContext);
|
||||||
|
mLibHalContext = NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(!libhal_ctx_init(mLibHalContext, &mDBusError)){
|
||||||
|
FREE_DBUS_ERROR("libhal_ctx_init", mDBusError);
|
||||||
|
libhal_ctx_free(mLibHalContext);
|
||||||
|
mLibHalContext = NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BatterySrc::~BatterySrc(){
|
||||||
|
if(mLibHalContext != NULL){
|
||||||
|
if(!libhal_ctx_shutdown(mLibHalContext, &mDBusError)){
|
||||||
|
FREE_DBUS_ERROR("libhal_ctx_shutdown", mDBusError);
|
||||||
|
}
|
||||||
|
libhal_ctx_free(mLibHalContext);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::list<Source*>BatterySrc::createInstances(QWidget* inParent){
|
||||||
|
std::list<Source*> list;
|
||||||
|
|
||||||
|
LibHalContext* libHalContext;
|
||||||
|
DBusError dBusError;
|
||||||
|
dbus_error_init(&dBusError);
|
||||||
|
if((libHalContext = libhal_ctx_new()) == NULL){
|
||||||
|
kdDebug() << "error: libmLibHalContext_new" << endl;
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
if(!libhal_ctx_set_dbus_connection(libHalContext, dbus_bus_get (DBUS_BUS_SYSTEM, &dBusError))){
|
||||||
|
FREE_DBUS_ERROR("libhal_ctx_set_dbus_connection", dBusError);
|
||||||
|
libhal_ctx_free(libHalContext);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
if(!libhal_ctx_init(libHalContext, &dBusError)){
|
||||||
|
FREE_DBUS_ERROR("libhal_ctx_init", dBusError);
|
||||||
|
libhal_ctx_free(libHalContext);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
int num = 0;
|
||||||
|
char** udis = libhal_manager_find_device_string_match(libHalContext, "info.category", "battery", &num, &dBusError);
|
||||||
|
if(!dbus_error_is_set(&dBusError)){
|
||||||
|
for(int i = 0; i < num; ++i){
|
||||||
|
if(libhal_device_get_property_type(libHalContext, udis[i], "battery.charge_level.last_full", &dBusError) == LIBHAL_PROPERTY_TYPE_INT32 && libhal_device_get_property_type(libHalContext, udis[i], "battery.charge_level.current", &dBusError) == LIBHAL_PROPERTY_TYPE_INT32){
|
||||||
|
if(!dbus_error_is_set(&dBusError)) // todo: check whether this check is redundant
|
||||||
|
list.push_back(new BatterySrc(inParent, udis[i]));
|
||||||
|
}
|
||||||
|
if(dbus_error_is_set(&dBusError)) {
|
||||||
|
DBUS_DEBUG_MESSAGE("libhal_device_get_property_type", dBusError);
|
||||||
|
dbus_error_free(&dBusError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
DBUS_DEBUG_MESSAGE("libhal_manager_find_device_string_match", dBusError);
|
||||||
|
dbus_error_free(&dBusError);
|
||||||
|
}
|
||||||
|
if(!libhal_ctx_shutdown(libHalContext, &dBusError)){
|
||||||
|
FREE_DBUS_ERROR("libhal_ctx_shutdown", dBusError);
|
||||||
|
}
|
||||||
|
// clean up
|
||||||
|
libhal_ctx_free(libHalContext);
|
||||||
|
libhal_free_string_array(udis);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString BatterySrc::fetchValue() {
|
||||||
|
QString s = "n/a";
|
||||||
|
if(mLibHalContext != NULL){
|
||||||
|
int last_full = 0;
|
||||||
|
int current = 0;
|
||||||
|
|
||||||
|
last_full = libhal_device_get_property_int(mLibHalContext, mUDI.ascii(), "battery.charge_level.last_full", &mDBusError);
|
||||||
|
if(dbus_error_is_set(&mDBusError)){
|
||||||
|
DBUS_DEBUG_MESSAGE("libhal_device_get_property_int", mDBusError);
|
||||||
|
dbus_error_free(&mDBusError);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
current = libhal_device_get_property_int(mLibHalContext, mUDI.ascii(), "battery.charge_level.current", &mDBusError);
|
||||||
|
if(dbus_error_is_set(&mDBusError)){
|
||||||
|
DBUS_DEBUG_MESSAGE("libhal_device_get_property_int", mDBusError);
|
||||||
|
dbus_error_free(&mDBusError);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
s = QString::number(qRound((current * 100.0) / last_full)) + " %";
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
@ -0,0 +1,76 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef BATTERYSRC_H
|
||||||
|
#define BATTERYSRC_H
|
||||||
|
#include "labelsource.h"
|
||||||
|
#include "threadedtrigger.h"
|
||||||
|
#include <qfile.h>
|
||||||
|
#include <qstring.h>
|
||||||
|
#include <list>
|
||||||
|
#include <hal/libhal.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BatterySrc fetches the state of charge of the battery from HAL
|
||||||
|
* @author Ken Werner
|
||||||
|
*/
|
||||||
|
class BatterySrc : public LabelSource {
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new Source
|
||||||
|
*/
|
||||||
|
BatterySrc(QWidget* inParent, QString inUDI);
|
||||||
|
virtual ~BatterySrc();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates instances of that Source (and returns pointers to them)
|
||||||
|
*/
|
||||||
|
static std::list<Source*> createInstances(QWidget* inParent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches and returns the value of this source
|
||||||
|
* This method is called from a thread so don't call it directly
|
||||||
|
*/
|
||||||
|
virtual QString fetchValue();
|
||||||
|
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* triggers the fetchValue method
|
||||||
|
*/
|
||||||
|
ThreadedTrigger mTrigger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The hal udi of that battery source
|
||||||
|
*/
|
||||||
|
QString mUDI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The local hal context
|
||||||
|
*/
|
||||||
|
LibHalContext* mLibHalContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The local dbus error object
|
||||||
|
*/
|
||||||
|
DBusError mDBusError;
|
||||||
|
|
||||||
|
};
|
||||||
|
#endif //BATTERYSRC_H
|
@ -0,0 +1,57 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "cpuinfofreqsrc.h"
|
||||||
|
#include <qtextstream.h>
|
||||||
|
#include <qfile.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
|
||||||
|
CpuinfoFreqSrc::CpuinfoFreqSrc(QWidget* inParent, const QFile& inSourceFile):
|
||||||
|
LabelSource(inParent),
|
||||||
|
mSourceFile(inSourceFile.name()),
|
||||||
|
mTrigger(this){
|
||||||
|
mID = "proc";
|
||||||
|
mName = mID;
|
||||||
|
mDescription = i18n("This source is provided by the Linux kernel proc vfs interface.");
|
||||||
|
}
|
||||||
|
|
||||||
|
CpuinfoFreqSrc::~CpuinfoFreqSrc(){
|
||||||
|
}
|
||||||
|
|
||||||
|
std::list<Source*>CpuinfoFreqSrc::createInstances(QWidget* inParent){
|
||||||
|
std::list<Source*> list;
|
||||||
|
QFile cpuinfoFreqFile( "/proc/cpuinfo" );
|
||||||
|
if(cpuinfoFreqFile.open(IO_ReadOnly))
|
||||||
|
list.push_back(new CpuinfoFreqSrc(inParent, cpuinfoFreqFile));
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString CpuinfoFreqSrc::fetchValue(){
|
||||||
|
QString s = "n/a";
|
||||||
|
if(mSourceFile.open(IO_ReadOnly)){
|
||||||
|
while( mSourceFile.readLine( s, 64 ) != -1 )
|
||||||
|
if( s.startsWith( "cpu MHz") )
|
||||||
|
break;
|
||||||
|
s = s.section( ':', 1, 1 ).stripWhiteSpace();
|
||||||
|
s = KHzinHumanReadable(uint(s.toDouble() * 1000));
|
||||||
|
mSourceFile.close();
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef CPUINFOFREQSRC_H
|
||||||
|
#define CPUINFOFREQSRC_H
|
||||||
|
#include "labelsource.h"
|
||||||
|
#include "threadedtrigger.h"
|
||||||
|
#include <qfile.h>
|
||||||
|
#include <list>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CpuinfoFreqSrc reads temperature values from /proc/cpuinfo
|
||||||
|
*/
|
||||||
|
class CpuinfoFreqSrc : public LabelSource {
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new Source from the given File
|
||||||
|
*/
|
||||||
|
CpuinfoFreqSrc(QWidget* inParent, const QFile& inSourceFile);
|
||||||
|
virtual ~CpuinfoFreqSrc();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates instances of that Source (and returns pointers to them)
|
||||||
|
*/
|
||||||
|
static std::list<Source*> createInstances(QWidget* inParent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches and returns the value of this source
|
||||||
|
* This method is called from a thread so don't call it directly
|
||||||
|
*/
|
||||||
|
virtual QString fetchValue();
|
||||||
|
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* The file from which the value is read
|
||||||
|
*/
|
||||||
|
QFile mSourceFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* triggers the fetchValue method
|
||||||
|
*/
|
||||||
|
ThreadedTrigger mTrigger;
|
||||||
|
};
|
||||||
|
#endif //CPUINFOFREQSRC_H
|
||||||
|
|
@ -0,0 +1,100 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "hddtempsrc.h"
|
||||||
|
|
||||||
|
#include <qsocketdevice.h>
|
||||||
|
#include <qhostaddress.h>
|
||||||
|
#include <qcstring.h>
|
||||||
|
|
||||||
|
#include <klocale.h>
|
||||||
|
|
||||||
|
//#include <kdebug.h>
|
||||||
|
|
||||||
|
const Q_ULONG HDDTempSrc::BUFFERSIZE = 128;
|
||||||
|
const Q_UINT32 HDDTempSrc::ADDRESS = (127<<24)|1;
|
||||||
|
const Q_UINT16 HDDTempSrc::PORT = 7634;
|
||||||
|
|
||||||
|
HDDTempSrc::HDDTempSrc(QWidget* inParent, uint inIndex, const QString& inDevice, const QString& inModelName):
|
||||||
|
LabelSource(inParent),
|
||||||
|
mIndex(inIndex),
|
||||||
|
mTrigger(this){
|
||||||
|
mID = "HDDTemp" + QString().setNum(inIndex);
|
||||||
|
mName = mID;
|
||||||
|
mDescription = i18n("This source is provided by hddtemp. (%1, %2)").arg(inDevice).arg(inModelName);
|
||||||
|
}
|
||||||
|
|
||||||
|
HDDTempSrc::~HDDTempSrc(){
|
||||||
|
}
|
||||||
|
|
||||||
|
std::list<Source*>HDDTempSrc::createInstances(QWidget* inParent){
|
||||||
|
std::list<Source*> list;
|
||||||
|
QSocketDevice sd;
|
||||||
|
sd.setBlocking(true);
|
||||||
|
if(sd.connect((ADDRESS), PORT)){
|
||||||
|
//kdDebug() << "hddtemp is availalble" << endl;
|
||||||
|
QCString tmp(0);
|
||||||
|
Q_LONG numBytes = 0;
|
||||||
|
Q_LONG numTotalBytes = 0;
|
||||||
|
do{
|
||||||
|
tmp.resize(numTotalBytes+BUFFERSIZE);
|
||||||
|
numBytes = sd.readBlock(tmp.data()+numTotalBytes, BUFFERSIZE);
|
||||||
|
// numBytes could be -1 too in case of an error!
|
||||||
|
numTotalBytes += QMAX(numBytes, 0);
|
||||||
|
}while(numBytes>0);
|
||||||
|
sd.close();
|
||||||
|
tmp.resize(numTotalBytes+1);
|
||||||
|
//kdDebug() << "following data was read: " << tmp << endl;
|
||||||
|
// split the string
|
||||||
|
QStringList sl = QStringList::split(tmp[0], tmp);
|
||||||
|
// create the sources
|
||||||
|
if(sl.size() > 0 && sl.size()%4 == 0){
|
||||||
|
for(uint i = 0; i < sl.size(); i += 4)
|
||||||
|
list.push_back(new HDDTempSrc(inParent, i/4, sl[i], sl[i+1]));
|
||||||
|
}
|
||||||
|
}//else
|
||||||
|
//kdDebug() << "hddtemp is not availalble" << endl; // << sd.error() << endl;
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString HDDTempSrc::fetchValue(){
|
||||||
|
QString s = "n/a";
|
||||||
|
QSocketDevice sd;
|
||||||
|
sd.setBlocking(true);
|
||||||
|
if(sd.connect((ADDRESS), PORT)){
|
||||||
|
QCString tmp(0);
|
||||||
|
Q_LONG numBytes = 0;
|
||||||
|
Q_LONG numTotalBytes = 0;
|
||||||
|
do{
|
||||||
|
tmp.resize(numTotalBytes+BUFFERSIZE);
|
||||||
|
numBytes = sd.readBlock(tmp.data()+numTotalBytes, BUFFERSIZE);
|
||||||
|
// numBytes could be -1 too in case of an error!
|
||||||
|
numTotalBytes += QMAX(numBytes, 0);
|
||||||
|
}while(numBytes>0);
|
||||||
|
sd.close();
|
||||||
|
tmp.resize(numTotalBytes+1);
|
||||||
|
QStringList sl = QStringList::split(tmp[0], tmp);
|
||||||
|
if(sl.size() > 0 && sl.size()%4 == 0){
|
||||||
|
s = formatTemperature(sl[mIndex*4+2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,74 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef HDDTEMPSRC_H
|
||||||
|
#define HDDTEMPSRC_H
|
||||||
|
#include "labelsource.h"
|
||||||
|
#include "threadedtrigger.h"
|
||||||
|
#include <list>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HDDTempSrc reads temperature of your harddisk provided by hddtemp
|
||||||
|
*/
|
||||||
|
class HDDTempSrc : public LabelSource {
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* defines how many bytes are read at once from the network
|
||||||
|
*/
|
||||||
|
static const Q_ULONG BUFFERSIZE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* defines the address
|
||||||
|
*/
|
||||||
|
static const Q_UINT32 ADDRESS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* defines the port
|
||||||
|
*/
|
||||||
|
static const Q_UINT16 PORT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new Source from the given File
|
||||||
|
*/
|
||||||
|
HDDTempSrc(QWidget* inParent, uint inIndex, const QString& inDevice, const QString& inModelName);
|
||||||
|
virtual ~HDDTempSrc();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates instances of that Source (and returns pointers to them)
|
||||||
|
*/
|
||||||
|
static std::list<Source*> createInstances(QWidget* inParent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches and returns the value of this source
|
||||||
|
* This method is called from a thread so don't call it directly
|
||||||
|
*/
|
||||||
|
virtual QString fetchValue();
|
||||||
|
|
||||||
|
private:
|
||||||
|
uint mIndex;
|
||||||
|
/**
|
||||||
|
* triggers the fetchValue method
|
||||||
|
*/
|
||||||
|
ThreadedTrigger mTrigger;
|
||||||
|
};
|
||||||
|
#endif //HDDTEMPSRC_H
|
||||||
|
|
@ -0,0 +1,91 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "hwmonfansrc.h"
|
||||||
|
#include <qtextstream.h>
|
||||||
|
#include <qdir.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
|
||||||
|
HwMonFanSrc::HwMonFanSrc(QWidget* inParent, const QFile& inSourceFile, unsigned int inIndex):
|
||||||
|
LabelSource(inParent),
|
||||||
|
mSourceFile(inSourceFile.name()),
|
||||||
|
mTrigger(this, 3000){
|
||||||
|
//mName = "HwMon " + inSourceFile.name()[inSourceFile.name().length() - 7];
|
||||||
|
mID = "hwmonFan" + QString::number(inIndex);
|
||||||
|
mName = mID;
|
||||||
|
mDescription = i18n("This fan source is provided by hwmon. (%1)").arg(inSourceFile.name());
|
||||||
|
}
|
||||||
|
|
||||||
|
HwMonFanSrc::~HwMonFanSrc(){
|
||||||
|
}
|
||||||
|
|
||||||
|
std::list<Source*>HwMonFanSrc::createInstances(QWidget* inParent){
|
||||||
|
std::list<Source*> list;
|
||||||
|
// /sys/class/hwmon/hwmon*/device/fan*_input
|
||||||
|
QDir d("/sys/class/hwmon/");
|
||||||
|
QDir subd;
|
||||||
|
QString device = "/device";
|
||||||
|
// check the i2c interface if hwmon isn't available
|
||||||
|
// /sys/bus/i2c/devices/*/fan*_input
|
||||||
|
if(!d.exists()){
|
||||||
|
d.setPath("/sys/bus/i2c/devices/");
|
||||||
|
device = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(d.exists()){
|
||||||
|
unsigned int index = 1;
|
||||||
|
d.setFilter(QDir::Dirs);
|
||||||
|
d.setSorting(QDir::Name);
|
||||||
|
for(unsigned int i = 0; i < d.count(); i++ ){
|
||||||
|
if((d[i] != ".") && (d[i] != "..")){
|
||||||
|
subd = d.canonicalPath() + "/" + d[i] + device;
|
||||||
|
subd.setFilter(QDir::Files);
|
||||||
|
subd.setSorting(QDir::Name);
|
||||||
|
for ( unsigned int j = 0; j < subd.count(); j++ ){
|
||||||
|
if((subd[j] != ".") && (subd[j] != "..") && (QDir::match(subd.canonicalPath() + "/fan*_input", subd.canonicalPath() + "/" + subd[j]))){
|
||||||
|
QFile f(subd.canonicalPath() + "/" + subd[j]);
|
||||||
|
if(f.open(IO_ReadOnly)){
|
||||||
|
QTextStream textStream( &f );
|
||||||
|
QString s = textStream.readLine();
|
||||||
|
f.close();
|
||||||
|
if(!s.startsWith("-")){
|
||||||
|
list.push_back(new HwMonFanSrc(inParent, f, index));
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString HwMonFanSrc::fetchValue(){
|
||||||
|
QString s = "n/a";
|
||||||
|
if(mSourceFile.open(IO_ReadOnly)){
|
||||||
|
QTextStream textStream( &mSourceFile );
|
||||||
|
s = textStream.readLine().stripWhiteSpace();
|
||||||
|
mSourceFile.close();
|
||||||
|
s.append(" rpm");
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,66 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef HWMONFANSRC_H
|
||||||
|
#define HWMONFANSRC_H
|
||||||
|
#include "labelsource.h"
|
||||||
|
#include "threadedtrigger.h"
|
||||||
|
#include <qfile.h>
|
||||||
|
#include <list>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HwMonThermalSrc reads fan rpm values from /sys/class/hwmon/\*\/device/fan*_input
|
||||||
|
* that is provided by the hwmon kernel by the lmsensors kernel modules since version 2.6.14.
|
||||||
|
* /sys/bus/i2c/devices/\*\/fan*_input is used as a fall back.
|
||||||
|
* see /usr/src/linux/Documentation/hwmon/sysfs-interface
|
||||||
|
*/
|
||||||
|
class HwMonFanSrc : public LabelSource {
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new Source from the given File
|
||||||
|
*/
|
||||||
|
HwMonFanSrc(QWidget* inParent, const QFile& inSourceFile, unsigned int inIndex);
|
||||||
|
virtual ~HwMonFanSrc();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates instances of that Source (and returns pointers to them)
|
||||||
|
*/
|
||||||
|
static std::list<Source*> createInstances(QWidget* inParent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches and returns the value of this source
|
||||||
|
* This method is called from a thread so don't call it directly
|
||||||
|
*/
|
||||||
|
virtual QString fetchValue();
|
||||||
|
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* The file from which the value is read
|
||||||
|
*/
|
||||||
|
QFile mSourceFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* triggers the fetchValue method
|
||||||
|
*/
|
||||||
|
ThreadedTrigger mTrigger;
|
||||||
|
};
|
||||||
|
#endif //HWMONFANSRC_H
|
||||||
|
|
@ -0,0 +1,94 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "hwmonthermalsrc.h"
|
||||||
|
#include <qtextstream.h>
|
||||||
|
#include <qdir.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
|
||||||
|
HwMonThermalSrc::HwMonThermalSrc(QWidget* inParent, const QFile& inSourceFile, unsigned int inIndex):
|
||||||
|
LabelSource(inParent),
|
||||||
|
mSourceFile(inSourceFile.name()),
|
||||||
|
mTrigger(this, 3000){
|
||||||
|
//mName = "HwMon " + inSourceFile.name()[inSourceFile.name().length() - 7];
|
||||||
|
mID = "hwmon" + QString::number(inIndex);
|
||||||
|
mName = mID;
|
||||||
|
mDescription = i18n("This thermal source is provided by hwmon. (%1)").arg(inSourceFile.name());
|
||||||
|
}
|
||||||
|
|
||||||
|
HwMonThermalSrc::~HwMonThermalSrc(){
|
||||||
|
}
|
||||||
|
|
||||||
|
std::list<Source*>HwMonThermalSrc::createInstances(QWidget* inParent){
|
||||||
|
std::list<Source*> list;
|
||||||
|
// /sys/class/hwmon/*/device/temp*_input
|
||||||
|
QDir d("/sys/class/hwmon/");
|
||||||
|
QDir subd;
|
||||||
|
QString device = "/device";
|
||||||
|
// check the i2c interface if hwmon isn't available
|
||||||
|
// /sys/bus/i2c/devices/*/temp*_input
|
||||||
|
if(!d.exists()){
|
||||||
|
d.setPath("/sys/bus/i2c/devices/");
|
||||||
|
device = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(d.exists()){
|
||||||
|
unsigned int index = 1;
|
||||||
|
d.setFilter(QDir::Dirs);
|
||||||
|
d.setSorting(QDir::Name);
|
||||||
|
for(unsigned int i = 0; i < d.count(); i++ ){
|
||||||
|
if((d[i] != ".") && (d[i] != "..")){
|
||||||
|
subd = d.canonicalPath() + "/" + d[i] + device;
|
||||||
|
subd.setFilter(QDir::Files);
|
||||||
|
subd.setSorting(QDir::Name);
|
||||||
|
for(unsigned int j = 0; j < subd.count(); j++){
|
||||||
|
if((subd[j] != ".") && (subd[j] != "..") && (QDir::match(subd.canonicalPath() + "/temp*_input", subd.canonicalPath() + "/" + subd[j]))){
|
||||||
|
QFile f(subd.canonicalPath() + "/" + subd[j]);
|
||||||
|
if(f.open(IO_ReadOnly)){
|
||||||
|
QTextStream textStream( &f );
|
||||||
|
QString s = textStream.readLine();
|
||||||
|
f.close();
|
||||||
|
if(!s.startsWith("-")){
|
||||||
|
list.push_back(new HwMonThermalSrc(inParent, f, index));
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString HwMonThermalSrc::fetchValue(){
|
||||||
|
QString s = "n/a";
|
||||||
|
if(mSourceFile.open(IO_ReadOnly)){
|
||||||
|
QTextStream textStream( &mSourceFile );
|
||||||
|
s = textStream.readLine();
|
||||||
|
mSourceFile.close();
|
||||||
|
s = s.stripWhiteSpace();
|
||||||
|
if(s.length() > 3)
|
||||||
|
s = s.remove(s.length() - 3, 3);
|
||||||
|
s = formatTemperature(s);
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,66 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef HWMONTHERMALSRC_H
|
||||||
|
#define HWMONTHERMALSRC_H
|
||||||
|
#include "labelsource.h"
|
||||||
|
#include "threadedtrigger.h"
|
||||||
|
#include <qfile.h>
|
||||||
|
#include <list>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HwMonThermalSrc reads temperature values from /sys/class/hwmon/\*\/device/temp*_input
|
||||||
|
* that is provided by the hwmon kernel by the lmsensors kernel modules since version 2.6.14.
|
||||||
|
* /sys/bus/i2c/devices/\*\/temp*_input is used as a fall back.
|
||||||
|
* see /usr/src/linux/Documentation/hwmon/sysfs-interface
|
||||||
|
*/
|
||||||
|
class HwMonThermalSrc : public LabelSource {
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new Source from the given File
|
||||||
|
*/
|
||||||
|
HwMonThermalSrc(QWidget* inParent, const QFile& inSourceFile, unsigned int inIndex);
|
||||||
|
virtual ~HwMonThermalSrc();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates instances of that Source (and returns pointers to them)
|
||||||
|
*/
|
||||||
|
static std::list<Source*> createInstances(QWidget* inParent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches and returns the value of this source
|
||||||
|
* This method is called from a thread so don't call it directly
|
||||||
|
*/
|
||||||
|
virtual QString fetchValue();
|
||||||
|
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* The file from which the value is read
|
||||||
|
*/
|
||||||
|
QFile mSourceFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* triggers the fetchValue method
|
||||||
|
*/
|
||||||
|
ThreadedTrigger mTrigger;
|
||||||
|
};
|
||||||
|
#endif //HWMONTHERMALSRC_H
|
||||||
|
|
@ -0,0 +1,111 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "i8ksrc.h"
|
||||||
|
#include <qtextstream.h>
|
||||||
|
#include <qdir.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
|
||||||
|
I8kSrc::I8kSrc(QWidget* inParent, const QFile& inSourceFile, unsigned int inIndex):
|
||||||
|
LabelSource(inParent),
|
||||||
|
mIndex(inIndex),
|
||||||
|
mSourceFile(inSourceFile.name()),
|
||||||
|
mTrigger(this){
|
||||||
|
mID = I8kSrc::index2Name(inIndex);
|
||||||
|
mName = mID;
|
||||||
|
mDescription = i18n("This source is provided by i8k kernel module.");
|
||||||
|
}
|
||||||
|
|
||||||
|
I8kSrc::~I8kSrc(){
|
||||||
|
}
|
||||||
|
|
||||||
|
std::list<Source*>I8kSrc::createInstances(QWidget* inParent){
|
||||||
|
std::list<Source*> list;
|
||||||
|
QFile i8kFile("/proc/i8k");
|
||||||
|
if(i8kFile.open(IO_ReadOnly)){
|
||||||
|
QTextStream textStream(&i8kFile);
|
||||||
|
QString s = textStream.readLine();
|
||||||
|
i8kFile.close();
|
||||||
|
QStringList entries = QStringList::split(' ', s);
|
||||||
|
if(entries.size() && entries[0] == "1.0"){ // support for version 1.0
|
||||||
|
// CPU temp
|
||||||
|
if(entries.size() >= 4 && !entries[3].startsWith("-"))
|
||||||
|
list.push_back(new I8kSrc(inParent, i8kFile, 3));
|
||||||
|
// left fan
|
||||||
|
if(entries.size() >= 7 && !entries[4].startsWith("-"))
|
||||||
|
list.push_back(new I8kSrc(inParent, i8kFile, 6));
|
||||||
|
// left fan
|
||||||
|
if(entries.size() >= 8 && !entries[5].startsWith("-"))
|
||||||
|
list.push_back(new I8kSrc(inParent, i8kFile, 7));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
QString I8kSrc::fetchValue(){
|
||||||
|
QString s = "n/a";
|
||||||
|
if(mSourceFile.open(IO_ReadOnly)){
|
||||||
|
QTextStream textStream(&mSourceFile);
|
||||||
|
s = textStream.readLine();
|
||||||
|
mSourceFile.close();
|
||||||
|
s = s.section(' ', mIndex, mIndex, QString::SectionSkipEmpty).stripWhiteSpace();
|
||||||
|
switch(mIndex){
|
||||||
|
case 3: // CPU temperature (Celsius)
|
||||||
|
s = formatTemperature(s);
|
||||||
|
break;
|
||||||
|
case 6: // left fan rpm
|
||||||
|
case 7: // right fan rpm
|
||||||
|
if(s.length() > 1)
|
||||||
|
s.truncate(s.length() - 1); //s = QString::number(s.toInt()/10);
|
||||||
|
s.append(" rpm");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString I8kSrc::index2Name(unsigned int inIndex){
|
||||||
|
switch(inIndex){
|
||||||
|
case 0: // /proc/i8k format version
|
||||||
|
return "i8k Format Version";
|
||||||
|
case 1: // BIOS version
|
||||||
|
return "Bios";
|
||||||
|
case 2: // serial number
|
||||||
|
return "Serial";
|
||||||
|
case 3: // CPU temperature (Celsius)
|
||||||
|
return "CPU";
|
||||||
|
case 4: // left fan status
|
||||||
|
return "left Fan Status";
|
||||||
|
case 5: // right fan status
|
||||||
|
return "right Fan Status";
|
||||||
|
case 6: // left fan rpm
|
||||||
|
return "left Fan";
|
||||||
|
case 7: // right fan rpm
|
||||||
|
return "right Fan";
|
||||||
|
case 8: // ac status
|
||||||
|
return "AC Status";
|
||||||
|
case 9: // buttons status
|
||||||
|
return "Button Status";
|
||||||
|
default:
|
||||||
|
return "unknown" + QString().setNum(inIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,74 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef I8KSRC_H
|
||||||
|
#define I8KSRC_H
|
||||||
|
#include "labelsource.h"
|
||||||
|
#include "threadedtrigger.h"
|
||||||
|
#include <qfile.h>
|
||||||
|
#include <list>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* I8kSrc reads CPU thermal and fan rpm values from /proc/i8k
|
||||||
|
* which is provided by the i8k kernel module.
|
||||||
|
*/
|
||||||
|
class I8kSrc : public LabelSource {
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new Source from the given File
|
||||||
|
*/
|
||||||
|
I8kSrc(QWidget* inParent, const QFile& inSourceFile, unsigned int inIndex);
|
||||||
|
virtual ~I8kSrc();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates instances of that Source (and returns pointers to them)
|
||||||
|
*/
|
||||||
|
static std::list<Source*> createInstances(QWidget* inParent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches and returns the value of this source
|
||||||
|
* This method is called from a thread so don't call it directly
|
||||||
|
*/
|
||||||
|
virtual QString fetchValue();
|
||||||
|
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* Returns the name (such as CPU, GPU, ...) of the sensor according to a given index
|
||||||
|
*/
|
||||||
|
static QString index2Name(unsigned int inIndex);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the index of the source in /proc/acpi/ibm/thermal
|
||||||
|
*/
|
||||||
|
unsigned int mIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The file from which the value is read
|
||||||
|
*/
|
||||||
|
QFile mSourceFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* triggers the fetchValue method
|
||||||
|
*/
|
||||||
|
ThreadedTrigger mTrigger;
|
||||||
|
};
|
||||||
|
#endif //I8KSRC_H
|
||||||
|
|
@ -0,0 +1,57 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "ibmacpifansrc.h"
|
||||||
|
#include <qtextstream.h>
|
||||||
|
#include <qfile.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
|
||||||
|
IBMACPIFanSrc::IBMACPIFanSrc(QWidget* inParent, const QFile& inSourceFile):
|
||||||
|
LabelSource(inParent),
|
||||||
|
mSourceFile(inSourceFile.name()),
|
||||||
|
mTrigger(this){
|
||||||
|
mID = "Fan";
|
||||||
|
mName = mID;
|
||||||
|
mDescription = i18n("This source is provided by the ACPI driver for IBM ThinkPads.");
|
||||||
|
}
|
||||||
|
|
||||||
|
IBMACPIFanSrc::~IBMACPIFanSrc(){
|
||||||
|
}
|
||||||
|
|
||||||
|
std::list<Source*>IBMACPIFanSrc::createInstances(QWidget* inParent){
|
||||||
|
std::list<Source*> list;
|
||||||
|
QFile ibmFile( "/proc/acpi/ibm/fan" );
|
||||||
|
if(ibmFile.open(IO_ReadOnly))
|
||||||
|
list.push_back(new IBMACPIFanSrc(inParent, ibmFile));
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString IBMACPIFanSrc::fetchValue(){
|
||||||
|
QString s = "n/a";
|
||||||
|
if(mSourceFile.open(IO_ReadOnly)){
|
||||||
|
while( mSourceFile.readLine( s, 64 ) != -1 )
|
||||||
|
if(s.startsWith("speed:"))
|
||||||
|
break;
|
||||||
|
s = s.section( ':', 1, 1 ).stripWhiteSpace() + " rpm";
|
||||||
|
mSourceFile.close();
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,63 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef IBMACPIFANSRC_H
|
||||||
|
#define IBMACPIFANSRC_H
|
||||||
|
#include "labelsource.h"
|
||||||
|
#include "threadedtrigger.h"
|
||||||
|
#include <qfile.h>
|
||||||
|
#include <list>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IBMACPIFanSrc reads fan values from /proc/acpi/ibm/thermal
|
||||||
|
* which is provided by the ibm-acpi kernel module.
|
||||||
|
*/
|
||||||
|
class IBMACPIFanSrc : public LabelSource {
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new Source from the given File and index
|
||||||
|
*/
|
||||||
|
IBMACPIFanSrc(QWidget* inParent, const QFile& inSourceFile);
|
||||||
|
virtual ~IBMACPIFanSrc();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates instances of that Source (and returns pointers to them)
|
||||||
|
*/
|
||||||
|
static std::list<Source*> createInstances(QWidget* inParent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches and returns the value of this source
|
||||||
|
* This method is called from a thread so don't call it directly
|
||||||
|
*/
|
||||||
|
virtual QString fetchValue();
|
||||||
|
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* The file from which the value is read
|
||||||
|
*/
|
||||||
|
QFile mSourceFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* triggers the fetchValue method
|
||||||
|
*/
|
||||||
|
ThreadedTrigger mTrigger;
|
||||||
|
};
|
||||||
|
#endif //IBMACPIFANSRC_H
|
@ -0,0 +1,88 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "ibmacpithermalsrc.h"
|
||||||
|
#include <qtextstream.h>
|
||||||
|
#include <qfile.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
//#include "hal/libhal.h"
|
||||||
|
// hal-get-property --udi /org/freedesktop/Hal/devices/computer --key system.product
|
||||||
|
|
||||||
|
IBMACPIThermalSrc::IBMACPIThermalSrc(QWidget* inParent, const QFile& inSourceFile, unsigned int inIndex):
|
||||||
|
LabelSource(inParent),
|
||||||
|
mIndex(inIndex),
|
||||||
|
mSourceFile(inSourceFile.name()),
|
||||||
|
mTrigger(this){
|
||||||
|
//mName = mName.setNum(inIndex+1).prepend("IBM");
|
||||||
|
mID = IBMACPIThermalSrc::index2Name(inIndex);
|
||||||
|
mName = mID;
|
||||||
|
mDescription = i18n("This source is provided by the ACPI driver for IBM ThinkPads.");
|
||||||
|
}
|
||||||
|
|
||||||
|
IBMACPIThermalSrc::~IBMACPIThermalSrc(){
|
||||||
|
}
|
||||||
|
|
||||||
|
std::list<Source*>IBMACPIThermalSrc::createInstances(QWidget* inParent){
|
||||||
|
std::list<Source*> list;
|
||||||
|
QFile ibmFile( "/proc/acpi/ibm/thermal" );
|
||||||
|
if(ibmFile.open(IO_ReadOnly)){
|
||||||
|
QTextStream textStream( &ibmFile );
|
||||||
|
QString s = textStream.readLine();
|
||||||
|
ibmFile.close();
|
||||||
|
s = s.remove("temperatures:");
|
||||||
|
QStringList entries = QStringList::split(' ' ,s);
|
||||||
|
for ( unsigned int i = 0; i < entries.size(); i++ ){
|
||||||
|
if(!entries[i].startsWith("-") && !entries[i].startsWith("0"))
|
||||||
|
list.push_back(new IBMACPIThermalSrc(inParent, ibmFile, i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString IBMACPIThermalSrc::fetchValue(){
|
||||||
|
QString s = "n/a";
|
||||||
|
if(mSourceFile.open(IO_ReadOnly)){
|
||||||
|
QTextStream textStream( &mSourceFile );
|
||||||
|
s = textStream.readLine();
|
||||||
|
mSourceFile.close();
|
||||||
|
s = s.section(':', 1, 1).section(' ', mIndex, mIndex, QString::SectionSkipEmpty).stripWhiteSpace();
|
||||||
|
s = formatTemperature(s);
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString IBMACPIThermalSrc::index2Name(unsigned int inIndex){
|
||||||
|
switch(inIndex){
|
||||||
|
case 0:
|
||||||
|
return "CPU";
|
||||||
|
case 1:
|
||||||
|
return "MiniPCI";
|
||||||
|
case 2:
|
||||||
|
return "HDD";
|
||||||
|
case 3:
|
||||||
|
return "GPU";
|
||||||
|
case 4:
|
||||||
|
return "Battery1";
|
||||||
|
case 6:
|
||||||
|
return "Battery2";
|
||||||
|
default:
|
||||||
|
return "ibmacpi" + QString().setNum(inIndex);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,73 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef IBMACPITHERMALSRC_H
|
||||||
|
#define IBMACPITHERMALSRC_H
|
||||||
|
#include "labelsource.h"
|
||||||
|
#include "threadedtrigger.h"
|
||||||
|
#include <qfile.h>
|
||||||
|
#include <list>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IBMACPIThermalSrc reads temperature values from /proc/acpi/ibm/thermal
|
||||||
|
* which is provided by the ibm-acpi kernel module.
|
||||||
|
*/
|
||||||
|
class IBMACPIThermalSrc : public LabelSource {
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new Source from the given File and index
|
||||||
|
*/
|
||||||
|
IBMACPIThermalSrc(QWidget* inParent, const QFile& inSourceFile, unsigned int inIndex);
|
||||||
|
virtual ~IBMACPIThermalSrc();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates instances of that Source (and returns pointers to them)
|
||||||
|
*/
|
||||||
|
static std::list<Source*> createInstances(QWidget* inParent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches and returns the value of this source
|
||||||
|
* This method is called from a thread so don't call it directly
|
||||||
|
*/
|
||||||
|
virtual QString fetchValue();
|
||||||
|
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* Returns the name (such as CPU, GPU, ...) of the sensor according to a given index
|
||||||
|
*/
|
||||||
|
static QString index2Name(unsigned int inIndex);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the index of the source in /proc/acpi/ibm/thermal
|
||||||
|
*/
|
||||||
|
unsigned int mIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The file from which the value is read
|
||||||
|
*/
|
||||||
|
QFile mSourceFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* triggers the fetchValue method
|
||||||
|
*/
|
||||||
|
ThreadedTrigger mTrigger;
|
||||||
|
};
|
||||||
|
#endif //IBMACPITHERMALSRC_H
|
@ -0,0 +1,63 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "ibmhdaps.h"
|
||||||
|
#include <qtextstream.h>
|
||||||
|
#include <qdir.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
|
||||||
|
IBMHDAPSSrc::IBMHDAPSSrc(QWidget* inParent, const QFile& inSourceFile):
|
||||||
|
LabelSource(inParent),
|
||||||
|
mSourceFile(inSourceFile.name()),
|
||||||
|
mTrigger(this){
|
||||||
|
mID = "HDAPS" + mSourceFile.name().section( '/', -1, -1, QString::SectionSkipEmpty ).remove("temp");
|
||||||
|
mName = mID;
|
||||||
|
mDescription = i18n("This thermal source is provided by the IBM HDAPS driver.");
|
||||||
|
}
|
||||||
|
|
||||||
|
IBMHDAPSSrc::~IBMHDAPSSrc(){
|
||||||
|
}
|
||||||
|
|
||||||
|
std::list<Source*>IBMHDAPSSrc::createInstances(QWidget* inParent){
|
||||||
|
std::list<Source*> list;
|
||||||
|
QDir hdapsDir( "/sys/bus/platform/drivers/hdaps/hdaps" );
|
||||||
|
if ( hdapsDir.exists() ){
|
||||||
|
hdapsDir.setFilter( QDir::Files | QDir::NoSymLinks );
|
||||||
|
hdapsDir.setSorting( QDir::Name);
|
||||||
|
for ( unsigned int i = 0; i < hdapsDir.count(); i++ ){
|
||||||
|
if(hdapsDir[i].startsWith("temp")){
|
||||||
|
QFile hdapsFile(hdapsDir.canonicalPath() + "/" + hdapsDir[i]);
|
||||||
|
list.push_back(new IBMHDAPSSrc(inParent, hdapsFile));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString IBMHDAPSSrc::fetchValue(){
|
||||||
|
QString s = "n/a";
|
||||||
|
if(mSourceFile.open(IO_ReadOnly)){
|
||||||
|
QTextStream textStream( &mSourceFile );
|
||||||
|
s = textStream.readLine().stripWhiteSpace();
|
||||||
|
mSourceFile.close();
|
||||||
|
s = formatTemperature(s);
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef IBMHDAPSSRC_H
|
||||||
|
#define IBMHDAPSSRC_H
|
||||||
|
#include "labelsource.h"
|
||||||
|
#include "threadedtrigger.h"
|
||||||
|
#include <qfile.h>
|
||||||
|
#include <list>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IBMHDAPSSrc reads temperature values of the IBM Hard Drive Active Protection System (HDAPS)
|
||||||
|
* from /sys/bus/platform/drivers/hdaps/hdaps/temp1
|
||||||
|
* which is provided by the hdapds.ko kernel module.
|
||||||
|
* @author Ken Werner
|
||||||
|
*/
|
||||||
|
class IBMHDAPSSrc : public LabelSource {
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new Source from the given File
|
||||||
|
*/
|
||||||
|
IBMHDAPSSrc(QWidget* inParent, const QFile& inSourceFile);
|
||||||
|
virtual ~IBMHDAPSSrc();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates instances of that Source (and returns pointers to them)
|
||||||
|
*/
|
||||||
|
static std::list<Source*> createInstances(QWidget* inParent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches and returns the value of this source
|
||||||
|
* This method is called from a thread so don't call it directly
|
||||||
|
*/
|
||||||
|
virtual QString fetchValue();
|
||||||
|
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* The file from which the value is read
|
||||||
|
*/
|
||||||
|
QFile mSourceFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* triggers the fetchValue method
|
||||||
|
*/
|
||||||
|
ThreadedTrigger mTrigger;
|
||||||
|
};
|
||||||
|
#endif //IBMHDAPSSRC_H
|
@ -0,0 +1,63 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by *
|
||||||
|
* Flavio Castelli, micron@madlab.it *
|
||||||
|
* Ken Werner, ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "ibookg4thermalsrc.h"
|
||||||
|
#include <qtextstream.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
|
||||||
|
IbookG4ThermalSrc::IbookG4ThermalSrc(QWidget* inParent, const QFile& inSourceFile, const QString& inName):
|
||||||
|
LabelSource(inParent),
|
||||||
|
mSourceFile(inSourceFile.name()),
|
||||||
|
mTrigger(this){
|
||||||
|
mID = inName;
|
||||||
|
mName = mID;
|
||||||
|
mDescription = i18n("This source shows a thermal sensor of your iBook.");
|
||||||
|
}
|
||||||
|
|
||||||
|
IbookG4ThermalSrc::~IbookG4ThermalSrc(){
|
||||||
|
}
|
||||||
|
|
||||||
|
std::list<Source*>IbookG4ThermalSrc::createInstances(QWidget* inParent){
|
||||||
|
std::list<Source*> list;
|
||||||
|
QFile ibookCPUFile("/sys/devices/temperatures/sensor1_temperature");
|
||||||
|
if(ibookCPUFile.open(IO_ReadOnly)){
|
||||||
|
list.push_back(new IbookG4ThermalSrc(inParent, ibookCPUFile, QString("CPU")));
|
||||||
|
ibookCPUFile.close();
|
||||||
|
}
|
||||||
|
QFile ibookGPUFile("/sys/devices/temperatures/sensor2_temperature");
|
||||||
|
if(ibookGPUFile.open(IO_ReadOnly)){
|
||||||
|
list.push_back(new IbookG4ThermalSrc(inParent, ibookGPUFile, QString("GPU")));
|
||||||
|
ibookGPUFile.close();
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString IbookG4ThermalSrc::fetchValue(){
|
||||||
|
QString s = "n/a";
|
||||||
|
if(mSourceFile.open(IO_ReadOnly)){
|
||||||
|
QTextStream textStream( &mSourceFile );
|
||||||
|
s = textStream.readLine().stripWhiteSpace();
|
||||||
|
mSourceFile.close();
|
||||||
|
s= formatTemperature(s);
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,66 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by *
|
||||||
|
* Flavio Castelli, micron@madlab.it *
|
||||||
|
* Ken Werner, ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef IBOOKG4THERMALSRC_H
|
||||||
|
#define IBOOKG4THERMALSRC_H
|
||||||
|
#include "labelsource.h"
|
||||||
|
#include "threadedtrigger.h"
|
||||||
|
#include <qfile.h>
|
||||||
|
#include <list>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Flavio Castelli
|
||||||
|
* @author Ken Werner
|
||||||
|
* IbookG4ThermalSrc reads temperature values from /sys/devices/temperatures/sensor[1,2]_temperature
|
||||||
|
* It may work on other Apple machines as well (please let me know)
|
||||||
|
*/
|
||||||
|
class IbookG4ThermalSrc : public LabelSource {
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new Source from the given File
|
||||||
|
*/
|
||||||
|
IbookG4ThermalSrc(QWidget* inParent, const QFile& inSourceFile, const QString& inName);
|
||||||
|
virtual ~IbookG4ThermalSrc();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates instances of that Source (and returns pointers to them)
|
||||||
|
*/
|
||||||
|
static std::list<Source*> createInstances(QWidget* inParent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches and returns the value of this source
|
||||||
|
* This method is called from a thread so don't call it directly
|
||||||
|
*/
|
||||||
|
virtual QString fetchValue();
|
||||||
|
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* The file from which the value is read
|
||||||
|
*/
|
||||||
|
QFile mSourceFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* triggers the fetchValue method
|
||||||
|
*/
|
||||||
|
ThreadedTrigger mTrigger;
|
||||||
|
};
|
||||||
|
#endif // IBOOKG4THERMALSRC_H
|
@ -0,0 +1,133 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "labelsource.h"
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <kcolorbutton.h>
|
||||||
|
#include <kfontrequester.h>
|
||||||
|
#include <qcombobox.h>
|
||||||
|
#include <qcheckbox.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
|
||||||
|
//#include "kdebug.h"
|
||||||
|
|
||||||
|
LabelSource::LabelSource(QWidget* inParent):
|
||||||
|
TriggeredSource(inParent),
|
||||||
|
mParent(inParent),
|
||||||
|
mLabelSourcePrefs(NULL){
|
||||||
|
}
|
||||||
|
|
||||||
|
LabelSource::~LabelSource(){
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget* LabelSource::getWidget(){
|
||||||
|
//kdDebug() << "LabelSource::getWidget called: " << mID << endl;
|
||||||
|
return mLabel;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LabelSource::createSubPrefs(QWidget* inParent){
|
||||||
|
if(!mLabelSourcePrefs){
|
||||||
|
mLabelSourcePrefs = new LabelSourcePrefs(inParent, "labelsourceprefsui");
|
||||||
|
// disable nameCheckBox if taskbarCheckBox is disabled
|
||||||
|
connect(mSourcePrefs->taskbarCheckBox, SIGNAL(toggled(bool)), mLabelSourcePrefs->colorLabel, SLOT(setEnabled(bool)));
|
||||||
|
connect(mSourcePrefs->taskbarCheckBox, SIGNAL(toggled(bool)), mLabelSourcePrefs->colorButton, SLOT(setEnabled(bool)));
|
||||||
|
connect(mSourcePrefs->taskbarCheckBox, SIGNAL(toggled(bool)), mLabelSourcePrefs->fontLabel, SLOT(setEnabled(bool)));
|
||||||
|
connect(mSourcePrefs->taskbarCheckBox, SIGNAL(toggled(bool)), mLabelSourcePrefs->fontRequester, SLOT(setEnabled(bool)));
|
||||||
|
connect(mSourcePrefs->taskbarCheckBox, SIGNAL(toggled(bool)), mLabelSourcePrefs->alignmentLabel, SLOT(setEnabled(bool)));
|
||||||
|
connect(mSourcePrefs->taskbarCheckBox, SIGNAL(toggled(bool)), mLabelSourcePrefs->alignmentComboBox, SLOT(setEnabled(bool)));
|
||||||
|
addPrefs(mLabelSourcePrefs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LabelSource::updatePrefsGUI(){
|
||||||
|
TriggeredSource::updatePrefsGUI(); // update prefs of the super class
|
||||||
|
mLabelSourcePrefs->colorButton->setColor(mLabel->paletteForegroundColor());
|
||||||
|
mLabelSourcePrefs->fontRequester->setFont(mLabel->font());
|
||||||
|
switch (mLabel->alignment()) {
|
||||||
|
case Qt::AlignCenter:
|
||||||
|
mLabelSourcePrefs->alignmentComboBox->setCurrentItem(1);
|
||||||
|
break;
|
||||||
|
case Qt::AlignRight:
|
||||||
|
mLabelSourcePrefs->alignmentComboBox->setCurrentItem(2);
|
||||||
|
break;
|
||||||
|
default: // Qt::AlignLeft
|
||||||
|
break;
|
||||||
|
mLabelSourcePrefs->alignmentComboBox->setCurrentItem(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LabelSource::setPrefsWidgetsEnabled(bool isEnabled, bool isShownOnApplet){
|
||||||
|
TriggeredSource::setPrefsWidgetsEnabled(isEnabled, isShownOnApplet);
|
||||||
|
// disable/enable some widgets if source is disabled/enabled if(isEnabled)
|
||||||
|
mLabelSourcePrefs->colorLabel->setEnabled(isEnabled && isShownOnApplet);
|
||||||
|
mLabelSourcePrefs->colorButton->setEnabled(isEnabled && isShownOnApplet);
|
||||||
|
mLabelSourcePrefs->fontLabel->setEnabled(isEnabled && isShownOnApplet);
|
||||||
|
mLabelSourcePrefs->fontRequester->setEnabled(isEnabled && isShownOnApplet);
|
||||||
|
mLabelSourcePrefs->alignmentLabel->setEnabled(isEnabled && isShownOnApplet);
|
||||||
|
mLabelSourcePrefs->alignmentComboBox->setEnabled(isEnabled && isShownOnApplet);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LabelSource::applyPrefs(){
|
||||||
|
TriggeredSource::applyPrefs(); // call apply prefs of the super class
|
||||||
|
mLabel->setPaletteForegroundColor(mLabelSourcePrefs->colorButton->color());
|
||||||
|
mLabel->setFont(mLabelSourcePrefs->fontRequester->font());
|
||||||
|
int alignID = mLabelSourcePrefs->alignmentComboBox->currentItem();
|
||||||
|
Qt::AlignmentFlags align = Qt::AlignCenter;
|
||||||
|
if(alignID == 0){
|
||||||
|
align = Qt::AlignLeft;
|
||||||
|
}else if(alignID == 2){
|
||||||
|
align = Qt::AlignRight;
|
||||||
|
}
|
||||||
|
mLabel->setAlignment(align);
|
||||||
|
updateLabel(mValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LabelSource::savePrefs(KConfig* inKConfig){
|
||||||
|
TriggeredSource::savePrefs(inKConfig);
|
||||||
|
inKConfig->writeEntry(mID + "_color", mLabelSourcePrefs->colorButton->color());
|
||||||
|
inKConfig->writeEntry(mID + "_font", mLabelSourcePrefs->fontRequester->font());
|
||||||
|
inKConfig->writeEntry(mID + "_align", mLabel->alignment());
|
||||||
|
}
|
||||||
|
|
||||||
|
void LabelSource::loadPrefs(KConfig* inKConfig){
|
||||||
|
TriggeredSource::loadPrefs(inKConfig);
|
||||||
|
QColor color = inKConfig->readColorEntry(mID + "_color");
|
||||||
|
if(!color.isValid())
|
||||||
|
color.setRgb(0,0,0);
|
||||||
|
mLabel->setPaletteForegroundColor(color);
|
||||||
|
mLabel->setFont(inKConfig->readFontEntry(mID + "_font"));
|
||||||
|
mLabel->setAlignment(inKConfig->readNumEntry(mID + "_align"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void LabelSource::updateLabel(const QString& inValue){
|
||||||
|
// update the label text
|
||||||
|
QString text = (getName().isEmpty() || !showName()) ? inValue : getName() + ": " + inValue;
|
||||||
|
//kdDebug() << "updateLabel " << getName() << ", value: " << text << endl;
|
||||||
|
//if(mLabel->text() != text)
|
||||||
|
mLabel->setText(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LabelSource::realizeWidget(){
|
||||||
|
Source::realizeWidget();
|
||||||
|
// the prefs dialog is created in the addPrefs method
|
||||||
|
mLabel = new QLabel(i18n("n/a"), mParent);
|
||||||
|
mLabel->setTextFormat(Qt::PlainText);
|
||||||
|
connect(this, SIGNAL(valueUpdated(const QString&)), this, SLOT(updateLabel(const QString&)));
|
||||||
|
}
|
@ -0,0 +1,107 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef LABELSOURCE_H
|
||||||
|
#define LABELSOURCE_H
|
||||||
|
|
||||||
|
#include "triggeredsource.h"
|
||||||
|
#include "labelsourcePrefs.h"
|
||||||
|
|
||||||
|
class QLabel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LabelSource displays its value on a configurable QLabel
|
||||||
|
* @author Ken Werner
|
||||||
|
*/
|
||||||
|
class LabelSource : public TriggeredSource{
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new DefaultSource from the given File
|
||||||
|
*/
|
||||||
|
LabelSource(QWidget* inParent);
|
||||||
|
|
||||||
|
virtual ~LabelSource();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Label of this source that is displayed in the kicker
|
||||||
|
*/
|
||||||
|
QWidget* getWidget();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* fills the prefs gui with appropriate values
|
||||||
|
*/
|
||||||
|
virtual void updatePrefsGUI();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* realizes the widget. that means, create the QLabel.
|
||||||
|
*/
|
||||||
|
virtual void realizeWidget();
|
||||||
|
|
||||||
|
protected slots:
|
||||||
|
/**
|
||||||
|
* updates the label
|
||||||
|
*/
|
||||||
|
virtual void updateLabel(const QString& inValue);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Applies the prefs
|
||||||
|
*/
|
||||||
|
virtual void applyPrefs();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Saves the prefs (implicit apply)
|
||||||
|
*/
|
||||||
|
virtual void savePrefs(KConfig* inKConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads the prefs
|
||||||
|
*/
|
||||||
|
virtual void loadPrefs(KConfig* inKConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method enables or disables various widgets of the preferences dialog depending on isEnabled and isShownOnApplet
|
||||||
|
* This method can be extended in sub classes
|
||||||
|
*/
|
||||||
|
virtual void setPrefsWidgetsEnabled(bool isEnabled, bool isShownOnApplet);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* Allows subclasses adding their own preferences using the addPrefs method
|
||||||
|
*/
|
||||||
|
virtual void createSubPrefs(QWidget* inParent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Displays the content of that source
|
||||||
|
*/
|
||||||
|
QLabel* mLabel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the parent of the label we are going to create
|
||||||
|
*/
|
||||||
|
QWidget* mParent;
|
||||||
|
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* the LabelSources part of the preferences gui
|
||||||
|
*/
|
||||||
|
LabelSourcePrefs* mLabelSourcePrefs;
|
||||||
|
};
|
||||||
|
#endif //LABELSOURCE_H
|
@ -0,0 +1,110 @@
|
|||||||
|
#include <kdialog.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file './labelsourcePrefs.ui'
|
||||||
|
**
|
||||||
|
** Created: Thu Jun 21 19:16:51 2007
|
||||||
|
** by: The User Interface Compiler ($Id: qt/main.cpp 3.3.7 edited Aug 31 2005 $)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "labelsourcePrefs.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qframe.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <kcolorbutton.h>
|
||||||
|
#include <kfontrequester.h>
|
||||||
|
#include <qcombobox.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a LabelSourcePrefs as a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
LabelSourcePrefs::LabelSourcePrefs( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "LabelSourcePrefs" );
|
||||||
|
LabelSourcePrefsLayout = new QVBoxLayout( this, 0, 6, "LabelSourcePrefsLayout");
|
||||||
|
|
||||||
|
defaultSourcePrefsFrame = new QFrame( this, "defaultSourcePrefsFrame" );
|
||||||
|
defaultSourcePrefsFrame->setFrameShape( QFrame::NoFrame );
|
||||||
|
defaultSourcePrefsFrame->setFrameShadow( QFrame::Plain );
|
||||||
|
defaultSourcePrefsFrameLayout = new QVBoxLayout( defaultSourcePrefsFrame, 0, 6, "defaultSourcePrefsFrameLayout");
|
||||||
|
|
||||||
|
taskbartitleLabel = new QLabel( defaultSourcePrefsFrame, "taskbartitleLabel" );
|
||||||
|
QFont taskbartitleLabel_font( taskbartitleLabel->font() );
|
||||||
|
taskbartitleLabel_font.setBold( TRUE );
|
||||||
|
taskbartitleLabel->setFont( taskbartitleLabel_font );
|
||||||
|
defaultSourcePrefsFrameLayout->addWidget( taskbartitleLabel );
|
||||||
|
|
||||||
|
layout13 = new QHBoxLayout( 0, 0, 6, "layout13");
|
||||||
|
|
||||||
|
colorLabel = new QLabel( defaultSourcePrefsFrame, "colorLabel" );
|
||||||
|
layout13->addWidget( colorLabel );
|
||||||
|
|
||||||
|
colorButton = new KColorButton( defaultSourcePrefsFrame, "colorButton" );
|
||||||
|
layout13->addWidget( colorButton );
|
||||||
|
spacer1 = new QSpacerItem( 350, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
||||||
|
layout13->addItem( spacer1 );
|
||||||
|
defaultSourcePrefsFrameLayout->addLayout( layout13 );
|
||||||
|
|
||||||
|
layout17 = new QHBoxLayout( 0, 0, 6, "layout17");
|
||||||
|
|
||||||
|
fontLabel = new QLabel( defaultSourcePrefsFrame, "fontLabel" );
|
||||||
|
layout17->addWidget( fontLabel );
|
||||||
|
|
||||||
|
fontRequester = new KFontRequester( defaultSourcePrefsFrame, "fontRequester" );
|
||||||
|
layout17->addWidget( fontRequester );
|
||||||
|
defaultSourcePrefsFrameLayout->addLayout( layout17 );
|
||||||
|
|
||||||
|
layout18 = new QHBoxLayout( 0, 0, 6, "layout18");
|
||||||
|
|
||||||
|
alignmentLabel = new QLabel( defaultSourcePrefsFrame, "alignmentLabel" );
|
||||||
|
layout18->addWidget( alignmentLabel );
|
||||||
|
|
||||||
|
alignmentComboBox = new QComboBox( FALSE, defaultSourcePrefsFrame, "alignmentComboBox" );
|
||||||
|
layout18->addWidget( alignmentComboBox );
|
||||||
|
spacer2 = new QSpacerItem( 350, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
||||||
|
layout18->addItem( spacer2 );
|
||||||
|
defaultSourcePrefsFrameLayout->addLayout( layout18 );
|
||||||
|
LabelSourcePrefsLayout->addWidget( defaultSourcePrefsFrame );
|
||||||
|
languageChange();
|
||||||
|
resize( QSize(299, 135).expandedTo(minimumSizeHint()) );
|
||||||
|
clearWState( WState_Polished );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
LabelSourcePrefs::~LabelSourcePrefs()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sets the strings of the subwidgets using the current
|
||||||
|
* language.
|
||||||
|
*/
|
||||||
|
void LabelSourcePrefs::languageChange()
|
||||||
|
{
|
||||||
|
setCaption( tr2i18n( "LabelSourcePrefs" ) );
|
||||||
|
taskbartitleLabel->setText( tr2i18n( "<br>\n"
|
||||||
|
"Taskbar visual settings" ) );
|
||||||
|
colorLabel->setText( tr2i18n( "Foreground color:" ) );
|
||||||
|
colorButton->setText( QString::null );
|
||||||
|
fontLabel->setText( tr2i18n( "Font:" ) );
|
||||||
|
alignmentLabel->setText( tr2i18n( "Alignment:" ) );
|
||||||
|
alignmentComboBox->clear();
|
||||||
|
alignmentComboBox->insertItem( tr2i18n( "Left" ) );
|
||||||
|
alignmentComboBox->insertItem( tr2i18n( "Center" ) );
|
||||||
|
alignmentComboBox->insertItem( tr2i18n( "Right" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "labelsourcePrefs.moc"
|
@ -0,0 +1,186 @@
|
|||||||
|
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||||
|
<class>LabelSourcePrefs</class>
|
||||||
|
<widget class="QWidget">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>LabelSourcePrefs</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>299</width>
|
||||||
|
<height>135</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="caption">
|
||||||
|
<string>LabelSourcePrefs</string>
|
||||||
|
</property>
|
||||||
|
<vbox>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QFrame">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>defaultSourcePrefsFrame</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>Plain</enum>
|
||||||
|
</property>
|
||||||
|
<vbox>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QLabel">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>taskbartitleLabel</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<bold>1</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><br>
|
||||||
|
Taskbar visual settings</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLayoutWidget">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>layout13</cstring>
|
||||||
|
</property>
|
||||||
|
<hbox>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<widget class="QLabel">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>colorLabel</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Foreground color:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="KColorButton">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>colorButton</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<spacer>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>spacer1</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>Expanding</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint">
|
||||||
|
<size>
|
||||||
|
<width>350</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</hbox>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLayoutWidget">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>layout17</cstring>
|
||||||
|
</property>
|
||||||
|
<hbox>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<widget class="QLabel">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>fontLabel</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Font:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="KFontRequester">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>fontRequester</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</hbox>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLayoutWidget">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>layout18</cstring>
|
||||||
|
</property>
|
||||||
|
<hbox>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<widget class="QLabel">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>alignmentLabel</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Alignment:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QComboBox">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Left</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Center</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Right</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>alignmentComboBox</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<spacer>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>spacer2</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>Expanding</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint">
|
||||||
|
<size>
|
||||||
|
<width>350</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</hbox>
|
||||||
|
</widget>
|
||||||
|
</vbox>
|
||||||
|
</widget>
|
||||||
|
</vbox>
|
||||||
|
</widget>
|
||||||
|
<layoutdefaults spacing="6" margin="11"/>
|
||||||
|
<includehints>
|
||||||
|
<includehint>kcolorbutton.h</includehint>
|
||||||
|
<includehint>kfontrequester.h</includehint>
|
||||||
|
</includehints>
|
||||||
|
</UI>
|
@ -0,0 +1,175 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "nvidiathermalsrc.h"
|
||||||
|
#include <qstringlist.h>
|
||||||
|
#include <qregexp.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
#include <kdebug.h>
|
||||||
|
|
||||||
|
#ifndef HAVE_NVCONTROL
|
||||||
|
#include <kprocio.h>
|
||||||
|
#else
|
||||||
|
#include <qpaintdevice.h> // for the Device* pointer
|
||||||
|
|
||||||
|
// include the NVCtrl include stuff
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
#include <fixx11h.h> // needed for Qt, to include X11 header
|
||||||
|
extern "C" {
|
||||||
|
#include <NVCtrlLib.h>
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_NVCONTROL
|
||||||
|
NVidiaThermalSrc::NVidiaThermalSrc(QWidget* inParent, const QString& inID, const QString& inName):
|
||||||
|
LabelSource(inParent), mProcess(0) {
|
||||||
|
#else
|
||||||
|
NVidiaThermalSrc::NVidiaThermalSrc(QWidget* inParent, const QString& inID, const QString& inName, unsigned int attrib):
|
||||||
|
LabelSource(inParent), mAttrib(attrib) {
|
||||||
|
#endif
|
||||||
|
mID = inID;
|
||||||
|
mName = inName;
|
||||||
|
mDescription = i18n("This source is provided by the nVidia GPU card driver tools");
|
||||||
|
|
||||||
|
mRefreshTimer = new QTimer(this, "default refresh handler" );
|
||||||
|
// connect the timer
|
||||||
|
connect(mRefreshTimer, SIGNAL(timeout()), this, SLOT(fetchValue()));
|
||||||
|
connect(this, SIGNAL(enabledChanged(bool, Source*)), this, SLOT(enable(bool)));
|
||||||
|
}
|
||||||
|
|
||||||
|
NVidiaThermalSrc::~NVidiaThermalSrc(){
|
||||||
|
#ifndef HAVE_NVCONTROL
|
||||||
|
delete mProcess;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
std::list<Source*>NVidiaThermalSrc::createInstances(QWidget* inParent){
|
||||||
|
std::list<Source*> list;
|
||||||
|
#ifndef HAVE_NVCONTROL
|
||||||
|
// see if the path contains nvidia-settings. if yes,
|
||||||
|
// execute it and look for the query type "GPUCoreTemp"
|
||||||
|
// and "GPUAmbientTemp" and create two instances for each
|
||||||
|
// of them
|
||||||
|
// start nvidia-settings, if available and wait for it to exit.
|
||||||
|
KProcIO proc;
|
||||||
|
proc << "nvidia-settings"
|
||||||
|
<< "-n" // don't load config
|
||||||
|
<< "-q" << "GPUCoreTemp"
|
||||||
|
<< "-q" << "GPUAmbientTemp";
|
||||||
|
if(!proc.start(KProcess::Block))
|
||||||
|
return list;
|
||||||
|
|
||||||
|
// now see what it printed...
|
||||||
|
QString ln;
|
||||||
|
QString pout;
|
||||||
|
while(proc.readln(ln) != -1)
|
||||||
|
pout+= ln + '\n';
|
||||||
|
|
||||||
|
if(pout.contains("Attribute 'GPUCoreTemp'"))
|
||||||
|
list.push_back(new NVidiaThermalSrc(inParent, "GPUCoreTemp", "NVidiaCore"));
|
||||||
|
if(pout.contains("Attribute 'GPUAmbientTemp'"))
|
||||||
|
list.push_back(new NVidiaThermalSrc(inParent, "GPUAmbientTemp", "NVidiaAmbient"));
|
||||||
|
#else
|
||||||
|
int evt_base = 0, err_base = 0, temp;
|
||||||
|
Display * dpy = QPaintDevice::x11AppDisplay();
|
||||||
|
|
||||||
|
// do we have the XNVCtrl extension loaded?
|
||||||
|
if(!XNVCTRLQueryExtension(dpy, &evt_base, &err_base))
|
||||||
|
return list;
|
||||||
|
|
||||||
|
// core temp support?
|
||||||
|
if(XNVCTRLQueryAttribute (dpy, 0, 0,
|
||||||
|
NV_CTRL_GPU_CORE_TEMPERATURE, &temp)
|
||||||
|
)
|
||||||
|
list.push_back(new NVidiaThermalSrc(inParent, "GPUCoreTemp", "NVidiaCore",
|
||||||
|
NV_CTRL_GPU_CORE_TEMPERATURE));
|
||||||
|
|
||||||
|
// ambient temp support?
|
||||||
|
if(XNVCTRLQueryAttribute (dpy, 0, 0,
|
||||||
|
NV_CTRL_AMBIENT_TEMPERATURE, &temp)
|
||||||
|
)
|
||||||
|
list.push_back(new NVidiaThermalSrc(inParent, "GPUAmbientTemp", "NVidiaAmbient",
|
||||||
|
NV_CTRL_AMBIENT_TEMPERATURE));
|
||||||
|
#endif
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
void NVidiaThermalSrc::enable(bool inEnable){
|
||||||
|
if(inEnable && !mRefreshTimer->isActive()){ // start the timer
|
||||||
|
fetchValue();
|
||||||
|
mRefreshTimer->start(3000);
|
||||||
|
}else if(!inEnable && mRefreshTimer->isActive()) // stops the timer
|
||||||
|
mRefreshTimer->stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void NVidiaThermalSrc::evaluateStdout(){
|
||||||
|
#ifndef HAVE_NVCONTROL
|
||||||
|
QString val = i18n("n/a");
|
||||||
|
|
||||||
|
// now see what it printed...
|
||||||
|
QString ln;
|
||||||
|
QString pout;
|
||||||
|
while(mProcess->readln(ln) != -1)
|
||||||
|
pout+= ln + '\n';
|
||||||
|
QRegExp regexp("Attribute\\s'" + mID + "'.*(\\d+)\\.");
|
||||||
|
if(regexp.search(pout) != -1)
|
||||||
|
val = formatTemperature(regexp.cap(1));
|
||||||
|
mValue = val;
|
||||||
|
emit valueUpdated(mValue); // calls updateLabel(mValue) of LabelSource
|
||||||
|
|
||||||
|
// delete the object, to be ready for a new run
|
||||||
|
delete mProcess;
|
||||||
|
mProcess = 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef HAVE_NVCONTROL
|
||||||
|
void NVidiaThermalSrc::createProcess() {
|
||||||
|
mProcess = new KProcIO;
|
||||||
|
connect(mProcess, SIGNAL(processExited(KProcess*)), this, SLOT(evaluateStdout()));
|
||||||
|
*mProcess << "nvidia-settings" << "-n"
|
||||||
|
<< "-q" << mID;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
QString NVidiaThermalSrc::fetchValue(){
|
||||||
|
#ifndef HAVE_NVCONTROL
|
||||||
|
if(!mProcess) {
|
||||||
|
createProcess();
|
||||||
|
if(!mProcess->start()) {
|
||||||
|
mValue = "n/a";
|
||||||
|
delete mProcess;
|
||||||
|
mProcess = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getValue();
|
||||||
|
#else
|
||||||
|
int temp;
|
||||||
|
Display * dpy = QPaintDevice::x11AppDisplay();
|
||||||
|
if(XNVCTRLQueryAttribute (dpy, 0, 0, mAttrib, &temp))
|
||||||
|
mValue = formatTemperature(QString::number(temp));
|
||||||
|
else
|
||||||
|
mValue = "n/a";
|
||||||
|
emit valueUpdated(mValue); // calls updateLabel(mValue) of LabelSource
|
||||||
|
return mValue;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,86 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef NVIDIATHERMALSRC_H
|
||||||
|
#define NVIDIATHERMALSRC_H
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
#include "labelsource.h"
|
||||||
|
#include <list>
|
||||||
|
#include <qtimer.h>
|
||||||
|
|
||||||
|
class KProcIO;
|
||||||
|
/**
|
||||||
|
* NVidiaThermalSrc calls nvidia-settings to fetch the thermal values of the GPU
|
||||||
|
* @author Ken Werner
|
||||||
|
*/
|
||||||
|
class NVidiaThermalSrc : public LabelSource {
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new Source from the given File
|
||||||
|
*/
|
||||||
|
#ifndef HAVE_NVCONTROL
|
||||||
|
NVidiaThermalSrc(QWidget* inParent, const QString& inID, const QString& inName);
|
||||||
|
#else
|
||||||
|
NVidiaThermalSrc(QWidget* inParent, const QString& inID, const QString& inName, unsigned int attrib);
|
||||||
|
#endif
|
||||||
|
virtual ~NVidiaThermalSrc();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates instances of that Source (and returns pointers to them)
|
||||||
|
*/
|
||||||
|
static std::list<Source*> createInstances(QWidget* inParent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* runs the nvidia-settings command
|
||||||
|
*/
|
||||||
|
virtual QString fetchValue();
|
||||||
|
|
||||||
|
protected slots:
|
||||||
|
/**
|
||||||
|
* enables (starts the timer) or disables (stops the timer)
|
||||||
|
* this method is called if mSource gets enabled or disabled
|
||||||
|
*/
|
||||||
|
void enable(bool inEnable);
|
||||||
|
|
||||||
|
private:
|
||||||
|
#ifndef HAVE_NVCONTROL
|
||||||
|
/**
|
||||||
|
* create mProcess and connects its exited signal to
|
||||||
|
* the evaluateStdout slot.
|
||||||
|
*/
|
||||||
|
void createProcess();
|
||||||
|
KProcIO* mProcess;
|
||||||
|
#else
|
||||||
|
unsigned int mAttrib;
|
||||||
|
#endif
|
||||||
|
/**
|
||||||
|
* The refresh timer
|
||||||
|
*/
|
||||||
|
QTimer* mRefreshTimer;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
/**
|
||||||
|
* updates the label
|
||||||
|
*/
|
||||||
|
virtual void evaluateStdout();
|
||||||
|
};
|
||||||
|
#endif //NVIDIATHERMALSRC_H
|
@ -0,0 +1,58 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "omnibookthermalsrc.h"
|
||||||
|
#include <qtextstream.h>
|
||||||
|
#include <qfile.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
|
||||||
|
OmnibookThermalSrc::OmnibookThermalSrc(QWidget* inParent, const QFile& inSourceFile):
|
||||||
|
LabelSource(inParent),
|
||||||
|
mSourceFile(inSourceFile.name()),
|
||||||
|
mTrigger(this){
|
||||||
|
mID = "CPU";
|
||||||
|
mName = mID;
|
||||||
|
mDescription = i18n("This source is provided by the Omnibook Configuration Tools & Patches.");
|
||||||
|
}
|
||||||
|
|
||||||
|
OmnibookThermalSrc::~OmnibookThermalSrc(){
|
||||||
|
}
|
||||||
|
|
||||||
|
std::list<Source*>OmnibookThermalSrc::createInstances(QWidget* inParent){
|
||||||
|
std::list<Source*> list;
|
||||||
|
QFile omiFile( "/proc/omnibook/temperature" );
|
||||||
|
if(omiFile.open(IO_ReadOnly)){
|
||||||
|
list.push_back(new OmnibookThermalSrc(inParent, omiFile));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString OmnibookThermalSrc::fetchValue(){
|
||||||
|
QString s = "n/a";
|
||||||
|
if(mSourceFile.open(IO_ReadOnly)){
|
||||||
|
QTextStream textStream( &mSourceFile );
|
||||||
|
s = textStream.readLine();
|
||||||
|
mSourceFile.close();
|
||||||
|
s = s.section(':',-1,-1, QString::SectionSkipEmpty).stripWhiteSpace();
|
||||||
|
s = formatTemperature(s.left(s.length()-1));
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef OMNIBOOKTHERMALSRC_H
|
||||||
|
#define OMNIBOOKTHERMALSRC_H
|
||||||
|
#include "labelsource.h"
|
||||||
|
#include "threadedtrigger.h"
|
||||||
|
#include <qfile.h>
|
||||||
|
#include <list>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OmnibookThermalSrc reads temperature values from /proc/omnibook/temperature
|
||||||
|
* which is provided by the omnibook kernel module.
|
||||||
|
*/
|
||||||
|
class OmnibookThermalSrc : public LabelSource {
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new Source from the given File
|
||||||
|
*/
|
||||||
|
OmnibookThermalSrc(QWidget* inParent, const QFile& inSourceFile);
|
||||||
|
virtual ~OmnibookThermalSrc();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates instances of that Source (and returns pointers to them)
|
||||||
|
*/
|
||||||
|
static std::list<Source*> createInstances(QWidget* inParent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches and returns the value of this source
|
||||||
|
* This method is called from a thread so don't call it directly
|
||||||
|
*/
|
||||||
|
virtual QString fetchValue();
|
||||||
|
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* The file from which the value is read
|
||||||
|
*/
|
||||||
|
QFile mSourceFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* triggers the fetchValue method
|
||||||
|
*/
|
||||||
|
ThreadedTrigger mTrigger;
|
||||||
|
};
|
||||||
|
#endif //OMNIBOOKTHERMALSRC_H
|
||||||
|
|
@ -0,0 +1,222 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "source.h"
|
||||||
|
#include <math.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qcheckbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
#include <kglobal.h>
|
||||||
|
|
||||||
|
//#include "kdebug.h"
|
||||||
|
|
||||||
|
Source::Source(QWidget* inParent):
|
||||||
|
mID(""),
|
||||||
|
mPosition(0),
|
||||||
|
mName(""),
|
||||||
|
mDescription(""),
|
||||||
|
mEnabled(true),
|
||||||
|
mMaybeEnabled(true),
|
||||||
|
mShowOnApplet(true),
|
||||||
|
mMaybeShowOnApplet(true),
|
||||||
|
mShowName(true),
|
||||||
|
mToolTipEnabled(true),
|
||||||
|
mSourcePrefs(0) {
|
||||||
|
}
|
||||||
|
|
||||||
|
Source::~Source(){
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString& Source::getID() const{
|
||||||
|
return mID;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int Source::getPosition() const{
|
||||||
|
return mPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Source::setPosition(int inPosition, KConfig* inKConfig){
|
||||||
|
mPosition = inPosition;
|
||||||
|
inKConfig->writeEntry(mID + "_position", mPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString& Source::getName() const{
|
||||||
|
return mName;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString& Source::getDescription() const{
|
||||||
|
return mDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Source::isMetric() const{
|
||||||
|
return mIsMetric;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Source::isEnabled() const{
|
||||||
|
return mEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Source::showOnApplet() const{
|
||||||
|
return mShowOnApplet;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Source::showName() const{
|
||||||
|
return mShowName;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Source::isToolTipEnabled() const{
|
||||||
|
return mToolTipEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Source::setMaybeEnabled(bool inMaybeEnabled){
|
||||||
|
if(inMaybeEnabled != mMaybeEnabled){
|
||||||
|
mMaybeEnabled = inMaybeEnabled;
|
||||||
|
// disable/enable some widgets if source is disabled/enabled
|
||||||
|
setPrefsWidgetsEnabled(mMaybeEnabled, mSourcePrefs->taskbarCheckBox->isChecked());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget* Source::createPrefs(QWidget* inParent){
|
||||||
|
if(!mSourcePrefs){
|
||||||
|
mSourcePrefs = new SourcePrefs(inParent, "sourceprefsui");
|
||||||
|
|
||||||
|
// disable nameCheckBox if taskbarCheckBox is disabled
|
||||||
|
connect(mSourcePrefs->taskbarCheckBox, SIGNAL(toggled(bool)), mSourcePrefs->nameCheckBox, SLOT(setEnabled(bool)));
|
||||||
|
|
||||||
|
// add prefs widgets from sub classes
|
||||||
|
createSubPrefs(mSourcePrefs);
|
||||||
|
|
||||||
|
// add bottom vspacer
|
||||||
|
mSourcePrefs->layout()->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding) );
|
||||||
|
|
||||||
|
updatePrefsGUI(); // fill the prefs gui
|
||||||
|
}
|
||||||
|
return mSourcePrefs;
|
||||||
|
}
|
||||||
|
|
||||||
|
SourcePrefs* Source::getPrefs(){
|
||||||
|
return mSourcePrefs;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Source::updatePrefsGUI(){
|
||||||
|
// set values
|
||||||
|
mSourcePrefs->nameLineEdit->setText(mName);
|
||||||
|
mSourcePrefs->descriptionLabel->setText(mDescription);
|
||||||
|
mSourcePrefs->taskbarCheckBox->setChecked(mShowOnApplet);
|
||||||
|
mSourcePrefs->nameCheckBox->setChecked(mShowName);
|
||||||
|
mSourcePrefs->tooltipCheckBox->setChecked(mToolTipEnabled);
|
||||||
|
|
||||||
|
// disable/enable some widgets if source is disabled/enabled
|
||||||
|
setPrefsWidgetsEnabled(mEnabled, mShowOnApplet);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Source::setPrefsWidgetsEnabled(bool isEnabled, bool isShownOnApplet){
|
||||||
|
mSourcePrefs->nameLabel->setEnabled(isEnabled);
|
||||||
|
mSourcePrefs->nameLineEdit->setEnabled(isEnabled);
|
||||||
|
mSourcePrefs->taskbarCheckBox->setEnabled(isEnabled);
|
||||||
|
mSourcePrefs->nameCheckBox->setEnabled(isEnabled && isShownOnApplet);
|
||||||
|
mSourcePrefs->tooltipCheckBox->setEnabled(isEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Source::addPrefs(QWidget* inParent){
|
||||||
|
if(inParent != NULL)
|
||||||
|
mSourcePrefs->layout()->add(inParent);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Source::applyPrefs(){
|
||||||
|
mMaybeShowOnApplet = mSourcePrefs->taskbarCheckBox->isChecked();
|
||||||
|
mShowName = mSourcePrefs->nameCheckBox->isChecked();
|
||||||
|
mName = mSourcePrefs->nameLineEdit->text();
|
||||||
|
mToolTipEnabled = mSourcePrefs->tooltipCheckBox->isChecked();
|
||||||
|
|
||||||
|
//kdDebug() << "Source::applyPrefs() mEnabled: " << mEnabled << ", mMaybeEnabled: " << mMaybeEnabled << endl;
|
||||||
|
if(mEnabled != mMaybeEnabled){
|
||||||
|
mEnabled = mMaybeEnabled;
|
||||||
|
//kdDebug() << "Source::applyPrefs() emit enabledChanged: " << mEnabled << endl;
|
||||||
|
emit enabledChanged(mEnabled, this);
|
||||||
|
// force hide/show on kicker. if the user just
|
||||||
|
// disabled/enabled the source, we want to show / hide
|
||||||
|
// the source too, also if the "show on kicker" property
|
||||||
|
// did not changed. so, force this here.
|
||||||
|
mShowOnApplet = !mMaybeShowOnApplet;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!mEnabled)
|
||||||
|
emit displaySource(false, this);
|
||||||
|
else if(mMaybeShowOnApplet != mShowOnApplet) {
|
||||||
|
emit displaySource(mMaybeShowOnApplet, this);
|
||||||
|
}
|
||||||
|
mShowOnApplet = mMaybeShowOnApplet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Source::savePrefs(KConfig* inKConfig){
|
||||||
|
inKConfig->writeEntry(mID + "_position", mPosition);
|
||||||
|
inKConfig->writeEntry(mID + "_enabled", mEnabled);
|
||||||
|
inKConfig->writeEntry(mID + "_showOnApplet", mShowOnApplet);
|
||||||
|
inKConfig->writeEntry(mID + "_showName", mShowName);
|
||||||
|
inKConfig->writeEntry(mID + "_name", mName);
|
||||||
|
inKConfig->writeEntry(mID + "_toolTipEnabled", mToolTipEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Source::loadPrefs(KConfig* inKConfig){
|
||||||
|
mPosition = inKConfig->readNumEntry(mID + "_position", mPosition);
|
||||||
|
mEnabled = inKConfig->readBoolEntry(mID + "_enabled", mEnabled);
|
||||||
|
mMaybeEnabled = mEnabled;
|
||||||
|
mShowOnApplet = inKConfig->readBoolEntry(mID + "_showOnApplet", mShowOnApplet);
|
||||||
|
mMaybeShowOnApplet = mShowOnApplet;
|
||||||
|
mShowName = inKConfig->readBoolEntry(mID + "_showName", mShowName);
|
||||||
|
mName = inKConfig->readEntry(mID + "_name", mName);
|
||||||
|
mToolTipEnabled = inKConfig->readBoolEntry(mID + "_toolTipEnabled", mToolTipEnabled);
|
||||||
|
|
||||||
|
// initializing
|
||||||
|
// this signal is usually catched by the ThreadedTrigger who enables or disables the fetch loop
|
||||||
|
emit enabledChanged(mEnabled, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
// utility methods
|
||||||
|
QString Source::formatTemperature(const QString& temp) const {
|
||||||
|
if(mIsMetric) {
|
||||||
|
return temp + QString::fromUtf8(" °C");
|
||||||
|
} else {
|
||||||
|
return QString::number(celsiusToFahrenheit(temp.toInt())).append(QString::fromUtf8(" °F"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QString Source::KHzinHumanReadable( uint value ) const{
|
||||||
|
if( value >= 1000000 )
|
||||||
|
return QString::number( round(value/1000000.0, 1) ) + " GHz";
|
||||||
|
else if( value >= 1000 )
|
||||||
|
return QString::number( round(value/1000.0, -1) ) + " MHz";
|
||||||
|
else
|
||||||
|
return QString::number( value ) + " KHz";
|
||||||
|
}
|
||||||
|
double Source::round(double inValue, int inDigits) const{
|
||||||
|
return floor(inValue * pow( 10, inDigits) + 0.5) * pow(10, -inDigits);
|
||||||
|
}
|
||||||
|
int Source::celsiusToFahrenheit(int inCelsius) const{
|
||||||
|
return qRound(1.8 * inCelsius + 32);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Source::realizeWidget(){
|
||||||
|
mIsMetric = KGlobal::locale()->measureSystem() == KLocale::Metric;
|
||||||
|
}
|
@ -0,0 +1,249 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef SOURCE_H
|
||||||
|
#define SOURCE_H
|
||||||
|
#include <qstring.h>
|
||||||
|
|
||||||
|
#include "sourceprefs.h"
|
||||||
|
#include <kconfig.h>
|
||||||
|
|
||||||
|
// Forward Declarationss
|
||||||
|
class QVBoxLayout;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This abstract Source is the super class of all sources and provides just the basics.
|
||||||
|
* @author Ken Werner
|
||||||
|
*/
|
||||||
|
class Source : public QObject {
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new Source
|
||||||
|
*/
|
||||||
|
Source(QWidget* inParent);
|
||||||
|
virtual ~Source();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the internal Name of this source
|
||||||
|
*/
|
||||||
|
const QString& getID() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the position of this source in the layout
|
||||||
|
*/
|
||||||
|
int getPosition() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the position of this source in the layout
|
||||||
|
*/
|
||||||
|
void setPosition(int inPosition, KConfig* inKConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Name of this source
|
||||||
|
*/
|
||||||
|
const QString& getName() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Description of this source
|
||||||
|
*/
|
||||||
|
const QString& getDescription() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if this source is currently enabled otherwise false
|
||||||
|
*/
|
||||||
|
bool isEnabled() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if this source is shown on the kicker applet (taskbar) otherwise false
|
||||||
|
*/
|
||||||
|
bool showOnApplet() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if this source shows it's name in kicker otherwise false
|
||||||
|
*/
|
||||||
|
bool showName() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if this source is currently enabled otherwise false
|
||||||
|
*/
|
||||||
|
bool isToolTipEnabled() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the widget of this source that is displayed in the kicker
|
||||||
|
*/
|
||||||
|
virtual QWidget* getWidget() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the formatted value of this source
|
||||||
|
*/
|
||||||
|
virtual QString getValue() const = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the preference panel of this source and calls createSubPrefs
|
||||||
|
*/
|
||||||
|
virtual QWidget* createPrefs(QWidget* inParent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returnes the preference panel of this source
|
||||||
|
*/
|
||||||
|
virtual SourcePrefs* getPrefs();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* fills the prefs gui with appropriate values
|
||||||
|
*/
|
||||||
|
virtual void updatePrefsGUI();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* realizes the event. this function will be called
|
||||||
|
* by the applet to tell the Source to actually create
|
||||||
|
* its widget. it will always be called from the GUI thread.
|
||||||
|
*/
|
||||||
|
virtual void realizeWidget() = 0;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
/**
|
||||||
|
* Might enable or disable the source
|
||||||
|
* Source is only enabled/disabled if applyPrefs is called afterwards
|
||||||
|
*/
|
||||||
|
virtual void setMaybeEnabled(bool inMaybeEnabled);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Applies the preferences
|
||||||
|
*/
|
||||||
|
virtual void applyPrefs();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Saves the preferences (implicit apply)
|
||||||
|
*/
|
||||||
|
virtual void savePrefs(KConfig* inKConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads the preferences
|
||||||
|
*/
|
||||||
|
virtual void loadPrefs(KConfig* inKConfig);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
/**
|
||||||
|
* This signal is emitted whenever the enabled flag (mEnabled) of this source has changed
|
||||||
|
*/
|
||||||
|
void enabledChanged(bool inEnabled, Source* inSource); // needed by kima.cpp to add sources to its layout
|
||||||
|
/**
|
||||||
|
* This signal is emitted whenever this Source should be added or removed from the display (layout) of the kicker applet
|
||||||
|
*/
|
||||||
|
void displaySource(bool inDisplay, Source* inSource);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* This method can be overridden in sub classes to add specific the preference panels
|
||||||
|
*/
|
||||||
|
virtual void addPrefs(QWidget* inParent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows subclasses adding their own preferences using the addPrefs method
|
||||||
|
*/
|
||||||
|
virtual void createSubPrefs(QWidget* inParent) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method enables or disables various widgets of the preferences dialog depending on isEnabled and isShownOnApplet
|
||||||
|
* This method can be extended in sub classes
|
||||||
|
*/
|
||||||
|
virtual void setPrefsWidgetsEnabled(bool isEnabled, bool isShownOnApplet);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns true if the measure system is set metric, false if imperial
|
||||||
|
*/
|
||||||
|
bool isMetric() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The ID of the source
|
||||||
|
* must be unique among the sources
|
||||||
|
*/
|
||||||
|
QString mID;
|
||||||
|
/**
|
||||||
|
* The Position of the source in the layout
|
||||||
|
*/
|
||||||
|
int mPosition;
|
||||||
|
/**
|
||||||
|
* The name of that source showed in the kicker
|
||||||
|
*/
|
||||||
|
QString mName;
|
||||||
|
/**
|
||||||
|
* The description of that source
|
||||||
|
*/
|
||||||
|
QString mDescription;
|
||||||
|
/**
|
||||||
|
* Indicates whether that source is enabled (showed on the kicker) or not
|
||||||
|
*/
|
||||||
|
bool mEnabled;
|
||||||
|
/**
|
||||||
|
* stores the SourcListItem checkbox value
|
||||||
|
* and is updated through SourceListItem
|
||||||
|
*/
|
||||||
|
bool mMaybeEnabled;
|
||||||
|
/**
|
||||||
|
* Indicates whether to show that source on the kicker applet (taskbar) or not
|
||||||
|
* mEnabled controls whether this source is displayed or not, see mIsDisplayed
|
||||||
|
*/
|
||||||
|
bool mShowOnApplet;
|
||||||
|
/**
|
||||||
|
* Indicates whether that source is shown on the kicker applet (taskbar) or not. this is temporary and stores only what the user configured in the preferences dialog. it is applied to mShowOnApplet in applyPrefs
|
||||||
|
*/
|
||||||
|
bool mMaybeShowOnApplet;
|
||||||
|
/**
|
||||||
|
* Indicates whether to show the name in kicker or not
|
||||||
|
*/
|
||||||
|
bool mShowName;
|
||||||
|
/**
|
||||||
|
* Indicates whether that source is showed on the tooltip or not
|
||||||
|
*/
|
||||||
|
bool mToolTipEnabled;
|
||||||
|
|
||||||
|
// utility methods
|
||||||
|
/**
|
||||||
|
* formats the given temperature into a string which has
|
||||||
|
* a degree sign / fahrenheit sign depending on the locale used.
|
||||||
|
*/
|
||||||
|
QString formatTemperature(const QString& temp) const;
|
||||||
|
/**
|
||||||
|
* Translates a given frequency in KHz to a human readable string
|
||||||
|
*/
|
||||||
|
QString KHzinHumanReadable(uint value) const;
|
||||||
|
/**
|
||||||
|
* Translates degree Celsius to degree Fahrenheit
|
||||||
|
*/
|
||||||
|
int celsiusToFahrenheit(int inCelsius) const;
|
||||||
|
/**
|
||||||
|
* Returns inValue rounded to inDigits
|
||||||
|
*/
|
||||||
|
double round(double inValue, int inDigits=0) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The preference panel of that source
|
||||||
|
*/
|
||||||
|
SourcePrefs* mSourcePrefs;
|
||||||
|
private:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* indicates whether the measure system is set metric or imperial
|
||||||
|
*/
|
||||||
|
bool mIsMetric;
|
||||||
|
};
|
||||||
|
#endif //SOURCE_H
|
@ -0,0 +1,88 @@
|
|||||||
|
#include <kdialog.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file './sourceprefs.ui'
|
||||||
|
**
|
||||||
|
** Created: Thu Jun 21 19:16:51 2007
|
||||||
|
** by: The User Interface Compiler ($Id: qt/main.cpp 3.3.7 edited Aug 31 2005 $)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "sourceprefs.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qcheckbox.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a SourcePrefs as a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
SourcePrefs::SourcePrefs( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "SourcePrefs" );
|
||||||
|
SourcePrefsLayout = new QVBoxLayout( this, 0, 6, "SourcePrefsLayout");
|
||||||
|
|
||||||
|
descriptionLabel = new QLabel( this, "descriptionLabel" );
|
||||||
|
SourcePrefsLayout->addWidget( descriptionLabel );
|
||||||
|
|
||||||
|
hBoxLayout = new QHBoxLayout( 0, 0, 6, "hBoxLayout");
|
||||||
|
|
||||||
|
nameLabel = new QLabel( this, "nameLabel" );
|
||||||
|
hBoxLayout->addWidget( nameLabel );
|
||||||
|
|
||||||
|
nameLineEdit = new QLineEdit( this, "nameLineEdit" );
|
||||||
|
hBoxLayout->addWidget( nameLineEdit );
|
||||||
|
spacer8 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
||||||
|
hBoxLayout->addItem( spacer8 );
|
||||||
|
SourcePrefsLayout->addLayout( hBoxLayout );
|
||||||
|
|
||||||
|
taskbarCheckBox = new QCheckBox( this, "taskbarCheckBox" );
|
||||||
|
SourcePrefsLayout->addWidget( taskbarCheckBox );
|
||||||
|
|
||||||
|
hBoxLayout2 = new QHBoxLayout( 0, 0, 6, "hBoxLayout2");
|
||||||
|
spacer8_2 = new QSpacerItem( 20, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
|
||||||
|
hBoxLayout2->addItem( spacer8_2 );
|
||||||
|
|
||||||
|
nameCheckBox = new QCheckBox( this, "nameCheckBox" );
|
||||||
|
hBoxLayout2->addWidget( nameCheckBox );
|
||||||
|
SourcePrefsLayout->addLayout( hBoxLayout2 );
|
||||||
|
|
||||||
|
tooltipCheckBox = new QCheckBox( this, "tooltipCheckBox" );
|
||||||
|
SourcePrefsLayout->addWidget( tooltipCheckBox );
|
||||||
|
languageChange();
|
||||||
|
resize( QSize(203, 127).expandedTo(minimumSizeHint()) );
|
||||||
|
clearWState( WState_Polished );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
SourcePrefs::~SourcePrefs()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sets the strings of the subwidgets using the current
|
||||||
|
* language.
|
||||||
|
*/
|
||||||
|
void SourcePrefs::languageChange()
|
||||||
|
{
|
||||||
|
setCaption( tr2i18n( "SourcePrefs" ) );
|
||||||
|
descriptionLabel->setText( tr2i18n( "description" ) );
|
||||||
|
nameLabel->setText( tr2i18n( "Name:" ) );
|
||||||
|
taskbarCheckBox->setText( tr2i18n( "Show this source in Taskbar" ) );
|
||||||
|
nameCheckBox->setText( tr2i18n( "Show name in Taskbar" ) );
|
||||||
|
tooltipCheckBox->setText( tr2i18n( "Show this source in ToolTip" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "sourceprefs.moc"
|
@ -0,0 +1,127 @@
|
|||||||
|
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||||
|
<class>SourcePrefs</class>
|
||||||
|
<widget class="QWidget">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>SourcePrefs</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>203</width>
|
||||||
|
<height>127</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="caption">
|
||||||
|
<string>SourcePrefs</string>
|
||||||
|
</property>
|
||||||
|
<vbox>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QLabel">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>descriptionLabel</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>description</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLayoutWidget">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>hBoxLayout</cstring>
|
||||||
|
</property>
|
||||||
|
<hbox>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<widget class="QLabel">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>nameLabel</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Name:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLineEdit">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>nameLineEdit</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<spacer>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>spacer8</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>Expanding</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</hbox>
|
||||||
|
</widget>
|
||||||
|
<widget class="QCheckBox">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>taskbarCheckBox</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Show this source in Taskbar</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLayoutWidget">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>hBoxLayout2</cstring>
|
||||||
|
</property>
|
||||||
|
<hbox>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<spacer>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>spacer8</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
<widget class="QCheckBox">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>nameCheckBox</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Show name in Taskbar</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</hbox>
|
||||||
|
</widget>
|
||||||
|
<widget class="QCheckBox">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>tooltipCheckBox</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Show this source in ToolTip</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</vbox>
|
||||||
|
</widget>
|
||||||
|
<layoutdefaults spacing="6" margin="11"/>
|
||||||
|
</UI>
|
@ -0,0 +1,66 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "sysfreqsrc.h"
|
||||||
|
#include <qtextstream.h>
|
||||||
|
#include <qfile.h>
|
||||||
|
#include <qdir.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
|
||||||
|
SysFreqSrc::SysFreqSrc(QWidget* inParent, const QFile& inSourceFile):
|
||||||
|
LabelSource(inParent),
|
||||||
|
mSourceFile(inSourceFile.name()),
|
||||||
|
mTrigger(this){
|
||||||
|
mID = "cpufreq" + mSourceFile.name().section( '/', -3, -3, QString::SectionSkipEmpty ).remove("cpu");
|
||||||
|
mName = mID;
|
||||||
|
mDescription = i18n("This source is provided by the Linux kernel cpufreq subsystem.");
|
||||||
|
}
|
||||||
|
|
||||||
|
SysFreqSrc::~SysFreqSrc(){
|
||||||
|
}
|
||||||
|
|
||||||
|
std::list<Source*>SysFreqSrc::createInstances(QWidget* inParent){
|
||||||
|
std::list<Source*> list;
|
||||||
|
|
||||||
|
QDir cpuDir( "/sys/devices/system/cpu" );
|
||||||
|
if ( cpuDir.exists() ){
|
||||||
|
cpuDir.setFilter( QDir::Dirs | QDir::NoSymLinks );
|
||||||
|
cpuDir.setSorting( QDir::Name);
|
||||||
|
for ( unsigned int i = 0; i < cpuDir.count(); i++ ){
|
||||||
|
if(cpuDir[i].startsWith("cpu")){
|
||||||
|
QFile sysFreqFile(cpuDir.canonicalPath() + "/" + cpuDir[i] + "/cpufreq/scaling_cur_freq");
|
||||||
|
if(sysFreqFile.open(IO_ReadOnly))
|
||||||
|
list.push_back(new SysFreqSrc(inParent, sysFreqFile));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString SysFreqSrc::fetchValue(){
|
||||||
|
QString s = "n/a";
|
||||||
|
if(mSourceFile.open(IO_ReadOnly)){
|
||||||
|
QTextStream textStream(&mSourceFile);
|
||||||
|
s = KHzinHumanReadable(textStream.readLine().toUInt());
|
||||||
|
mSourceFile.close();
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,63 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef SYSFREQSRC_H
|
||||||
|
#define SYSFREQSRC_H
|
||||||
|
#include "labelsource.h"
|
||||||
|
#include "threadedtrigger.h"
|
||||||
|
#include <qfile.h>
|
||||||
|
#include <list>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SysFreqSrc reads frequency values from /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
|
||||||
|
*/
|
||||||
|
class SysFreqSrc : public LabelSource {
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new Source from the given File
|
||||||
|
*/
|
||||||
|
SysFreqSrc(QWidget* inParent, const QFile& inSourceFile);
|
||||||
|
virtual ~SysFreqSrc();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates instances of that Source (and returns pointers to them)
|
||||||
|
*/
|
||||||
|
static std::list<Source*> createInstances(QWidget* inParent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches and returns the value of this source
|
||||||
|
* This method is called from a thread so don't call it directly
|
||||||
|
*/
|
||||||
|
virtual QString fetchValue();
|
||||||
|
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* The file from which the value is read
|
||||||
|
*/
|
||||||
|
QFile mSourceFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* triggers the fetchValue method
|
||||||
|
*/
|
||||||
|
ThreadedTrigger mTrigger;
|
||||||
|
};
|
||||||
|
#endif //SYSFREQSRC_H
|
||||||
|
|
@ -0,0 +1,67 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "threadedtrigger.h"
|
||||||
|
#include <qapplication.h>
|
||||||
|
|
||||||
|
//#include "kdebug.h"
|
||||||
|
|
||||||
|
ThreadedTrigger::ThreadedTrigger(TriggeredSource* inSource, unsigned long inRefreshSleep):
|
||||||
|
mSource(inSource),
|
||||||
|
mRefreshSleep(inRefreshSleep),
|
||||||
|
mRunning(false)
|
||||||
|
{
|
||||||
|
connect(mSource, SIGNAL(enabledChanged(bool, Source*)), this, SLOT(enable(bool)));
|
||||||
|
}
|
||||||
|
|
||||||
|
ThreadedTrigger::~ThreadedTrigger(){
|
||||||
|
enable(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ThreadedTrigger::enable(bool inEnable){
|
||||||
|
if(inEnable && !mRunning){ // start this thread (calls run())
|
||||||
|
//kdDebug() << "start thread " << mSource->getName() << endl;
|
||||||
|
// start the thread
|
||||||
|
mRunning = true;
|
||||||
|
this->start(QThread::LowPriority);
|
||||||
|
}else if(!inEnable && mRunning){ // stops the thread
|
||||||
|
//kdDebug() << "stop thread " << mSource->getName() << endl;
|
||||||
|
mRunning = false;
|
||||||
|
mWaitMutex.lock();
|
||||||
|
mWaitCond.wakeOne();
|
||||||
|
mWaitMutex.unlock();
|
||||||
|
this->wait();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ThreadedTrigger::run(){
|
||||||
|
mWaitMutex.lock();
|
||||||
|
while( mRunning ) {
|
||||||
|
QString text = mSource->fetchValue();
|
||||||
|
UpdateEvent* ue = new UpdateEvent(text); // Qt will delete the ue when done
|
||||||
|
QApplication::postEvent(mSource, ue); // send the event to the TriggeredSource
|
||||||
|
if(mWaitCond.wait(&mWaitMutex, mRefreshSleep))
|
||||||
|
break; // we were woken up
|
||||||
|
}
|
||||||
|
// if we are here, the mutex must be locked:
|
||||||
|
// 1. QWaitCondition::wait locks it when it returns
|
||||||
|
// 2. mWaitMutex is locked when we enter the loop
|
||||||
|
mWaitMutex.unlock(); // unlock it again
|
||||||
|
}
|
@ -0,0 +1,89 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef THREADEDTRIGGER_H
|
||||||
|
#define THREADEDTRIGGER_H
|
||||||
|
|
||||||
|
#include "source.h"
|
||||||
|
#include "updateevent.h"
|
||||||
|
#include "triggeredsource.h"
|
||||||
|
#include <qwaitcondition.h>
|
||||||
|
#include <qmutex.h>
|
||||||
|
#include <qthread.h>
|
||||||
|
#include <qevent.h>
|
||||||
|
#include <qobject.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ThreadedTrigger calls the fetchValue method of a source asynchronous using a thread
|
||||||
|
* @author Ken Werner
|
||||||
|
*/
|
||||||
|
class ThreadedTrigger : public QObject, QThread{
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new ThreadedTrigger
|
||||||
|
*/
|
||||||
|
ThreadedTrigger(TriggeredSource* inSource, unsigned long inRefreshSleep = 1000);
|
||||||
|
|
||||||
|
virtual ~ThreadedTrigger();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* fetches tcalls the fetchValue method periodically
|
||||||
|
* and sends an UpdateEvent to the source
|
||||||
|
*/
|
||||||
|
virtual void run();
|
||||||
|
|
||||||
|
protected slots:
|
||||||
|
/**
|
||||||
|
* enables (starts the thread) or disables (stops the thread)
|
||||||
|
* this method is called if mSource gets enabled or disabled
|
||||||
|
*/
|
||||||
|
void enable(bool inEnable);
|
||||||
|
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* pointer to the TriggeredSource
|
||||||
|
**/
|
||||||
|
TriggeredSource* mSource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* time in milli seconds between two value fetches
|
||||||
|
*/
|
||||||
|
unsigned long mRefreshSleep;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* indicates whether this thread runs
|
||||||
|
*/
|
||||||
|
bool mRunning;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* this is the condition, on which this thread sleeps
|
||||||
|
* mRefreshSleep milliseconds.
|
||||||
|
*/
|
||||||
|
QWaitCondition mWaitCond;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* this mutex ensures that the thread always sleeps on the
|
||||||
|
* condition, if we signal it.
|
||||||
|
*/
|
||||||
|
QMutex mWaitMutex;
|
||||||
|
};
|
||||||
|
#endif //THREADEDTRIGGER_H
|
@ -0,0 +1,48 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "triggeredsource.h"
|
||||||
|
#include "updateevent.h"
|
||||||
|
#include <qapplication.h>
|
||||||
|
|
||||||
|
//#include "kdebug.h"
|
||||||
|
|
||||||
|
TriggeredSource::TriggeredSource(QWidget* inParent):
|
||||||
|
Source(inParent){
|
||||||
|
}
|
||||||
|
|
||||||
|
TriggeredSource::~TriggeredSource(){
|
||||||
|
}
|
||||||
|
|
||||||
|
void TriggeredSource::customEvent(QCustomEvent* event){
|
||||||
|
if(event->type() == UpdateEvent::TYPE ){
|
||||||
|
UpdateEvent* ue = static_cast<UpdateEvent*>(event);
|
||||||
|
// update mValue
|
||||||
|
mValue = ue->getMessage();
|
||||||
|
//kdDebug() << "emit valueUpdated(mValue); value: " << mValue << endl;
|
||||||
|
emit valueUpdated(mValue);
|
||||||
|
}else{
|
||||||
|
Source::customEvent(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QString TriggeredSource::getValue() const{
|
||||||
|
return mValue;
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef TRIGGEREDSOURCE_H
|
||||||
|
#define TRIGGEREDSOURCE_H
|
||||||
|
|
||||||
|
#include "source.h"
|
||||||
|
#include <qevent.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TriggeredSource provides fetchValue and
|
||||||
|
* can be triggered asynchronously by ThreadedTrigger
|
||||||
|
* @author Ken Werner
|
||||||
|
*/
|
||||||
|
class TriggeredSource : public Source{
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new TriggeredSource
|
||||||
|
*/
|
||||||
|
TriggeredSource(QWidget* inParent);
|
||||||
|
|
||||||
|
virtual ~TriggeredSource();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the formatted value of this source
|
||||||
|
*/
|
||||||
|
virtual QString getValue() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches and returns the value of this source
|
||||||
|
* This method might be called from a thread so don't call it directly
|
||||||
|
*/
|
||||||
|
virtual QString fetchValue() = 0;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
/**
|
||||||
|
* This signal is emitted whenever the value of this source (mValue) is updated
|
||||||
|
*/
|
||||||
|
void valueUpdated(const QString& inValue);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* consumes the UpdateEvent
|
||||||
|
*/
|
||||||
|
virtual void customEvent(QCustomEvent* event);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the buffered value of this source
|
||||||
|
*/
|
||||||
|
QString mValue;
|
||||||
|
};
|
||||||
|
#endif //TRIGGEREDSOURCE_H
|
@ -0,0 +1,29 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 by Johannes Schaub *
|
||||||
|
* schaub-johannes@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "updateevent.h"
|
||||||
|
|
||||||
|
UpdateEvent::UpdateEvent(const QString& inMessage):
|
||||||
|
QCustomEvent(UpdateEvent::TYPE),
|
||||||
|
mMessage(inMessage){
|
||||||
|
}
|
||||||
|
const QString& UpdateEvent::getMessage() const{
|
||||||
|
return mMessage;
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 by Johannes Schaub *
|
||||||
|
* schaub-johannes@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef UPDATEEVENT_H
|
||||||
|
#define UPDATEEVENT_H
|
||||||
|
|
||||||
|
#include <qevent.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UpdateEvent is a custom event to update the QObject of the ThreadedTrigger periodically
|
||||||
|
*/
|
||||||
|
class UpdateEvent: public QCustomEvent{
|
||||||
|
public:
|
||||||
|
UpdateEvent(const QString& inMessage);
|
||||||
|
static const int TYPE = QEvent::User + 1;
|
||||||
|
const QString& getMessage() const;
|
||||||
|
private:
|
||||||
|
QString mMessage;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //UPDATEEVENT_H
|
@ -0,0 +1,70 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2006 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "uptimesrc.h"
|
||||||
|
#include <qtextstream.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
|
||||||
|
UptimeSrc::UptimeSrc(QWidget* inParent, const QFile& inSourceFile):
|
||||||
|
LabelSource(inParent),
|
||||||
|
mSourceFile(inSourceFile.name()),
|
||||||
|
mTrigger(this, 30000){ // 30 seconds
|
||||||
|
mEnabled = false; // disable this source by default to to save kicker space
|
||||||
|
mID = "Uptime";
|
||||||
|
mName = mID;
|
||||||
|
mDescription = i18n("This source is provided by /proc/uptime.");
|
||||||
|
}
|
||||||
|
|
||||||
|
UptimeSrc::~UptimeSrc(){
|
||||||
|
}
|
||||||
|
|
||||||
|
std::list<Source*>UptimeSrc::createInstances(QWidget* inParent){
|
||||||
|
std::list<Source*> list;
|
||||||
|
QFile uptimeFile("/proc/uptime" );
|
||||||
|
if(uptimeFile.open(IO_ReadOnly))
|
||||||
|
list.push_back(new UptimeSrc(inParent, uptimeFile));
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString UptimeSrc::fetchValue(){
|
||||||
|
QString s = "n/a";
|
||||||
|
int secs;
|
||||||
|
if(mSourceFile.open(IO_ReadOnly)) {
|
||||||
|
QTextStream stream( &mSourceFile );
|
||||||
|
stream >> secs;
|
||||||
|
|
||||||
|
//QString seconds = QString::number(secs % 60).rightJustify(2, '0');
|
||||||
|
QString minutes = QString::number(secs / 60 % 60).rightJustify(2, '0');
|
||||||
|
QString hours = QString::number(secs / 3600 % 24).rightJustify(2, '0');
|
||||||
|
QString days = QString::number(secs / 86400);
|
||||||
|
if(days != "0")
|
||||||
|
s = mTimeFormatLong.arg(days).arg(hours).arg(minutes);
|
||||||
|
else
|
||||||
|
s = mTimeFormatShort.arg(hours).arg(minutes);
|
||||||
|
mSourceFile.close();
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UptimeSrc::realizeWidget() {
|
||||||
|
LabelSource::realizeWidget();
|
||||||
|
mTimeFormatLong = i18n("%1d %2:%3");
|
||||||
|
mTimeFormatShort = i18n("%1:%2");
|
||||||
|
}
|
@ -0,0 +1,74 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 by Ken Werner *
|
||||||
|
* ken.werner@web.de *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef UPTIMESRC_H
|
||||||
|
#define UPTIMESRC_H
|
||||||
|
#include "labelsource.h"
|
||||||
|
#include "threadedtrigger.h"
|
||||||
|
#include <qfile.h>
|
||||||
|
#include <list>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UptimeSrc reads fan values from /proc/acpi/ibm/thermal
|
||||||
|
* which is provided by the ibm-acpi kernel module.
|
||||||
|
*/
|
||||||
|
class UptimeSrc : public LabelSource {
|
||||||
|
Q_OBJECT //macro which activates signals and slots (moc)
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new Source from the given File and index
|
||||||
|
*/
|
||||||
|
UptimeSrc(QWidget* inParent, const QFile& inSourceFile);
|
||||||
|
virtual ~UptimeSrc();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates instances of that Source (and returns pointers to them)
|
||||||
|
*/
|
||||||
|
static std::list<Source*> createInstances(QWidget* inParent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches and returns the value of this source
|
||||||
|
* This method is called from a thread so don't call it directly
|
||||||
|
*/
|
||||||
|
virtual QString fetchValue();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the format for the akku time left from i18n.
|
||||||
|
*/
|
||||||
|
virtual void realizeWidget();
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* The file from which the value is read
|
||||||
|
*/
|
||||||
|
QFile mSourceFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the format of the time display. short and long version
|
||||||
|
*/
|
||||||
|
QString mTimeFormatShort;
|
||||||
|
QString mTimeFormatLong;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* triggers the fetchValue method
|
||||||
|
*/
|
||||||
|
ThreadedTrigger mTrigger;
|
||||||
|
};
|
||||||
|
#endif //UPTIMESRC_H
|
Loading…
Reference in new issue