Added KDE3 version of knutclient

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/knutclient@1092914 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
commit f867212c17

@ -0,0 +1,4 @@
Daniel Prynych
<Daniel@prynych.cz>
<Daniel.Prynych@buzuluk.cz>

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

@ -0,0 +1,129 @@
0.1 First version
0.2 Switched preferences in style KDE 2.2
Added save/load configuration file
0.3 Added OUTPUT CURRENT
Added RUNTIME on panel
Added switch 230/120V and 50/60Hz
Added read XFER from UPS
Added more members on main (front) panel
0.3.2 Added German localization - Crissi
Added Italian localization - Andrea
Added Tool Tip in main (front) panel
0.4.0 Added setting font for main (front) a analog panels
Added BATT_CURRENT
Added BATT_TEMP
0.4.1 First revision for KDE 3
0.5.0 Added autorange for output current, battery current and battery voltage
Added new UPS dialog (autosizing)
Added view of all UPS(NUT) variables
Added French localization
Cleaning code
0.6.0 Added change color for background of main panel
Added change color for background of main window
Added change color of analog panels (background, finger, font ...)
Changes in knutnet. I started clean code in knutnet.
First version of manual, now in Czech language only. Sorry.
Changed in view if all UPS(NUT) variables
Added running instant commands
Added setting RW variables
0.6.1 Added list of error to statusbar.
New (faster) version of KNutNet class.
First version of manual in English language.
0.7.0 Added support for new protocol client-sever and new versions of variables.
New version window for showing variables.
New version of core. Core were divided on two parts, the core and the main window.
Added Russian localization. - Oleg Shevchenko
Added Ukrainian localization. - Oleg Shevchenko
Added quicker return from lost connection to data OK.
Added correct for connection on bad line, when protocol UDP is used.
Changed in preferences window. Main protocol is TCP now.
Corrected a few small mistakes.
0.7.1 Correct dead-lock of knutclient when upsd crashed
0.7.2 New version of Handbook (only Czech language).
New showing runtime.
Corrected problem witch Handbook for KDE 3.1.x.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=210962
New Handbook for Czech language.
Changed for add/delete the first ups.
0.7.3 New version of Handbook.
Corrected frequence/frequency error
0.8.0 New showing of runtime, when connection is down (-:--)
Small changes in code.
Zeroing analog panels when connection is down.
Corrected knutnet.h for FreeBSD
(Carlos Fernando Assis Paniago)
New icons
Corrected "save properties" for KDE Logout
0.8.1 New look
Added shortcut, dialog for configuring key settings.
(Laurent Montel)
0.8.2 Changed code for KDE 3.2.x, correct QPallete problem
Corrected connect (...) in KNutMessageManager class
0.8.2.1 Corrected for gcc-3.4
(Andrea Joachens)
0.8.3 Corrected version number for Debian
Corrected French localization
0.8.4 Added refresh connection (reconnect)
0.8.5 Corrected maximum values for battery voltage, battery current and output current
when big UPS (Powerware 9305, ......) is used.
0.8.6 Correct German localization
0.9.0 Made new net layer.
Connecting is asynchrone now.
End of supporting UDP protocol.
KDE older then 3.0.0 already is not supported.
0.9.1 Added checkbox for turn on/off of error message window
0.9.2 Added support for automake 1.8 and 1.9
Added Spanish localization.
(Sir Mad)
New categories for knutclient are 'Qt;KDE;System;Monitor;'
(Sir Mad)
0.9.3 Corrected error for x86_64 environment
(Alexey Sidorov)
0.9.4 Made facelift of analog pointers
Added: click on dock makes or activates main window
Added: Show message when KNC is connected on NUT server again.
Added New error message AlreadySetUsername
Added: New analog panel "Output frequency".
Added: New error message NoListVars.
Corrected: All message window have timeout now and use message manager.
Corrected: Icon in dock has transparent background now.
Corrected: New message window rewrites older message window when has same priority
Corrected: Corrected problem with logon when was switched on other NUT server
Corrected: Corrected problem when values of status was "WAIT"
Corrected: Corrected error in knutdock.h
(Sunil)
0.9.5
Added Polish localization - Tomasz Walach
Added: Into comboBox, for setting main window, was added values "Auto".
Added: New icons for preference window.
Changed: KNC is running on KDE 4 /on distribution which uses KDE4 a has
support for aplication from KDE3 / a little better.
Changed: Window for select of UPS values was changed.
Changed: Index file for czech language uses UTF8, older versions use iso-8859-2
Corrected: Font for analog meter's values is changed/repainted immediately.

@ -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,24 @@
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
noinst_HEADERS = Makefile.cvs installDeb.sh installFedora.sh installMandriva.sh \
installMandriva4.sh

@ -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 @@
Knutclient is GUI client for UPS system NUT.

File diff suppressed because it is too large Load Diff

1561
config.guess vendored

File diff suppressed because it is too large Load Diff

@ -0,0 +1,244 @@
/* 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
/* 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,361 @@
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
$ ./configure --host=x86_64-linux-gnu --build=x86_64-linux-gnu --prefix=/opt/kde3 --mandir=${prefix}/share/man --infodir=${prefix}/share/info --with-qt-includes=/usr/include/qt3/ --with-qt-libraries=/usr/lib/qt3/ --enable-mt --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:2136: checking build system type
configure:2154: result: x86_64-pc-linux-gnu
configure:2176: checking host system type
configure:2191: result: x86_64-pc-linux-gnu
configure:2213: checking target system type
configure:2228: result: x86_64-pc-linux-gnu
configure:2289: checking for a BSD-compatible install
configure:2345: result: /usr/bin/install -c
configure:2360: checking for -p flag to install
configure:2373: result: yes
configure:2384: 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='-Wall -g -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'
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_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=set
ac_cv_env_host_alias_value=x86_64-linux-gnu
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='-Wall -g -O2'
CONF_FILES=''
CPP=''
CPPFLAGS=''
CXX=''
CXXCPP=''
CXXDEPMODE=''
CXXFLAGS='-g -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=''
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='x86_64-linux-gnu'
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='${prefix}/include'
infodir='${prefix}/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='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${prefix}/share/man'
mkdir_p=''
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='${prefix}/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

1686
config.sub vendored

File diff suppressed because it is too large Load Diff

@ -0,0 +1,2 @@
./admin/configure.in.min
configure.in.in

@ -0,0 +1,126 @@
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(knutclient, 0.9.5) 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.2.0)
AC_PATH_KDE
dnl =======================================================
dnl FILE: configure.in.in
dnl =======================================================
#MIN_CONFIG(3.2.0)
dnl PACKAGE set before
AC_C_BIGENDIAN
AC_CHECK_KDEMAXPATHLEN
KDE_CREATE_SUBDIRSLIST
AC_CONFIG_FILES([ Makefile ])
AC_CONFIG_FILES([ doc/Makefile ])
AC_CONFIG_FILES([ doc/cs/Makefile ])
AC_CONFIG_FILES([ doc/en/Makefile ])
AC_CONFIG_FILES([ pics/Makefile ])
AC_CONFIG_FILES([ po/Makefile ])
AC_CONFIG_FILES([ specs/Makefile ])
AC_CONFIG_FILES([ src/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,6 @@
#MIN_CONFIG(3.2.0)
AM_INIT_AUTOMAKE(knutclient, 0.9.5)
AC_C_BIGENDIAN
AC_CHECK_KDEMAXPATHLEN

@ -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 = knutclient
SUBDIRS = $(AUTODIRS)

@ -0,0 +1,2 @@
KDE_DOCS = knutclient
KDE_LANG = cs

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,2 @@
KDE_DOCS = knutclient
KDE_LANG = en

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,9 @@
#!/bin/sh
make -f Makefile.cvs
[ ! -f Makefile ] || make clean
export kde_htmldir=/usr/share/doc/kde/HTML
./configure --prefix=/usr
make
make install

@ -0,0 +1,9 @@
#!/bin/sh
make -f Makefile.cvs
[ ! -f Makefile ] || make clean
export kde_htmldir=/usr/share/doc/HTML
./configure --prefix=/usr
make
make install

@ -0,0 +1,9 @@
#!/bin/sh
make -f Makefile.cvs
[ ! -f Makefile ] || make clean
export kde_htmldir=/usr/share/doc/HTML
./configure --prefix=/usr
make
make install

@ -0,0 +1,13 @@
#!/bin/sh
make -f Makefile.cvs
[ ! -f Makefile ] || make clean
export kde_htmldir=/opt/kde3/usr/share/doc/HTML
export KDEDIRS=/usr:/opt/kde3
sh ./configure --prefix=/opt/kde3
make
make install
mv /opt/kde3/share/applnk/Utilities/knutclient.desktop /opt/kde3/share/applications/kde/

@ -0,0 +1,8 @@
METASOURCES = AUTO
kncpicsdir = $(kde_datadir)/knutclient/pics
kncpics_HEADERS = knc_conn.png knc_error.png knc_main.png knc_ups.png \
knc_batt.png knc_mpref.png knc_panel.png knc_mset.png knc_upses.png knc_analog.png \
knc_dock.png

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,3 @@
POFILES = AUTO
noinst_HEADERS = cs.po de.po es.po fr.po it.po knutclient.pot pt_BR.po \
ru.po uk.po pl.po

@ -0,0 +1,837 @@
# translation of cs.po to
# Daniel Prynych <Daniel.Prynych@alo.cz>, 2003, 2004, 2006, 2009.
# Daniel Prynych <Daniel@prynych.cz>, 2008.
# Daniel Prynych <Daniel.Prynych@buzuluk.cz>, 2008, 2009.
msgid ""
msgstr ""
"Project-Id-Version: cs\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-02-21 12:13+0100\n"
"PO-Revision-Date: 2009-02-21 12:24+0100\n"
"Last-Translator: Daniel Prynych <Daniel.Prynych@alo.cz>\n"
"Language-Team: <cs@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 "Daniel Prynych"
#: _translatorinfo.cpp:3
msgid ""
"_: EMAIL OF TRANSLATORS\n"
"Your emails"
msgstr "Daniel@prynych.cz"
#: knutclient.cpp:86
msgid "Ready."
msgstr "Připraven."
#: knutclient.cpp:218 knutclient.cpp:219
msgid "The connection was renewed."
msgstr "Spojení bylo obnoveno."
#: knutclient.cpp:285
msgid "The connection failed. The next connection will make after %1 sec."
msgstr "Spojení bylo chybné. Následující spojení bude za %1 sekund."
#: knutclient.cpp:546
msgid "upsd > 1.2 doesn't support UDP. Connection is switched to TCP"
msgstr "upsd > 1.2 nepodporuje UDP. Spojení je přepnuto na TCP."
#: knutclient.cpp:688 knutclient.cpp:689
msgid "Data OK"
msgstr "Data v pořádku"
#: knutclient.cpp:781 knutclient.cpp:782
msgid "The connection was closed by the second side (upsd)."
msgstr "Spojení bylo uzavřeno druhou stranou (upsd)."
#: knutclient.cpp:798 knutclient.cpp:799
msgid "UPS is off."
msgstr "UPS je vypnuta."
#: knutclient.cpp:802 knutclient.cpp:803
msgid "UPS is back on."
msgstr "UPS je připojena."
#: knutclient.cpp:808 knutclient.cpp:809
msgid "Power is back online."
msgstr "Síťové napájení obnoveno."
#: knutclient.cpp:814 knutclient.cpp:815
msgid "UPS is on battery."
msgstr "UPS běží na baterie."
#: knutclient.cpp:820 knutclient.cpp:821
msgid "UPS battery is low."
msgstr "Baterie je vybita."
#: knutclient.cpp:824 knutclient.cpp:825
msgid "UPS battery is OK."
msgstr "UPS baterie je v pořádku."
#: knutclient.cpp:830 knutclient.cpp:831
msgid "UPS battery is bad and needs be replaced."
msgstr "UPS baterie je špatná a je jí potřeba vyměnit."
#: knutclient.cpp:836 knutclient.cpp:837
msgid "UPS is overloaded."
msgstr "UPS je přetížena."
#: knutclient.cpp:840 knutclient.cpp:841
msgid "UPS isn't overloaded."
msgstr "UPS není přetížena."
#: knutclient.cpp:846 knutclient.cpp:847 knutdock.cpp:449
msgid "UPS is performing calibration"
msgstr "UPS provádí kalibraci."
#: knutclient.cpp:850 knutclient.cpp:851
msgid "Calibration of UPS is ended."
msgstr "Kalibrace UPS je ukončena."
#: knutclient.cpp:856 knutclient.cpp:857
msgid "UPS is boosting incoming voltage."
msgstr "UPS navyšuje vstupní napětí."
#: knutclient.cpp:860 knutclient.cpp:861
msgid "Boosting of UPS is ended."
msgstr "Navyšovaní napětí je ukončeno."
#: knutclient.cpp:866 knutclient.cpp:867
msgid "UPS is trimming incoming voltage."
msgstr "UPS uřezává vstupní napětí."
#: knutclient.cpp:870 knutclient.cpp:871
msgid "Trimming of UPS is ended."
msgstr "Ořezávaní napětí je ukončeno."
#: knutclient.cpp:887 knutclient.cpp:954 knutclient.cpp:963
msgid "Switched"
msgstr "Přepnuto"
#: knutclient.cpp:1103 knutdock.cpp:640 knutmainwindow.cpp:781
msgid "Reconnect"
msgstr "Obnovit spojení"
#: knutdock.cpp:419 knutdock.cpp:469 knutfrontpanel.cpp:192
#: knutnewupsdlg.cpp:69 knutprintupsvar.cpp:78
msgid "Name"
msgstr "Název"
#: knutdock.cpp:420 knutnewupsdlg.cpp:83
msgid "UPS name"
msgstr "Jméno UPS"
#: knutdock.cpp:421 knutnewupsdlg.cpp:77
msgid "UPS address"
msgstr "Adresa UPS"
#: knutdock.cpp:422 knutdock.cpp:443 knutdock.cpp:446 knutdock.cpp:449
#: knutdock.cpp:452 knutdock.cpp:455 knutdock.cpp:458
msgid "Status : "
msgstr "Stav : "
#: knutdock.cpp:425 knutvardata.cpp:209
msgid "Connection doesn't exist."
msgstr "Spojení neexistuje."
#: knutdock.cpp:429 knutfrontpanel.cpp:80
msgid "UPS On line"
msgstr "Provoz na sít"
#: knutdock.cpp:433 knutfrontpanel.cpp:95
msgid "UPS On battery"
msgstr "Provoz na baterie"
#: knutdock.cpp:437
msgid "UPS Of line"
msgstr "Provoz na sít "
#: knutdock.cpp:443
msgid "UPS Battery is low"
msgstr "Baterie je vybita."
#: knutdock.cpp:446 knutfrontpanel.cpp:138
msgid "Replace battery"
msgstr "Vyměnit baterie"
#: knutdock.cpp:452
msgid "UPS is Overload"
msgstr "UPS je přetížena"
#: knutdock.cpp:455
msgid "UPS is trimming voltage"
msgstr "UPS uřezává vstupní napětí"
#: knutdock.cpp:458
msgid "UPS is boosting voltage"
msgstr "UPS navyšuje vstupní napětí"
#: knutdock.cpp:464
msgid "Error : "
msgstr "Chyba : "
#: knutdock.cpp:467 knutfrontpanel.cpp:182
msgid "Manufac. : "
msgstr "Výrobce : "
#: knutdock.cpp:471
msgid "Serial"
msgstr "Sériové č."
#: knutdock.cpp:473
msgid "Firmware"
msgstr "Verze Firmware"
#: knutdock.cpp:477 knutfrontpanel.cpp:233
msgid "Runtime"
msgstr "Runtime"
#: knutdock.cpp:477
msgid " : %1:%2 min"
msgstr " : %1:%2 min"
#: knutdock.cpp:482 knutvardata.cpp:45
msgid "Battery Charge"
msgstr "Kapacita baterie"
#: knutdock.cpp:487 knutvardata.cpp:48
msgid "UPS Load"
msgstr "Zatížení UPS"
#: knutdock.cpp:513 knutmainwindow.cpp:663
msgid "Are you sure ?"
msgstr "Jste si jistý ?"
#: knutdock.cpp:636 knutmainwindow.cpp:748
msgid "&Showing UPS variables and commands"
msgstr "&Zobrazení UPS proměnných a příkazů"
#: knutdock.cpp:637 knutmainwindow.cpp:749
msgid "&Running instant commands"
msgstr "&Spuštění okamžitých příkazů"
#: knutdock.cpp:638 knutmainwindow.cpp:750
msgid "Setting R&W variables"
msgstr "&Nastavení UPS RW proměnných"
#: knutdock.cpp:642
msgid "&Preferences"
msgstr "N&astavení"
#: knutdock.cpp:644
msgid "&About KNutClient"
msgstr "&O aplikaci KNutClient"
#: knutdock.cpp:646
msgid "&Minimize"
msgstr "&Minimalizovat"
#: knutdock.cpp:648
msgid "&Exit"
msgstr "&Konec"
#: knutfrontpanel.cpp:110
msgid "UPS Overload"
msgstr "Přetížení"
#: knutfrontpanel.cpp:124
msgid "UPS Battery low"
msgstr "Baterie je vybita"
#: knutfrontpanel.cpp:152
msgid "UPS calibration"
msgstr "Kalibrace UPS"
#: knutfrontpanel.cpp:202
msgid "Serial : "
msgstr "Sériové č. : "
#: knutfrontpanel.cpp:212
msgid "Firm. rev. : "
msgstr "Ver. firmware : "
#: knutinstcomms.cpp:33
msgid "Instant commands"
msgstr "Okamžité příkazy"
#: knutinstcomms.cpp:45
msgid "RUN INSTANT COMMAND"
msgstr "Spustit stálý příkaz"
#: knutinstcomms.cpp:49
msgid "Command:"
msgstr "Příkaz:"
#: knutinstcomms.cpp:53 knutnewupsdlg.cpp:102 knutrwvar.cpp:70
msgid "User name:"
msgstr "Uživatelské jméno:"
#: knutinstcomms.cpp:54 knutnewupsdlg.cpp:109 knutrwvar.cpp:71
msgid "Password:"
msgstr "Heslo:"
#: knutmainwindow.cpp:59
msgid "test of conection from 5"
msgstr "test připojení z "
#: knutmainwindow.cpp:745
msgid "Quits the application"
msgstr "Ukončí program"
#: knutmainwindow.cpp:778
msgid "&Using descriptions"
msgstr "&Použít popis"
#: knutnewupsdlg.cpp:39
msgid "New Ups"
msgstr "Nová UPS"
#: knutnewupsdlg.cpp:89
msgid "Delay (ms):"
msgstr "Zpoždění (ms):"
#: knutnewupsdlg.cpp:96
msgid "Port:"
msgstr "Port:"
#: knutnewupsdlg.cpp:116
msgid "Store NUT password in configuration file"
msgstr "Uložit NUT heslo do konfiguračního souboru"
#: knutnewupsdlg.cpp:123
msgid "Availabled UPS values"
msgstr "Dostupné UPS proměnné"
#: knutnewupsdlg.cpp:124
msgid "Selected UPS values"
msgstr "Vybrané UPS proměnné"
#: knutnewupsdlg.cpp:134
msgid "UPS Variables"
msgstr "UPS Proměnné"
#: knutnewupsdlg.cpp:255
msgid "No Name or UPS address"
msgstr "Nezadané jméno nebo adresa UPS"
#: knutnewupsdlg.cpp:263
msgid "This Name exist"
msgstr "Toto jméno již existuje"
#: knutnewupsdlg.cpp:270
msgid "Delay must be number"
msgstr "Zpoždění musí být číslo"
#: knutnewupsdlg.cpp:276
msgid "Port must be number"
msgstr "Port musí byt číslo"
#: knutnewupsdlg.cpp:281
msgid "Port must be from 1025 until 65535"
msgstr "Port musí být v rozsahu od 1025 do 65535"
#: knutnewupsdlg.cpp:286
msgid "Delay is too small"
msgstr "Zpoždění je příliš malé"
#: knutprefdlg.cpp:45
msgid "Preferences"
msgstr "Nastavení UPS"
#: knutprefdlg.cpp:508
msgid "Setting"
msgstr "Nastavení"
#: knutprefdlg.cpp:508
msgid "Main Setting"
msgstr "Hlavní nastavení"
#: knutprefdlg.cpp:516
msgid "Voltage/Frequency"
msgstr "Napětí/Frekvence"
#: knutprefdlg.cpp:519
msgid "&Use High-Low XFER"
msgstr "&Použít High-Low XFER"
#: knutprefdlg.cpp:521
msgid "Number of columns :"
msgstr "Počet sloupců :"
#: knutprefdlg.cpp:524 knutprefdlg.cpp:815 knutprefdlg.cpp:894
msgid "Use custom background color"
msgstr "Použít vlastní barvu pozadí"
#: knutprefdlg.cpp:528 knutprefdlg.cpp:818 knutprefdlg.cpp:896
msgid "Color of background :"
msgstr "Barva pozadí :"
#: knutprefdlg.cpp:532
msgid "Use dialog \"Are you sure\""
msgstr "Použít dialog \"Jste si jistý\""
#: knutprefdlg.cpp:535
msgid "Use Main window when program is started"
msgstr "Použít hlavní okno když program startuje"
#: knutprefdlg.cpp:538
msgid "Show message window, when program reports error"
msgstr "Zobrazit okno zpráv, když program hlásí chybu"
#: knutprefdlg.cpp:543
msgid "Auto"
msgstr "Automaticky"
#: knutprefdlg.cpp:547
msgid "Nominal Input Voltage"
msgstr "Vstupní napětí"
#: knutprefdlg.cpp:550
msgid "&230 V"
msgstr "&230 V"
#: knutprefdlg.cpp:551
msgid "&120 V"
msgstr "&120 V"
#: knutprefdlg.cpp:553
msgid "Nominal Input Frequency"
msgstr "Vstupní frekvence"
#: knutprefdlg.cpp:556
msgid "&50 Hz"
msgstr "&50 Hz"
#: knutprefdlg.cpp:557
msgid "&60 Hz"
msgstr "&60 Hz"
#: knutprefdlg.cpp:628
msgid "UPS"
msgstr "UPS"
#: knutprefdlg.cpp:628
msgid "UPS Setting"
msgstr "Nastavení UPS"
#: knutprefdlg.cpp:646
msgid "&Add"
msgstr "Př&idat"
#: knutprefdlg.cpp:667
msgid "Dock bar"
msgstr "Dokovací lišta"
#: knutprefdlg.cpp:667
msgid "Docking Setting"
msgstr "Nastavení dokovaní"
#: knutprefdlg.cpp:671
msgid "Type of dock's showing"
msgstr "Typ zobrazení v doku"
#: knutprefdlg.cpp:676
msgid "Items of tooltip"
msgstr "Prvky ToolTipu"
#: knutprefdlg.cpp:684
msgid "&Picture"
msgstr "&Obrázkové"
#: knutprefdlg.cpp:685
msgid "&General"
msgstr "&Souhrnné"
#: knutprefdlg.cpp:688 knutprefdlg.cpp:799
msgid "M&anufacturer"
msgstr "Výr&obce"
#: knutprefdlg.cpp:691 knutprefdlg.cpp:802
msgid "M&odel"
msgstr "&Model"
#: knutprefdlg.cpp:694 knutprefdlg.cpp:805
msgid "&Serial"
msgstr "&Sériové č."
#: knutprefdlg.cpp:697 knutprefdlg.cpp:808
msgid "&Firm. rev."
msgstr "Verze &Firmware"
#: knutprefdlg.cpp:700 knutprefdlg.cpp:811
msgid "&Runtime"
msgstr "&Runtime"
#: knutprefdlg.cpp:703
msgid "&Battery Charge"
msgstr "&Kapacita baterie"
#: knutprefdlg.cpp:706
msgid "&UPS Load"
msgstr "&Zatížení UPS"
#: knutprefdlg.cpp:710
msgid "Use custom icon's background color"
msgstr "Použít vlastní barvu pozadí"
#: knutprefdlg.cpp:713
msgid "Color of icon's background :"
msgstr "Barva pozadí pro ikonu :"
#: knutprefdlg.cpp:769
msgid "Panel"
msgstr "Panel"
#: knutprefdlg.cpp:769
msgid "Panel Setting"
msgstr "Nastavení hlavního panelu"
#: knutprefdlg.cpp:784
msgid "UPS &Overload"
msgstr "&Přetížení"
#: knutprefdlg.cpp:787
msgid "UPS &Battery low"
msgstr "&Baterie je vybita"
#: knutprefdlg.cpp:790
msgid "R&eplace battery"
msgstr "&Vyměnit baterie"
#: knutprefdlg.cpp:793
msgid "Ups &calibration"
msgstr "&Kalibrace UPS"
#: knutprefdlg.cpp:796
msgid "&Manufac. + Model"
msgstr "Výrobce + M&odel"
#: knutprefdlg.cpp:851
msgid "Setting Fonts"
msgstr "Nastavení písma"
#: knutprefdlg.cpp:858
msgid "&Use custom font"
msgstr "&Použít vlastní písma"
#: knutprefdlg.cpp:863
msgid "Main panel"
msgstr "Hlavní panel"
#: knutprefdlg.cpp:864
msgid "Analog panels"
msgstr "Analogové panely"
#: knutprefdlg.cpp:887
msgid "Analog"
msgstr "Analog"
#: knutprefdlg.cpp:887
msgid "Setting Analog panel"
msgstr "Nastavení analogových panelů"
#: knutprefdlg.cpp:898
msgid "Use custom other colors"
msgstr "Použít vlastní barvy"
#: knutprefdlg.cpp:900
msgid "Color of pointer :"
msgstr "Barva ručičky :"
#: knutprefdlg.cpp:902
msgid "Color of OK range :"
msgstr "Barva OK rozsahu :"
#: knutprefdlg.cpp:904
msgid "Color of warning range :"
msgstr "Barva rozsahu varovaní :"
#: knutprefdlg.cpp:906
msgid "Color of error range :"
msgstr "Barva rozsahu chyby :"
#: knutprefdlg.cpp:908
msgid "Color of scale :"
msgstr "Barva stupnice :"
#: knutprefdlg.cpp:910
msgid "Color of font :"
msgstr "Barva písma :"
#: knutprefdlg.cpp:913
msgid "Digital processing of pointers :"
msgstr "Vylepšení zpracovaní ručičky :"
#: knutprefdlg.cpp:964
msgid "Nothing processing"
msgstr "Žádné"
#: knutprefdlg.cpp:965
msgid "Fast antialiasing"
msgstr "Rychlé"
#: knutprefdlg.cpp:966
msgid "Fine antialiasing"
msgstr "Vylepšené"
#: knutprefdlg.cpp:967
msgid "Fast antialiasing and blur motion"
msgstr "Rychlé a rozostření okrajů"
#: knutprefdlg.cpp:968
msgid "Fine antialiasing and blur motion"
msgstr "Vylepšené a rozostření okrajů"
#: knutprintupsvar.cpp:41
msgid "Variables"
msgstr "UPS Proměnné"
#: knutprintupsvar.cpp:50
msgid "Reload Vars"
msgstr "Obnovit"
#: knutprintupsvar.cpp:52
msgid "UPS variables"
msgstr "UPS proměnné"
#: knutprintupsvar.cpp:79
msgid "Value"
msgstr "Hodnota"
#: knutprintupsvar.cpp:81
msgid "Description"
msgstr "Popis"
#: knutprintupsvar.cpp:90
msgid "Instant Commands"
msgstr "Okamžité příkazy"
#: knutprintupsvar.cpp:103
msgid "Read/Write Variables"
msgstr "Měnitelné hodnoty"
#: knutprintupsvar.cpp:121
msgid "Read Only Variables"
msgstr "Stálé hodnoty"
#: knutrwvar.cpp:40
msgid "RW variables"
msgstr "UPS RW Proměnné"
#: knutrwvar.cpp:56
msgid "SET RW VARIABLE"
msgstr "NASTAVIT RW PROMĚNOU"
#: knutrwvar.cpp:61
msgid "Variable:"
msgstr "Proměnná"
#: knutrwvar.cpp:64
msgid "Value:"
msgstr "Hodnota"
#: knutvardata.cpp:43
msgid "None"
msgstr "Žádný výběr"
#: knutvardata.cpp:44
msgid "Input Voltage"
msgstr "Vstupní napětí"
#: knutvardata.cpp:46
msgid "UPS Temperature"
msgstr "Teplota UPS"
#: knutvardata.cpp:47
msgid "Input Frequency"
msgstr "Vstupní frekvence"
#: knutvardata.cpp:49
msgid "Outside Temperature"
msgstr "Vnější teplota"
#: knutvardata.cpp:50
msgid "Outside Humidity"
msgstr "Vnější vlhkost"
#: knutvardata.cpp:51
msgid "Battery Voltage"
msgstr "Napětí baterie"
#: knutvardata.cpp:52
msgid "Output Voltage"
msgstr "Výstupní napětí"
#: knutvardata.cpp:53
msgid "Output Current"
msgstr "Výstupní proud"
#: knutvardata.cpp:54
msgid "Output Frequency"
msgstr "Výstupní frekvence"
#: knutvardata.cpp:55
msgid "Battery Temperature"
msgstr "Teplota baterie"
#: knutvardata.cpp:56
msgid "Battery Current"
msgstr "Proud baterie"
#: knutvardata.cpp:186
#, fuzzy
msgid "No memory."
msgstr "Není dostatek paměti"
#: knutvardata.cpp:187
msgid "No address."
msgstr "Nezadaná adresa"
#: knutvardata.cpp:188
msgid "Unknown address."
msgstr "Neznámá adresa"
#: knutvardata.cpp:191
msgid "Error of connection."
msgstr "Chyba spojení"
#: knutvardata.cpp:194
msgid "No connection with server."
msgstr "Neexistuje spojeni se serverem."
#: knutvardata.cpp:196
msgid "Server-client protocol or variables of NUT are unknown."
msgstr "Protokol server-klient nebo nebo proměnné NUT-u jsou neznámé."
#: knutvardata.cpp:197
msgid "No UPS on this address."
msgstr "Nezadaná adresa"
#: knutvardata.cpp:198
msgid "Connection was refused by server."
msgstr "Spojeni bylo serverem odmítnuto."
#: knutvardata.cpp:200
msgid "Server doesn't receive data."
msgstr "Server nepřijímá data."
#: knutvardata.cpp:201
msgid "Server doesn't send data."
msgstr "Server neposílá data."
#: knutvardata.cpp:202
msgid "Server doesn't answer."
msgstr "Server neodpovídá."
#: knutvardata.cpp:204
msgid "Server returns data with unknown format."
msgstr "Server vrací data v neznámém formátu."
#: knutvardata.cpp:205
msgid "Server returns unknown data."
msgstr "Server vrací neznámá data."
#: knutvardata.cpp:206
msgid "Command VER returns data with unknown format."
msgstr "Příkaz VER vrací data v neznámém formátu."
#: knutvardata.cpp:208
msgid "No data."
msgstr "Žádná data"
#: knutvardata.cpp:212
msgid "Access denied. Failed password ?"
msgstr "Přístup odmítnut. Špatné heslo ?"
#: knutvardata.cpp:213
msgid "UPS doesn't sent data to server (Data Stale)."
msgstr "UPS nemůže poslat data na server. (Data se nemění)"
#: knutvardata.cpp:214
msgid "Server doesn't know this command."
msgstr "Server nezná tento příkaz."
#: knutvardata.cpp:217
msgid "UPS's driver isn't connected."
msgstr "Ovladač pro UPS není připojen."
#: knutvardata.cpp:219
msgid "Server required password."
msgstr "Server požaduje heslo."
#: knutvardata.cpp:220
msgid "Incorrect password."
msgstr "Nesprávné heslo."
#: knutvardata.cpp:221
msgid "UPS doesn't response."
msgstr "UPS neodpovídá."
#: knutvardata.cpp:222
msgid "Command failed."
msgstr "Špatný příkaz."
#: knutvardata.cpp:223
msgid "UPS doesn't know this instant command."
msgstr "UPS nezná tento okamžitý příkaz."
#: knutvardata.cpp:224
msgid "UPS doesn't support this instant command."
msgstr "UPS nepodporuje tento okamžitý příkaz."
#: knutvardata.cpp:225
msgid "UPS doesn't known this variable."
msgstr "UPS nezná tuto proměnou."
#: knutvardata.cpp:226
msgid "UPS doesn't support this variable."
msgstr "UPS nepodporuje tuto proměnou."
#: knutvardata.cpp:227
msgid "UPS doesn't support this value in this variable."
msgstr "UPS nepodporuje tuto hodnotu v této proměnné."
#: knutvardata.cpp:228
msgid "Name of UPS is unknown."
msgstr "Jméno UPS-ky je neznámé ."
#: knutvardata.cpp:230
msgid "Username has been already entered."
msgstr "Uživatelské jméno již byla zadáno."
#: knutvardata.cpp:231
msgid "Password has been already entered."
msgstr "Heslo již bylo zadáno."
#: knutvardata.cpp:233
msgid "Server doesn't send list of variables."
msgstr "Server neposílá seznam proměnných."
#: knutvardata.cpp:236
msgid "Unknown error."
msgstr "Neznámá chyba"
#: main.cpp:31
msgid "Client for Network UPS Tool"
msgstr "Klient pro UPS systém NUT"
#: main.cpp:37
msgid "Don't dock in Kicker"
msgstr "Neumístit do doku (Kicker)"
#: main.cpp:47
msgid "KNutClient"
msgstr "KNutClient"
#. i18n: file ./knutclientui.rc line 13
#: rc.cpp:9
#, no-c-format
msgid "&Connection"
msgstr "Spojení"

@ -0,0 +1,842 @@
# translation of de.po to
# Copyright (C) 2002,2003, 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
#
# Christoph Thielecke <crissi99@gmx.de>, 2002,2003, 2004, 2008.
# Daniel Prynych <Daniel.Prynych@alo.cz>, 2003, 2005.
# Christoph Thielecke <christoph.thielecke@gmx.de>, 2006.
msgid ""
msgstr ""
"Project-Id-Version: de\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-02-21 12:13+0100\n"
"PO-Revision-Date: 2008-05-26 07:18+0200\n"
"Last-Translator: Christoph Thielecke <crissi99@gmx.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 "Christoph Thielecke"
#: _translatorinfo.cpp:3
msgid ""
"_: EMAIL OF TRANSLATORS\n"
"Your emails"
msgstr "crissi99@gmx.de"
#: knutclient.cpp:86
msgid "Ready."
msgstr "Bereit."
#: knutclient.cpp:218 knutclient.cpp:219
msgid "The connection was renewed."
msgstr "Die Verbindung wurde erneuert."
#: knutclient.cpp:285
msgid "The connection failed. The next connection will make after %1 sec."
msgstr ""
"Die Verbindung ist fehlgeschlagen. Die nächste Verbindung wir nach %1s "
"aufgebaut."
#: knutclient.cpp:546
msgid "upsd > 1.2 doesn't support UDP. Connection is switched to TCP"
msgstr "upsd > 1.2 unterstützt kien UDP. Verbindung mit TCP geschaltet."
#: knutclient.cpp:688 knutclient.cpp:689
msgid "Data OK"
msgstr "Daten OK"
#: knutclient.cpp:781 knutclient.cpp:782
msgid "The connection was closed by the second side (upsd)."
msgstr "Die Verbindung wurde von der anderen Seite (upsd) geschlossen."
#: knutclient.cpp:798 knutclient.cpp:799
msgid "UPS is off."
msgstr "USV ist aus."
#: knutclient.cpp:802 knutclient.cpp:803
msgid "UPS is back on."
msgstr "USV wieder an."
#: knutclient.cpp:808 knutclient.cpp:809
msgid "Power is back online."
msgstr "Netzspannung ist wieder verfügbar."
#: knutclient.cpp:814 knutclient.cpp:815
msgid "UPS is on battery."
msgstr "USV ist im Akkubetrieb."
#: knutclient.cpp:820 knutclient.cpp:821
msgid "UPS battery is low."
msgstr "USV hat niedrigeren Akkustand."
#: knutclient.cpp:824 knutclient.cpp:825
msgid "UPS battery is OK."
msgstr "USV Akkustand ist OK."
#: knutclient.cpp:830 knutclient.cpp:831
msgid "UPS battery is bad and needs be replaced."
msgstr "USV Akku ist in schlechter Verfassung und muss ausgewechselt werden."
#: knutclient.cpp:836 knutclient.cpp:837
msgid "UPS is overloaded."
msgstr "USV ist überlastet."
#: knutclient.cpp:840 knutclient.cpp:841
msgid "UPS isn't overloaded."
msgstr "USV ist nicht überlastet."
#: knutclient.cpp:846 knutclient.cpp:847 knutdock.cpp:449
msgid "UPS is performing calibration"
msgstr "USV wird gerade kalibriert"
#: knutclient.cpp:850 knutclient.cpp:851
msgid "Calibration of UPS is ended."
msgstr "Kalibration der USV ist beendet."
#: knutclient.cpp:856 knutclient.cpp:857
msgid "UPS is boosting incoming voltage."
msgstr "USV verstärkt eingehende Spannung."
#: knutclient.cpp:860 knutclient.cpp:861
msgid "Boosting of UPS is ended."
msgstr "Verstärkung der USV ist beendet."
#: knutclient.cpp:866 knutclient.cpp:867
msgid "UPS is trimming incoming voltage."
msgstr "USV beschränkt eingehende Spannung."
#: knutclient.cpp:870 knutclient.cpp:871
msgid "Trimming of UPS is ended."
msgstr "Beschränkung der USV ist beendet."
#: knutclient.cpp:887 knutclient.cpp:954 knutclient.cpp:963
msgid "Switched"
msgstr "Geschaltet"
#: knutclient.cpp:1103 knutdock.cpp:640 knutmainwindow.cpp:781
msgid "Reconnect"
msgstr "Erneut verbinden"
#: knutdock.cpp:419 knutdock.cpp:469 knutfrontpanel.cpp:192
#: knutnewupsdlg.cpp:69 knutprintupsvar.cpp:78
msgid "Name"
msgstr "Name"
#: knutdock.cpp:420 knutnewupsdlg.cpp:83
msgid "UPS name"
msgstr "Benutzername"
#: knutdock.cpp:421 knutnewupsdlg.cpp:77
msgid "UPS address"
msgstr "USV-Adresse"
#: knutdock.cpp:422 knutdock.cpp:443 knutdock.cpp:446 knutdock.cpp:449
#: knutdock.cpp:452 knutdock.cpp:455 knutdock.cpp:458
msgid "Status : "
msgstr "Status : "
#: knutdock.cpp:425 knutvardata.cpp:209
msgid "Connection doesn't exist."
msgstr "Verbindung existiert nicht."
#: knutdock.cpp:429 knutfrontpanel.cpp:80
msgid "UPS On line"
msgstr "USV-Netzbetrieb"
#: knutdock.cpp:433 knutfrontpanel.cpp:95
msgid "UPS On battery"
msgstr "USV-Akkubetrieb"
#: knutdock.cpp:437
msgid "UPS Of line"
msgstr "USV offline"
#: knutdock.cpp:443
msgid "UPS Battery is low"
msgstr "USV-Akkustand niedrig"
#: knutdock.cpp:446 knutfrontpanel.cpp:138
msgid "Replace battery"
msgstr "Akku ersetzen"
#: knutdock.cpp:452
msgid "UPS is Overload"
msgstr "USV überlastet"
#: knutdock.cpp:455
msgid "UPS is trimming voltage"
msgstr "USV beschränkt Spannung"
#: knutdock.cpp:458
msgid "UPS is boosting voltage"
msgstr "USV erhöht Spannung"
#: knutdock.cpp:464
msgid "Error : "
msgstr "Fehler :"
#: knutdock.cpp:467 knutfrontpanel.cpp:182
msgid "Manufac. : "
msgstr "Hersteller: "
#: knutdock.cpp:471
msgid "Serial"
msgstr "Seriell"
#: knutdock.cpp:473
msgid "Firmware"
msgstr "Firmware"
#: knutdock.cpp:477 knutfrontpanel.cpp:233
msgid "Runtime"
msgstr "Laufzeit"
#: knutdock.cpp:477
msgid " : %1:%2 min"
msgstr " : %1:%2 min"
#: knutdock.cpp:482 knutvardata.cpp:45
msgid "Battery Charge"
msgstr "Akkustand"
#: knutdock.cpp:487 knutvardata.cpp:48
msgid "UPS Load"
msgstr "USV-Auslastung"
#: knutdock.cpp:513 knutmainwindow.cpp:663
msgid "Are you sure ?"
msgstr "Sind Sie Sicher?"
#: knutdock.cpp:636 knutmainwindow.cpp:748
msgid "&Showing UPS variables and commands"
msgstr "USV-Variablen und Kommandos werden ange&zeigt"
#: knutdock.cpp:637 knutmainwindow.cpp:749
msgid "&Running instant commands"
msgstr "Sofort-Kommandos werden ausge&führt"
#: knutdock.cpp:638 knutmainwindow.cpp:750
msgid "Setting R&W variables"
msgstr "&RW-Variablen werden gesetzt"
#: knutdock.cpp:642
msgid "&Preferences"
msgstr "&Einstellungen"
#: knutdock.cpp:644
msgid "&About KNutClient"
msgstr "&Über KNutClient"
#: knutdock.cpp:646
msgid "&Minimize"
msgstr "&Minimieren"
#: knutdock.cpp:648
msgid "&Exit"
msgstr "&Beenden"
#: knutfrontpanel.cpp:110
msgid "UPS Overload"
msgstr "USV-Überlastung"
#: knutfrontpanel.cpp:124
msgid "UPS Battery low"
msgstr "USV niedriger Akkustand"
#: knutfrontpanel.cpp:152
msgid "UPS calibration"
msgstr "USV-Kalibration"
#: knutfrontpanel.cpp:202
msgid "Serial : "
msgstr "Seriennr.: "
#: knutfrontpanel.cpp:212
msgid "Firm. rev. : "
msgstr "Firmw.-Rev.: "
#: knutinstcomms.cpp:33
msgid "Instant commands"
msgstr "Sofortkommandos"
#: knutinstcomms.cpp:45
msgid "RUN INSTANT COMMAND"
msgstr "SOFORTKOMMANDO STARTEN"
#: knutinstcomms.cpp:49
msgid "Command:"
msgstr "Kommando:"
#: knutinstcomms.cpp:53 knutnewupsdlg.cpp:102 knutrwvar.cpp:70
msgid "User name:"
msgstr "Benutzername:"
#: knutinstcomms.cpp:54 knutnewupsdlg.cpp:109 knutrwvar.cpp:71
msgid "Password:"
msgstr "Passwort:"
#: knutmainwindow.cpp:59
msgid "test of conection from 5"
msgstr "Test der Verbindung von 5"
#: knutmainwindow.cpp:745
msgid "Quits the application"
msgstr "Beendet das Programm."
#: knutmainwindow.cpp:778
msgid "&Using descriptions"
msgstr "Beschreibungen werden &verwendet"
#: knutnewupsdlg.cpp:39
msgid "New Ups"
msgstr "Neue USV"
#: knutnewupsdlg.cpp:89
msgid "Delay (ms):"
msgstr "Verzögerung (ms):"
#: knutnewupsdlg.cpp:96
msgid "Port:"
msgstr "Port:"
#: knutnewupsdlg.cpp:116
msgid "Store NUT password in configuration file"
msgstr "NUT-Passwort in Konfigurationsdatei speichern"
#: knutnewupsdlg.cpp:123
msgid "Availabled UPS values"
msgstr ""
#: knutnewupsdlg.cpp:124
msgid "Selected UPS values"
msgstr ""
#: knutnewupsdlg.cpp:134
msgid "UPS Variables"
msgstr "USV-Variablen"
#: knutnewupsdlg.cpp:255
msgid "No Name or UPS address"
msgstr "Kein Name oder USV-Adresse"
#: knutnewupsdlg.cpp:263
msgid "This Name exist"
msgstr "Dieser Name existiert bereits"
#: knutnewupsdlg.cpp:270
msgid "Delay must be number"
msgstr "Die Verzögerung muss eine Zahl sein"
#: knutnewupsdlg.cpp:276
msgid "Port must be number"
msgstr "Der Port muss eine Zahl sein"
#: knutnewupsdlg.cpp:281
msgid "Port must be from 1025 until 65535"
msgstr "Der Port muss zwischen 1025 und 65535 liegen"
#: knutnewupsdlg.cpp:286
msgid "Delay is too small"
msgstr "Verzögerung ist zu klein"
#: knutprefdlg.cpp:45
msgid "Preferences"
msgstr "Einstellungen"
#: knutprefdlg.cpp:508
msgid "Setting"
msgstr "Einstellung"
#: knutprefdlg.cpp:508
msgid "Main Setting"
msgstr "Haupteinstellung"
#: knutprefdlg.cpp:516
msgid "Voltage/Frequency"
msgstr "Spannung/Frequenz"
#: knutprefdlg.cpp:519
msgid "&Use High-Low XFER"
msgstr "Hoch-Niedrig-XFER &benutzen"
#: knutprefdlg.cpp:521
msgid "Number of columns :"
msgstr "Anzahl der Zeilen:"
#: knutprefdlg.cpp:524 knutprefdlg.cpp:815 knutprefdlg.cpp:894
msgid "Use custom background color"
msgstr "Benutzerdefinierte Hintergrundfarbe benutzen:"
#: knutprefdlg.cpp:528 knutprefdlg.cpp:818 knutprefdlg.cpp:896
msgid "Color of background :"
msgstr "Hintergrundfarbe:"
#: knutprefdlg.cpp:532
msgid "Use dialog \"Are you sure\""
msgstr "\"Sind Sie sicher\"?-Dialog benutzen"
#: knutprefdlg.cpp:535
msgid "Use Main window when program is started"
msgstr "Wenn Programm gestartet, Hauptfenster benutzen"
#: knutprefdlg.cpp:538
msgid "Show message window, when program reports error"
msgstr "Wenn Programm Fehler meldet, Nachrichtenfenster anzeigen"
#: knutprefdlg.cpp:543
msgid "Auto"
msgstr ""
#: knutprefdlg.cpp:547
msgid "Nominal Input Voltage"
msgstr "Nominelle Eingangsspannung"
#: knutprefdlg.cpp:550
msgid "&230 V"
msgstr "&230 V"
#: knutprefdlg.cpp:551
msgid "&120 V"
msgstr "&120 V"
#: knutprefdlg.cpp:553
msgid "Nominal Input Frequency"
msgstr "Nominelle Eingangsfrequenz"
#: knutprefdlg.cpp:556
msgid "&50 Hz"
msgstr "&50 Hz"
#: knutprefdlg.cpp:557
msgid "&60 Hz"
msgstr "&60 Hz"
#: knutprefdlg.cpp:628
msgid "UPS"
msgstr "USV"
#: knutprefdlg.cpp:628
msgid "UPS Setting"
msgstr "USV-Einstellung"
#: knutprefdlg.cpp:646
msgid "&Add"
msgstr "&Hinzufügen"
#: knutprefdlg.cpp:667
#, fuzzy
msgid "Dock bar"
msgstr "Andocken"
#: knutprefdlg.cpp:667
msgid "Docking Setting"
msgstr "Einstellung des Docking"
#: knutprefdlg.cpp:671
msgid "Type of dock's showing"
msgstr "Typ der Dockanzeige"
#: knutprefdlg.cpp:676
msgid "Items of tooltip"
msgstr "Elemente des Kurztipps"
#: knutprefdlg.cpp:684
msgid "&Picture"
msgstr "&Bild"
#: knutprefdlg.cpp:685
msgid "&General"
msgstr "&Allgemein"
#: knutprefdlg.cpp:688 knutprefdlg.cpp:799
msgid "M&anufacturer"
msgstr "&Hersteller"
#: knutprefdlg.cpp:691 knutprefdlg.cpp:802
msgid "M&odel"
msgstr "M&odell"
#: knutprefdlg.cpp:694 knutprefdlg.cpp:805
msgid "&Serial"
msgstr "&Serien-Nr."
#: knutprefdlg.cpp:697 knutprefdlg.cpp:808
msgid "&Firm. rev."
msgstr "&Firmw-Rev."
#: knutprefdlg.cpp:700 knutprefdlg.cpp:811
msgid "&Runtime"
msgstr "&Laufzeit"
#: knutprefdlg.cpp:703
msgid "&Battery Charge"
msgstr "&Akkuladung"
#: knutprefdlg.cpp:706
msgid "&UPS Load"
msgstr "&USV-Auslastung"
#: knutprefdlg.cpp:710
msgid "Use custom icon's background color"
msgstr "Benutzerdefinierte Hintergrundfarbe für Symbol benutzen"
#: knutprefdlg.cpp:713
msgid "Color of icon's background :"
msgstr "Hintergrundfarbe des Symbols:"
#: knutprefdlg.cpp:769
msgid "Panel"
msgstr "Kontrollleiste"
#: knutprefdlg.cpp:769
msgid "Panel Setting"
msgstr "Kontrollleisteneinstellung"
#: knutprefdlg.cpp:784
msgid "UPS &Overload"
msgstr "USV-Über&lastung"
#: knutprefdlg.cpp:787
msgid "UPS &Battery low"
msgstr "USV niedriger &Batteriestand"
#: knutprefdlg.cpp:790
msgid "R&eplace battery"
msgstr "Akku ers&etzen"
#: knutprefdlg.cpp:793
msgid "Ups &calibration"
msgstr "USV-&Kalibration"
#: knutprefdlg.cpp:796
msgid "&Manufac. + Model"
msgstr "Hersteller + &Modell"
#: knutprefdlg.cpp:851
msgid "Setting Fonts"
msgstr "Schriftarten einstellen"
#: knutprefdlg.cpp:858
msgid "&Use custom font"
msgstr "Benutzerdefinierte Schriftart &benutzen"
#: knutprefdlg.cpp:863
msgid "Main panel"
msgstr "Hauptkontrollleiste"
#: knutprefdlg.cpp:864
msgid "Analog panels"
msgstr "Analoge Bedienfläche"
#: knutprefdlg.cpp:887
msgid "Analog"
msgstr "Analog"
#: knutprefdlg.cpp:887
msgid "Setting Analog panel"
msgstr "Analoges Bedienfeld setzen"
#: knutprefdlg.cpp:898
msgid "Use custom other colors"
msgstr "Benutzerdefinierte andere Farben benutzen"
#: knutprefdlg.cpp:900
msgid "Color of pointer :"
msgstr "Farbe des Zeigers:"
#: knutprefdlg.cpp:902
msgid "Color of OK range :"
msgstr "Farbe des OK-Bereiches:"
#: knutprefdlg.cpp:904
msgid "Color of warning range :"
msgstr "Farbe des Warnung-Bereiches:"
#: knutprefdlg.cpp:906
msgid "Color of error range :"
msgstr "Farbe des Fehler-Bereiches:"
#: knutprefdlg.cpp:908
msgid "Color of scale :"
msgstr "Farbe der Skalierung:"
#: knutprefdlg.cpp:910
msgid "Color of font :"
msgstr "Schriftfarbe:"
#: knutprefdlg.cpp:913
msgid "Digital processing of pointers :"
msgstr "Digitalverarbeitung der Zeiger:"
#: knutprefdlg.cpp:964
msgid "Nothing processing"
msgstr "Keine Verarbeitung"
#: knutprefdlg.cpp:965
msgid "Fast antialiasing"
msgstr "Schnelle Kantenglättung"
#: knutprefdlg.cpp:966
msgid "Fine antialiasing"
msgstr "Feine Kantenglättung"
#: knutprefdlg.cpp:967
msgid "Fast antialiasing and blur motion"
msgstr "Schnelle Kantenglättung und verschwommene Bewegung"
#: knutprefdlg.cpp:968
msgid "Fine antialiasing and blur motion"
msgstr "Feine Kantenglättung und verschwommene Bewegung"
#: knutprintupsvar.cpp:41
msgid "Variables"
msgstr "Variablen"
#: knutprintupsvar.cpp:50
msgid "Reload Vars"
msgstr "Neugeladene Variablen"
#: knutprintupsvar.cpp:52
msgid "UPS variables"
msgstr "USV-Variablen"
#: knutprintupsvar.cpp:79
msgid "Value"
msgstr "Wert:"
#: knutprintupsvar.cpp:81
msgid "Description"
msgstr "Beschreibung"
#: knutprintupsvar.cpp:90
msgid "Instant Commands"
msgstr "Sofortkommandos"
#: knutprintupsvar.cpp:103
msgid "Read/Write Variables"
msgstr "Lesen/Schreiben-Variablen"
#: knutprintupsvar.cpp:121
msgid "Read Only Variables"
msgstr "Nur lesbare Variablen"
#: knutrwvar.cpp:40
msgid "RW variables"
msgstr "RW-Variablen"
#: knutrwvar.cpp:56
msgid "SET RW VARIABLE"
msgstr "RW-VARIABLE SETZEN"
#: knutrwvar.cpp:61
msgid "Variable:"
msgstr "Variable:"
#: knutrwvar.cpp:64
msgid "Value:"
msgstr "Wert:"
#: knutvardata.cpp:43
msgid "None"
msgstr "Keine"
#: knutvardata.cpp:44
msgid "Input Voltage"
msgstr "Eingangsspannung"
#: knutvardata.cpp:46
msgid "UPS Temperature"
msgstr "USV-Temperatur"
#: knutvardata.cpp:47
msgid "Input Frequency"
msgstr "Eingangsfrequenz"
#: knutvardata.cpp:49
msgid "Outside Temperature"
msgstr "USV-Aussentemperatur"
#: knutvardata.cpp:50
msgid "Outside Humidity"
msgstr "Aussenfeuchtigkeit"
#: knutvardata.cpp:51
msgid "Battery Voltage"
msgstr "Akkuspannung"
#: knutvardata.cpp:52
msgid "Output Voltage"
msgstr "Ausgangsspannung"
#: knutvardata.cpp:53
msgid "Output Current"
msgstr "Aktuelle Ausgabe"
#: knutvardata.cpp:54
msgid "Output Frequency"
msgstr "Ausgangsfrequenz"
#: knutvardata.cpp:55
msgid "Battery Temperature"
msgstr "Batterietemperatur"
#: knutvardata.cpp:56
msgid "Battery Current"
msgstr "Batterie aktuell"
#: knutvardata.cpp:186
#, fuzzy
msgid "No memory."
msgstr "Kein Speicher."
#: knutvardata.cpp:187
msgid "No address."
msgstr "Keine Adresse."
#: knutvardata.cpp:188
msgid "Unknown address."
msgstr "Unbekannte Adresse."
#: knutvardata.cpp:191
msgid "Error of connection."
msgstr "Fehler bei der Verbindung"
#: knutvardata.cpp:194
msgid "No connection with server."
msgstr "Keine Verbindung zum Server."
#: knutvardata.cpp:196
msgid "Server-client protocol or variables of NUT are unknown."
msgstr "Server-Client-Protokoll oder Variablen von NUT unbekannt"
#: knutvardata.cpp:197
msgid "No UPS on this address."
msgstr "Keine USV an dieser Adresse."
#: knutvardata.cpp:198
msgid "Connection was refused by server."
msgstr "Verbindung wurde vom Server abgelehnt."
#: knutvardata.cpp:200
msgid "Server doesn't receive data."
msgstr "Der Server emfängt keine Daten."
#: knutvardata.cpp:201
msgid "Server doesn't send data."
msgstr "Der Server sendet keine Daten."
#: knutvardata.cpp:202
msgid "Server doesn't answer."
msgstr "Der Server antwortet nicht."
#: knutvardata.cpp:204
msgid "Server returns data with unknown format."
msgstr "Server gab Daten in unbekanntem Vormat zurück."
#: knutvardata.cpp:205
msgid "Server returns unknown data."
msgstr "Server gab unbekannte Daten zurück."
#: knutvardata.cpp:206
msgid "Command VER returns data with unknown format."
msgstr "Kommando VER gab Daten in unbekanntem Format zurück."
#: knutvardata.cpp:208
msgid "No data."
msgstr "Keine Daten."
#: knutvardata.cpp:212
msgid "Access denied. Failed password ?"
msgstr "Zugriff verweigert. Falsches Passwort?"
#: knutvardata.cpp:213
msgid "UPS doesn't sent data to server (Data Stale)."
msgstr "Die USV sendet keine Daten zum Server (Daten gestohlen)."
#: knutvardata.cpp:214
msgid "Server doesn't know this command."
msgstr "Server kennt dieses Kommando nicht."
#: knutvardata.cpp:217
msgid "UPS's driver isn't connected."
msgstr "USV-Treiber ist nicht verbunden."
#: knutvardata.cpp:219
msgid "Server required password."
msgstr "Server erfordert Passwort."
#: knutvardata.cpp:220
msgid "Incorrect password."
msgstr "Fehlerhaftes Passwort."
#: knutvardata.cpp:221
msgid "UPS doesn't response."
msgstr "USV reagiert nicht."
#: knutvardata.cpp:222
msgid "Command failed."
msgstr "Kammando fehlgeschlagen."
#: knutvardata.cpp:223
msgid "UPS doesn't know this instant command."
msgstr "USV kennt dieses Sofortkommando nicht."
#: knutvardata.cpp:224
msgid "UPS doesn't support this instant command."
msgstr "USV unterstützt dieses Sofortkommando nicht."
#: knutvardata.cpp:225
msgid "UPS doesn't known this variable."
msgstr "USV kennt diese Variable nicht."
#: knutvardata.cpp:226
msgid "UPS doesn't support this variable."
msgstr "USV unterstützt diese Variable nicht."
#: knutvardata.cpp:227
msgid "UPS doesn't support this value in this variable."
msgstr "USV unterstützt diese Wert in dieser Variable nicht."
#: knutvardata.cpp:228
msgid "Name of UPS is unknown."
msgstr "Name der USV unbekannt."
#: knutvardata.cpp:230
msgid "Username has been already entered."
msgstr "Der Benutzername wurde bereits eingegeben."
#: knutvardata.cpp:231
msgid "Password has been already entered."
msgstr "Das Passwort wurde bereits eingegeben."
#: knutvardata.cpp:233
msgid "Server doesn't send list of variables."
msgstr "Der Server sendet keine Liste von Variablen."
#: knutvardata.cpp:236
msgid "Unknown error."
msgstr "Unbekannter Fehler."
#: main.cpp:31
msgid "Client for Network UPS Tool"
msgstr "Klient für das Netzwerk-USV-Werkzeug"
#: main.cpp:37
msgid "Don't dock in Kicker"
msgstr "Nicht ein Kontrollleiste einbinden"
#: main.cpp:47
msgid "KNutClient"
msgstr "KNutClient"
#. i18n: file ./knutclientui.rc line 13
#: rc.cpp:9
#, no-c-format
msgid "&Connection"
msgstr "&Verbindung"

1029
po/es.po

File diff suppressed because it is too large Load Diff

@ -0,0 +1,858 @@
# translation of fr.po to Français
# translation of fr.po to
# translation of fr.po to Czech
# translation of fr.po to français
# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
# Arnaud Quette <arnaud.quette@free.fr>, 2003, 2004.
# Daniel Prynych <Daniel.Prynych@alo.cz>, 2003, 2004.
#
msgid ""
msgstr ""
"Project-Id-Version: fr\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-02-21 12:13+0100\n"
"PO-Revision-Date: 2009-02-22 21:44+0100\n"
"Last-Translator: Arnaud Quette <arnaud.quette@free.fr>\n"
"Language-Team: French <fr@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 "Arnaud de Lorbeau,Arnaud Quette"
#: _translatorinfo.cpp:3
msgid ""
"_: EMAIL OF TRANSLATORS\n"
"Your emails"
msgstr "adelorbeau@mandrakesoft.com,arnaud.quette@free.fr"
#: knutclient.cpp:86
msgid "Ready."
msgstr "Prêt."
#: knutclient.cpp:218 knutclient.cpp:219
msgid "The connection was renewed."
msgstr "La connexion a été renouvelé."
#: knutclient.cpp:285
msgid "The connection failed. The next connection will make after %1 sec."
msgstr "La connexion a échoué. Nouvelle tentative dans %1·sec."
#: knutclient.cpp:546
msgid "upsd > 1.2 doesn't support UDP. Connection is switched to TCP"
msgstr "upsd > 1.2 ne supporte pas UDP. La connexion est basculé en TCP"
#: knutclient.cpp:688 knutclient.cpp:689
msgid "Data OK"
msgstr "Données OK"
#: knutclient.cpp:781 knutclient.cpp:782
msgid "The connection was closed by the second side (upsd)."
msgstr "La connexion a été fermé par la seconde partie (upsd)."
#: knutclient.cpp:798 knutclient.cpp:799
msgid "UPS is off."
msgstr "Onduleur arrêté"
#: knutclient.cpp:802 knutclient.cpp:803
msgid "UPS is back on."
msgstr "Onduleur démarré"
#: knutclient.cpp:808 knutclient.cpp:809
msgid "Power is back online."
msgstr "Retour secteur"
#: knutclient.cpp:814 knutclient.cpp:815
msgid "UPS is on battery."
msgstr "Onduleur sur batterie"
#: knutclient.cpp:820 knutclient.cpp:821
msgid "UPS battery is low."
msgstr "Onduleur Batterie basse"
#: knutclient.cpp:824 knutclient.cpp:825
msgid "UPS battery is OK."
msgstr "Batterie OK"
#: knutclient.cpp:830 knutclient.cpp:831
msgid "UPS battery is bad and needs be replaced."
msgstr "La batterie doit être remplacée."
#: knutclient.cpp:836 knutclient.cpp:837
msgid "UPS is overloaded."
msgstr "L'onduleur est en surcharge."
#: knutclient.cpp:840 knutclient.cpp:841
msgid "UPS isn't overloaded."
msgstr "L'onduleur n'est pas en surcharge."
#: knutclient.cpp:846 knutclient.cpp:847 knutdock.cpp:449
msgid "UPS is performing calibration"
msgstr "Calibrage onduleur en cours"
#: knutclient.cpp:850 knutclient.cpp:851
msgid "Calibration of UPS is ended."
msgstr "Calibrage onduleur terminé."
#: knutclient.cpp:856 knutclient.cpp:857
msgid "UPS is boosting incoming voltage."
msgstr "L'onduleur est en redressement de la tension d'entrée."
#: knutclient.cpp:860 knutclient.cpp:861
msgid "Boosting of UPS is ended."
msgstr "Redressement de la tension d'entrée terminé."
#: knutclient.cpp:866 knutclient.cpp:867
msgid "UPS is trimming incoming voltage."
msgstr "L'onduleur est en rabaissement de la tension d'entrée."
#: knutclient.cpp:870 knutclient.cpp:871
msgid "Trimming of UPS is ended."
msgstr "Rabaissement de la tension d'entrée terminé."
#: knutclient.cpp:887 knutclient.cpp:954 knutclient.cpp:963
msgid "Switched"
msgstr "Basculé"
#: knutclient.cpp:1103 knutdock.cpp:640 knutmainwindow.cpp:781
msgid "Reconnect"
msgstr "Reconnexion"
#: knutdock.cpp:419 knutdock.cpp:469 knutfrontpanel.cpp:192
#: knutnewupsdlg.cpp:69 knutprintupsvar.cpp:78
msgid "Name"
msgstr "Nom"
#: knutdock.cpp:420 knutnewupsdlg.cpp:83
msgid "UPS name"
msgstr "Onduleur"
#: knutdock.cpp:421 knutnewupsdlg.cpp:77
msgid "UPS address"
msgstr "Adresse Onduleur"
#: knutdock.cpp:422 knutdock.cpp:443 knutdock.cpp:446 knutdock.cpp:449
#: knutdock.cpp:452 knutdock.cpp:455 knutdock.cpp:458
msgid "Status : "
msgstr "Statut : "
#: knutdock.cpp:425 knutvardata.cpp:209
msgid "Connection doesn't exist."
msgstr "Cette connexion n'existe pas."
#: knutdock.cpp:429 knutfrontpanel.cpp:80
msgid "UPS On line"
msgstr "Sur secteur"
#: knutdock.cpp:433 knutfrontpanel.cpp:95
msgid "UPS On battery"
msgstr "Sur batterie"
#: knutdock.cpp:437
msgid "UPS Of line"
msgstr "Onduleur arrêté"
#: knutdock.cpp:443
msgid "UPS Battery is low"
msgstr "Niveau batterie basse"
#: knutdock.cpp:446 knutfrontpanel.cpp:138
msgid "Replace battery"
msgstr "Remplacer la batterie"
#: knutdock.cpp:452
msgid "UPS is Overload"
msgstr "En surcharge"
#: knutdock.cpp:455
msgid "UPS is trimming voltage"
msgstr "L'onduleur rabaisse la tension"
#: knutdock.cpp:458
msgid "UPS is boosting voltage"
msgstr "L'onduleur redresse la tension"
#: knutdock.cpp:464
msgid "Error : "
msgstr "Erreur : "
#: knutdock.cpp:467 knutfrontpanel.cpp:182
msgid "Manufac. : "
msgstr "Fabricant : "
#: knutdock.cpp:471
msgid "Serial"
msgstr "N° de série"
#: knutdock.cpp:473
msgid "Firmware"
msgstr "Vers. Fw."
#: knutdock.cpp:477 knutfrontpanel.cpp:233
msgid "Runtime"
msgstr "Autonomie"
#: knutdock.cpp:477
msgid " : %1:%2 min"
msgstr " : %1:%2 min"
#: knutdock.cpp:482 knutvardata.cpp:45
msgid "Battery Charge"
msgstr "Charge de la batterie"
#: knutdock.cpp:487 knutvardata.cpp:48
msgid "UPS Load"
msgstr "Charge de l'onduleur"
#: knutdock.cpp:513 knutmainwindow.cpp:663
msgid "Are you sure ?"
msgstr "Êtes vous sûr ?"
#: knutdock.cpp:636 knutmainwindow.cpp:748
msgid "&Showing UPS variables and commands"
msgstr "&Voir les variables et commandes onduleurs"
#: knutdock.cpp:637 knutmainwindow.cpp:749
msgid "&Running instant commands"
msgstr "Commandes &instantanées"
#: knutdock.cpp:638 knutmainwindow.cpp:750
msgid "Setting R&W variables"
msgstr "Configurer les &variables de l'onduleur"
#: knutdock.cpp:642
msgid "&Preferences"
msgstr "&Préférences"
#: knutdock.cpp:644
msgid "&About KNutClient"
msgstr "&A propos de KNutClient"
#: knutdock.cpp:646
msgid "&Minimize"
msgstr "&Réduire"
#: knutdock.cpp:648
msgid "&Exit"
msgstr "&Sortir"
#: knutfrontpanel.cpp:110
msgid "UPS Overload"
msgstr "En surcharge"
#: knutfrontpanel.cpp:124
msgid "UPS Battery low"
msgstr "Niveau batterie bas"
#: knutfrontpanel.cpp:152
msgid "UPS calibration"
msgstr "Calibrage onduleur"
#: knutfrontpanel.cpp:202
msgid "Serial : "
msgstr "N° série : "
#: knutfrontpanel.cpp:212
msgid "Firm. rev. : "
msgstr "Vers. Fw. : "
#: knutinstcomms.cpp:33
msgid "Instant commands"
msgstr "Commandes directes"
#: knutinstcomms.cpp:45
msgid "RUN INSTANT COMMAND"
msgstr "Lancer Commande Directe"
#: knutinstcomms.cpp:49
msgid "Command:"
msgstr "Commande :"
#: knutinstcomms.cpp:53 knutnewupsdlg.cpp:102 knutrwvar.cpp:70
msgid "User name:"
msgstr "Utilisateur :"
#: knutinstcomms.cpp:54 knutnewupsdlg.cpp:109 knutrwvar.cpp:71
msgid "Password:"
msgstr "Mot de passe :"
#: knutmainwindow.cpp:59
msgid "test of conection from 5"
msgstr "test de connexion depuis 5"
#: knutmainwindow.cpp:745
msgid "Quits the application"
msgstr "Quitter l'application."
#: knutmainwindow.cpp:778
msgid "&Using descriptions"
msgstr "&Utiliser les descriptions"
#: knutnewupsdlg.cpp:39
msgid "New Ups"
msgstr "Nouvel Onduleur"
#: knutnewupsdlg.cpp:89
msgid "Delay (ms):"
msgstr "Délai (ms):"
#: knutnewupsdlg.cpp:96
msgid "Port:"
msgstr "Port :"
#: knutnewupsdlg.cpp:116
msgid "Store NUT password in configuration file"
msgstr "Stocker le mot de passe NUT dans le fichier de configuration"
#: knutnewupsdlg.cpp:123
msgid "Availabled UPS values"
msgstr "Valeurs disponibles"
#: knutnewupsdlg.cpp:124
msgid "Selected UPS values"
msgstr "Valeurs sélectionnées"
#: knutnewupsdlg.cpp:134
msgid "UPS Variables"
msgstr "Variables de l'onduleur"
#: knutnewupsdlg.cpp:255
msgid "No Name or UPS address"
msgstr "Pas de nom ou d'adresse pour l'onduleur"
#: knutnewupsdlg.cpp:263
msgid "This Name exist"
msgstr "Ce nom existe"
#: knutnewupsdlg.cpp:270
msgid "Delay must be number"
msgstr "Le délai doit être un nombre"
#: knutnewupsdlg.cpp:276
msgid "Port must be number"
msgstr "Le port doit être un nombre"
#: knutnewupsdlg.cpp:281
msgid "Port must be from 1025 until 65535"
msgstr "Le port doit valoir de 1025 à 65535"
#: knutnewupsdlg.cpp:286
msgid "Delay is too small"
msgstr "Le délai est trop faible"
#: knutprefdlg.cpp:45
msgid "Preferences"
msgstr "Préférences"
#: knutprefdlg.cpp:508
msgid "Setting"
msgstr "Paramètres"
#: knutprefdlg.cpp:508
msgid "Main Setting"
msgstr "Paramètres principaux"
#: knutprefdlg.cpp:516
msgid "Voltage/Frequency"
msgstr "Tension/Fréquence"
#: knutprefdlg.cpp:519
msgid "&Use High-Low XFER"
msgstr "&Utiliser Niveau Transfert Haut-Bas"
#: knutprefdlg.cpp:521
msgid "Number of columns :"
msgstr "Nombre de colonnes :"
#: knutprefdlg.cpp:524 knutprefdlg.cpp:815 knutprefdlg.cpp:894
msgid "Use custom background color"
msgstr "Utiliser une couleur de fond personnalisée :"
#: knutprefdlg.cpp:528 knutprefdlg.cpp:818 knutprefdlg.cpp:896
msgid "Color of background :"
msgstr "Couleur de fond :"
#: knutprefdlg.cpp:532
msgid "Use dialog \"Are you sure\""
msgstr "Utiliser la boite de dialogue \"Êtes vous sûr\""
#: knutprefdlg.cpp:535
msgid "Use Main window when program is started"
msgstr "Utiliser la Fenêtre Principale au démarrage du programme"
#: knutprefdlg.cpp:538
msgid "Show message window, when program reports error"
msgstr ""
"Afficher la fenêtre de message, lorsque le programme rapporte une erreur"
#: knutprefdlg.cpp:543
msgid "Auto"
msgstr "Auto"
#: knutprefdlg.cpp:547
msgid "Nominal Input Voltage"
msgstr "Tension d'entrée nominale"
#: knutprefdlg.cpp:550
msgid "&230 V"
msgstr "&230 V"
#: knutprefdlg.cpp:551
msgid "&120 V"
msgstr "&120 V"
#: knutprefdlg.cpp:553
msgid "Nominal Input Frequency"
msgstr "Fréquence d'entrée nominale"
#: knutprefdlg.cpp:556
msgid "&50 Hz"
msgstr "&50 Hz"
#: knutprefdlg.cpp:557
msgid "&60 Hz"
msgstr "&60 Hz"
#: knutprefdlg.cpp:628
msgid "UPS"
msgstr "Onduleur"
#: knutprefdlg.cpp:628
msgid "UPS Setting"
msgstr "Paramètres de l'onduleur"
#: knutprefdlg.cpp:646
msgid "&Add"
msgstr "&Ajouter"
#: knutprefdlg.cpp:667
msgid "Dock bar"
msgstr "Dock"
#: knutprefdlg.cpp:667
msgid "Docking Setting"
msgstr "Paramètres du dock"
#: knutprefdlg.cpp:671
msgid "Type of dock's showing"
msgstr "Type d'affichage du dock"
#: knutprefdlg.cpp:676
msgid "Items of tooltip"
msgstr "Eléments de l'aide contextuelle"
#: knutprefdlg.cpp:684
msgid "&Picture"
msgstr "&Image"
#: knutprefdlg.cpp:685
msgid "&General"
msgstr "&Général"
#: knutprefdlg.cpp:688 knutprefdlg.cpp:799
msgid "M&anufacturer"
msgstr "F&abricant"
#: knutprefdlg.cpp:691 knutprefdlg.cpp:802
msgid "M&odel"
msgstr "M&odèle"
#: knutprefdlg.cpp:694 knutprefdlg.cpp:805
msgid "&Serial"
msgstr "N°&Série"
#: knutprefdlg.cpp:697 knutprefdlg.cpp:808
msgid "&Firm. rev."
msgstr "&Vers. Fw."
#: knutprefdlg.cpp:700 knutprefdlg.cpp:811
msgid "&Runtime"
msgstr "&Autonomie"
#: knutprefdlg.cpp:703
msgid "&Battery Charge"
msgstr "&Charge de la batterie"
#: knutprefdlg.cpp:706
msgid "&UPS Load"
msgstr "Charge de l'&onduleur"
#: knutprefdlg.cpp:710
msgid "Use custom icon's background color"
msgstr "Utiliser une couleur de fond personnalisée pour les icones :"
#: knutprefdlg.cpp:713
msgid "Color of icon's background :"
msgstr "Couleur de fond des icones :"
#: knutprefdlg.cpp:769
msgid "Panel"
msgstr "Panneau"
#: knutprefdlg.cpp:769
msgid "Panel Setting"
msgstr "Paramètres du panneau"
#: knutprefdlg.cpp:784
msgid "UPS &Overload"
msgstr "En &Surcharge"
#: knutprefdlg.cpp:787
msgid "UPS &Battery low"
msgstr "&Batterie faible"
#: knutprefdlg.cpp:790
msgid "R&eplace battery"
msgstr "R&emplacer la batterie"
#: knutprefdlg.cpp:793
msgid "Ups &calibration"
msgstr "&Calibration de l'onduleur"
#: knutprefdlg.cpp:796
msgid "&Manufac. + Model"
msgstr "&Fabricant. + Modèle"
#: knutprefdlg.cpp:851
msgid "Setting Fonts"
msgstr "Paramètres des Polices"
#: knutprefdlg.cpp:858
msgid "&Use custom font"
msgstr "&Utiliser les polices personnalisées"
#: knutprefdlg.cpp:863
msgid "Main panel"
msgstr "Panneau principal"
#: knutprefdlg.cpp:864
msgid "Analog panels"
msgstr "Panneau analogique"
#: knutprefdlg.cpp:887
msgid "Analog"
msgstr "Analogique"
#: knutprefdlg.cpp:887
msgid "Setting Analog panel"
msgstr "Paramètres du panneau analogique"
#: knutprefdlg.cpp:898
msgid "Use custom other colors"
msgstr "Utiliser d'autres couleurs personnalisées"
#: knutprefdlg.cpp:900
msgid "Color of pointer :"
msgstr "Couleur du pointeur :"
#: knutprefdlg.cpp:902
msgid "Color of OK range :"
msgstr "Couleur pour \"OK\" :"
#: knutprefdlg.cpp:904
msgid "Color of warning range :"
msgstr "Couleur des avertissements :"
#: knutprefdlg.cpp:906
msgid "Color of error range :"
msgstr "Couleur des erreurs :"
#: knutprefdlg.cpp:908
msgid "Color of scale :"
msgstr "Couleur de l'échelle :"
#: knutprefdlg.cpp:910
msgid "Color of font :"
msgstr "Couleur des polices :"
#: knutprefdlg.cpp:913
msgid "Digital processing of pointers :"
msgstr "Traitement numérique des pointeurs :"
#: knutprefdlg.cpp:964
msgid "Nothing processing"
msgstr "Aucun traitement"
#: knutprefdlg.cpp:965
msgid "Fast antialiasing"
msgstr "Anti crénelage rapide"
#: knutprefdlg.cpp:966
msgid "Fine antialiasing"
msgstr "Anti crénelage fin"
#: knutprefdlg.cpp:967
msgid "Fast antialiasing and blur motion"
msgstr "Anti crénelage rapide et fondu animé"
#: knutprefdlg.cpp:968
msgid "Fine antialiasing and blur motion"
msgstr "Anti crénelage fin et fondu animé"
#: knutprintupsvar.cpp:41
msgid "Variables"
msgstr "Variables"
#: knutprintupsvar.cpp:50
msgid "Reload Vars"
msgstr "Recharger les variables"
#: knutprintupsvar.cpp:52
msgid "UPS variables"
msgstr "Variables de l'onduleur"
#: knutprintupsvar.cpp:79
msgid "Value"
msgstr "Valeur"
#: knutprintupsvar.cpp:81
msgid "Description"
msgstr "Descriptions"
#: knutprintupsvar.cpp:90
msgid "Instant Commands"
msgstr "Commandes directes"
#: knutprintupsvar.cpp:103
msgid "Read/Write Variables"
msgstr "Variables en lecture/écriture"
#: knutprintupsvar.cpp:121
msgid "Read Only Variables"
msgstr "Variables en lecture seule"
#: knutrwvar.cpp:40
msgid "RW variables"
msgstr "Variables en lecture/écriture"
#: knutrwvar.cpp:56
msgid "SET RW VARIABLE"
msgstr "Affecter une variable"
#: knutrwvar.cpp:61
msgid "Variable:"
msgstr "Variables :"
#: knutrwvar.cpp:64
msgid "Value:"
msgstr "Valeur"
#: knutvardata.cpp:43
msgid "None"
msgstr "Aucun"
#: knutvardata.cpp:44
msgid "Input Voltage"
msgstr "Tension d'entrée"
#: knutvardata.cpp:46
msgid "UPS Temperature"
msgstr "Température de l'onduleur"
#: knutvardata.cpp:47
msgid "Input Frequency"
msgstr "Fréquence d'entrée"
#: knutvardata.cpp:49
msgid "Outside Temperature"
msgstr "Température extérieure"
#: knutvardata.cpp:50
msgid "Outside Humidity"
msgstr "Humidité extérieure"
#: knutvardata.cpp:51
msgid "Battery Voltage"
msgstr "Tension de la batterie"
#: knutvardata.cpp:52
msgid "Output Voltage"
msgstr "Tension de sortie"
#: knutvardata.cpp:53
msgid "Output Current"
msgstr "Courant de sortie"
#: knutvardata.cpp:54
msgid "Output Frequency"
msgstr "Fréquence de Sortie"
#: knutvardata.cpp:55
msgid "Battery Temperature"
msgstr "Température de la batterie"
#: knutvardata.cpp:56
msgid "Battery Current"
msgstr "Courant de la batterie"
#: knutvardata.cpp:186
msgid "No memory."
msgstr "Pas de mémoire."
#: knutvardata.cpp:187
msgid "No address."
msgstr "Pas d'adresse."
#: knutvardata.cpp:188
msgid "Unknown address."
msgstr "Adresse inconnue."
#: knutvardata.cpp:191
msgid "Error of connection."
msgstr "Erreur de connexion."
#: knutvardata.cpp:194
msgid "No connection with server."
msgstr "Pas de connexion avec le serveur."
#: knutvardata.cpp:196
msgid "Server-client protocol or variables of NUT are unknown."
msgstr "Le protocole Client-Server ou les variables NUT sont inconnues."
#: knutvardata.cpp:197
msgid "No UPS on this address."
msgstr "Pas d'onduleur à cette adresse."
#: knutvardata.cpp:198
msgid "Connection was refused by server."
msgstr "La connexion a été refusée par le serveur."
#: knutvardata.cpp:200
msgid "Server doesn't receive data."
msgstr "Le serveur n'a pas reçu les données."
#: knutvardata.cpp:201
msgid "Server doesn't send data."
msgstr "Le serveur n'a pas renvoyé de données."
#: knutvardata.cpp:202
msgid "Server doesn't answer."
msgstr "Le serveur ne réponds pas."
#: knutvardata.cpp:204
msgid "Server returns data with unknown format."
msgstr "Le serveur a retourné des données dans un format inconnu."
#: knutvardata.cpp:205
msgid "Server returns unknown data."
msgstr "Le serveur a retourné des données inconnues."
#: knutvardata.cpp:206
msgid "Command VER returns data with unknown format."
msgstr "La commande VER a retourné des données dans un format inconnu."
#: knutvardata.cpp:208
msgid "No data."
msgstr "Pas de données"
#: knutvardata.cpp:212
msgid "Access denied. Failed password ?"
msgstr "Accès refusé : mot de passe invalide ?"
#: knutvardata.cpp:213
msgid "UPS doesn't sent data to server (Data Stale)."
msgstr "L'onduleur ne communique pas avec le serveur (Données Périmées)"
#: knutvardata.cpp:214
msgid "Server doesn't know this command."
msgstr "Le serveur ne connaît pas cette commande."
#: knutvardata.cpp:217
msgid "UPS's driver isn't connected."
msgstr "Le pilote de cet onduleur n'est pas connecté."
#: knutvardata.cpp:219
msgid "Server required password."
msgstr "Le serveur requiert un mot de passe."
#: knutvardata.cpp:220
msgid "Incorrect password."
msgstr "Mot de passe incorrect."
#: knutvardata.cpp:221
msgid "UPS doesn't response."
msgstr "L'onduleur ne réponds pas."
#: knutvardata.cpp:222
msgid "Command failed."
msgstr "La commande a échoué."
#: knutvardata.cpp:223
msgid "UPS doesn't know this instant command."
msgstr "L'onduleur ne connaît pas cette commande directe."
#: knutvardata.cpp:224
msgid "UPS doesn't support this instant command."
msgstr "L'onduleur ne supporte pas cette commande directe."
#: knutvardata.cpp:225
msgid "UPS doesn't known this variable."
msgstr "L'onduleur ne connaît pas cette variable."
#: knutvardata.cpp:226
msgid "UPS doesn't support this variable."
msgstr "L'onduleur ne supporte pas cette variable."
#: knutvardata.cpp:227
msgid "UPS doesn't support this value in this variable."
msgstr "L'onduleur ne supporte pas cette valeur pour cette variable."
#: knutvardata.cpp:228
msgid "Name of UPS is unknown."
msgstr "Cette onduleur est inconnu."
#: knutvardata.cpp:230
msgid "Username has been already entered."
msgstr "Le nom d'utilisateur a déjà été entré."
#: knutvardata.cpp:231
msgid "Password has been already entered."
msgstr "Le mot de passe a déjà été entré."
#: knutvardata.cpp:233
msgid "Server doesn't send list of variables."
msgstr "Le serveur n'a pas renvoyé la liste de variables."
#: knutvardata.cpp:236
msgid "Unknown error."
msgstr "Erreur inconnue."
#: main.cpp:31
msgid "Client for Network UPS Tool"
msgstr "Client pour Network UPS Tools"
#: main.cpp:37
msgid "Don't dock in Kicker"
msgstr "Ne pas docker dans le Kicker"
#: main.cpp:47
msgid "KNutClient"
msgstr "KNutClient"
#. i18n: file ./knutclientui.rc line 13
#: rc.cpp:9
#, no-c-format
msgid "&Connection"
msgstr "&Connection"
#~ msgid "Toggle the toolbar..."
#~ msgstr "Afficher la barre d'outils..."
#~ msgid "Toggle the statusbar..."
#~ msgstr "Afficher la barre d'état..."
#~ msgid "Protocol"
#~ msgstr "Protocole"
#~ msgid "UDP"
#~ msgstr "UDP"
#~ msgid "TCP"
#~ msgstr "TCP"
#~ msgid "&Settings"
#~ msgstr "&Paramètres"

@ -0,0 +1,864 @@
# translation of it.po to
# Daniel Prynych <Daniel.Prynych@alo.cz>, 2003, 2008.
msgid ""
msgstr ""
"Project-Id-Version: it\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-02-21 12:13+0100\n"
"PO-Revision-Date: 2008-06-11 20:56+0200\n"
"Last-Translator: Daniel Prynych <Daniel.Prynych@alo.cz>\n"
"Language-Team: <cs@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 "Andrea Pesarini"
#: _translatorinfo.cpp:3
msgid ""
"_: EMAIL OF TRANSLATORS\n"
"Your emails"
msgstr "andreapes72@yahoo.it"
#: knutclient.cpp:86
msgid "Ready."
msgstr "Pronto."
#: knutclient.cpp:218 knutclient.cpp:219
msgid "The connection was renewed."
msgstr "La connessione e' stata rinnovata"
#: knutclient.cpp:285
msgid "The connection failed. The next connection will make after %1 sec."
msgstr ""
"La connessione non e' riuscita.La prossima connessione verra' fatta dopo %1 "
"sec."
#: knutclient.cpp:546
msgid "upsd > 1.2 doesn't support UDP. Connection is switched to TCP"
msgstr "upsd > 1.2 non supporta UDP. Connessione spostata su TCP"
#: knutclient.cpp:688 knutclient.cpp:689
msgid "Data OK"
msgstr "Dati OK"
#: knutclient.cpp:781 knutclient.cpp:782
msgid "The connection was closed by the second side (upsd)."
msgstr "La connessione e' stata chiusa da un altro lato (upsd)."
#: knutclient.cpp:798 knutclient.cpp:799
msgid "UPS is off."
msgstr "UPS e' off."
#: knutclient.cpp:802 knutclient.cpp:803
msgid "UPS is back on."
msgstr "UPS e' tornato in linea."
#: knutclient.cpp:808 knutclient.cpp:809
msgid "Power is back online."
msgstr "Power e' tornato in linea."
#: knutclient.cpp:814 knutclient.cpp:815
msgid "UPS is on battery."
msgstr "UPS in modalita' batteria."
#: knutclient.cpp:820 knutclient.cpp:821
msgid "UPS battery is low."
msgstr "Batteria UPS scarica"
#: knutclient.cpp:824 knutclient.cpp:825
msgid "UPS battery is OK."
msgstr "Batteria UPS e' carica"
#: knutclient.cpp:830 knutclient.cpp:831
msgid "UPS battery is bad and needs be replaced."
msgstr "UPS ha le batterie rovinate, e' consigliato sostituirle."
#: knutclient.cpp:836 knutclient.cpp:837
msgid "UPS is overloaded."
msgstr "UPS in sovraccarico"
#: knutclient.cpp:840 knutclient.cpp:841
msgid "UPS isn't overloaded."
msgstr "UPS non e' in sovraccarico"
#: knutclient.cpp:846 knutclient.cpp:847 knutdock.cpp:449
#, fuzzy
msgid "UPS is performing calibration"
msgstr "Calibrazione UPS"
#: knutclient.cpp:850 knutclient.cpp:851
msgid "Calibration of UPS is ended."
msgstr "Calibrazione UPS completata"
#: knutclient.cpp:856 knutclient.cpp:857
msgid "UPS is boosting incoming voltage."
msgstr "UPS sta prendendo la tensione in entrata."
#: knutclient.cpp:860 knutclient.cpp:861
msgid "Boosting of UPS is ended."
msgstr "UPS ha finito."
#: knutclient.cpp:866 knutclient.cpp:867
msgid "UPS is trimming incoming voltage."
msgstr "UPS is trimming incoming voltage."
#: knutclient.cpp:870 knutclient.cpp:871
msgid "Trimming of UPS is ended."
msgstr "Trimming of UPS is ended."
#: knutclient.cpp:887 knutclient.cpp:954 knutclient.cpp:963
msgid "Switched"
msgstr "Selezionare"
#: knutclient.cpp:1103 knutdock.cpp:640 knutmainwindow.cpp:781
msgid "Reconnect"
msgstr "Riconnettere"
#: knutdock.cpp:419 knutdock.cpp:469 knutfrontpanel.cpp:192
#: knutnewupsdlg.cpp:69 knutprintupsvar.cpp:78
msgid "Name"
msgstr "Nome:"
#: knutdock.cpp:420 knutnewupsdlg.cpp:83
msgid "UPS name"
msgstr "Nome UPS"
#: knutdock.cpp:421 knutnewupsdlg.cpp:77
msgid "UPS address"
msgstr "Indirizzo UPS"
#: knutdock.cpp:422 knutdock.cpp:443 knutdock.cpp:446 knutdock.cpp:449
#: knutdock.cpp:452 knutdock.cpp:455 knutdock.cpp:458
msgid "Status : "
msgstr "Stato : "
#: knutdock.cpp:425 knutvardata.cpp:209
msgid "Connection doesn't exist."
msgstr "Connessione non esiste."
#: knutdock.cpp:429 knutfrontpanel.cpp:80
msgid "UPS On line"
msgstr "UPS in linea"
#: knutdock.cpp:433 knutfrontpanel.cpp:95
msgid "UPS On battery"
msgstr "UPS in modalita batteria"
#: knutdock.cpp:437
#, fuzzy
msgid "UPS Of line"
msgstr "UPS non in linea"
#: knutdock.cpp:443
msgid "UPS Battery is low"
msgstr "Batteria UPS scarica"
#: knutdock.cpp:446 knutfrontpanel.cpp:138
msgid "Replace battery"
msgstr "Sostituire batterie"
#: knutdock.cpp:452
msgid "UPS is Overload"
msgstr "UPS in sovraccarico"
#: knutdock.cpp:455
#, fuzzy
msgid "UPS is trimming voltage"
msgstr "UPS is trimming voltage"
#: knutdock.cpp:458
#, fuzzy
msgid "UPS is boosting voltage"
msgstr "Calibrazione UPS"
#: knutdock.cpp:464
msgid "Error : "
msgstr "Errore : "
#: knutdock.cpp:467 knutfrontpanel.cpp:182
msgid "Manufac. : "
msgstr "Manufac. : "
#: knutdock.cpp:471
#, fuzzy
msgid "Serial"
msgstr "Seriale"
#: knutdock.cpp:473
#, fuzzy
msgid "Firmware"
msgstr "Firmware"
#: knutdock.cpp:477 knutfrontpanel.cpp:233
msgid "Runtime"
msgstr "Runtime"
#: knutdock.cpp:477
msgid " : %1:%2 min"
msgstr " : %1:%2 min"
#: knutdock.cpp:482 knutvardata.cpp:45
msgid "Battery Charge"
msgstr "Capacita batterie"
#: knutdock.cpp:487 knutvardata.cpp:48
msgid "UPS Load"
msgstr "UPS carico"
#: knutdock.cpp:513 knutmainwindow.cpp:663
msgid "Are you sure ?"
msgstr "Sei sicuro ?"
#: knutdock.cpp:636 knutmainwindow.cpp:748
#, fuzzy
msgid "&Showing UPS variables and commands"
msgstr "Mostrando variabili e comandi UPS"
#: knutdock.cpp:637 knutmainwindow.cpp:749
#, fuzzy
msgid "&Running instant commands"
msgstr "Partenza comandi istantanei"
#: knutdock.cpp:638 knutmainwindow.cpp:750
#, fuzzy
msgid "Setting R&W variables"
msgstr "Variabili UPS"
#: knutdock.cpp:642
#, fuzzy
msgid "&Preferences"
msgstr "Preferenze"
#: knutdock.cpp:644
#, fuzzy
msgid "&About KNutClient"
msgstr "&About KNutClient"
#: knutdock.cpp:646
msgid "&Minimize"
msgstr "Minimizza"
#: knutdock.cpp:648
msgid "&Exit"
msgstr "&Exit"
#: knutfrontpanel.cpp:110
msgid "UPS Overload"
msgstr "UPS in sovraccarico"
#: knutfrontpanel.cpp:124
msgid "UPS Battery low"
msgstr "Batteria UPS scarica"
#: knutfrontpanel.cpp:152
msgid "UPS calibration"
msgstr "Calibrazione UPS"
#: knutfrontpanel.cpp:202
msgid "Serial : "
msgstr "Seriale: "
#: knutfrontpanel.cpp:212
msgid "Firm. rev. : "
msgstr "Ver. firmware : "
#: knutinstcomms.cpp:33
msgid "Instant commands"
msgstr "Comando istantaneo"
#: knutinstcomms.cpp:45
msgid "RUN INSTANT COMMAND"
msgstr "avvio comando instantaneo"
#: knutinstcomms.cpp:49
msgid "Command:"
msgstr "Comando:"
#: knutinstcomms.cpp:53 knutnewupsdlg.cpp:102 knutrwvar.cpp:70
msgid "User name:"
msgstr "User name:"
#: knutinstcomms.cpp:54 knutnewupsdlg.cpp:109 knutrwvar.cpp:71
msgid "Password:"
msgstr "Password:"
#: knutmainwindow.cpp:59
msgid "test of conection from 5"
msgstr "test di connessione dal 5"
#: knutmainwindow.cpp:745
msgid "Quits the application"
msgstr "Chiude l'applicazione"
#: knutmainwindow.cpp:778
#, fuzzy
msgid "&Using descriptions"
msgstr "&Descrizione usata"
#: knutnewupsdlg.cpp:39
msgid "New Ups"
msgstr "Nuovo UPS"
#: knutnewupsdlg.cpp:89
msgid "Delay (ms):"
msgstr "Ritardo (ms):"
#: knutnewupsdlg.cpp:96
msgid "Port:"
msgstr "Porta:"
#: knutnewupsdlg.cpp:116
msgid "Store NUT password in configuration file"
msgstr "Registra password di NUT nel file di configurazione"
#: knutnewupsdlg.cpp:123
msgid "Availabled UPS values"
msgstr ""
#: knutnewupsdlg.cpp:124
msgid "Selected UPS values"
msgstr ""
#: knutnewupsdlg.cpp:134
msgid "UPS Variables"
msgstr "Variabili UPS"
#: knutnewupsdlg.cpp:255
msgid "No Name or UPS address"
msgstr "Nessun nome o indirizzo UPS"
#: knutnewupsdlg.cpp:263
msgid "This Name exist"
msgstr "Questo nome esiste"
#: knutnewupsdlg.cpp:270
msgid "Delay must be number"
msgstr "Ritardo deve essere maggiore"
#: knutnewupsdlg.cpp:276
msgid "Port must be number"
msgstr "Porta deve essere un numero"
#: knutnewupsdlg.cpp:281
msgid "Port must be from 1025 until 65535"
msgstr "Porta puo variare da 1025 a 65535"
#: knutnewupsdlg.cpp:286
msgid "Delay is too small"
msgstr "Ritardo troppo piccolo"
#: knutprefdlg.cpp:45
msgid "Preferences"
msgstr "Preferenze"
#: knutprefdlg.cpp:508
msgid "Setting"
msgstr "Settaggi"
#: knutprefdlg.cpp:508
msgid "Main Setting"
msgstr "Settaggi principali"
#: knutprefdlg.cpp:516
msgid "Voltage/Frequency"
msgstr "Tensione/Frequenza"
#: knutprefdlg.cpp:519
msgid "&Use High-Low XFER"
msgstr "&Use High-Low XFER"
#: knutprefdlg.cpp:521
msgid "Number of columns :"
msgstr "Number of rows :"
#: knutprefdlg.cpp:524 knutprefdlg.cpp:815 knutprefdlg.cpp:894
msgid "Use custom background color"
msgstr "Colore di sfondo custom:"
#: knutprefdlg.cpp:528 knutprefdlg.cpp:818 knutprefdlg.cpp:896
msgid "Color of background :"
msgstr "Colore di sfondo :"
#: knutprefdlg.cpp:532
#, fuzzy
msgid "Use dialog \"Are you sure\""
msgstr "Usare dialogo \"Sei sicuro\""
#: knutprefdlg.cpp:535
msgid "Use Main window when program is started"
msgstr "Usa Schermata Principale quando il programma caricato"
#: knutprefdlg.cpp:538
msgid "Show message window, when program reports error"
msgstr "Apri finestra , quando programma riporta errori"
#: knutprefdlg.cpp:543
msgid "Auto"
msgstr ""
#: knutprefdlg.cpp:547
msgid "Nominal Input Voltage"
msgstr "Tensione di Ingresso"
#: knutprefdlg.cpp:550
msgid "&230 V"
msgstr "&230 V"
#: knutprefdlg.cpp:551
msgid "&120 V"
msgstr "&120 V"
#: knutprefdlg.cpp:553
msgid "Nominal Input Frequency"
msgstr "Frequenza di ingresso"
#: knutprefdlg.cpp:556
msgid "&50 Hz"
msgstr "&50 Hz"
#: knutprefdlg.cpp:557
msgid "&60 Hz"
msgstr "&60 Hz"
#: knutprefdlg.cpp:628
msgid "UPS"
msgstr "UPS"
#: knutprefdlg.cpp:628
msgid "UPS Setting"
msgstr "Settaggi UPS"
#: knutprefdlg.cpp:646
msgid "&Add"
msgstr "&Add"
#: knutprefdlg.cpp:667
#, fuzzy
msgid "Dock bar"
msgstr "Dock"
#: knutprefdlg.cpp:667
#, fuzzy
msgid "Docking Setting"
msgstr "Docking Setting"
#: knutprefdlg.cpp:671
msgid "Type of dock's showing"
msgstr "Type of dock's showing"
#: knutprefdlg.cpp:676
msgid "Items of tooltip"
msgstr "Items of tooltip"
#: knutprefdlg.cpp:684
msgid "&Picture"
msgstr "&Picture"
#: knutprefdlg.cpp:685
#, fuzzy
msgid "&General"
msgstr "&Generale"
#: knutprefdlg.cpp:688 knutprefdlg.cpp:799
msgid "M&anufacturer"
msgstr "M&anufacturer"
#: knutprefdlg.cpp:691 knutprefdlg.cpp:802
msgid "M&odel"
msgstr "&Modello"
#: knutprefdlg.cpp:694 knutprefdlg.cpp:805
msgid "&Serial"
msgstr "&Seriale"
#: knutprefdlg.cpp:697 knutprefdlg.cpp:808
msgid "&Firm. rev."
msgstr "&Firm. rev."
#: knutprefdlg.cpp:700 knutprefdlg.cpp:811
msgid "&Runtime"
msgstr "&Runtime"
#: knutprefdlg.cpp:703
#, fuzzy
msgid "&Battery Charge"
msgstr "Capacita batterie"
#: knutprefdlg.cpp:706
#, fuzzy
msgid "&UPS Load"
msgstr "UPS carico"
#: knutprefdlg.cpp:710
#, fuzzy
msgid "Use custom icon's background color"
msgstr "Colore di sfondo custom:"
#: knutprefdlg.cpp:713
#, fuzzy
msgid "Color of icon's background :"
msgstr "Colore di sfondo :"
#: knutprefdlg.cpp:769
msgid "Panel"
msgstr "Pannello"
#: knutprefdlg.cpp:769
msgid "Panel Setting"
msgstr "Settaggi pannello"
#: knutprefdlg.cpp:784
msgid "UPS &Overload"
msgstr "UPS &Sovraccarico"
#: knutprefdlg.cpp:787
msgid "UPS &Battery low"
msgstr "UPS &Batterie scariche"
#: knutprefdlg.cpp:790
msgid "R&eplace battery"
msgstr "R&impiazzare batterie"
#: knutprefdlg.cpp:793
msgid "Ups &calibration"
msgstr "UPS &calibrazione"
#: knutprefdlg.cpp:796
msgid "&Manufac. + Model"
msgstr "&Manufac. + Modello"
#: knutprefdlg.cpp:851
msgid "Setting Fonts"
msgstr "Settaggio Fonts"
#: knutprefdlg.cpp:858
msgid "&Use custom font"
msgstr "&Usare custom font"
#: knutprefdlg.cpp:863
msgid "Main panel"
msgstr "Pannello principale"
#: knutprefdlg.cpp:864
msgid "Analog panels"
msgstr "Pannello analogico"
#: knutprefdlg.cpp:887
msgid "Analog"
msgstr "Analogico"
#: knutprefdlg.cpp:887
msgid "Setting Analog panel"
msgstr "Settaggi Pannello Analogico"
#: knutprefdlg.cpp:898
msgid "Use custom other colors"
msgstr "Usare altri custom colori"
#: knutprefdlg.cpp:900
msgid "Color of pointer :"
msgstr "Colore del puntatore :"
#: knutprefdlg.cpp:902
msgid "Color of OK range :"
msgstr "Colore di OK range :"
#: knutprefdlg.cpp:904
msgid "Color of warning range :"
msgstr "Colore di warning range :"
#: knutprefdlg.cpp:906
msgid "Color of error range :"
msgstr "Colore di error range :"
#: knutprefdlg.cpp:908
msgid "Color of scale :"
msgstr "Colore di scala :"
#: knutprefdlg.cpp:910
msgid "Color of font :"
msgstr "Colore del font :"
#: knutprefdlg.cpp:913
#, fuzzy
msgid "Digital processing of pointers :"
msgstr "Digital processing of pointers :"
#: knutprefdlg.cpp:964
msgid "Nothing processing"
msgstr "Nothing processing"
#: knutprefdlg.cpp:965
msgid "Fast antialiasing"
msgstr "Fast antialiasing"
#: knutprefdlg.cpp:966
msgid "Fine antialiasing"
msgstr "Fine antialiasing"
#: knutprefdlg.cpp:967
msgid "Fast antialiasing and blur motion"
msgstr "Fast antialiasing and blur motion"
#: knutprefdlg.cpp:968
msgid "Fine antialiasing and blur motion"
msgstr "Fine antialiasing and blur motion"
#: knutprintupsvar.cpp:41
msgid "Variables"
msgstr "Variabili"
#: knutprintupsvar.cpp:50
msgid "Reload Vars"
msgstr "Ricarica Variabili"
#: knutprintupsvar.cpp:52
msgid "UPS variables"
msgstr "Variabili UPS"
#: knutprintupsvar.cpp:79
msgid "Value"
msgstr "Valore"
#: knutprintupsvar.cpp:81
msgid "Description"
msgstr "Descrizione"
#: knutprintupsvar.cpp:90
msgid "Instant Commands"
msgstr "Comandi Istantanei"
#: knutprintupsvar.cpp:103
msgid "Read/Write Variables"
msgstr "Variabili di lettura/scrittura"
#: knutprintupsvar.cpp:121
msgid "Read Only Variables"
msgstr "Variabili di sola lettura"
#: knutrwvar.cpp:40
msgid "RW variables"
msgstr "Variabili RW"
#: knutrwvar.cpp:56
msgid "SET RW VARIABLE"
msgstr "Settare Variabile RW"
#: knutrwvar.cpp:61
msgid "Variable:"
msgstr "Variabile:"
#: knutrwvar.cpp:64
msgid "Value:"
msgstr "Valore:"
#: knutvardata.cpp:43
msgid "None"
msgstr "Nessuno"
#: knutvardata.cpp:44
msgid "Input Voltage"
msgstr "Tensione di Ingresso"
#: knutvardata.cpp:46
msgid "UPS Temperature"
msgstr "Temperatura UPS"
#: knutvardata.cpp:47
msgid "Input Frequency"
msgstr "Frequenza di ingresso"
#: knutvardata.cpp:49
msgid "Outside Temperature"
msgstr "Temperatura esterna"
#: knutvardata.cpp:50
msgid "Outside Humidity"
msgstr "Umidita esterna"
#: knutvardata.cpp:51
msgid "Battery Voltage"
msgstr "Tensione delle batterie"
#: knutvardata.cpp:52
msgid "Output Voltage"
msgstr "Tensione in uscita"
#: knutvardata.cpp:53
msgid "Output Current"
msgstr "Corrente in uscita"
#: knutvardata.cpp:54
#, fuzzy
msgid "Output Frequency"
msgstr "Frequenza di uscita"
#: knutvardata.cpp:55
msgid "Battery Temperature"
msgstr "Temperatura Batterie"
#: knutvardata.cpp:56
msgid "Battery Current"
msgstr "Corrente Batterie"
#: knutvardata.cpp:186
#, fuzzy
msgid "No memory."
msgstr "Non c'e' memoria"
#: knutvardata.cpp:187
msgid "No address."
msgstr "Non c'e' indirizzo"
#: knutvardata.cpp:188
msgid "Unknown address."
msgstr "Indirizzo sconosciuto "
#: knutvardata.cpp:191
msgid "Error of connection."
msgstr "Errore di connessione"
#: knutvardata.cpp:194
#, fuzzy
msgid "No connection with server."
msgstr "Non connesso con il server."
#: knutvardata.cpp:196
msgid "Server-client protocol or variables of NUT are unknown."
msgstr "Il protocollo del Server-client o della varibile di NUT e' sconosciuta"
#: knutvardata.cpp:197
msgid "No UPS on this address."
msgstr "Nessun UPS a questo indirizzo"
#: knutvardata.cpp:198
#, fuzzy
msgid "Connection was refused by server."
msgstr "Non connesso con il server."
#: knutvardata.cpp:200
msgid "Server doesn't receive data."
msgstr "Il server non riceve le informazioni."
#: knutvardata.cpp:201
msgid "Server doesn't send data."
msgstr "Il server non manda le informazioni."
#: knutvardata.cpp:202
msgid "Server doesn't answer."
msgstr "Il Server non risponde."
#: knutvardata.cpp:204
msgid "Server returns data with unknown format."
msgstr "Il Server riporta dati con formato sconosciuto."
#: knutvardata.cpp:205
#, fuzzy
msgid "Server returns unknown data."
msgstr "Il Server riporta dati sconosciuti."
#: knutvardata.cpp:206
msgid "Command VER returns data with unknown format."
msgstr "Command VER riporta dati con formato sconosciuto."
#: knutvardata.cpp:208
msgid "No data."
msgstr "Nessun dato."
#: knutvardata.cpp:212
msgid "Access denied. Failed password ?"
msgstr "Accesso negato. Password sbagliata ?"
#: knutvardata.cpp:213
msgid "UPS doesn't sent data to server (Data Stale)."
msgstr "L'UPS non riesce a mandare le informazioni al server."
#: knutvardata.cpp:214
msgid "Server doesn't know this command."
msgstr "Il server non conosce questo comando."
#: knutvardata.cpp:217
#, fuzzy
msgid "UPS's driver isn't connected."
msgstr "UPS's driver non e' connesso."
#: knutvardata.cpp:219
msgid "Server required password."
msgstr "Il Server richiede la password."
#: knutvardata.cpp:220
msgid "Incorrect password."
msgstr "Password non corretta."
#: knutvardata.cpp:221
msgid "UPS doesn't response."
msgstr "Ups non risponde."
#: knutvardata.cpp:222
msgid "Command failed."
msgstr "Comando fallito."
#: knutvardata.cpp:223
msgid "UPS doesn't know this instant command."
msgstr "Ups non riconosce questo comando istantaneo."
#: knutvardata.cpp:224
msgid "UPS doesn't support this instant command."
msgstr "Ups non supporta questo comando istantaneo."
#: knutvardata.cpp:225
msgid "UPS doesn't known this variable."
msgstr "Ups non conosce questa variabile."
#: knutvardata.cpp:226
msgid "UPS doesn't support this variable."
msgstr "Ups non supporta questa variabile."
#: knutvardata.cpp:227
msgid "UPS doesn't support this value in this variable."
msgstr "Ups non supporta questo valore in questa variabile."
#: knutvardata.cpp:228
msgid "Name of UPS is unknown."
msgstr "Nome dell'UPS sconosciuto."
#: knutvardata.cpp:230
msgid "Username has been already entered."
msgstr "Username e' stata gia inserito."
#: knutvardata.cpp:231
msgid "Password has been already entered."
msgstr "Password e' stata gia inserita."
#: knutvardata.cpp:233
#, fuzzy
msgid "Server doesn't send list of variables."
msgstr "Server non manda lista di variabili."
#: knutvardata.cpp:236
msgid "Unknown error."
msgstr "Errore sconosciuto."
#: main.cpp:31
msgid "Client for Network UPS Tool"
msgstr "Client for Network UPS Tool"
#: main.cpp:37
msgid "Don't dock in Kicker"
msgstr "Don't dock in Kicker"
#: main.cpp:47
msgid "KNutClient"
msgstr "KNutClient"
#. i18n: file ./knutclientui.rc line 13
#: rc.cpp:9
#, no-c-format
msgid "&Connection"
msgstr "&Connection"

@ -0,0 +1,836 @@
# 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: 2009-02-21 12:13+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 ""
#: knutclient.cpp:86
msgid "Ready."
msgstr ""
#: knutclient.cpp:218 knutclient.cpp:219
msgid "The connection was renewed."
msgstr ""
#: knutclient.cpp:285
msgid "The connection failed. The next connection will make after %1 sec."
msgstr ""
#: knutclient.cpp:546
msgid "upsd > 1.2 doesn't support UDP. Connection is switched to TCP"
msgstr ""
#: knutclient.cpp:688 knutclient.cpp:689
msgid "Data OK"
msgstr ""
#: knutclient.cpp:781 knutclient.cpp:782
msgid "The connection was closed by the second side (upsd)."
msgstr ""
#: knutclient.cpp:798 knutclient.cpp:799
msgid "UPS is off."
msgstr ""
#: knutclient.cpp:802 knutclient.cpp:803
msgid "UPS is back on."
msgstr ""
#: knutclient.cpp:808 knutclient.cpp:809
msgid "Power is back online."
msgstr ""
#: knutclient.cpp:814 knutclient.cpp:815
msgid "UPS is on battery."
msgstr ""
#: knutclient.cpp:820 knutclient.cpp:821
msgid "UPS battery is low."
msgstr ""
#: knutclient.cpp:824 knutclient.cpp:825
msgid "UPS battery is OK."
msgstr ""
#: knutclient.cpp:830 knutclient.cpp:831
msgid "UPS battery is bad and needs be replaced."
msgstr ""
#: knutclient.cpp:836 knutclient.cpp:837
msgid "UPS is overloaded."
msgstr ""
#: knutclient.cpp:840 knutclient.cpp:841
msgid "UPS isn't overloaded."
msgstr ""
#: knutclient.cpp:846 knutclient.cpp:847 knutdock.cpp:449
msgid "UPS is performing calibration"
msgstr ""
#: knutclient.cpp:850 knutclient.cpp:851
msgid "Calibration of UPS is ended."
msgstr ""
#: knutclient.cpp:856 knutclient.cpp:857
msgid "UPS is boosting incoming voltage."
msgstr ""
#: knutclient.cpp:860 knutclient.cpp:861
msgid "Boosting of UPS is ended."
msgstr ""
#: knutclient.cpp:866 knutclient.cpp:867
msgid "UPS is trimming incoming voltage."
msgstr ""
#: knutclient.cpp:870 knutclient.cpp:871
msgid "Trimming of UPS is ended."
msgstr ""
#: knutclient.cpp:887 knutclient.cpp:954 knutclient.cpp:963
msgid "Switched"
msgstr ""
#: knutclient.cpp:1103 knutdock.cpp:640 knutmainwindow.cpp:781
msgid "Reconnect"
msgstr ""
#: knutdock.cpp:419 knutdock.cpp:469 knutfrontpanel.cpp:192
#: knutnewupsdlg.cpp:69 knutprintupsvar.cpp:78
msgid "Name"
msgstr ""
#: knutdock.cpp:420 knutnewupsdlg.cpp:83
msgid "UPS name"
msgstr ""
#: knutdock.cpp:421 knutnewupsdlg.cpp:77
msgid "UPS address"
msgstr ""
#: knutdock.cpp:422 knutdock.cpp:443 knutdock.cpp:446 knutdock.cpp:449
#: knutdock.cpp:452 knutdock.cpp:455 knutdock.cpp:458
msgid "Status : "
msgstr ""
#: knutdock.cpp:425 knutvardata.cpp:209
msgid "Connection doesn't exist."
msgstr ""
#: knutdock.cpp:429 knutfrontpanel.cpp:80
msgid "UPS On line"
msgstr ""
#: knutdock.cpp:433 knutfrontpanel.cpp:95
msgid "UPS On battery"
msgstr ""
#: knutdock.cpp:437
msgid "UPS Of line"
msgstr ""
#: knutdock.cpp:443
msgid "UPS Battery is low"
msgstr ""
#: knutdock.cpp:446 knutfrontpanel.cpp:138
msgid "Replace battery"
msgstr ""
#: knutdock.cpp:452
msgid "UPS is Overload"
msgstr ""
#: knutdock.cpp:455
msgid "UPS is trimming voltage"
msgstr ""
#: knutdock.cpp:458
msgid "UPS is boosting voltage"
msgstr ""
#: knutdock.cpp:464
msgid "Error : "
msgstr ""
#: knutdock.cpp:467 knutfrontpanel.cpp:182
msgid "Manufac. : "
msgstr ""
#: knutdock.cpp:471
msgid "Serial"
msgstr ""
#: knutdock.cpp:473
msgid "Firmware"
msgstr ""
#: knutdock.cpp:477 knutfrontpanel.cpp:233
msgid "Runtime"
msgstr ""
#: knutdock.cpp:477
msgid " : %1:%2 min"
msgstr ""
#: knutdock.cpp:482 knutvardata.cpp:45
msgid "Battery Charge"
msgstr ""
#: knutdock.cpp:487 knutvardata.cpp:48
msgid "UPS Load"
msgstr ""
#: knutdock.cpp:513 knutmainwindow.cpp:663
msgid "Are you sure ?"
msgstr ""
#: knutdock.cpp:636 knutmainwindow.cpp:748
msgid "&Showing UPS variables and commands"
msgstr ""
#: knutdock.cpp:637 knutmainwindow.cpp:749
msgid "&Running instant commands"
msgstr ""
#: knutdock.cpp:638 knutmainwindow.cpp:750
msgid "Setting R&W variables"
msgstr ""
#: knutdock.cpp:642
msgid "&Preferences"
msgstr ""
#: knutdock.cpp:644
msgid "&About KNutClient"
msgstr ""
#: knutdock.cpp:646
msgid "&Minimize"
msgstr ""
#: knutdock.cpp:648
msgid "&Exit"
msgstr ""
#: knutfrontpanel.cpp:110
msgid "UPS Overload"
msgstr ""
#: knutfrontpanel.cpp:124
msgid "UPS Battery low"
msgstr ""
#: knutfrontpanel.cpp:152
msgid "UPS calibration"
msgstr ""
#: knutfrontpanel.cpp:202
msgid "Serial : "
msgstr ""
#: knutfrontpanel.cpp:212
msgid "Firm. rev. : "
msgstr ""
#: knutinstcomms.cpp:33
msgid "Instant commands"
msgstr ""
#: knutinstcomms.cpp:45
msgid "RUN INSTANT COMMAND"
msgstr ""
#: knutinstcomms.cpp:49
msgid "Command:"
msgstr ""
#: knutinstcomms.cpp:53 knutnewupsdlg.cpp:102 knutrwvar.cpp:70
msgid "User name:"
msgstr ""
#: knutinstcomms.cpp:54 knutnewupsdlg.cpp:109 knutrwvar.cpp:71
msgid "Password:"
msgstr ""
#: knutmainwindow.cpp:59
msgid "test of conection from 5"
msgstr ""
#: knutmainwindow.cpp:745
msgid "Quits the application"
msgstr ""
#: knutmainwindow.cpp:778
msgid "&Using descriptions"
msgstr ""
#: knutnewupsdlg.cpp:39
msgid "New Ups"
msgstr ""
#: knutnewupsdlg.cpp:89
msgid "Delay (ms):"
msgstr ""
#: knutnewupsdlg.cpp:96
msgid "Port:"
msgstr ""
#: knutnewupsdlg.cpp:116
msgid "Store NUT password in configuration file"
msgstr ""
#: knutnewupsdlg.cpp:123
msgid "Availabled UPS values"
msgstr ""
#: knutnewupsdlg.cpp:124
msgid "Selected UPS values"
msgstr ""
#: knutnewupsdlg.cpp:134
msgid "UPS Variables"
msgstr ""
#: knutnewupsdlg.cpp:255
msgid "No Name or UPS address"
msgstr ""
#: knutnewupsdlg.cpp:263
msgid "This Name exist"
msgstr ""
#: knutnewupsdlg.cpp:270
msgid "Delay must be number"
msgstr ""
#: knutnewupsdlg.cpp:276
msgid "Port must be number"
msgstr ""
#: knutnewupsdlg.cpp:281
msgid "Port must be from 1025 until 65535"
msgstr ""
#: knutnewupsdlg.cpp:286
msgid "Delay is too small"
msgstr ""
#: knutprefdlg.cpp:45
msgid "Preferences"
msgstr ""
#: knutprefdlg.cpp:508
msgid "Setting"
msgstr ""
#: knutprefdlg.cpp:508
msgid "Main Setting"
msgstr ""
#: knutprefdlg.cpp:516
msgid "Voltage/Frequency"
msgstr ""
#: knutprefdlg.cpp:519
msgid "&Use High-Low XFER"
msgstr ""
#: knutprefdlg.cpp:521
msgid "Number of columns :"
msgstr ""
#: knutprefdlg.cpp:524 knutprefdlg.cpp:815 knutprefdlg.cpp:894
msgid "Use custom background color"
msgstr ""
#: knutprefdlg.cpp:528 knutprefdlg.cpp:818 knutprefdlg.cpp:896
msgid "Color of background :"
msgstr ""
#: knutprefdlg.cpp:532
msgid "Use dialog \"Are you sure\""
msgstr ""
#: knutprefdlg.cpp:535
msgid "Use Main window when program is started"
msgstr ""
#: knutprefdlg.cpp:538
msgid "Show message window, when program reports error"
msgstr ""
#: knutprefdlg.cpp:543
msgid "Auto"
msgstr ""
#: knutprefdlg.cpp:547
msgid "Nominal Input Voltage"
msgstr ""
#: knutprefdlg.cpp:550
msgid "&230 V"
msgstr ""
#: knutprefdlg.cpp:551
msgid "&120 V"
msgstr ""
#: knutprefdlg.cpp:553
msgid "Nominal Input Frequency"
msgstr ""
#: knutprefdlg.cpp:556
msgid "&50 Hz"
msgstr ""
#: knutprefdlg.cpp:557
msgid "&60 Hz"
msgstr ""
#: knutprefdlg.cpp:628
msgid "UPS"
msgstr ""
#: knutprefdlg.cpp:628
msgid "UPS Setting"
msgstr ""
#: knutprefdlg.cpp:646
msgid "&Add"
msgstr ""
#: knutprefdlg.cpp:667
msgid "Dock bar"
msgstr ""
#: knutprefdlg.cpp:667
msgid "Docking Setting"
msgstr ""
#: knutprefdlg.cpp:671
msgid "Type of dock's showing"
msgstr ""
#: knutprefdlg.cpp:676
msgid "Items of tooltip"
msgstr ""
#: knutprefdlg.cpp:684
msgid "&Picture"
msgstr ""
#: knutprefdlg.cpp:685
msgid "&General"
msgstr ""
#: knutprefdlg.cpp:688 knutprefdlg.cpp:799
msgid "M&anufacturer"
msgstr ""
#: knutprefdlg.cpp:691 knutprefdlg.cpp:802
msgid "M&odel"
msgstr ""
#: knutprefdlg.cpp:694 knutprefdlg.cpp:805
msgid "&Serial"
msgstr ""
#: knutprefdlg.cpp:697 knutprefdlg.cpp:808
msgid "&Firm. rev."
msgstr ""
#: knutprefdlg.cpp:700 knutprefdlg.cpp:811
msgid "&Runtime"
msgstr ""
#: knutprefdlg.cpp:703
msgid "&Battery Charge"
msgstr ""
#: knutprefdlg.cpp:706
msgid "&UPS Load"
msgstr ""
#: knutprefdlg.cpp:710
msgid "Use custom icon's background color"
msgstr ""
#: knutprefdlg.cpp:713
msgid "Color of icon's background :"
msgstr ""
#: knutprefdlg.cpp:769
msgid "Panel"
msgstr ""
#: knutprefdlg.cpp:769
msgid "Panel Setting"
msgstr ""
#: knutprefdlg.cpp:784
msgid "UPS &Overload"
msgstr ""
#: knutprefdlg.cpp:787
msgid "UPS &Battery low"
msgstr ""
#: knutprefdlg.cpp:790
msgid "R&eplace battery"
msgstr ""
#: knutprefdlg.cpp:793
msgid "Ups &calibration"
msgstr ""
#: knutprefdlg.cpp:796
msgid "&Manufac. + Model"
msgstr ""
#: knutprefdlg.cpp:851
msgid "Setting Fonts"
msgstr ""
#: knutprefdlg.cpp:858
msgid "&Use custom font"
msgstr ""
#: knutprefdlg.cpp:863
msgid "Main panel"
msgstr ""
#: knutprefdlg.cpp:864
msgid "Analog panels"
msgstr ""
#: knutprefdlg.cpp:887
msgid "Analog"
msgstr ""
#: knutprefdlg.cpp:887
msgid "Setting Analog panel"
msgstr ""
#: knutprefdlg.cpp:898
msgid "Use custom other colors"
msgstr ""
#: knutprefdlg.cpp:900
msgid "Color of pointer :"
msgstr ""
#: knutprefdlg.cpp:902
msgid "Color of OK range :"
msgstr ""
#: knutprefdlg.cpp:904
msgid "Color of warning range :"
msgstr ""
#: knutprefdlg.cpp:906
msgid "Color of error range :"
msgstr ""
#: knutprefdlg.cpp:908
msgid "Color of scale :"
msgstr ""
#: knutprefdlg.cpp:910
msgid "Color of font :"
msgstr ""
#: knutprefdlg.cpp:913
msgid "Digital processing of pointers :"
msgstr ""
#: knutprefdlg.cpp:964
msgid "Nothing processing"
msgstr ""
#: knutprefdlg.cpp:965
msgid "Fast antialiasing"
msgstr ""
#: knutprefdlg.cpp:966
msgid "Fine antialiasing"
msgstr ""
#: knutprefdlg.cpp:967
msgid "Fast antialiasing and blur motion"
msgstr ""
#: knutprefdlg.cpp:968
msgid "Fine antialiasing and blur motion"
msgstr ""
#: knutprintupsvar.cpp:41
msgid "Variables"
msgstr ""
#: knutprintupsvar.cpp:50
msgid "Reload Vars"
msgstr ""
#: knutprintupsvar.cpp:52
msgid "UPS variables"
msgstr ""
#: knutprintupsvar.cpp:79
msgid "Value"
msgstr ""
#: knutprintupsvar.cpp:81
msgid "Description"
msgstr ""
#: knutprintupsvar.cpp:90
msgid "Instant Commands"
msgstr ""
#: knutprintupsvar.cpp:103
msgid "Read/Write Variables"
msgstr ""
#: knutprintupsvar.cpp:121
msgid "Read Only Variables"
msgstr ""
#: knutrwvar.cpp:40
msgid "RW variables"
msgstr ""
#: knutrwvar.cpp:56
msgid "SET RW VARIABLE"
msgstr ""
#: knutrwvar.cpp:61
msgid "Variable:"
msgstr ""
#: knutrwvar.cpp:64
msgid "Value:"
msgstr ""
#: knutvardata.cpp:43
msgid "None"
msgstr ""
#: knutvardata.cpp:44
msgid "Input Voltage"
msgstr ""
#: knutvardata.cpp:46
msgid "UPS Temperature"
msgstr ""
#: knutvardata.cpp:47
msgid "Input Frequency"
msgstr ""
#: knutvardata.cpp:49
msgid "Outside Temperature"
msgstr ""
#: knutvardata.cpp:50
msgid "Outside Humidity"
msgstr ""
#: knutvardata.cpp:51
msgid "Battery Voltage"
msgstr ""
#: knutvardata.cpp:52
msgid "Output Voltage"
msgstr ""
#: knutvardata.cpp:53
msgid "Output Current"
msgstr ""
#: knutvardata.cpp:54
msgid "Output Frequency"
msgstr ""
#: knutvardata.cpp:55
msgid "Battery Temperature"
msgstr ""
#: knutvardata.cpp:56
msgid "Battery Current"
msgstr ""
#: knutvardata.cpp:186
msgid "No memory."
msgstr ""
#: knutvardata.cpp:187
msgid "No address."
msgstr ""
#: knutvardata.cpp:188
msgid "Unknown address."
msgstr ""
#: knutvardata.cpp:191
msgid "Error of connection."
msgstr ""
#: knutvardata.cpp:194
msgid "No connection with server."
msgstr ""
#: knutvardata.cpp:196
msgid "Server-client protocol or variables of NUT are unknown."
msgstr ""
#: knutvardata.cpp:197
msgid "No UPS on this address."
msgstr ""
#: knutvardata.cpp:198
msgid "Connection was refused by server."
msgstr ""
#: knutvardata.cpp:200
msgid "Server doesn't receive data."
msgstr ""
#: knutvardata.cpp:201
msgid "Server doesn't send data."
msgstr ""
#: knutvardata.cpp:202
msgid "Server doesn't answer."
msgstr ""
#: knutvardata.cpp:204
msgid "Server returns data with unknown format."
msgstr ""
#: knutvardata.cpp:205
msgid "Server returns unknown data."
msgstr ""
#: knutvardata.cpp:206
msgid "Command VER returns data with unknown format."
msgstr ""
#: knutvardata.cpp:208
msgid "No data."
msgstr ""
#: knutvardata.cpp:212
msgid "Access denied. Failed password ?"
msgstr ""
#: knutvardata.cpp:213
msgid "UPS doesn't sent data to server (Data Stale)."
msgstr ""
#: knutvardata.cpp:214
msgid "Server doesn't know this command."
msgstr ""
#: knutvardata.cpp:217
msgid "UPS's driver isn't connected."
msgstr ""
#: knutvardata.cpp:219
msgid "Server required password."
msgstr ""
#: knutvardata.cpp:220
msgid "Incorrect password."
msgstr ""
#: knutvardata.cpp:221
msgid "UPS doesn't response."
msgstr ""
#: knutvardata.cpp:222
msgid "Command failed."
msgstr ""
#: knutvardata.cpp:223
msgid "UPS doesn't know this instant command."
msgstr ""
#: knutvardata.cpp:224
msgid "UPS doesn't support this instant command."
msgstr ""
#: knutvardata.cpp:225
msgid "UPS doesn't known this variable."
msgstr ""
#: knutvardata.cpp:226
msgid "UPS doesn't support this variable."
msgstr ""
#: knutvardata.cpp:227
msgid "UPS doesn't support this value in this variable."
msgstr ""
#: knutvardata.cpp:228
msgid "Name of UPS is unknown."
msgstr ""
#: knutvardata.cpp:230
msgid "Username has been already entered."
msgstr ""
#: knutvardata.cpp:231
msgid "Password has been already entered."
msgstr ""
#: knutvardata.cpp:233
msgid "Server doesn't send list of variables."
msgstr ""
#: knutvardata.cpp:236
msgid "Unknown error."
msgstr ""
#: main.cpp:31
msgid "Client for Network UPS Tool"
msgstr ""
#: main.cpp:37
msgid "Don't dock in Kicker"
msgstr ""
#: main.cpp:47
msgid "KNutClient"
msgstr ""
#. i18n: file ./knutclientui.rc line 13
#: rc.cpp:9
#, no-c-format
msgid "&Connection"
msgstr ""

@ -0,0 +1,837 @@
# This file is put in the public domain.
#
# Tomasz Walach <tomasz_rysz@o2.pl>, 2009.
msgid ""
msgstr ""
"Project-Id-Version: knutclient\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-02-21 12:13+0100\n"
"PO-Revision-Date: 2009-02-24 21:21+0100\n"
"Last-Translator: Tomasz Walach <tomasz_rysz@o2.pl>\n"
"Language-Team: Polish <kde-i18n-doc@lists.kde.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Lokalize 0.3\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2);\n"
#: _translatorinfo.cpp:1
msgid ""
"_: NAME OF TRANSLATORS\n"
"Your names"
msgstr "Tomasz Walach"
#: _translatorinfo.cpp:3
msgid ""
"_: EMAIL OF TRANSLATORS\n"
"Your emails"
msgstr "tomasz_rysz@o2.pl"
#: knutclient.cpp:86
msgid "Ready."
msgstr "Gotowy."
#: knutclient.cpp:218 knutclient.cpp:219
msgid "The connection was renewed."
msgstr "Połączenie odnowione."
#: knutclient.cpp:285
msgid "The connection failed. The next connection will make after %1 sec."
msgstr "Błąd połączenia. Następne połączenie będzie za %1 sek."
#: knutclient.cpp:546
msgid "upsd > 1.2 doesn't support UDP. Connection is switched to TCP"
msgstr "upsd > 1.2 nie obsługuje UDP. Połączenie przełączone na TCP"
#: knutclient.cpp:688 knutclient.cpp:689
msgid "Data OK"
msgstr "Dane poprawne"
#: knutclient.cpp:781 knutclient.cpp:782
msgid "The connection was closed by the second side (upsd)."
msgstr "Połączenie zamknięte przez drugą stronę (upsd)."
#: knutclient.cpp:798 knutclient.cpp:799
msgid "UPS is off."
msgstr "UPS jest wyłączony."
#: knutclient.cpp:802 knutclient.cpp:803
msgid "UPS is back on."
msgstr "UPS jest włączony."
#: knutclient.cpp:808 knutclient.cpp:809
msgid "Power is back online."
msgstr "Przywrócono zasilanie."
#: knutclient.cpp:814 knutclient.cpp:815
msgid "UPS is on battery."
msgstr "UPS na zasilaniu z akumulatora(ów)."
#: knutclient.cpp:820 knutclient.cpp:821
msgid "UPS battery is low."
msgstr "Akumulator(y) UPS'a na wyczerpaniu."
#: knutclient.cpp:824 knutclient.cpp:825
msgid "UPS battery is OK."
msgstr "Akumulator(y) UPS'a w porządku."
#: knutclient.cpp:830 knutclient.cpp:831
msgid "UPS battery is bad and needs be replaced."
msgstr "Akumulator UPS'a jest uszkodzony i wymaga wymiany."
#: knutclient.cpp:836 knutclient.cpp:837
msgid "UPS is overloaded."
msgstr "UPS jest przeciążony."
#: knutclient.cpp:840 knutclient.cpp:841
msgid "UPS isn't overloaded."
msgstr "UPS nie jest przeciążony."
#: knutclient.cpp:846 knutclient.cpp:847 knutdock.cpp:449
msgid "UPS is performing calibration"
msgstr "Kalibracja ustawień UPS'a"
#: knutclient.cpp:850 knutclient.cpp:851
msgid "Calibration of UPS is ended."
msgstr "Kalibracja UPS'a zakończona."
#: knutclient.cpp:856 knutclient.cpp:857
msgid "UPS is boosting incoming voltage."
msgstr "UPS zwiększa napięcie wejściowe."
#: knutclient.cpp:860 knutclient.cpp:861
msgid "Boosting of UPS is ended."
msgstr "Zwiększanie napięcia przez UPS zakończone."
#: knutclient.cpp:866 knutclient.cpp:867
msgid "UPS is trimming incoming voltage."
msgstr "UPS obniża napięcie wejściowe."
#: knutclient.cpp:870 knutclient.cpp:871
msgid "Trimming of UPS is ended."
msgstr "Obniżanie napięcia przez UPS zakończone."
#: knutclient.cpp:887 knutclient.cpp:954 knutclient.cpp:963
msgid "Switched"
msgstr "Przełączony"
#: knutclient.cpp:1103 knutdock.cpp:640 knutmainwindow.cpp:781
msgid "Reconnect"
msgstr "Połącz ponownie"
#: knutdock.cpp:419 knutdock.cpp:469 knutfrontpanel.cpp:192
#: knutnewupsdlg.cpp:69 knutprintupsvar.cpp:78
msgid "Name"
msgstr "Nazwa"
#: knutdock.cpp:420 knutnewupsdlg.cpp:83
msgid "UPS name"
msgstr "Nazwa UPS'a"
#: knutdock.cpp:421 knutnewupsdlg.cpp:77
msgid "UPS address"
msgstr "Adres UPS'a"
#: knutdock.cpp:422 knutdock.cpp:443 knutdock.cpp:446 knutdock.cpp:449
#: knutdock.cpp:452 knutdock.cpp:455 knutdock.cpp:458
msgid "Status : "
msgstr "Status : "
#: knutdock.cpp:425 knutvardata.cpp:209
msgid "Connection doesn't exist."
msgstr "Połączenie nie istnieje."
#: knutdock.cpp:429 knutfrontpanel.cpp:80
msgid "UPS On line"
msgstr "UPS zasilanie sieciowe"
#: knutdock.cpp:433 knutfrontpanel.cpp:95
msgid "UPS On battery"
msgstr "UPS zasilanie akumulatorowe"
#: knutdock.cpp:437
msgid "UPS Of line"
msgstr "UPS odłączony od zasilania sieciowego"
#: knutdock.cpp:443
msgid "UPS Battery is low"
msgstr "UPS niski poziom akumulatora(ów)"
#: knutdock.cpp:446 knutfrontpanel.cpp:138
msgid "Replace battery"
msgstr "Wymień akumulator(y)"
#: knutdock.cpp:452
msgid "UPS is Overload"
msgstr "UPS jest przeciążony"
#: knutdock.cpp:455
msgid "UPS is trimming voltage"
msgstr "UPS obniża napięcie"
#: knutdock.cpp:458
msgid "UPS is boosting voltage"
msgstr "UPS podwyższa napięcie"
#: knutdock.cpp:464
msgid "Error : "
msgstr "Błąd : "
#: knutdock.cpp:467 knutfrontpanel.cpp:182
msgid "Manufac. : "
msgstr "Producent : "
#: knutdock.cpp:471
msgid "Serial"
msgstr "Oznaczenie"
#: knutdock.cpp:473
msgid "Firmware"
msgstr "Firmware"
#: knutdock.cpp:477 knutfrontpanel.cpp:233
msgid "Runtime"
msgstr "Czas pracy"
#: knutdock.cpp:477
msgid " : %1:%2 min"
msgstr " : %1:%2 min"
#: knutdock.cpp:482 knutvardata.cpp:45
msgid "Battery Charge"
msgstr "Naładowanie akumulatora"
#: knutdock.cpp:487 knutvardata.cpp:48
msgid "UPS Load"
msgstr "Obciążenie UPS'a"
#: knutdock.cpp:513 knutmainwindow.cpp:663
msgid "Are you sure ?"
msgstr "Czy jesteś pewien ?"
#: knutdock.cpp:636 knutmainwindow.cpp:748
msgid "&Showing UPS variables and commands"
msgstr "Do&stępne zmienne i polecenia UPS'a"
#: knutdock.cpp:637 knutmainwindow.cpp:749
msgid "&Running instant commands"
msgstr "U&ruchomienie poleceń"
#: knutdock.cpp:638 knutmainwindow.cpp:750
msgid "Setting R&W variables"
msgstr "Ustawienie zmiennych R&W"
#: knutdock.cpp:642
msgid "&Preferences"
msgstr "&Ustawienia"
#: knutdock.cpp:644
msgid "&About KNutClient"
msgstr "&O KNutClient"
#: knutdock.cpp:646
msgid "&Minimize"
msgstr "&Minimalizuj"
#: knutdock.cpp:648
msgid "&Exit"
msgstr "&Zakończ"
#: knutfrontpanel.cpp:110
msgid "UPS Overload"
msgstr "UPS przeciążenie"
#: knutfrontpanel.cpp:124
msgid "UPS Battery low"
msgstr "UPS niski poziom akumulatora(ów)"
#: knutfrontpanel.cpp:152
msgid "UPS calibration"
msgstr "UPS kalibracja"
#: knutfrontpanel.cpp:202
msgid "Serial : "
msgstr "Nr seryjny : "
#: knutfrontpanel.cpp:212
msgid "Firm. rev. : "
msgstr "Wersja Firmware : "
#: knutinstcomms.cpp:33
msgid "Instant commands"
msgstr "Polecenia"
#: knutinstcomms.cpp:45
msgid "RUN INSTANT COMMAND"
msgstr "Wykonaj polecenie"
#: knutinstcomms.cpp:49
msgid "Command:"
msgstr "Polecenie:"
#: knutinstcomms.cpp:53 knutnewupsdlg.cpp:102 knutrwvar.cpp:70
msgid "User name:"
msgstr "Nazwa użytkownika:"
#: knutinstcomms.cpp:54 knutnewupsdlg.cpp:109 knutrwvar.cpp:71
msgid "Password:"
msgstr "Hasło:"
#: knutmainwindow.cpp:59
msgid "test of conection from 5"
msgstr "test połączenia za 5"
#: knutmainwindow.cpp:745
msgid "Quits the application"
msgstr "Zakończ"
#: knutmainwindow.cpp:778
msgid "&Using descriptions"
msgstr "&Stosuj opisy"
#: knutnewupsdlg.cpp:39
msgid "New Ups"
msgstr "Nowy Ups"
#: knutnewupsdlg.cpp:89
msgid "Delay (ms):"
msgstr "Opóźnienie (ms):"
#: knutnewupsdlg.cpp:96
msgid "Port:"
msgstr "Port:"
#: knutnewupsdlg.cpp:116
msgid "Store NUT password in configuration file"
msgstr "Zapisz hasło NUT'a w pliku konfiguracyjnym"
#: knutnewupsdlg.cpp:123
msgid "Availabled UPS values"
msgstr "Dostępne zmienne UPS'a"
#: knutnewupsdlg.cpp:124
msgid "Selected UPS values"
msgstr "Wybrane zmienne UPS'a"
#: knutnewupsdlg.cpp:134
msgid "UPS Variables"
msgstr "UPS Zmienne"
#: knutnewupsdlg.cpp:255
msgid "No Name or UPS address"
msgstr "Brak nazwy lub adresu UPS'a"
#: knutnewupsdlg.cpp:263
msgid "This Name exist"
msgstr "Nazwa istnieje"
#: knutnewupsdlg.cpp:270
msgid "Delay must be number"
msgstr "Opóźnienie musi być liczbą"
#: knutnewupsdlg.cpp:276
msgid "Port must be number"
msgstr "Port musi być liczbą"
#: knutnewupsdlg.cpp:281
msgid "Port must be from 1025 until 65535"
msgstr "Numer portu musi być z przedziału 1025 do 65535"
#: knutnewupsdlg.cpp:286
msgid "Delay is too small"
msgstr "Wartość opóźnienia jest za mała"
#: knutprefdlg.cpp:45
msgid "Preferences"
msgstr "Preferencje"
#: knutprefdlg.cpp:508
msgid "Setting"
msgstr "Ustawienia"
#: knutprefdlg.cpp:508
msgid "Main Setting"
msgstr "Główne ustawiania"
#: knutprefdlg.cpp:516
msgid "Voltage/Frequency"
msgstr "Napięcie/Częstotliwość"
#: knutprefdlg.cpp:519
msgid "&Use High-Low XFER"
msgstr "&Zastosuj High-Low XFER"
#: knutprefdlg.cpp:521
msgid "Number of columns :"
msgstr "Liczba kolumn :"
#: knutprefdlg.cpp:524 knutprefdlg.cpp:815 knutprefdlg.cpp:894
msgid "Use custom background color"
msgstr "Stosuj wybrany kolor tła"
#: knutprefdlg.cpp:528 knutprefdlg.cpp:818 knutprefdlg.cpp:896
msgid "Color of background :"
msgstr "Kolor tła :"
#: knutprefdlg.cpp:532
msgid "Use dialog \"Are you sure\""
msgstr "Stosuj dialog \"Czy jesteś pewien\""
#: knutprefdlg.cpp:535
msgid "Use Main window when program is started"
msgstr "Wyświetl Główne okno po uruchomieniu"
#: knutprefdlg.cpp:538
msgid "Show message window, when program reports error"
msgstr "Pokaż okno wiadomości, gdy program zgłasza błędy"
#: knutprefdlg.cpp:543
msgid "Auto"
msgstr "Automatycznie"
#: knutprefdlg.cpp:547
msgid "Nominal Input Voltage"
msgstr "Nominalne napięcie wejściowe"
#: knutprefdlg.cpp:550
msgid "&230 V"
msgstr "&230 V"
#: knutprefdlg.cpp:551
msgid "&120 V"
msgstr "&120 V"
#: knutprefdlg.cpp:553
msgid "Nominal Input Frequency"
msgstr "Nominalna częstotliwość wejściowa"
#: knutprefdlg.cpp:556
msgid "&50 Hz"
msgstr "&50 Hz"
#: knutprefdlg.cpp:557
msgid "&60 Hz"
msgstr "&60 Hz"
#: knutprefdlg.cpp:628
msgid "UPS"
msgstr "UPS"
#: knutprefdlg.cpp:628
msgid "UPS Setting"
msgstr "Ustawienia UPS'a"
#: knutprefdlg.cpp:646
msgid "&Add"
msgstr "Dod&aj"
#: knutprefdlg.cpp:667
msgid "Dock bar"
msgstr "Tacka"
#: knutprefdlg.cpp:667
msgid "Docking Setting"
msgstr "Ustawienia tacki systemowej"
#: knutprefdlg.cpp:671
msgid "Type of dock's showing"
msgstr "Typ prezentacji w tace systemowej"
#: knutprefdlg.cpp:676
msgid "Items of tooltip"
msgstr "Informacje w dymku"
#: knutprefdlg.cpp:684
msgid "&Picture"
msgstr "&Graficzna"
#: knutprefdlg.cpp:685
msgid "&General"
msgstr "&Opisowa"
#: knutprefdlg.cpp:688 knutprefdlg.cpp:799
msgid "M&anufacturer"
msgstr "P&roducent"
#: knutprefdlg.cpp:691 knutprefdlg.cpp:802
msgid "M&odel"
msgstr "M&odel"
#: knutprefdlg.cpp:694 knutprefdlg.cpp:805
msgid "&Serial"
msgstr "Nr &seryjny"
#: knutprefdlg.cpp:697 knutprefdlg.cpp:808
msgid "&Firm. rev."
msgstr "Wersja &Firmware"
#: knutprefdlg.cpp:700 knutprefdlg.cpp:811
msgid "&Runtime"
msgstr "Czas p&racy"
#: knutprefdlg.cpp:703
msgid "&Battery Charge"
msgstr "&Naładowanie akumulatora"
#: knutprefdlg.cpp:706
msgid "&UPS Load"
msgstr "Obciążenie &UPS'a"
#: knutprefdlg.cpp:710
msgid "Use custom icon's background color"
msgstr "Stosuj kolor tła ikon"
#: knutprefdlg.cpp:713
msgid "Color of icon's background :"
msgstr "Kolor tła ikony :"
#: knutprefdlg.cpp:769
msgid "Panel"
msgstr "Panel"
#: knutprefdlg.cpp:769
msgid "Panel Setting"
msgstr "Ustawienia panela"
#: knutprefdlg.cpp:784
msgid "UPS &Overload"
msgstr "UPS &przeciążenie"
#: knutprefdlg.cpp:787
msgid "UPS &Battery low"
msgstr "UPS &niski poziom akumulatora(ów)"
#: knutprefdlg.cpp:790
msgid "R&eplace battery"
msgstr "&Wymień akumulator(y)"
#: knutprefdlg.cpp:793
msgid "Ups &calibration"
msgstr "UPS &kalibracja "
#: knutprefdlg.cpp:796
msgid "&Manufac. + Model"
msgstr "Producent + &Model"
#: knutprefdlg.cpp:851
msgid "Setting Fonts"
msgstr "Ustawienia czcionek"
#: knutprefdlg.cpp:858
msgid "&Use custom font"
msgstr "&Stosuj czcionki użytkownika"
#: knutprefdlg.cpp:863
msgid "Main panel"
msgstr "Panel główny"
#: knutprefdlg.cpp:864
msgid "Analog panels"
msgstr "Panel analogowy"
#: knutprefdlg.cpp:887
msgid "Analog"
msgstr "Analogowy"
#: knutprefdlg.cpp:887
msgid "Setting Analog panel"
msgstr "Ustawienia panelu analogowego"
#: knutprefdlg.cpp:898
msgid "Use custom other colors"
msgstr "Stosuj inne kolory użytkownika"
#: knutprefdlg.cpp:900
msgid "Color of pointer :"
msgstr "Kolor wskaźnika :"
#: knutprefdlg.cpp:902
msgid "Color of OK range :"
msgstr "Kolor prawidłowego zakresu :"
#: knutprefdlg.cpp:904
msgid "Color of warning range :"
msgstr "Kolor ostrzegawczego zakresu :"
#: knutprefdlg.cpp:906
msgid "Color of error range :"
msgstr "Kolor zakresu nieprawidłowego :"
#: knutprefdlg.cpp:908
msgid "Color of scale :"
msgstr "Kolor podziałki :"
#: knutprefdlg.cpp:910
msgid "Color of font :"
msgstr "Kolor czcionki :"
#: knutprefdlg.cpp:913
msgid "Digital processing of pointers :"
msgstr "Obróbka cyfrowa wskaźnika :"
#: knutprefdlg.cpp:964
msgid "Nothing processing"
msgstr "Nic nie obrabiaj"
#: knutprefdlg.cpp:965
msgid "Fast antialiasing"
msgstr "Szybki antyaliasing"
#: knutprefdlg.cpp:966
msgid "Fine antialiasing"
msgstr "Dokładny antyaliasing"
#: knutprefdlg.cpp:967
msgid "Fast antialiasing and blur motion"
msgstr "Szybki antyaliasing i rozmycie"
#: knutprefdlg.cpp:968
msgid "Fine antialiasing and blur motion"
msgstr "Dokładny antyaliasing i rozmycie"
#: knutprintupsvar.cpp:41
msgid "Variables"
msgstr "Zmienne"
#: knutprintupsvar.cpp:50
msgid "Reload Vars"
msgstr "Przeładuj zmienne"
#: knutprintupsvar.cpp:52
msgid "UPS variables"
msgstr "Zmienne UPS'a"
#: knutprintupsvar.cpp:79
msgid "Value"
msgstr "Wartość"
#: knutprintupsvar.cpp:81
msgid "Description"
msgstr "Opis"
#: knutprintupsvar.cpp:90
msgid "Instant Commands"
msgstr "Polecenia "
#: knutprintupsvar.cpp:103
msgid "Read/Write Variables"
msgstr "Odczyt/zapis zmiennych"
#: knutprintupsvar.cpp:121
msgid "Read Only Variables"
msgstr "Zmienne tylko do odczytu"
#: knutrwvar.cpp:40
msgid "RW variables"
msgstr "Zmienne RW"
#: knutrwvar.cpp:56
msgid "SET RW VARIABLE"
msgstr "USTAW ZMIENNĄ RW"
#: knutrwvar.cpp:61
msgid "Variable:"
msgstr "Zmienna:"
#: knutrwvar.cpp:64
msgid "Value:"
msgstr "Wartość:"
#: knutvardata.cpp:43
msgid "None"
msgstr "Nic"
#: knutvardata.cpp:44
msgid "Input Voltage"
msgstr "Napięcie wejściowe"
#: knutvardata.cpp:46
msgid "UPS Temperature"
msgstr "Temperatura UPS'a"
#: knutvardata.cpp:47
msgid "Input Frequency"
msgstr "Częstotliwość wejściowa"
#: knutvardata.cpp:49
msgid "Outside Temperature"
msgstr "Temperatura zewnętrzna"
#: knutvardata.cpp:50
msgid "Outside Humidity"
msgstr "Wilgotność zewnętrzna"
#: knutvardata.cpp:51
msgid "Battery Voltage"
msgstr "Napięcie akumulatora(ów)"
#: knutvardata.cpp:52
msgid "Output Voltage"
msgstr "Napięcie wyjściowe"
#: knutvardata.cpp:53
msgid "Output Current"
msgstr "Prąd wyjściowy"
#: knutvardata.cpp:54
msgid "Output Frequency"
msgstr "Częstotliwość wyjściowa"
#: knutvardata.cpp:55
msgid "Battery Temperature"
msgstr "Temperatura akumulatora(ów)"
#: knutvardata.cpp:56
msgid "Battery Current"
msgstr "Prąd akumulatora(ów)"
#: knutvardata.cpp:186
msgid "No memory."
msgstr "Brak pamięci."
#: knutvardata.cpp:187
msgid "No address."
msgstr "Brak adresu."
#: knutvardata.cpp:188
msgid "Unknown address."
msgstr "Nieznany adres."
#: knutvardata.cpp:191
msgid "Error of connection."
msgstr "Błąd połączenia."
#: knutvardata.cpp:194
msgid "No connection with server."
msgstr "Brak połączenia z serwerem."
#: knutvardata.cpp:196
msgid "Server-client protocol or variables of NUT are unknown."
msgstr "Protokół serwer-klient lub zmienne NUT'a są niezrozumiałe."
#: knutvardata.cpp:197
msgid "No UPS on this address."
msgstr "Brak UPS'a pod tym adresem."
#: knutvardata.cpp:198
msgid "Connection was refused by server."
msgstr "Połączenie odrzucone przez serwer."
#: knutvardata.cpp:200
msgid "Server doesn't receive data."
msgstr "Serwer nie przyjmuje danych."
#: knutvardata.cpp:201
msgid "Server doesn't send data."
msgstr "Serwer nie wysyła danych."
#: knutvardata.cpp:202
msgid "Server doesn't answer."
msgstr "Serwer nie odpowiada."
#: knutvardata.cpp:204
msgid "Server returns data with unknown format."
msgstr "Serwer zwrócił dane w nieznanym formacie."
#: knutvardata.cpp:205
msgid "Server returns unknown data."
msgstr "Serwer zwrócił nieznane dane."
#: knutvardata.cpp:206
msgid "Command VER returns data with unknown format."
msgstr "Polecenie VER zwraca dane w nieznanym formacie."
#: knutvardata.cpp:208
msgid "No data."
msgstr "Brak danych."
#: knutvardata.cpp:212
msgid "Access denied. Failed password ?"
msgstr "Brak dostępu. Błędne hasło ?"
#: knutvardata.cpp:213
msgid "UPS doesn't sent data to server (Data Stale)."
msgstr "UPS nie przesyła danych do serwera (Dane nieaktualne)."
#: knutvardata.cpp:214
msgid "Server doesn't know this command."
msgstr "Serwer nie zna tego polecenia."
#: knutvardata.cpp:217
msgid "UPS's driver isn't connected."
msgstr "Sterownik UPS'a nie jest podłączony."
#: knutvardata.cpp:219
msgid "Server required password."
msgstr "Serwer wymaga hasła."
#: knutvardata.cpp:220
msgid "Incorrect password."
msgstr "Nieprawidłowe hasło."
#: knutvardata.cpp:221
msgid "UPS doesn't response."
msgstr "UPS nie odpowiada."
#: knutvardata.cpp:222
msgid "Command failed."
msgstr "Polecenie nie wykonane."
#: knutvardata.cpp:223
msgid "UPS doesn't know this instant command."
msgstr "UPS nie zna tego polecenia."
#: knutvardata.cpp:224
msgid "UPS doesn't support this instant command."
msgstr "UPS nie wspiera tego polecenia."
#: knutvardata.cpp:225
msgid "UPS doesn't known this variable."
msgstr "UPS nie rozpoznaje zmiennej."
#: knutvardata.cpp:226
msgid "UPS doesn't support this variable."
msgstr "UPS nie wspiera tej zmiennej."
#: knutvardata.cpp:227
msgid "UPS doesn't support this value in this variable."
msgstr "UPS nie wspiera tej wartości zmiennej."
#: knutvardata.cpp:228
msgid "Name of UPS is unknown."
msgstr "Nieznana nazwa UPS'a."
#: knutvardata.cpp:230
msgid "Username has been already entered."
msgstr "Nazwa użytkownika była już wprowadzona."
#: knutvardata.cpp:231
msgid "Password has been already entered."
msgstr "Hasło było już wprowadzone."
#: knutvardata.cpp:233
msgid "Server doesn't send list of variables."
msgstr "Serwer nie przesyła listy zmiennych."
#: knutvardata.cpp:236
msgid "Unknown error."
msgstr "Nieznany błąd."
#: main.cpp:31
msgid "Client for Network UPS Tool"
msgstr "Klient dla Network UPS Tool"
#: main.cpp:37
msgid "Don't dock in Kicker"
msgstr "Nie umieszczaj w tacce systemowej"
#: main.cpp:47
msgid "KNutClient"
msgstr "KNutClient"
#. i18n: file ./knutclientui.rc line 13
#: rc.cpp:9
#, no-c-format
msgid "&Connection"
msgstr "&Połączenie"

@ -0,0 +1,843 @@
# translation of pt_BR.po to Czech
# tradução de knutclient.po para Brazilian Portuguese
# translation of pt_BR.po to Brazilian Portuguese
# translation of knutclient.po to Brazilian Portuguese
# Copyright (C) 2008 Free Software Foundation, Inc.
# Wellington Terumi Uemura <wellingtonuemura@gmail.com>, 2008.
# Lisiane Sztoltz Teixeira <lisiane@kdemail.net>, 2004.
# Daniel Prynych <Daniel.Prynych@alo.cz>, 2004.
#
msgid ""
msgstr ""
"Project-Id-Version: pt_BR\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-02-21 12:13+0100\n"
"PO-Revision-Date: 2008-05-29 14:32+0200\n"
"Last-Translator: Wellington Terumi Uemura <wellingtonuemura@gmail.com>\n"
"Language-Team: Czech <cs@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: gedit 2.22.0\n"
#: _translatorinfo.cpp:1
msgid ""
"_: NAME OF TRANSLATORS\n"
"Your names"
msgstr "Wellington Terumi Uemura"
#: _translatorinfo.cpp:3
msgid ""
"_: EMAIL OF TRANSLATORS\n"
"Your emails"
msgstr "wellingtonuemura@gmail.com"
#: knutclient.cpp:86
msgid "Ready."
msgstr "Pronto."
#: knutclient.cpp:218 knutclient.cpp:219
msgid "The connection was renewed."
msgstr "A conexão foi fechada pelo no-break (upsd)."
#: knutclient.cpp:285
msgid "The connection failed. The next connection will make after %1 sec."
msgstr "A conexão falhou. Uma nova conexão será feita depois de %1 segundos."
#: knutclient.cpp:546
msgid "upsd > 1.2 doesn't support UDP. Connection is switched to TCP"
msgstr "upsd > 1.2 não tem suporte para UDP. A conexão foi alternada para TCP"
#: knutclient.cpp:688 knutclient.cpp:689
msgid "Data OK"
msgstr "Dados OK"
#: knutclient.cpp:781 knutclient.cpp:782
msgid "The connection was closed by the second side (upsd)."
msgstr "A conexão foi fechada pelo no-break (upsd)"
#: knutclient.cpp:798 knutclient.cpp:799
msgid "UPS is off."
msgstr "O no-break está desligado."
#: knutclient.cpp:802 knutclient.cpp:803
msgid "UPS is back on."
msgstr "O no-break está ligado."
#: knutclient.cpp:808 knutclient.cpp:809
msgid "Power is back online."
msgstr "A força retornou."
#: knutclient.cpp:814 knutclient.cpp:815
msgid "UPS is on battery."
msgstr "O no-break está funcionado com bateria."
#: knutclient.cpp:820 knutclient.cpp:821
msgid "UPS battery is low."
msgstr "A bateria do no-break está fraca."
#: knutclient.cpp:824 knutclient.cpp:825
msgid "UPS battery is OK."
msgstr "A bateria do no-break está OK."
#: knutclient.cpp:830 knutclient.cpp:831
msgid "UPS battery is bad and needs be replaced."
msgstr "A bateria do no-break está com problemas e precisa ser trocada."
#: knutclient.cpp:836 knutclient.cpp:837
msgid "UPS is overloaded."
msgstr "O no-break está sobrecarregado."
#: knutclient.cpp:840 knutclient.cpp:841
msgid "UPS isn't overloaded."
msgstr "O no-break não está sobrecarregado."
#: knutclient.cpp:846 knutclient.cpp:847 knutdock.cpp:449
msgid "UPS is performing calibration"
msgstr "O no-break está sendo calibrado"
#: knutclient.cpp:850 knutclient.cpp:851
msgid "Calibration of UPS is ended."
msgstr "A calibração do no-break foi finalizada."
#: knutclient.cpp:856 knutclient.cpp:857
msgid "UPS is boosting incoming voltage."
msgstr "O no-break está aumentando a voltagem de entrada."
#: knutclient.cpp:860 knutclient.cpp:861
msgid "Boosting of UPS is ended."
msgstr "O aumento de voltagem de entrada do no-break terminou."
#: knutclient.cpp:866 knutclient.cpp:867
msgid "UPS is trimming incoming voltage."
msgstr "O no-break está ajustando a voltagem de entrada."
#: knutclient.cpp:870 knutclient.cpp:871
msgid "Trimming of UPS is ended."
msgstr "O ajuste da entrada da voltagem do no-break terminou."
#: knutclient.cpp:887 knutclient.cpp:954 knutclient.cpp:963
msgid "Switched"
msgstr "Comutado"
#: knutclient.cpp:1103 knutdock.cpp:640 knutmainwindow.cpp:781
msgid "Reconnect"
msgstr "Reconectar"
#: knutdock.cpp:419 knutdock.cpp:469 knutfrontpanel.cpp:192
#: knutnewupsdlg.cpp:69 knutprintupsvar.cpp:78
msgid "Name"
msgstr "Nome"
#: knutdock.cpp:420 knutnewupsdlg.cpp:83
msgid "UPS name"
msgstr "Nome do No-break"
#: knutdock.cpp:421 knutnewupsdlg.cpp:77
msgid "UPS address"
msgstr "Endereço do No-break"
#: knutdock.cpp:422 knutdock.cpp:443 knutdock.cpp:446 knutdock.cpp:449
#: knutdock.cpp:452 knutdock.cpp:455 knutdock.cpp:458
msgid "Status : "
msgstr "Status :"
#: knutdock.cpp:425 knutvardata.cpp:209
msgid "Connection doesn't exist."
msgstr "A conexão não existe."
#: knutdock.cpp:429 knutfrontpanel.cpp:80
msgid "UPS On line"
msgstr "No-break Ativo"
#: knutdock.cpp:433 knutfrontpanel.cpp:95
msgid "UPS On battery"
msgstr "No-break Usando Bateria"
#: knutdock.cpp:437
msgid "UPS Of line"
msgstr "No-break desconectado"
#: knutdock.cpp:443
msgid "UPS Battery is low"
msgstr "A bateria do no-break está fraca"
#: knutdock.cpp:446 knutfrontpanel.cpp:138
msgid "Replace battery"
msgstr "Troque a bateria"
#: knutdock.cpp:452
msgid "UPS is Overload"
msgstr "O no-break está sobrecarregado"
#: knutdock.cpp:455
msgid "UPS is trimming voltage"
msgstr "O no-break está ajustando a voltagem"
#: knutdock.cpp:458
msgid "UPS is boosting voltage"
msgstr "O no-break está aumentando a voltagem"
#: knutdock.cpp:464
msgid "Error : "
msgstr "Erro : "
#: knutdock.cpp:467 knutfrontpanel.cpp:182
msgid "Manufac. : "
msgstr "Fabric. : "
#: knutdock.cpp:471
msgid "Serial"
msgstr "No. de série"
#: knutdock.cpp:473
msgid "Firmware"
msgstr "Firmware"
#: knutdock.cpp:477 knutfrontpanel.cpp:233
msgid "Runtime"
msgstr "Em Execução"
#: knutdock.cpp:477
msgid " : %1:%2 min"
msgstr " : %1:%2 min"
#: knutdock.cpp:482 knutvardata.cpp:45
msgid "Battery Charge"
msgstr "Carga da Bateria"
#: knutdock.cpp:487 knutvardata.cpp:48
msgid "UPS Load"
msgstr "Carga do No-break"
#: knutdock.cpp:513 knutmainwindow.cpp:663
msgid "Are you sure ?"
msgstr "Você tem certeza?"
#: knutdock.cpp:636 knutmainwindow.cpp:748
msgid "&Showing UPS variables and commands"
msgstr "&Mostrar os comandos e variáveis do no-break"
#: knutdock.cpp:637 knutmainwindow.cpp:749
msgid "&Running instant commands"
msgstr "&Executar comandos instantâneos"
#: knutdock.cpp:638 knutmainwindow.cpp:750
msgid "Setting R&W variables"
msgstr "Definir variáveis de &Leit./Escr."
#: knutdock.cpp:642
msgid "&Preferences"
msgstr "&Configurações"
#: knutdock.cpp:644
msgid "&About KNutClient"
msgstr "&Sobre o KNutClient"
#: knutdock.cpp:646
msgid "&Minimize"
msgstr "&Minimizar"
#: knutdock.cpp:648
msgid "&Exit"
msgstr "S&air"
#: knutfrontpanel.cpp:110
msgid "UPS Overload"
msgstr "Sobrecarga do No-break"
#: knutfrontpanel.cpp:124
msgid "UPS Battery low"
msgstr "No-break com Bateria Fraca"
#: knutfrontpanel.cpp:152
msgid "UPS calibration"
msgstr "Calibragem do No-break"
#: knutfrontpanel.cpp:202
msgid "Serial : "
msgstr "Serial : "
#: knutfrontpanel.cpp:212
msgid "Firm. rev. : "
msgstr "Vers. do Firm.:"
#: knutinstcomms.cpp:33
msgid "Instant commands"
msgstr "Comandos instantâneos"
#: knutinstcomms.cpp:45
msgid "RUN INSTANT COMMAND"
msgstr "EXECUTAR COMANDO INSTANTÂNEO"
#: knutinstcomms.cpp:49
msgid "Command:"
msgstr "Comando:"
#: knutinstcomms.cpp:53 knutnewupsdlg.cpp:102 knutrwvar.cpp:70
msgid "User name:"
msgstr "Nome do usuário:"
#: knutinstcomms.cpp:54 knutnewupsdlg.cpp:109 knutrwvar.cpp:71
msgid "Password:"
msgstr "Senha:"
#: knutmainwindow.cpp:59
msgid "test of conection from 5"
msgstr "teste de conexão à partir de 5"
#: knutmainwindow.cpp:745
msgid "Quits the application"
msgstr "Finalizar o aplicação"
#: knutmainwindow.cpp:778
msgid "&Using descriptions"
msgstr "&Usar descrições"
#: knutnewupsdlg.cpp:39
msgid "New Ups"
msgstr "Novo No-break"
#: knutnewupsdlg.cpp:89
msgid "Delay (ms):"
msgstr "Atraso (ms):"
#: knutnewupsdlg.cpp:96
msgid "Port:"
msgstr "Porta: "
#: knutnewupsdlg.cpp:116
msgid "Store NUT password in configuration file"
msgstr "Armazenar a senha do NUT no arquivo de configuração"
#: knutnewupsdlg.cpp:123
msgid "Availabled UPS values"
msgstr ""
#: knutnewupsdlg.cpp:124
msgid "Selected UPS values"
msgstr ""
#: knutnewupsdlg.cpp:134
msgid "UPS Variables"
msgstr "Variáveis do No-break"
#: knutnewupsdlg.cpp:255
msgid "No Name or UPS address"
msgstr "Sem Nome ou Endereço do No-break"
#: knutnewupsdlg.cpp:263
msgid "This Name exist"
msgstr "Este nome já existe"
#: knutnewupsdlg.cpp:270
msgid "Delay must be number"
msgstr "O valor de Atraso deve ser numérico"
#: knutnewupsdlg.cpp:276
msgid "Port must be number"
msgstr "O valor da Porta deve ser numérico"
#: knutnewupsdlg.cpp:281
msgid "Port must be from 1025 until 65535"
msgstr "O valor da Porta deve conter um valor de 1025 até 65535"
#: knutnewupsdlg.cpp:286
msgid "Delay is too small"
msgstr "O Atraso é muito pequeno"
#: knutprefdlg.cpp:45
msgid "Preferences"
msgstr "Preferências"
#: knutprefdlg.cpp:508
msgid "Setting"
msgstr "Configuração"
#: knutprefdlg.cpp:508
msgid "Main Setting"
msgstr "Configuração Principal"
#: knutprefdlg.cpp:516
msgid "Voltage/Frequency"
msgstr "Voltagem/Freqüência"
#: knutprefdlg.cpp:519
msgid "&Use High-Low XFER"
msgstr "&Usar XFER Baixo/Alto"
#: knutprefdlg.cpp:521
msgid "Number of columns :"
msgstr "Quantidade de colunas:"
#: knutprefdlg.cpp:524 knutprefdlg.cpp:815 knutprefdlg.cpp:894
msgid "Use custom background color"
msgstr "Utilizar cor do plano de fundo personalizado"
#: knutprefdlg.cpp:528 knutprefdlg.cpp:818 knutprefdlg.cpp:896
msgid "Color of background :"
msgstr "Cor do plano de fundo:"
#: knutprefdlg.cpp:532
msgid "Use dialog \"Are you sure\""
msgstr "Usar diálogo \"Você tem certeza?\" :"
#: knutprefdlg.cpp:535
msgid "Use Main window when program is started"
msgstr "Usar janela principal quando o programa iniciar"
#: knutprefdlg.cpp:538
msgid "Show message window, when program reports error"
msgstr "Mostrar janela de mensagem quando o programa reportar um erro"
#: knutprefdlg.cpp:543
msgid "Auto"
msgstr ""
#: knutprefdlg.cpp:547
msgid "Nominal Input Voltage"
msgstr "Entrada de Voltagem Nominal"
#: knutprefdlg.cpp:550
msgid "&230 V"
msgstr "&230 V"
#: knutprefdlg.cpp:551
msgid "&120 V"
msgstr "&120 V"
#: knutprefdlg.cpp:553
msgid "Nominal Input Frequency"
msgstr "Freqüência de entrada nominal"
#: knutprefdlg.cpp:556
msgid "&50 Hz"
msgstr "&50 Hz"
#: knutprefdlg.cpp:557
msgid "&60 Hz"
msgstr "&60 Hz"
#: knutprefdlg.cpp:628
msgid "UPS"
msgstr "No-break"
#: knutprefdlg.cpp:628
msgid "UPS Setting"
msgstr "Configuração do No-break"
#: knutprefdlg.cpp:646
msgid "&Add"
msgstr "&Adicionar"
#: knutprefdlg.cpp:667
#, fuzzy
msgid "Dock bar"
msgstr "Encaixar"
#: knutprefdlg.cpp:667
msgid "Docking Setting"
msgstr "Configuração do encaixe"
#: knutprefdlg.cpp:671
msgid "Type of dock's showing"
msgstr "Mostrar os tipos de encaixe"
#: knutprefdlg.cpp:676
msgid "Items of tooltip"
msgstr "Itens da ferramenta de dicas"
#: knutprefdlg.cpp:684
msgid "&Picture"
msgstr "&Figura"
#: knutprefdlg.cpp:685
msgid "&General"
msgstr "&Geral"
#: knutprefdlg.cpp:688 knutprefdlg.cpp:799
msgid "M&anufacturer"
msgstr "F&abricante"
#: knutprefdlg.cpp:691 knutprefdlg.cpp:802
msgid "M&odel"
msgstr "M&odelo"
#: knutprefdlg.cpp:694 knutprefdlg.cpp:805
msgid "&Serial"
msgstr "No de &série"
#: knutprefdlg.cpp:697 knutprefdlg.cpp:808
msgid "&Firm. rev."
msgstr "&Ver. do Firm.: "
#: knutprefdlg.cpp:700 knutprefdlg.cpp:811
msgid "&Runtime"
msgstr "Em E&xecução"
#: knutprefdlg.cpp:703
msgid "&Battery Charge"
msgstr "Carga da &Bateria"
#: knutprefdlg.cpp:706
msgid "&UPS Load"
msgstr "Carga do &No-break"
#: knutprefdlg.cpp:710
msgid "Use custom icon's background color"
msgstr "Utilizar ícones com cor do plano de fundo personalizado"
#: knutprefdlg.cpp:713
msgid "Color of icon's background :"
msgstr "Cor de plano de fundo do ícone:"
#: knutprefdlg.cpp:769
msgid "Panel"
msgstr "Painel"
#: knutprefdlg.cpp:769
msgid "Panel Setting"
msgstr "Configuração do painel"
#: knutprefdlg.cpp:784
msgid "UPS &Overload"
msgstr "&Carga do No-break"
#: knutprefdlg.cpp:787
msgid "UPS &Battery low"
msgstr "&Bateria do No-break com pouca carga"
#: knutprefdlg.cpp:790
msgid "R&eplace battery"
msgstr "Tro&que a bateria"
#: knutprefdlg.cpp:793
msgid "Ups &calibration"
msgstr "&Calibragem do No-break"
#: knutprefdlg.cpp:796
msgid "&Manufac. + Model"
msgstr "Fabricante + &Modelo"
#: knutprefdlg.cpp:851
msgid "Setting Fonts"
msgstr "Configuração de Fontes"
#: knutprefdlg.cpp:858
msgid "&Use custom font"
msgstr "&Utilizar fonte personalizada"
#: knutprefdlg.cpp:863
msgid "Main panel"
msgstr "Painel principal"
#: knutprefdlg.cpp:864
msgid "Analog panels"
msgstr "Painel analógico"
#: knutprefdlg.cpp:887
msgid "Analog"
msgstr "Analógico"
#: knutprefdlg.cpp:887
msgid "Setting Analog panel"
msgstr "Configuração do painel analógico"
#: knutprefdlg.cpp:898
msgid "Use custom other colors"
msgstr "Utilizar outras cores personalizadas"
#: knutprefdlg.cpp:900
msgid "Color of pointer :"
msgstr "Cor do ponteiro:"
#: knutprefdlg.cpp:902
msgid "Color of OK range :"
msgstr "Cor do limite OK:"
#: knutprefdlg.cpp:904
msgid "Color of warning range :"
msgstr "Cor do limite de aviso:"
#: knutprefdlg.cpp:906
msgid "Color of error range :"
msgstr "Cor do limite de erro:"
#: knutprefdlg.cpp:908
msgid "Color of scale :"
msgstr "Cor da escala :"
#: knutprefdlg.cpp:910
msgid "Color of font :"
msgstr "Cor da fonte :"
#: knutprefdlg.cpp:913
msgid "Digital processing of pointers :"
msgstr "Cor do ponteiro:"
#: knutprefdlg.cpp:964
msgid "Nothing processing"
msgstr "Nada sendo processado"
#: knutprefdlg.cpp:965
msgid "Fast antialiasing"
msgstr "Suavização rápida de amostra"
#: knutprefdlg.cpp:966
msgid "Fine antialiasing"
msgstr "Suavização fina de amostra"
#: knutprefdlg.cpp:967
msgid "Fast antialiasing and blur motion"
msgstr "Suavização rápida de amostra e desfoque gaussiano"
#: knutprefdlg.cpp:968
msgid "Fine antialiasing and blur motion"
msgstr "Suavização fina de amostra e desfoque gaussiano"
#: knutprintupsvar.cpp:41
msgid "Variables"
msgstr "Variáveis"
#: knutprintupsvar.cpp:50
msgid "Reload Vars"
msgstr "Recarregar variáveis"
#: knutprintupsvar.cpp:52
msgid "UPS variables"
msgstr "Variáveis do No-break"
#: knutprintupsvar.cpp:79
msgid "Value"
msgstr "Valor"
#: knutprintupsvar.cpp:81
msgid "Description"
msgstr "Descrição"
#: knutprintupsvar.cpp:90
msgid "Instant Commands"
msgstr "Comandos Instantâneos"
#: knutprintupsvar.cpp:103
msgid "Read/Write Variables"
msgstr "Variáveis de Leitura/Escrita"
#: knutprintupsvar.cpp:121
msgid "Read Only Variables"
msgstr "Variáveis Apenas de Leitura"
#: knutrwvar.cpp:40
msgid "RW variables"
msgstr "Variáveis de Leit./Escr."
#: knutrwvar.cpp:56
msgid "SET RW VARIABLE"
msgstr "DEFINIR VARIÁVEL DE LEIT./ESCR."
#: knutrwvar.cpp:61
msgid "Variable:"
msgstr "Variável:"
#: knutrwvar.cpp:64
msgid "Value:"
msgstr "Valor:"
#: knutvardata.cpp:43
msgid "None"
msgstr "Nenhum"
#: knutvardata.cpp:44
msgid "Input Voltage"
msgstr "Voltagem de Entrada"
#: knutvardata.cpp:46
msgid "UPS Temperature"
msgstr "Temperatura do No-break"
#: knutvardata.cpp:47
msgid "Input Frequency"
msgstr "Freqüência de Entrada"
#: knutvardata.cpp:49
msgid "Outside Temperature"
msgstr "Temperatura Exterior"
#: knutvardata.cpp:50
msgid "Outside Humidity"
msgstr "Umidade Exterior"
#: knutvardata.cpp:51
msgid "Battery Voltage"
msgstr "Voltagem da Bateria"
#: knutvardata.cpp:52
msgid "Output Voltage"
msgstr "Voltagem de Saída"
#: knutvardata.cpp:53
msgid "Output Current"
msgstr "Corrente de Saída"
#: knutvardata.cpp:54
msgid "Output Frequency"
msgstr "Freqüência de Saída"
#: knutvardata.cpp:55
msgid "Battery Temperature"
msgstr "Temperatura da Bateria"
#: knutvardata.cpp:56
msgid "Battery Current"
msgstr "Corrente da Bateria"
#: knutvardata.cpp:186
#, fuzzy
msgid "No memory."
msgstr "Sem Memória."
#: knutvardata.cpp:187
msgid "No address."
msgstr "Sem endereço."
#: knutvardata.cpp:188
msgid "Unknown address."
msgstr "Endereço desconhecido."
#: knutvardata.cpp:191
msgid "Error of connection."
msgstr "Erro de Conexão."
#: knutvardata.cpp:194
msgid "No connection with server."
msgstr "Sem conexão com o servidor."
#: knutvardata.cpp:196
msgid "Server-client protocol or variables of NUT are unknown."
msgstr "Protocolo cliente-servidor ou variáveis do NUT são desconhecidas."
#: knutvardata.cpp:197
msgid "No UPS on this address."
msgstr "Não há nenhum no-break neste endereço."
#: knutvardata.cpp:198
msgid "Connection was refused by server."
msgstr "Conexão foi recusada pelo servidor."
#: knutvardata.cpp:200
msgid "Server doesn't receive data."
msgstr "O servidor não está recebendo dados."
#: knutvardata.cpp:201
msgid "Server doesn't send data."
msgstr "O servidor não está enviando dados."
#: knutvardata.cpp:202
msgid "Server doesn't answer."
msgstr "O servidor não está respondendo."
#: knutvardata.cpp:204
msgid "Server returns data with unknown format."
msgstr "O servidor retornou dados com um formato desconhecido."
#: knutvardata.cpp:205
msgid "Server returns unknown data."
msgstr "O servidor retornou dados desconhecidos."
#: knutvardata.cpp:206
msgid "Command VER returns data with unknown format."
msgstr "O comando VER retornou dados com um formato desconhecido."
#: knutvardata.cpp:208
msgid "No data."
msgstr "Sem dados."
#: knutvardata.cpp:212
msgid "Access denied. Failed password ?"
msgstr "Acesso negado. Senha errada?"
#: knutvardata.cpp:213
msgid "UPS doesn't sent data to server (Data Stale)."
msgstr "O no-break não consegue enviar dados para o servidor (pane de dados)."
#: knutvardata.cpp:214
msgid "Server doesn't know this command."
msgstr "O servidor desconhece este comando."
#: knutvardata.cpp:217
msgid "UPS's driver isn't connected."
msgstr "O driver do no-break não está conectado."
#: knutvardata.cpp:219
msgid "Server required password."
msgstr "O servidor precisa de uma senha."
#: knutvardata.cpp:220
msgid "Incorrect password."
msgstr "Senha incorreta."
#: knutvardata.cpp:221
msgid "UPS doesn't response."
msgstr "O no-break não responde."
#: knutvardata.cpp:222
msgid "Command failed."
msgstr "O comando falhou."
#: knutvardata.cpp:223
msgid "UPS doesn't know this instant command."
msgstr "O no-break desconhece este comando instantâneo."
#: knutvardata.cpp:224
msgid "UPS doesn't support this instant command."
msgstr "O no-break não tem suporte para este comando instantâneo."
#: knutvardata.cpp:225
msgid "UPS doesn't known this variable."
msgstr "O no-break desconhece esta variável."
#: knutvardata.cpp:226
msgid "UPS doesn't support this variable."
msgstr "O no-break não tem suporte para esta variável."
#: knutvardata.cpp:227
msgid "UPS doesn't support this value in this variable."
msgstr "O no-break não tem suporte para este valor nesta variável."
#: knutvardata.cpp:228
msgid "Name of UPS is unknown."
msgstr "O nome do no-break é desconhecido."
#: knutvardata.cpp:230
msgid "Username has been already entered."
msgstr "O nome de usuário já foi alterado."
#: knutvardata.cpp:231
msgid "Password has been already entered."
msgstr "A senha já foi informada."
#: knutvardata.cpp:233
msgid "Server doesn't send list of variables."
msgstr "O servidor não envia a lista de variáveis."
#: knutvardata.cpp:236
msgid "Unknown error."
msgstr "Erro desconhecido."
#: main.cpp:31
msgid "Client for Network UPS Tool"
msgstr "Cliente para No-break de Rede"
#: main.cpp:37
msgid "Don't dock in Kicker"
msgstr "Não encaixar no painel"
#: main.cpp:47
msgid "KNutClient"
msgstr "KNutClient"
#. i18n: file ./knutclientui.rc line 13
#: rc.cpp:9
#, no-c-format
msgid "&Connection"
msgstr "&Conexão"

@ -0,0 +1,917 @@
# translation of ru.po to Czech
# translation of ru.po to Russian
# Copyright (C) 2003,2004 Free Software Foundation, Inc.
# Oleg Shevchenko <oleg@kpgaz.chernigov.ua>, 2003,2004.
# Daniel Prynych <Daniel.Prynych@alo.cz>, 2003, 2004.
#
msgid ""
msgstr ""
"Project-Id-Version: ru\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-02-21 12:13+0100\n"
"PO-Revision-Date: 2004-02-17 19:01+0100\n"
"Last-Translator: Daniel Prynych <Daniel.Prynych@alo.cz>\n"
"Language-Team: Czech <cs@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.0.2\n"
#: _translatorinfo.cpp:1
msgid ""
"_: NAME OF TRANSLATORS\n"
"Your names"
msgstr "Oleg Shevchenko"
#: _translatorinfo.cpp:3
msgid ""
"_: EMAIL OF TRANSLATORS\n"
"Your emails"
msgstr "oleg@kpgaz.chernigov.ua"
#: knutclient.cpp:86
msgid "Ready."
msgstr "Готов."
#: knutclient.cpp:218 knutclient.cpp:219
msgid "The connection was renewed."
msgstr ""
#: knutclient.cpp:285
msgid "The connection failed. The next connection will make after %1 sec."
msgstr ""
#: knutclient.cpp:546
msgid "upsd > 1.2 doesn't support UDP. Connection is switched to TCP"
msgstr "upsd > 1.2 не поддерживает UDP. Соединение переключено на TCP"
#: knutclient.cpp:688 knutclient.cpp:689
msgid "Data OK"
msgstr "Данные OK"
#: knutclient.cpp:781 knutclient.cpp:782
msgid "The connection was closed by the second side (upsd)."
msgstr ""
#: knutclient.cpp:798 knutclient.cpp:799
msgid "UPS is off."
msgstr "UPS выкл."
#: knutclient.cpp:802 knutclient.cpp:803
msgid "UPS is back on."
msgstr "UPS вкл."
#: knutclient.cpp:808 knutclient.cpp:809
msgid "Power is back online."
msgstr "Питание возвращено."
#: knutclient.cpp:814 knutclient.cpp:815
msgid "UPS is on battery."
msgstr "UPS на батарее."
#: knutclient.cpp:820 knutclient.cpp:821
msgid "UPS battery is low."
msgstr "UPS батарея разряженная."
#: knutclient.cpp:824 knutclient.cpp:825
msgid "UPS battery is OK."
msgstr "UPS батарея OK."
#: knutclient.cpp:830 knutclient.cpp:831
msgid "UPS battery is bad and needs be replaced."
msgstr "UPS батарея плохая и требует замены."
#: knutclient.cpp:836 knutclient.cpp:837
msgid "UPS is overloaded."
msgstr "UPS перегружен."
#: knutclient.cpp:840 knutclient.cpp:841
msgid "UPS isn't overloaded."
msgstr "UPS не перегружен."
#: knutclient.cpp:846 knutclient.cpp:847 knutdock.cpp:449
msgid "UPS is performing calibration"
msgstr "UPS выполняю калибровку"
#: knutclient.cpp:850 knutclient.cpp:851
msgid "Calibration of UPS is ended."
msgstr "Калибровка UPS завершена."
#: knutclient.cpp:856 knutclient.cpp:857
msgid "UPS is boosting incoming voltage."
msgstr "UPS повышаю входное напряжение."
#: knutclient.cpp:860 knutclient.cpp:861
msgid "Boosting of UPS is ended."
msgstr "Повышение напряжения завершено."
#: knutclient.cpp:866 knutclient.cpp:867
msgid "UPS is trimming incoming voltage."
msgstr "UPS подстройка входного напряжения."
#: knutclient.cpp:870 knutclient.cpp:871
msgid "Trimming of UPS is ended."
msgstr "Подстройка напряжения завершена."
#: knutclient.cpp:887 knutclient.cpp:954 knutclient.cpp:963
msgid "Switched"
msgstr "Переключить"
#: knutclient.cpp:1103 knutdock.cpp:640 knutmainwindow.cpp:781
msgid "Reconnect"
msgstr ""
#: knutdock.cpp:419 knutdock.cpp:469 knutfrontpanel.cpp:192
#: knutnewupsdlg.cpp:69 knutprintupsvar.cpp:78
msgid "Name"
msgstr "Имя"
#: knutdock.cpp:420 knutnewupsdlg.cpp:83
msgid "UPS name"
msgstr "UPS имя"
#: knutdock.cpp:421 knutnewupsdlg.cpp:77
msgid "UPS address"
msgstr "UPS адрес"
#: knutdock.cpp:422 knutdock.cpp:443 knutdock.cpp:446 knutdock.cpp:449
#: knutdock.cpp:452 knutdock.cpp:455 knutdock.cpp:458
msgid "Status : "
msgstr "Статус : "
#: knutdock.cpp:425 knutvardata.cpp:209
msgid "Connection doesn't exist."
msgstr "Соединение не установлено."
#: knutdock.cpp:429 knutfrontpanel.cpp:80
msgid "UPS On line"
msgstr "UPS на линии"
#: knutdock.cpp:433 knutfrontpanel.cpp:95
msgid "UPS On battery"
msgstr "UPS на батарее"
#: knutdock.cpp:437
msgid "UPS Of line"
msgstr "UPS на линии"
#: knutdock.cpp:443
msgid "UPS Battery is low"
msgstr "UPS батарея разряженая."
#: knutdock.cpp:446 knutfrontpanel.cpp:138
msgid "Replace battery"
msgstr "Заменить батарею"
#: knutdock.cpp:452
msgid "UPS is Overload"
msgstr "UPS Перегрузка"
#: knutdock.cpp:455
msgid "UPS is trimming voltage"
msgstr "UPS подстройка напряжения"
#: knutdock.cpp:458
msgid "UPS is boosting voltage"
msgstr "UPS повышение напряжения"
#: knutdock.cpp:464
msgid "Error : "
msgstr "Ошибка : "
#: knutdock.cpp:467 knutfrontpanel.cpp:182
msgid "Manufac. : "
msgstr "Производитель : "
#: knutdock.cpp:471
msgid "Serial"
msgstr "Порт"
#: knutdock.cpp:473
msgid "Firmware"
msgstr "Firmware"
#: knutdock.cpp:477 knutfrontpanel.cpp:233
msgid "Runtime"
msgstr "Время работы"
#: knutdock.cpp:477
msgid " : %1:%2 min"
msgstr " : %1:%2 мин"
#: knutdock.cpp:482 knutvardata.cpp:45
msgid "Battery Charge"
msgstr "Зарядка батареи"
#: knutdock.cpp:487 knutvardata.cpp:48
msgid "UPS Load"
msgstr "UPS Загрузка"
#: knutdock.cpp:513 knutmainwindow.cpp:663
msgid "Are you sure ?"
msgstr "Вы уверенны?"
#: knutdock.cpp:636 knutmainwindow.cpp:748
msgid "&Showing UPS variables and commands"
msgstr "П&оказать UPS переменные и команды"
#: knutdock.cpp:637 knutmainwindow.cpp:749
msgid "&Running instant commands"
msgstr "Запуск &прямых команд"
#: knutdock.cpp:638 knutmainwindow.cpp:750
msgid "Setting R&W variables"
msgstr "&Установка переменных RW"
#: knutdock.cpp:642
msgid "&Preferences"
msgstr "Предпочтени&я"
#: knutdock.cpp:644
msgid "&About KNutClient"
msgstr "&О программе KNutClient"
#: knutdock.cpp:646
msgid "&Minimize"
msgstr "&Минимизация"
#: knutdock.cpp:648
msgid "&Exit"
msgstr "&Выход"
#: knutfrontpanel.cpp:110
msgid "UPS Overload"
msgstr "UPS Перегрузка"
#: knutfrontpanel.cpp:124
msgid "UPS Battery low"
msgstr "UPS Батарея разряженная"
#: knutfrontpanel.cpp:152
msgid "UPS calibration"
msgstr "UPS калибровка"
#: knutfrontpanel.cpp:202
msgid "Serial : "
msgstr "Serial : "
#: knutfrontpanel.cpp:212
msgid "Firm. rev. : "
msgstr "Firm. rev. : "
#: knutinstcomms.cpp:33
msgid "Instant commands"
msgstr "Прямые команды"
#: knutinstcomms.cpp:45
msgid "RUN INSTANT COMMAND"
msgstr "ВЫПОЛНИТЬ ПРЯМУЮ КОМАНДУ"
#: knutinstcomms.cpp:49
msgid "Command:"
msgstr "Команда:"
#: knutinstcomms.cpp:53 knutnewupsdlg.cpp:102 knutrwvar.cpp:70
msgid "User name:"
msgstr "Имя пользователя:"
#: knutinstcomms.cpp:54 knutnewupsdlg.cpp:109 knutrwvar.cpp:71
msgid "Password:"
msgstr "Пароль:"
#: knutmainwindow.cpp:59
msgid "test of conection from 5"
msgstr ""
#: knutmainwindow.cpp:745
msgid "Quits the application"
msgstr "Выйти из приложения"
#: knutmainwindow.cpp:778
msgid "&Using descriptions"
msgstr "Использую &описания"
#: knutnewupsdlg.cpp:39
msgid "New Ups"
msgstr "Новый UPS"
#: knutnewupsdlg.cpp:89
msgid "Delay (ms):"
msgstr "Задержка (мс):"
#: knutnewupsdlg.cpp:96
msgid "Port:"
msgstr "Порт:"
#: knutnewupsdlg.cpp:116
msgid "Store NUT password in configuration file"
msgstr "Хранить NUT пароль в конфигурационном файле"
#: knutnewupsdlg.cpp:123
msgid "Availabled UPS values"
msgstr ""
#: knutnewupsdlg.cpp:124
msgid "Selected UPS values"
msgstr ""
#: knutnewupsdlg.cpp:134
msgid "UPS Variables"
msgstr "UPS переменные"
#: knutnewupsdlg.cpp:255
msgid "No Name or UPS address"
msgstr "Отсутствует Имя или UPS адрес"
#: knutnewupsdlg.cpp:263
msgid "This Name exist"
msgstr "Такое Имя уже существует"
#: knutnewupsdlg.cpp:270
msgid "Delay must be number"
msgstr "Задержка должна быть числовой"
#: knutnewupsdlg.cpp:276
msgid "Port must be number"
msgstr "Порт должен быть числовой"
#: knutnewupsdlg.cpp:281
msgid "Port must be from 1025 until 65535"
msgstr "Порт должен быть в диапазоне 1025 - 65535"
#: knutnewupsdlg.cpp:286
msgid "Delay is too small"
msgstr "Задержка слишком маленькая"
#: knutprefdlg.cpp:45
msgid "Preferences"
msgstr "Предпочтения"
#: knutprefdlg.cpp:508
msgid "Setting"
msgstr "Настройки"
#: knutprefdlg.cpp:508
msgid "Main Setting"
msgstr "Основные настройки"
#: knutprefdlg.cpp:516
msgid "Voltage/Frequency"
msgstr "Напряжение/Частота"
#: knutprefdlg.cpp:519
msgid "&Use High-Low XFER"
msgstr "&Использовать Высокий Низкий XFER"
#: knutprefdlg.cpp:521
msgid "Number of columns :"
msgstr "Количество колонок :"
#: knutprefdlg.cpp:524 knutprefdlg.cpp:815 knutprefdlg.cpp:894
msgid "Use custom background color"
msgstr "Использовать выбранный цвет фона"
#: knutprefdlg.cpp:528 knutprefdlg.cpp:818 knutprefdlg.cpp:896
msgid "Color of background :"
msgstr "Цвет фона :"
#: knutprefdlg.cpp:532
#, fuzzy
msgid "Use dialog \"Are you sure\""
msgstr "Использовать диалог \"Вы уверенны\" :"
#: knutprefdlg.cpp:535
#, fuzzy
msgid "Use Main window when program is started"
msgstr "Использовать главное окно при старте :"
#: knutprefdlg.cpp:538
#, fuzzy
msgid "Show message window, when program reports error"
msgstr "Использовать главное окно при старте :"
#: knutprefdlg.cpp:543
msgid "Auto"
msgstr ""
#: knutprefdlg.cpp:547
msgid "Nominal Input Voltage"
msgstr "Номинальное входное напряжение"
#: knutprefdlg.cpp:550
msgid "&230 V"
msgstr "&230 В"
#: knutprefdlg.cpp:551
msgid "&120 V"
msgstr "&120 В"
#: knutprefdlg.cpp:553
msgid "Nominal Input Frequency"
msgstr "Номинальная входная частота"
#: knutprefdlg.cpp:556
msgid "&50 Hz"
msgstr "&50 Гц"
#: knutprefdlg.cpp:557
msgid "&60 Hz"
msgstr "&60 Гц"
#: knutprefdlg.cpp:628
msgid "UPS"
msgstr "UPS"
#: knutprefdlg.cpp:628
msgid "UPS Setting"
msgstr "UPS Настройки"
#: knutprefdlg.cpp:646
msgid "&Add"
msgstr "&Добавить"
#: knutprefdlg.cpp:667
#, fuzzy
msgid "Dock bar"
msgstr "Dock"
#: knutprefdlg.cpp:667
msgid "Docking Setting"
msgstr "Dock настройки"
#: knutprefdlg.cpp:671
msgid "Type of dock's showing"
msgstr "Тип показаных dock's"
#: knutprefdlg.cpp:676
msgid "Items of tooltip"
msgstr "Пункты подсказки"
#: knutprefdlg.cpp:684
msgid "&Picture"
msgstr "&Картина"
#: knutprefdlg.cpp:685
msgid "&General"
msgstr "&Основной"
#: knutprefdlg.cpp:688 knutprefdlg.cpp:799
msgid "M&anufacturer"
msgstr "Пр&оизводитель"
#: knutprefdlg.cpp:691 knutprefdlg.cpp:802
msgid "M&odel"
msgstr "&Модель"
#: knutprefdlg.cpp:694 knutprefdlg.cpp:805
msgid "&Serial"
msgstr "Пор&т"
#: knutprefdlg.cpp:697 knutprefdlg.cpp:808
msgid "&Firm. rev."
msgstr "&Firm. rev."
#: knutprefdlg.cpp:700 knutprefdlg.cpp:811
msgid "&Runtime"
msgstr "&Время работы"
#: knutprefdlg.cpp:703
msgid "&Battery Charge"
msgstr "&Зарядка батареи"
#: knutprefdlg.cpp:706
msgid "&UPS Load"
msgstr "UPS З&агрузка"
#: knutprefdlg.cpp:710
msgid "Use custom icon's background color"
msgstr "Использовать выбранный цвет фона для иконок"
#: knutprefdlg.cpp:713
msgid "Color of icon's background :"
msgstr "Цвет фона для иконок:"
#: knutprefdlg.cpp:769
msgid "Panel"
msgstr "Панель"
#: knutprefdlg.cpp:769
msgid "Panel Setting"
msgstr "Настройка панели"
#: knutprefdlg.cpp:784
msgid "UPS &Overload"
msgstr "UPS &Перегрузка"
#: knutprefdlg.cpp:787
msgid "UPS &Battery low"
msgstr "UPS &Батарея разряженная"
#: knutprefdlg.cpp:790
msgid "R&eplace battery"
msgstr "&Заменить батарею"
#: knutprefdlg.cpp:793
msgid "Ups &calibration"
msgstr "UPS &Калибровка"
#: knutprefdlg.cpp:796
msgid "&Manufac. + Model"
msgstr "П&роизводитель + Модель"
#: knutprefdlg.cpp:851
msgid "Setting Fonts"
msgstr "Настройка шрифтов"
#: knutprefdlg.cpp:858
msgid "&Use custom font"
msgstr "И&спользовать выбранный шрифт"
#: knutprefdlg.cpp:863
msgid "Main panel"
msgstr "Основная панель"
#: knutprefdlg.cpp:864
msgid "Analog panels"
msgstr "Аналоговая панель"
#: knutprefdlg.cpp:887
msgid "Analog"
msgstr "Аналог"
#: knutprefdlg.cpp:887
msgid "Setting Analog panel"
msgstr "Настройка аналоговой панели"
#: knutprefdlg.cpp:898
msgid "Use custom other colors"
msgstr "Использовать выбранные цвета"
#: knutprefdlg.cpp:900
msgid "Color of pointer :"
msgstr "Цвет точки :"
#: knutprefdlg.cpp:902
msgid "Color of OK range :"
msgstr "Цвет области OK :"
#: knutprefdlg.cpp:904
msgid "Color of warning range :"
msgstr "Цвет области предупреждения :"
#: knutprefdlg.cpp:906
msgid "Color of error range :"
msgstr "Цвет области Ошибка:"
#: knutprefdlg.cpp:908
msgid "Color of scale :"
msgstr "Цвет масштаба :"
#: knutprefdlg.cpp:910
msgid "Color of font :"
msgstr "Цвет шрифта :"
#: knutprefdlg.cpp:913
#, fuzzy
msgid "Digital processing of pointers :"
msgstr "Цвет точки :"
#: knutprefdlg.cpp:964
msgid "Nothing processing"
msgstr ""
#: knutprefdlg.cpp:965
msgid "Fast antialiasing"
msgstr ""
#: knutprefdlg.cpp:966
msgid "Fine antialiasing"
msgstr ""
#: knutprefdlg.cpp:967
msgid "Fast antialiasing and blur motion"
msgstr ""
#: knutprefdlg.cpp:968
msgid "Fine antialiasing and blur motion"
msgstr ""
#: knutprintupsvar.cpp:41
msgid "Variables"
msgstr "Переменные"
#: knutprintupsvar.cpp:50
msgid "Reload Vars"
msgstr "Перечитать переменные"
#: knutprintupsvar.cpp:52
msgid "UPS variables"
msgstr "UPS переменные"
#: knutprintupsvar.cpp:79
msgid "Value"
msgstr "Значение"
#: knutprintupsvar.cpp:81
msgid "Description"
msgstr "Описание"
#: knutprintupsvar.cpp:90
msgid "Instant Commands"
msgstr "Прямые команды"
#: knutprintupsvar.cpp:103
msgid "Read/Write Variables"
msgstr "Переменные R/W"
#: knutprintupsvar.cpp:121
msgid "Read Only Variables"
msgstr "Переменные R/O"
#: knutrwvar.cpp:40
msgid "RW variables"
msgstr "RW переменные"
#: knutrwvar.cpp:56
msgid "SET RW VARIABLE"
msgstr "УСТАНОВКА ПЕРЕМЕННЫХ RW"
#: knutrwvar.cpp:61
msgid "Variable:"
msgstr "Переменная:"
#: knutrwvar.cpp:64
msgid "Value:"
msgstr "Значение:"
#: knutvardata.cpp:43
msgid "None"
msgstr "Нет"
#: knutvardata.cpp:44
msgid "Input Voltage"
msgstr "Входное напряжение"
#: knutvardata.cpp:46
msgid "UPS Temperature"
msgstr "UPS Температура"
#: knutvardata.cpp:47
msgid "Input Frequency"
msgstr "Входная частота"
#: knutvardata.cpp:49
msgid "Outside Temperature"
msgstr "Окружающая температура"
#: knutvardata.cpp:50
msgid "Outside Humidity"
msgstr "Окружающая влажность"
#: knutvardata.cpp:51
msgid "Battery Voltage"
msgstr "Напряжение батареи"
#: knutvardata.cpp:52
msgid "Output Voltage"
msgstr "Выходное напряжение"
#: knutvardata.cpp:53
msgid "Output Current"
msgstr "Выходное текущее"
#: knutvardata.cpp:54
#, fuzzy
msgid "Output Frequency"
msgstr "Входная частота"
#: knutvardata.cpp:55
msgid "Battery Temperature"
msgstr "Температура батареи"
#: knutvardata.cpp:56
msgid "Battery Current"
msgstr "Батарея текущая"
#: knutvardata.cpp:186
#, fuzzy
msgid "No memory."
msgstr "Нет памяти."
#: knutvardata.cpp:187
msgid "No address."
msgstr "Нет адреса."
#: knutvardata.cpp:188
msgid "Unknown address."
msgstr "Неизвестный адрес."
#: knutvardata.cpp:191
msgid "Error of connection."
msgstr ""
#: knutvardata.cpp:194
#, fuzzy
msgid "No connection with server."
msgstr "Нет связи с сервером."
#: knutvardata.cpp:196
msgid "Server-client protocol or variables of NUT are unknown."
msgstr "Сервер-клиент протокол или переменные для NUT неизвестны."
#: knutvardata.cpp:197
msgid "No UPS on this address."
msgstr "UPS отсутствует на данном адресе."
#: knutvardata.cpp:198
#, fuzzy
msgid "Connection was refused by server."
msgstr "Нет связи с сервером."
#: knutvardata.cpp:200
msgid "Server doesn't receive data."
msgstr "Сервер не принимает данных."
#: knutvardata.cpp:201
msgid "Server doesn't send data."
msgstr "Сервер не пересылает данные."
#: knutvardata.cpp:202
msgid "Server doesn't answer."
msgstr "Сервер не отвечает."
#: knutvardata.cpp:204
msgid "Server returns data with unknown format."
msgstr "Сервер возвращает данные в неизвестном формате."
#: knutvardata.cpp:205
msgid "Server returns unknown data."
msgstr "Сервер возвращает неизвестные данные."
#: knutvardata.cpp:206
msgid "Command VER returns data with unknown format."
msgstr "Команда VER возвращает данные в неизвестном формате."
#: knutvardata.cpp:208
msgid "No data."
msgstr "Нет данных."
#: knutvardata.cpp:212
msgid "Access denied. Failed password ?"
msgstr "Доступ запрещен. Неправильный пароль ?"
#: knutvardata.cpp:213
msgid "UPS doesn't sent data to server (Data Stale)."
msgstr "UPS не пересылает данные на сервер (Данные устаревшие)."
#: knutvardata.cpp:214
msgid "Server doesn't know this command."
msgstr "Сервер не знает команду."
#: knutvardata.cpp:217
msgid "UPS's driver isn't connected."
msgstr "UPS не могу соединиться с драйвером."
#: knutvardata.cpp:219
msgid "Server required password."
msgstr "Сервер требует пароль."
#: knutvardata.cpp:220
msgid "Incorrect password."
msgstr "Неправильный пароль."
#: knutvardata.cpp:221
msgid "UPS doesn't response."
msgstr "UPS не отвечает."
#: knutvardata.cpp:222
msgid "Command failed."
msgstr "Неверная команда."
#: knutvardata.cpp:223
msgid "UPS doesn't know this instant command."
msgstr "UPS не знает команду."
#: knutvardata.cpp:224
msgid "UPS doesn't support this instant command."
msgstr "UPS не поддерживает команду."
#: knutvardata.cpp:225
msgid "UPS doesn't known this variable."
msgstr "UPS не знает переменную."
#: knutvardata.cpp:226
msgid "UPS doesn't support this variable."
msgstr "UPS не поддерживает переменную."
#: knutvardata.cpp:227
msgid "UPS doesn't support this value in this variable."
msgstr "UPS не поддерживает это значение для данной переменной."
#: knutvardata.cpp:228
msgid "Name of UPS is unknown."
msgstr "Имя UPS неизвестное."
#: knutvardata.cpp:230
msgid "Username has been already entered."
msgstr ""
#: knutvardata.cpp:231
msgid "Password has been already entered."
msgstr ""
#: knutvardata.cpp:233
#, fuzzy
msgid "Server doesn't send list of variables."
msgstr "Сервер не пересылает данные."
#: knutvardata.cpp:236
msgid "Unknown error."
msgstr "Неизвестная ошибка."
#: main.cpp:31
msgid "Client for Network UPS Tool"
msgstr "Клиент для Network UPS Tool"
#: main.cpp:37
msgid "Don't dock in Kicker"
msgstr "Отсутствует Dock при ударе"
#: main.cpp:47
msgid "KNutClient"
msgstr "KNutClient"
#. i18n: file ./knutclientui.rc line 13
#: rc.cpp:9
#, no-c-format
msgid "&Connection"
msgstr ""
#~ msgid "Toggle the toolbar..."
#~ msgstr "Переключатель toolbar"
#~ msgid "Toggle the statusbar..."
#~ msgstr "Переключатель статусной строки"
#~ msgid "Protocol"
#~ msgstr "Протокол"
#~ msgid "UDP"
#~ msgstr "UDP"
#~ msgid "TCP"
#~ msgstr "TCP"
#, fuzzy
#~ msgid "&Settings"
#~ msgstr "Настройки"
#~ msgid "KNutRWVar"
#~ msgstr "KNutRWVar"
#~ msgid "KNutNet"
#~ msgstr "KNutNet"
#~ msgid "KNutFrontPanel"
#~ msgstr "KNutFrontPanel"
#~ msgid "KNutMainWindow"
#~ msgstr "KNutMainWindow"
#~ msgid "KAnalog"
#~ msgstr "KAnalog"
#~ msgid "KNutNewUpsDlg"
#~ msgstr "KNutNewUpsDlg"
#~ msgid "KNutPrefDlg"
#~ msgstr "KNutPrefDlg"
#~ msgid "KNutPrintUpsVar"
#~ msgstr "KNutPrintUpsVar"
#, fuzzy
#~ msgid "Unknown Error"
#~ msgstr "Неизвестная ошибка."
#, fuzzy
#~ msgid "UPS is performing calibration."
#~ msgstr "UPS калибровка"
#~ msgid "Showing UPS variables and commands"
#~ msgstr "Показать UPS переменные и команды"
#~ msgid "Running instant commands"
#~ msgstr "Запуск прямых команд"
#~ msgid "Setting RW variables"
#~ msgstr "Установка переменных RW"
#~ msgid "Name : "
#~ msgstr "Имя : "
#~ msgid "Runtime : "
#~ msgstr "Время работы : "
#~ msgid "Name:"
#~ msgstr "Имя:"

@ -0,0 +1,918 @@
# translation of uk.po to Czech
# translation of uk.po to Russian
# translation of ru.po to Russian
# Copyright (C) 2003,2004 Free Software Foundation, Inc.
# Oleg Shevchenko <oleg@kpgaz.chernigov.ua>, 2003,2004.
# Daniel Prynych <Daniel.Prynych@alo.cz>, 2003, 2004.
#
msgid ""
msgstr ""
"Project-Id-Version: uk\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-02-21 12:13+0100\n"
"PO-Revision-Date: 2004-02-17 19:03+0100\n"
"Last-Translator: Daniel Prynych <Daniel.Prynych@alo.cz>\n"
"Language-Team: Czech <cs@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.0.2\n"
#: _translatorinfo.cpp:1
msgid ""
"_: NAME OF TRANSLATORS\n"
"Your names"
msgstr "Oleg Shevchenko"
#: _translatorinfo.cpp:3
msgid ""
"_: EMAIL OF TRANSLATORS\n"
"Your emails"
msgstr "oleg@kpgaz.chernigov.ua"
#: knutclient.cpp:86
msgid "Ready."
msgstr "Готовий."
#: knutclient.cpp:218 knutclient.cpp:219
msgid "The connection was renewed."
msgstr ""
#: knutclient.cpp:285
msgid "The connection failed. The next connection will make after %1 sec."
msgstr ""
#: knutclient.cpp:546
msgid "upsd > 1.2 doesn't support UDP. Connection is switched to TCP"
msgstr "upsd > 1.2 не підтримуєт UDP. З'єднання переключено на TCP"
#: knutclient.cpp:688 knutclient.cpp:689
msgid "Data OK"
msgstr "Дані OK"
#: knutclient.cpp:781 knutclient.cpp:782
msgid "The connection was closed by the second side (upsd)."
msgstr ""
#: knutclient.cpp:798 knutclient.cpp:799
msgid "UPS is off."
msgstr "UPS викл."
#: knutclient.cpp:802 knutclient.cpp:803
msgid "UPS is back on."
msgstr "UPS вкл."
#: knutclient.cpp:808 knutclient.cpp:809
msgid "Power is back online."
msgstr "Напругу повернуто."
#: knutclient.cpp:814 knutclient.cpp:815
msgid "UPS is on battery."
msgstr "UPS на батареї."
#: knutclient.cpp:820 knutclient.cpp:821
msgid "UPS battery is low."
msgstr "UPS батарея розряжена."
#: knutclient.cpp:824 knutclient.cpp:825
msgid "UPS battery is OK."
msgstr "UPS батарея OK."
#: knutclient.cpp:830 knutclient.cpp:831
msgid "UPS battery is bad and needs be replaced."
msgstr "UPS батарея погана і потребує заміни."
#: knutclient.cpp:836 knutclient.cpp:837
msgid "UPS is overloaded."
msgstr "UPS перевантажений."
#: knutclient.cpp:840 knutclient.cpp:841
msgid "UPS isn't overloaded."
msgstr "UPS не перевантажений."
#: knutclient.cpp:846 knutclient.cpp:847 knutdock.cpp:449
msgid "UPS is performing calibration"
msgstr "UPS починаю калібровку"
#: knutclient.cpp:850 knutclient.cpp:851
msgid "Calibration of UPS is ended."
msgstr "Калібровку UPS закінчено."
#: knutclient.cpp:856 knutclient.cpp:857
msgid "UPS is boosting incoming voltage."
msgstr "UPS підняття вхідної напруги."
#: knutclient.cpp:860 knutclient.cpp:861
msgid "Boosting of UPS is ended."
msgstr "Підняття напруги закінчено."
#: knutclient.cpp:866 knutclient.cpp:867
msgid "UPS is trimming incoming voltage."
msgstr "UPS підстройка вхідної нагруги."
#: knutclient.cpp:870 knutclient.cpp:871
msgid "Trimming of UPS is ended."
msgstr "Підстройка вхідної напруги закінчено."
#: knutclient.cpp:887 knutclient.cpp:954 knutclient.cpp:963
msgid "Switched"
msgstr "Переключити"
#: knutclient.cpp:1103 knutdock.cpp:640 knutmainwindow.cpp:781
msgid "Reconnect"
msgstr ""
#: knutdock.cpp:419 knutdock.cpp:469 knutfrontpanel.cpp:192
#: knutnewupsdlg.cpp:69 knutprintupsvar.cpp:78
msgid "Name"
msgstr "Ім'я"
#: knutdock.cpp:420 knutnewupsdlg.cpp:83
msgid "UPS name"
msgstr "UPS ім'я"
#: knutdock.cpp:421 knutnewupsdlg.cpp:77
msgid "UPS address"
msgstr "UPS адреса"
#: knutdock.cpp:422 knutdock.cpp:443 knutdock.cpp:446 knutdock.cpp:449
#: knutdock.cpp:452 knutdock.cpp:455 knutdock.cpp:458
msgid "Status : "
msgstr "Статус : "
#: knutdock.cpp:425 knutvardata.cpp:209
msgid "Connection doesn't exist."
msgstr "Зв'язок не встановлено."
#: knutdock.cpp:429 knutfrontpanel.cpp:80
msgid "UPS On line"
msgstr "UPS на лінії"
#: knutdock.cpp:433 knutfrontpanel.cpp:95
msgid "UPS On battery"
msgstr "UPS на батареї"
#: knutdock.cpp:437
msgid "UPS Of line"
msgstr "UPS на лінії"
#: knutdock.cpp:443
msgid "UPS Battery is low"
msgstr "UPS батарея розряжена"
#: knutdock.cpp:446 knutfrontpanel.cpp:138
msgid "Replace battery"
msgstr "Замінити батарею"
#: knutdock.cpp:452
msgid "UPS is Overload"
msgstr "UPS Переватаження"
#: knutdock.cpp:455
msgid "UPS is trimming voltage"
msgstr "UPS підстройка напруги"
#: knutdock.cpp:458
msgid "UPS is boosting voltage"
msgstr "UPS підняття напруги"
#: knutdock.cpp:464
msgid "Error : "
msgstr "Помилка : "
#: knutdock.cpp:467 knutfrontpanel.cpp:182
msgid "Manufac. : "
msgstr "Виробник : "
#: knutdock.cpp:471
msgid "Serial"
msgstr "Порт"
#: knutdock.cpp:473
msgid "Firmware"
msgstr "Firmware"
#: knutdock.cpp:477 knutfrontpanel.cpp:233
msgid "Runtime"
msgstr "Час роботи"
#: knutdock.cpp:477
msgid " : %1:%2 min"
msgstr " : %1:%2 мін"
#: knutdock.cpp:482 knutvardata.cpp:45
msgid "Battery Charge"
msgstr "Зарядка батареї"
#: knutdock.cpp:487 knutvardata.cpp:48
msgid "UPS Load"
msgstr "UPS Завантаження"
#: knutdock.cpp:513 knutmainwindow.cpp:663
msgid "Are you sure ?"
msgstr "Ви впевнені?"
#: knutdock.cpp:636 knutmainwindow.cpp:748
msgid "&Showing UPS variables and commands"
msgstr "Показа&ти UPS змінні та команди"
#: knutdock.cpp:637 knutmainwindow.cpp:749
msgid "&Running instant commands"
msgstr "Запуск прями&х команд"
#: knutdock.cpp:638 knutmainwindow.cpp:750
msgid "Setting R&W variables"
msgstr "Установка змін&них RW"
#: knutdock.cpp:642
msgid "&Preferences"
msgstr "Перева&ги"
#: knutdock.cpp:644
msgid "&About KNutClient"
msgstr "П&ро KNutClient"
#: knutdock.cpp:646
msgid "&Minimize"
msgstr "&Мінімізація"
#: knutdock.cpp:648
msgid "&Exit"
msgstr "Вихі&д"
#: knutfrontpanel.cpp:110
msgid "UPS Overload"
msgstr "UPS Переватаження"
#: knutfrontpanel.cpp:124
msgid "UPS Battery low"
msgstr "UPS Батарея розряжена"
#: knutfrontpanel.cpp:152
msgid "UPS calibration"
msgstr "UPS калібровка"
#: knutfrontpanel.cpp:202
msgid "Serial : "
msgstr "Serial : "
#: knutfrontpanel.cpp:212
msgid "Firm. rev. : "
msgstr "Firm. rev. : "
#: knutinstcomms.cpp:33
msgid "Instant commands"
msgstr "Прямі команди"
#: knutinstcomms.cpp:45
msgid "RUN INSTANT COMMAND"
msgstr "ВИКОНАТИ ПРЯМУ КОМАНДУ"
#: knutinstcomms.cpp:49
msgid "Command:"
msgstr "Команда:"
#: knutinstcomms.cpp:53 knutnewupsdlg.cpp:102 knutrwvar.cpp:70
msgid "User name:"
msgstr "Ім'я користувача:"
#: knutinstcomms.cpp:54 knutnewupsdlg.cpp:109 knutrwvar.cpp:71
msgid "Password:"
msgstr "Пароль:"
#: knutmainwindow.cpp:59
msgid "test of conection from 5"
msgstr ""
#: knutmainwindow.cpp:745
msgid "Quits the application"
msgstr "Вийти з програми"
#: knutmainwindow.cpp:778
msgid "&Using descriptions"
msgstr "Вико&ристовую описання"
#: knutnewupsdlg.cpp:39
msgid "New Ups"
msgstr "Новий UPS"
#: knutnewupsdlg.cpp:89
msgid "Delay (ms):"
msgstr "Затримка (мс):"
#: knutnewupsdlg.cpp:96
msgid "Port:"
msgstr "Порт:"
#: knutnewupsdlg.cpp:116
msgid "Store NUT password in configuration file"
msgstr "Зберігати NUT пароль в конфігураційному файлі"
#: knutnewupsdlg.cpp:123
msgid "Availabled UPS values"
msgstr ""
#: knutnewupsdlg.cpp:124
msgid "Selected UPS values"
msgstr ""
#: knutnewupsdlg.cpp:134
msgid "UPS Variables"
msgstr "UPS змінні"
#: knutnewupsdlg.cpp:255
msgid "No Name or UPS address"
msgstr "Відсутнє Ім'я або UPS адреса"
#: knutnewupsdlg.cpp:263
msgid "This Name exist"
msgstr "Таке Ім'я вже існує"
#: knutnewupsdlg.cpp:270
msgid "Delay must be number"
msgstr "Затримка повинна бути числовою"
#: knutnewupsdlg.cpp:276
msgid "Port must be number"
msgstr "Порт повинен бути числовим"
#: knutnewupsdlg.cpp:281
msgid "Port must be from 1025 until 65535"
msgstr "Порт повинен бути в діапазоні 1025 - 65535"
#: knutnewupsdlg.cpp:286
msgid "Delay is too small"
msgstr "Затримка дуже мала"
#: knutprefdlg.cpp:45
msgid "Preferences"
msgstr "Переваги"
#: knutprefdlg.cpp:508
msgid "Setting"
msgstr "Налаштування"
#: knutprefdlg.cpp:508
msgid "Main Setting"
msgstr "Основні налаштування"
#: knutprefdlg.cpp:516
msgid "Voltage/Frequency"
msgstr "Напруга/Частота"
#: knutprefdlg.cpp:519
msgid "&Use High-Low XFER"
msgstr "&Використовувати Високий Низький XFER"
#: knutprefdlg.cpp:521
msgid "Number of columns :"
msgstr "Кількість стовбчиків :"
#: knutprefdlg.cpp:524 knutprefdlg.cpp:815 knutprefdlg.cpp:894
msgid "Use custom background color"
msgstr "Використовувати вказаний колір фону"
#: knutprefdlg.cpp:528 knutprefdlg.cpp:818 knutprefdlg.cpp:896
msgid "Color of background :"
msgstr "Колір фону :"
#: knutprefdlg.cpp:532
#, fuzzy
msgid "Use dialog \"Are you sure\""
msgstr "Використовувати діалог \"Ви впевнені\" :"
#: knutprefdlg.cpp:535
#, fuzzy
msgid "Use Main window when program is started"
msgstr "Використовувати головне вікно при старті :"
#: knutprefdlg.cpp:538
#, fuzzy
msgid "Show message window, when program reports error"
msgstr "Використовувати головне вікно при старті :"
#: knutprefdlg.cpp:543
msgid "Auto"
msgstr ""
#: knutprefdlg.cpp:547
msgid "Nominal Input Voltage"
msgstr "Номінальна Вхідна Напруга"
#: knutprefdlg.cpp:550
msgid "&230 V"
msgstr "&230 В"
#: knutprefdlg.cpp:551
msgid "&120 V"
msgstr "&120 В"
#: knutprefdlg.cpp:553
msgid "Nominal Input Frequency"
msgstr "Номінальна Вхідна Частота"
#: knutprefdlg.cpp:556
msgid "&50 Hz"
msgstr "&50 Гц"
#: knutprefdlg.cpp:557
msgid "&60 Hz"
msgstr "&60 Гц"
#: knutprefdlg.cpp:628
msgid "UPS"
msgstr "UPS"
#: knutprefdlg.cpp:628
msgid "UPS Setting"
msgstr "UPS Налаштування"
#: knutprefdlg.cpp:646
msgid "&Add"
msgstr "&Додати"
#: knutprefdlg.cpp:667
#, fuzzy
msgid "Dock bar"
msgstr "Dock"
#: knutprefdlg.cpp:667
msgid "Docking Setting"
msgstr "Dock налаштування"
#: knutprefdlg.cpp:671
msgid "Type of dock's showing"
msgstr "Тип показаних dock's"
#: knutprefdlg.cpp:676
msgid "Items of tooltip"
msgstr "Пункти підсказки"
#: knutprefdlg.cpp:684
msgid "&Picture"
msgstr "&Картина"
#: knutprefdlg.cpp:685
msgid "&General"
msgstr "&Основний"
#: knutprefdlg.cpp:688 knutprefdlg.cpp:799
msgid "M&anufacturer"
msgstr "Ви&робник"
#: knutprefdlg.cpp:691 knutprefdlg.cpp:802
msgid "M&odel"
msgstr "&Модель"
#: knutprefdlg.cpp:694 knutprefdlg.cpp:805
msgid "&Serial"
msgstr "Пор&т"
#: knutprefdlg.cpp:697 knutprefdlg.cpp:808
msgid "&Firm. rev."
msgstr "&Firm. rev."
#: knutprefdlg.cpp:700 knutprefdlg.cpp:811
msgid "&Runtime"
msgstr "&Час роботи"
#: knutprefdlg.cpp:703
msgid "&Battery Charge"
msgstr "З&арядка батареї"
#: knutprefdlg.cpp:706
msgid "&UPS Load"
msgstr "UPS &Завантаження"
#: knutprefdlg.cpp:710
msgid "Use custom icon's background color"
msgstr "Використовувати вказаний колір фону для іконок"
#: knutprefdlg.cpp:713
msgid "Color of icon's background :"
msgstr "Колір фону для іконок :"
#: knutprefdlg.cpp:769
msgid "Panel"
msgstr "Панель"
#: knutprefdlg.cpp:769
msgid "Panel Setting"
msgstr "Налаштування панелі"
#: knutprefdlg.cpp:784
msgid "UPS &Overload"
msgstr "UPS &Перевантаження"
#: knutprefdlg.cpp:787
msgid "UPS &Battery low"
msgstr "UPS &Батарея розряжена"
#: knutprefdlg.cpp:790
msgid "R&eplace battery"
msgstr "&Замінити батарею"
#: knutprefdlg.cpp:793
msgid "Ups &calibration"
msgstr "UPS &Калібровка"
#: knutprefdlg.cpp:796
msgid "&Manufac. + Model"
msgstr "В&иробник + Модель"
#: knutprefdlg.cpp:851
msgid "Setting Fonts"
msgstr "Налаштування шрифтів"
#: knutprefdlg.cpp:858
msgid "&Use custom font"
msgstr "В&икористовувати вказаний шрифт"
#: knutprefdlg.cpp:863
msgid "Main panel"
msgstr "Основна панель"
#: knutprefdlg.cpp:864
msgid "Analog panels"
msgstr "Аналогова панель"
#: knutprefdlg.cpp:887
msgid "Analog"
msgstr "Аналог"
#: knutprefdlg.cpp:887
msgid "Setting Analog panel"
msgstr "Налаштування аналогової панелі"
#: knutprefdlg.cpp:898
msgid "Use custom other colors"
msgstr "Використовувати вказані кольори"
#: knutprefdlg.cpp:900
msgid "Color of pointer :"
msgstr "Колір крапки :"
#: knutprefdlg.cpp:902
msgid "Color of OK range :"
msgstr "Колір області OK :"
#: knutprefdlg.cpp:904
msgid "Color of warning range :"
msgstr "Колір області попередження :"
#: knutprefdlg.cpp:906
msgid "Color of error range :"
msgstr "Колір області Помилка:"
#: knutprefdlg.cpp:908
msgid "Color of scale :"
msgstr "Колір масштабу :"
#: knutprefdlg.cpp:910
msgid "Color of font :"
msgstr "Колір шрифту :"
#: knutprefdlg.cpp:913
#, fuzzy
msgid "Digital processing of pointers :"
msgstr "Колір крапки :"
#: knutprefdlg.cpp:964
msgid "Nothing processing"
msgstr ""
#: knutprefdlg.cpp:965
msgid "Fast antialiasing"
msgstr ""
#: knutprefdlg.cpp:966
msgid "Fine antialiasing"
msgstr ""
#: knutprefdlg.cpp:967
msgid "Fast antialiasing and blur motion"
msgstr ""
#: knutprefdlg.cpp:968
msgid "Fine antialiasing and blur motion"
msgstr ""
#: knutprintupsvar.cpp:41
msgid "Variables"
msgstr "Змінні"
#: knutprintupsvar.cpp:50
msgid "Reload Vars"
msgstr "Перечитати змінні"
#: knutprintupsvar.cpp:52
msgid "UPS variables"
msgstr "UPS змінні"
#: knutprintupsvar.cpp:79
msgid "Value"
msgstr "Значенння"
#: knutprintupsvar.cpp:81
msgid "Description"
msgstr "Описанння"
#: knutprintupsvar.cpp:90
msgid "Instant Commands"
msgstr "Прямі команди"
#: knutprintupsvar.cpp:103
msgid "Read/Write Variables"
msgstr "Змінні R/W"
#: knutprintupsvar.cpp:121
msgid "Read Only Variables"
msgstr "Змінні R/O"
#: knutrwvar.cpp:40
msgid "RW variables"
msgstr "RW змінні"
#: knutrwvar.cpp:56
msgid "SET RW VARIABLE"
msgstr "УСТАНОВКА ЗМІННИХ RW"
#: knutrwvar.cpp:61
msgid "Variable:"
msgstr "Змінна:"
#: knutrwvar.cpp:64
msgid "Value:"
msgstr "Значення:"
#: knutvardata.cpp:43
msgid "None"
msgstr "Ні"
#: knutvardata.cpp:44
msgid "Input Voltage"
msgstr "Вхідна напруга"
#: knutvardata.cpp:46
msgid "UPS Temperature"
msgstr "UPS Температура"
#: knutvardata.cpp:47
msgid "Input Frequency"
msgstr "Вхідная частота"
#: knutvardata.cpp:49
msgid "Outside Temperature"
msgstr "Навколишня температура"
#: knutvardata.cpp:50
msgid "Outside Humidity"
msgstr "Навколишня вологість"
#: knutvardata.cpp:51
msgid "Battery Voltage"
msgstr "Напруга батареї"
#: knutvardata.cpp:52
msgid "Output Voltage"
msgstr "Вихідна напруга"
#: knutvardata.cpp:53
msgid "Output Current"
msgstr "Вихідне поточне"
#: knutvardata.cpp:54
#, fuzzy
msgid "Output Frequency"
msgstr "Вхідная частота"
#: knutvardata.cpp:55
msgid "Battery Temperature"
msgstr "Температура батареї"
#: knutvardata.cpp:56
msgid "Battery Current"
msgstr "Батарея поточна"
#: knutvardata.cpp:186
#, fuzzy
msgid "No memory."
msgstr "Недостатньо пам'яті."
#: knutvardata.cpp:187
msgid "No address."
msgstr "Адрес відсутній."
#: knutvardata.cpp:188
msgid "Unknown address."
msgstr "Невідомий адрес."
#: knutvardata.cpp:191
msgid "Error of connection."
msgstr ""
#: knutvardata.cpp:194
#, fuzzy
msgid "No connection with server."
msgstr "Зв'язок із сервером відсутній."
#: knutvardata.cpp:196
msgid "Server-client protocol or variables of NUT are unknown."
msgstr "Сервер-клієнт протокол або змінні для NUT невідомі."
#: knutvardata.cpp:197
msgid "No UPS on this address."
msgstr "UPS відсутній на даному адресі."
#: knutvardata.cpp:198
#, fuzzy
msgid "Connection was refused by server."
msgstr "Зв'язок із сервером відсутній."
#: knutvardata.cpp:200
msgid "Server doesn't receive data."
msgstr "Сервер не приймає данні."
#: knutvardata.cpp:201
msgid "Server doesn't send data."
msgstr "Сервер не пересилає дані."
#: knutvardata.cpp:202
msgid "Server doesn't answer."
msgstr "Сервер не відповідає."
#: knutvardata.cpp:204
msgid "Server returns data with unknown format."
msgstr "Сервер повертає данні в невідомому форматі."
#: knutvardata.cpp:205
msgid "Server returns unknown data."
msgstr "Сервер повертає невідомі данні."
#: knutvardata.cpp:206
msgid "Command VER returns data with unknown format."
msgstr "Команда VER повертає данні в невідомому форматі."
#: knutvardata.cpp:208
msgid "No data."
msgstr "Дані відсутні."
#: knutvardata.cpp:212
msgid "Access denied. Failed password ?"
msgstr "Доступ заборонено. Невірний пароль ?"
#: knutvardata.cpp:213
msgid "UPS doesn't sent data to server (Data Stale)."
msgstr "UPS не пересилає дані на сервер (Дані застарілі)."
#: knutvardata.cpp:214
msgid "Server doesn't know this command."
msgstr "Сервер не знає команду."
#: knutvardata.cpp:217
msgid "UPS's driver isn't connected."
msgstr "UPS не можу приєднатися до драйверу."
#: knutvardata.cpp:219
msgid "Server required password."
msgstr "Сервер потребує пароль."
#: knutvardata.cpp:220
msgid "Incorrect password."
msgstr "Невірний пароль."
#: knutvardata.cpp:221
msgid "UPS doesn't response."
msgstr "UPS не відповідає."
#: knutvardata.cpp:222
msgid "Command failed."
msgstr "Невірна команда."
#: knutvardata.cpp:223
msgid "UPS doesn't know this instant command."
msgstr "UPS не знає таку команду."
#: knutvardata.cpp:224
msgid "UPS doesn't support this instant command."
msgstr "UPS не підтримує команду."
#: knutvardata.cpp:225
msgid "UPS doesn't known this variable."
msgstr "UPS не знає таку змінну."
#: knutvardata.cpp:226
msgid "UPS doesn't support this variable."
msgstr "UPS не підтримує змінну."
#: knutvardata.cpp:227
msgid "UPS doesn't support this value in this variable."
msgstr "UPS не підтримує таке значення для даної змінної."
#: knutvardata.cpp:228
msgid "Name of UPS is unknown."
msgstr "Ім'я UPS невідоме."
#: knutvardata.cpp:230
msgid "Username has been already entered."
msgstr ""
#: knutvardata.cpp:231
msgid "Password has been already entered."
msgstr ""
#: knutvardata.cpp:233
#, fuzzy
msgid "Server doesn't send list of variables."
msgstr "Сервер не пересилає дані."
#: knutvardata.cpp:236
msgid "Unknown error."
msgstr "Невідома помилка."
#: main.cpp:31
msgid "Client for Network UPS Tool"
msgstr "Клієнт для Network UPS Tool"
#: main.cpp:37
msgid "Don't dock in Kicker"
msgstr "Відсутній dock при ударі"
#: main.cpp:47
msgid "KNutClient"
msgstr "KNutClient"
#. i18n: file ./knutclientui.rc line 13
#: rc.cpp:9
#, no-c-format
msgid "&Connection"
msgstr ""
#~ msgid "Toggle the toolbar..."
#~ msgstr "Перемикач toolbar..."
#~ msgid "Toggle the statusbar..."
#~ msgstr "Перемикач статусної стрічки..."
#~ msgid "Protocol"
#~ msgstr "Протокол"
#~ msgid "UDP"
#~ msgstr "UDP"
#~ msgid "TCP"
#~ msgstr "TCP"
#, fuzzy
#~ msgid "&Settings"
#~ msgstr "Налаштування"
#~ msgid "KNutRWVar"
#~ msgstr "KNutRWVar"
#~ msgid "KNutNet"
#~ msgstr "KNutNet"
#~ msgid "KNutFrontPanel"
#~ msgstr "KNutFrontPanel"
#~ msgid "KNutMainWindow"
#~ msgstr "KNutMainWindow"
#~ msgid "KAnalog"
#~ msgstr "KAnalog"
#~ msgid "KNutNewUpsDlg"
#~ msgstr "KNutNewUpsDlg"
#~ msgid "KNutPrefDlg"
#~ msgstr "KNutPrefDlg"
#~ msgid "KNutPrintUpsVar"
#~ msgstr "KNutPrintUpsVar"
#, fuzzy
#~ msgid "Unknown Error"
#~ msgstr "Невідома помилка."
#, fuzzy
#~ msgid "UPS is performing calibration."
#~ msgstr "UPS калібровка"
#~ msgid "Showing UPS variables and commands"
#~ msgstr "Показати UPS змінні та команди"
#~ msgid "Running instant commands"
#~ msgstr "Запуск прямих команд"
#~ msgid "Setting RW variables"
#~ msgstr "Установка змінних RW"
#~ msgid "Name : "
#~ msgstr "Ім'я : "
#~ msgid "Runtime : "
#~ msgstr "Час работи : "
#~ msgid "Name:"
#~ msgstr "Ім'я:"

@ -0,0 +1,6 @@
METASOURCES = AUTO
kncdatadir = specs
noinst_HEADERS = knutclient.spec.fedora.10 knutclient.spec.fedora.5 \
knutclient.spec.fedora.8 knutclient.spec.fedora.9 knutclient.spec.mandrake.10.1 \
knutclient.spec.mandriva.2006 knutclient.spec.mandriva.2009

@ -0,0 +1,58 @@
Summary: NUT GUI Interface
Name: knutclient
Version: 0.9.5
Release: 1
License: GPL
Vendor: Daniel Prynych <Daniel@prynych.cz>
Url: http://www.knut.noveradsl.cz/knutclient
Packager: Daniel Prynych <Daniel@prynych.cz>
Group: Applications/System
Prefix: /usr
Source: knutclient-0.9.5.tar.gz
BuildRoot: %{_tmppath}/build-root-%{name}
%description
Knutclient is a GUI interface for UPS system NUT
%prep
%setup
make -f Makefile.cvs
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} $LOCALFLAGS
%build
# Setup for parallel builds
numprocs=`egrep -c ^cpu[0-9]+ /proc/stat || :`
if [ "$numprocs" = "0" ]; then
numprocs=1
fi
make -j$numprocs
%install
export QA_RPATHS=$[ 0x0001|0x0010 ]
make install-strip DESTDIR=$RPM_BUILD_ROOT
cd $RPM_BUILD_ROOT
#mkdir -p usr/share/applications/
#cp -a usr/share/applnk/Applications/knutclient.desktop usr/share/applications/
#rm -rf usr/share/applnk
# as defattr point to root,root this will not work
#chown desktop.desktop kde-knutclient.desktop
cd $RPM_BUILD_ROOT
find . -type d | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > $RPM_BUILD_DIR/file.list.%{name}
find . -type f | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.%{name}
find . -type l | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.%{name}
%clean
rm -rf $RPM_BUILD_ROOT/*
rm -rf $RPM_BUILD_DIR/%{name}
rm -rf ../file.list.%{name}
%files -f ../file.list.%{name}
%defattr(-,root,root,0755)

@ -0,0 +1,56 @@
Summary: NUT GUI Interface
Name: knutclient
Version: 0.9.5
Release: 1
License: GPL
Vendor: Daniel Prynych <Daniel.Prynych@alo.cz>
Url: http://www.knut.noveradsl.cz/knutclient
Packager: Daniel Prynych <Daniel.Prynych@alo.cz>
Group: Applications/System
Prefix: /usr
Source: knutclient-0.9.5.tar.gz
BuildRoot: %{_tmppath}/build-root-%{name}
%description
Knutclient is a GUI interface for UPS system NUT
%prep
%setup
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} $LOCALFLAGS
%build
# Setup for parallel builds
numprocs=`egrep -c ^cpu[0-9]+ /proc/stat || :`
if [ "$numprocs" = "0" ]; then
numprocs=1
fi
make -j$numprocs
%install
make install-strip DESTDIR=$RPM_BUILD_ROOT
cd $RPM_BUILD_ROOT
#mkdir -p usr/share/applications/
#cp -a usr/share/applnk/Applications/knutclient.desktop usr/share/applications/
#rm -rf usr/share/applnk
# as defattr point to root,root this will not work
#chown desktop.desktop kde-knutclient.desktop
cd $RPM_BUILD_ROOT
find . -type d | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > $RPM_BUILD_DIR/file.list.%{name}
find . -type f | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.%{name}
find . -type l | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.%{name}
%clean
rm -rf $RPM_BUILD_ROOT/*
rm -rf $RPM_BUILD_DIR/%{name}
rm -rf ../file.list.%{name}
%files -f ../file.list.%{name}
%defattr(-,root,root,0755)

@ -0,0 +1,60 @@
Summary: NUT GUI Interface
Name: knutclient
Version: 0.9.5
Release: 1
License: GNU GPL
Vendor: Daniel Prynych <Daniel@prynych.cz>
Url: http://www.knut.noveradsl.cz/knutclient
Packager: Daniel Prynych <Daniel@prynych.cz>
Group: Applications/System
Prefix: /usr
Source: knutclient-0.9.5.tar.gz
BuildRoot: %{_tmppath}/build-root-%{name}
%description
Knutclient is a GUI interface for UPS system NUT
%prep
%setup
make -f Makefile.cvs
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} $LOCALFLAGS
%build
# Setup for parallel builds
numprocs=`egrep -c ^cpu[0-9]+ /proc/stat || :`
if [ "$numprocs" = "0" ]; then
numprocs=1
fi
make -j$numprocs
%install
make install-strip DESTDIR=$RPM_BUILD_ROOT
cd $RPM_BUILD_ROOT
#mkdir -p var/lib/menu/kde/Applications/Extras/Accessories/
#mkdir -p usr/share/applications/
#cp -a usr/share/applnk/Utilities/knutclient.desktop usr/share/applications/
#rm -rf usr/share/applnk
#cd var/lib/menu/kde/Applications/Extras/Accessories/
#ln -s /usr/share/applications/knutclient.desktop kde-knutclient.desktop
# as defattr point to root,root this will not work
#chown desktop.desktop kde-knutclient.desktop
cd $RPM_BUILD_ROOT
find . -type d | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > $RPM_BUILD_DIR/file.list.%{name}
find . -type f | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.%{name}
find . -type l | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.%{name}
%clean
rm -rf $RPM_BUILD_ROOT/*
rm -rf $RPM_BUILD_DIR/%{name}
rm -rf ../file.list.%{name}
%files -f ../file.list.%{name}
%defattr(-,root,root,0755)

@ -0,0 +1,60 @@
Summary: NUT GUI Interface
Name: knutclient
Version: 0.9.5
Release: 1
License: GNU GPL
Vendor: Daniel Prynych <Daniel@prynych.cz>
Url: http://www.knut.noveradsl.cz/knutclient
Packager: Daniel Prynych <Daniel@prynych.cz>
Group: Applications/System
Prefix: /usr
Source: knutclient-0.9.5.tar.gz
BuildRoot: %{_tmppath}/build-root-%{name}
%description
Knutclient is a GUI interface for UPS system NUT
%prep
%setup
make -f Makefile.cvs
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} $LOCALFLAGS
%build
# Setup for parallel builds
numprocs=`egrep -c ^cpu[0-9]+ /proc/stat || :`
if [ "$numprocs" = "0" ]; then
numprocs=1
fi
make -j$numprocs
%install
make install-strip DESTDIR=$RPM_BUILD_ROOT
cd $RPM_BUILD_ROOT
#mkdir -p var/lib/menu/kde/Applications/Extras/Accessories/
#mkdir -p usr/share/applications/
#cp -a usr/share/applnk/Utilities/knutclient.desktop usr/share/applications/
#rm -rf usr/share/applnk
#cd var/lib/menu/kde/Applications/Extras/Accessories/
#ln -s /usr/share/applications/knutclient.desktop kde-knutclient.desktop
# as defattr point to root,root this will not work
#chown desktop.desktop kde-knutclient.desktop
cd $RPM_BUILD_ROOT
find . -type d | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > $RPM_BUILD_DIR/file.list.%{name}
find . -type f | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.%{name}
find . -type l | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.%{name}
%clean
rm -rf $RPM_BUILD_ROOT/*
rm -rf $RPM_BUILD_DIR/%{name}
rm -rf ../file.list.%{name}
%files -f ../file.list.%{name}
%defattr(-,root,root,0755)

@ -0,0 +1,100 @@
Summary: NUT GUI Interface
Name: knutclient
Version: 0.9.5
Release: 1
License: GPL
Url: http://www.alo.cz/knutclient
Group: Monitoring
Source0: ftp://ftp.buzuluk.cz/pub/alo/knutclient/stable/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
%description
Knutclient is a GUI interface for UPS system NUT
%prep
%setup
sh admin/cvs.sh cvs
%build
CFLAGS="$RPM_OPT_FLAGS" \
CXXFLAGS="$RPM_OPT_FLAGS" \
./configure --prefix=%{_prefix} \
--libdir=%{_libdir} \
--enable-mt \
--disable-rpath
%make
%install
make install-strip DESTDIR=%buildroot
install -d %buildroot/%_menudir
cat > %buildroot/%_menudir/%{name} <<EOF
?package(%{name}):\
command="/usr/bin/knutclient"\
title="KNutClient"\
icon="knutclient.png"\
longtitle="A GUI interface for UPS system NUT"\
needs="X11"\
section="Applications/Monitoring"
EOF
%find_lang %{name}
%clean
rm -rf %{buildroot}
%post
%{update_menus}
%postun
%{clean_menus}
%files -f %name.lang
%defattr(-,root,root)
%doc README AUTHORS ChangeLog INSTALL TODO COPYING
%{_bindir}/knutclient
%{_menudir}/%{name}
%{_datadir}/applnk/Utilities/knutclient.desktop
%dir %{_datadir}/apps/knutclient
%{_datadir}/apps/knutclient/knutclientui.rc
%{_docdir}/HTML/*/knutclient
%{_iconsdir}/??color/??x??/apps/knutclient.png
%{_iconsdir}/??color/??x??/apps/knutclienterr.png
%{_iconsdir}/??color/??x??/apps/knutclientconn.png
%dir %{_datadir}/apps/knutclient/pics/knc_conn.png
%dir %{_datadir}/apps/knutclient/pics/knc_error.png
%dir %{_datadir}/apps/knutclient/pics/knc_main.png
%changelog
* Fri Dec 19 2003 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 0.7.4-1mdk
- New release
* Mon Nov 10 2003 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 0.7.3-3mdk
- Correction changelog
* Mon Nov 10 2003 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 0.7.3-2mdk
- Correction Buildrequires
* Fri Nov 07 2003 Thierry Vignaud <tvignaud@mandrakesoft.com> 0.7.3-1mdk
- new release
* Fri Jul 25 2003 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 0.6.3-1mdk
- New release
* Fri Jul 18 2003 Laurent MONTEL <lmontel@mandrakesoft.com> 0.6.0-3mdk
- Rebuild
* Wed Apr 30 2003 Lenny Cartier <lenny@mandrakesoft.com> 0.6.0-2mdk
- buildrequires
* Wed Jan 08 2003 Lenny Cartier <lenny@mandrakesoft.com> 0.6.0-1mdk
- 0.6.0
* Tue Aug 27 2002 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 0.5.0-2mdk
- New release
* Mon Aug 19 2002 Laurent Culioli <laurent@pschit.net> 0.4.1-4mdk
- rebuild with gcc3.2
* Sat Jul 27 2002 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 0.4.1-3mdk
- Mandrake adaptions
- Creation of patch for qt3 detection in configure
- Creation of french po file

@ -0,0 +1,111 @@
Summary: NUT GUI Interface
Name: knutclient
Version: 0.9.5
Release: 1
License: GPL
Url: http://www.knut.noveradsl.cz/knutclient
Group: Monitoring
Source0: ftp://ftp.buzuluk.cz/pub/alo/knutclient/stable/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
%description
Knutclient is a GUI interface for UPS system NUT
%prep
%setup
sh admin/cvs.sh cvs
%build
CFLAGS="$RPM_OPT_FLAGS" \
CXXFLAGS="$RPM_OPT_FLAGS" \
kde_htmldir=/usr/share/doc/HTML \
./configure --prefix=%{_prefix} \
--libdir=%{_libdir} \
--enable-mt \
--disable-rpath
%make
%install
make install-strip DESTDIR=%buildroot
install -d %buildroot/%_menudir
cat > %buildroot/%_menudir/%{name} <<EOF
?package(%{name}):\
command="/usr/bin/knutclient"\
title="KNutClient"\
icon="knutclient.png"\
longtitle="A GUI interface for UPS system NUT"\
needs="X11"\
section="Applications/Monitoring"
EOF
%find_lang %{name}
%clean
rm -rf %{buildroot}
%post
%{update_menus}
%postun
%{clean_menus}
%files -f %name.lang
%defattr(-,root,root)
%doc README AUTHORS ChangeLog INSTALL TODO COPYING
%{_bindir}/knutclient
%{_menudir}/%{name}
%{_datadir}/applnk/Utilities/knutclient.desktop
%dir %{_datadir}/apps/knutclient
%{_datadir}/apps/knutclient/knutclientui.rc
%{_docdir}/HTML/*/knutclient
%{_docdir}/kde/HTML/*/knutclient
%{_iconsdir}/??color/??x??/apps/knutclient.png
%{_iconsdir}/??color/??x??/apps/knutclienterr.png
%{_iconsdir}/??color/??x??/apps/knutclientconn.png
%dir %{_datadir}/apps/knutclient/pics/knc_conn.png
%dir %{_datadir}/apps/knutclient/pics/knc_error.png
%dir %{_datadir}/apps/knutclient/pics/knc_main.png
%dir %{_datadir}/apps/knutclient/pics/knc_analog.png
%dir %{_datadir}/apps/knutclient/pics/knc_batt.png
%dir %{_datadir}/apps/knutclient/pics/knc_dock.png
%dir %{_datadir}/apps/knutclient/pics/knc_mpref.png
%dir %{_datadir}/apps/knutclient/pics/knc_mset.png
%dir %{_datadir}/apps/knutclient/pics/knc_panel.png
%dir %{_datadir}/apps/knutclient/pics/knc_ups.png
%dir %{_datadir}/apps/knutclient/pics/knc_upses.png
%changelog
* Fri Dec 19 2003 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 0.7.4-1mdk
- New release
* Mon Nov 10 2003 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 0.7.3-3mdk
- Correction changelog
* Mon Nov 10 2003 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 0.7.3-2mdk
- Correction Buildrequires
* Fri Nov 07 2003 Thierry Vignaud <tvignaud@mandrakesoft.com> 0.7.3-1mdk
- new release
* Fri Jul 25 2003 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 0.6.3-1mdk
- New release
* Fri Jul 18 2003 Laurent MONTEL <lmontel@mandrakesoft.com> 0.6.0-3mdk
- Rebuild
* Wed Apr 30 2003 Lenny Cartier <lenny@mandrakesoft.com> 0.6.0-2mdk
- buildrequires
* Wed Jan 08 2003 Lenny Cartier <lenny@mandrakesoft.com> 0.6.0-1mdk
- 0.6.0
* Tue Aug 27 2002 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 0.5.0-2mdk
- New release
* Mon Aug 19 2002 Laurent Culioli <laurent@pschit.net> 0.4.1-4mdk
- rebuild with gcc3.2
* Sat Jul 27 2002 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 0.4.1-3mdk
- Mandrake adaptions
- Creation of patch for qt3 detection in configure
- Creation of french po file

@ -0,0 +1,124 @@
Summary: NUT GUI Interface
Name: knutclient
Version: 0.9.5
Release: 1
License: GPL
Url: http://www.knut.noveradsl.cz/knutclient
Group: Monitoring
Source0: ftp://ftp.buzuluk.cz/pub/alo/knutclient/stable/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
%description
Knutclient is a GUI interface for UPS system NUT
%prep
%setup
sh admin/cvs.sh cvs
%build
CFLAGS="$RPM_OPT_FLAGS" \
CXXFLAGS="$RPM_OPT_FLAGS" \
export kde_htmldir=/opt/kde3/share/doc/HTML \
export KDEDIRS=/usr:/opt/kde3
./configure --prefix=/opt/kde3 \
--libdir=%{_libdir} \
--enable-mt \
--disable-rpath
%make
%install
make install-strip DESTDIR=%buildroot
install -d %buildroot/%_menudir
cat > %buildroot/%_menudir/%{name} <<EOF
?package(%{name}):\
command="/opt/kde3/bin/knutclient"\
title="KNutClient"\
icon="knutclient.png"\
longtitle="A GUI interface for UPS system NUT"\
needs="X11"\
section="Applications/Monitoring"
EOF
mkdir -p %buildroot/opt/kde3/share/applications/kde/
mv %buildroot/opt/kde3/share/applnk/Utilities/knutclient.desktop %buildroot/opt/kde3/share/applications/kde/
rmdir %buildroot/opt/kde3/share/applnk/Utilities
rm %buildroot/opt/kde3/share/applications/kde/Utilities/knutclient.desktop
rmdir %buildroot/opt/kde3/share/applications/kde/Utilities
%find_lang %{name}
%clean
rm -rf %{buildroot}
%post
%{update_menus}
%postun
%{clean_menus}
%files -f %name.lang
%defattr(-,root,root)
%doc README AUTHORS ChangeLog INSTALL TODO COPYING
/opt/kde3/bin/knutclient
%{_menudir}/%{name}
/opt/kde3/share/applications/kde/knutclient.desktop
%dir /opt/kde3/share/apps/knutclient
/opt/kde3/share/apps/knutclient/knutclientui.rc
/opt/kde3/share/doc/HTML/*/knutclient
/opt/kde3/share/icons/??color/??x??/apps/knutclient.png
/opt/kde3/share/icons/??color/??x??/apps/knutclienterr.png
/opt/kde3/share/icons/??color/??x??/apps/knutclientconn.png
/opt/kde3/share/apps/knutclient/pics/knc_conn.png
/opt/kde3/share/apps/knutclient/pics/knc_error.png
/opt/kde3/share/apps/knutclient/pics/knc_main.png
/opt/kde3/share/apps/knutclient/pics/knc_analog.png
/opt/kde3/share/apps/knutclient/pics/knc_batt.png
/opt/kde3/share/apps/knutclient/pics/knc_dock.png
/opt/kde3/share/apps/knutclient/pics/knc_mpref.png
/opt/kde3/share/apps/knutclient/pics/knc_mset.png
/opt/kde3/share/apps/knutclient/pics/knc_panel.png
/opt/kde3/share/apps/knutclient/pics/knc_ups.png
/opt/kde3/share/apps/knutclient/pics/knc_upses.png
%changelog
* Sat Mar 21 2009 Daniel Prynych <Daniel@prynych.cz> 0.9.5-1
- changed part files
* Fri Dec 19 2003 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 0.7.4-1mdk
- New release
* Mon Nov 10 2003 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 0.7.3-3mdk
- Correction changelog
* Mon Nov 10 2003 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 0.7.3-2mdk
- Correction Buildrequires
* Fri Nov 07 2003 Thierry Vignaud <tvignaud@mandrakesoft.com> 0.7.3-1mdk
- new release
* Fri Jul 25 2003 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 0.6.3-1mdk
- New release
* Fri Jul 18 2003 Laurent MONTEL <lmontel@mandrakesoft.com> 0.6.0-3mdk
- Rebuild
* Wed Apr 30 2003 Lenny Cartier <lenny@mandrakesoft.com> 0.6.0-2mdk
- buildrequires
* Wed Jan 08 2003 Lenny Cartier <lenny@mandrakesoft.com> 0.6.0-1mdk
- 0.6.0
* Tue Aug 27 2002 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 0.5.0-2mdk
- New release
* Mon Aug 19 2002 Laurent Culioli <laurent@pschit.net> 0.4.1-4mdk
- rebuild with gcc3.2
* Sat Jul 27 2002 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 0.4.1-3mdk
- Mandrake adaptions
- Creation of patch for qt3 detection in configure
- Creation of french po file

@ -0,0 +1,41 @@
# set the include path for X, qt and KDE
INCLUDES = $(all_includes)
# these are the headers for your project
noinst_HEADERS = knutclient.h knutmainwindow.h knutprefdlg.h knutnewupsdlg.h \
knutupsdata.h knutvardata.h knutnet.h knutfrontpanel.h knutpanelmeter.h knutdock.h \
knutprintupsvar.h knutinstcomms.h knutrwvar.h knutanalog.h knutmessagemanager.h \
knutmessage.h
# let automoc handle all of the meta source files (moc)
METASOURCES = AUTO
messages: rc.cpp
$(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
$(XGETTEXT) *.cpp -o $(podir)/knutclient.pot
KDE_ICON = AUTO
#########################################################################
# APPLICATION SECTION
#########################################################################
# this is the program that gets installed. it's name is used for all
# of the other Makefile.am variables
bin_PROGRAMS = knutclient
# the application source, library search path, and link libraries
knutclient_SOURCES = main.cpp knutclient.cpp knutmainwindow.cpp knutprefdlg.cpp \
knutnewupsdlg.cpp knutupsdata.cpp knutvardata.cpp knutnet.cpp knutfrontpanel.cpp \
knutpanelmeter.cpp knutdock.cpp knutprintupsvar.cpp knutinstcomms.cpp knutrwvar.cpp \
knutanalog.cpp knutmessagemanager.cpp knutmessage.cpp
knutclient_LDFLAGS = $(KDE_RPATH) $(all_libraries)
knutclient_LDADD = $(LIB_KDEUI)
# this is where the desktop file will go
shelldesktopdir = $(kde_appsdir)/Utilities
shelldesktop_DATA = knutclient.desktop
# this is where the shell's XML-GUI resource file goes
shellrcdir = $(kde_datadir)/knutclient
shellrc_DATA = knutclientui.rc

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,911 @@
/***************************************************************************
* Copyright (C) 2007 by Daniel Prynych *
* Daniel.Prynych@buzuluk.cz *
* *
* 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 "knutanalog.h"
/* pocitani uhlu */
/* nula je ve 3 hodiny */
/* prirustek je kladny ve smeru hod rucicek */
#include <stdio.h>
#include <math.h>
#include <qpainter.h>
#include <qframe.h>
#include <qfontmetrics.h>
#include <qfont.h>
#include <qbitmap.h>
#include <qpaintdevice.h>
#include <qcolor.h>
#include <kapp.h>
KNutAnalog::KNutAnalog( QWidget *parent, const char *name, int bottomLimit, int topLimit, int typeOfView, int countOfParts, int countOfSubParts, QColor pointerColor, QColor scaleColor, QColor textColor, QFont *analogFonts, int qualityOfPointer, bool makeBG )
: QFrame( parent, name ), m_bottomLimit(bottomLimit), m_topLimit(topLimit), m_typeOfView(typeOfView), m_countOfParts(countOfParts), m_countOfSubParts(countOfSubParts), m_pointerColor(pointerColor), m_scaleColor(scaleColor) ,m_textColor(textColor) {
if ( qualityOfPointer==0) {
m_speedOfAAlias=none;
m_makeBlurMotion=false;
}
else {
if ((qualityOfPointer==2) || (qualityOfPointer== 4)) m_speedOfAAlias=slow; else m_speedOfAAlias=fast;
if ((qualityOfPointer==3) || (qualityOfPointer== 4)) m_makeBlurMotion=true; else m_makeBlurMotion=false;
}
// m_showBackGround = true;
// m_showPointer = true;
if (m_countOfParts > 6) m_countOfParts=6;
else if (m_countOfParts < 2) m_countOfParts=2;
if ( m_countOfSubParts > 6 ) m_countOfSubParts = 6;
if ( m_countOfSubParts == 0 ) {
if (m_countOfParts < 4) m_countOfSubParts =5;
else {
if (m_countOfParts < 6) m_countOfSubParts=4;
else m_countOfSubParts =3;
}
}
m_valueOfPointer=m_bottomLimit;
/* hodnoty zavisle na typu zobrazeni */
switch (m_typeOfView) {
case 1 :
m_direction = 1; /* smer =1 ve smeru (clockwise), smer =-1 proti smeru hod. rucicek */
m_angleOfViewer=270;
m_startAngle=225;
m_centerX=m_widthOfBackGround/2;
m_centerY=m_widthOfBackGround/2;
m_widthOfScale=118;
m_radiusOfScaleNumbers=37;
break;
case 2 :
m_direction = -1; /* smer =1 ve smeru (clockwise), smer =-1 proti smeru hod. rucicek */
m_angleOfViewer=90;
m_startAngle=0;
m_centerX=13;
m_centerY=110;
m_widthOfScale=210;
m_radiusOfScaleNumbers=83;
break;
case 3 :
m_direction = 1; /* smer =1 ve smeru (clockwise), smer =-1 proti smeru hod. rucicek */
m_angleOfViewer=90;
m_startAngle=135;
m_centerX=m_widthOfBackGround/2;
m_centerY=m_widthOfBackGround-15;
m_widthOfScale=170;
m_radiusOfScaleNumbers=65;
break;
}
// konec hodnot zavislych na typu zobrazeni
if (analogFonts == 0) { // pokud neni predan font nastavi se systemovy font
m_scaleFont = kapp->font();
m_textFont = kapp->font();
}
else {
m_scaleFont= *analogFonts;
m_textFont= *analogFonts;
}
m_countOfColorParts = 0;
setMinimumSize( AnalogWidth, AnalogWidth );
setMaximumSize( AnalogWidth, AnalogWidth );
setFrameStyle( QFrame::Box | QFrame::Raised );
setLineWidth( 2 );
m_backgroudLayerBig = new QPixmap( (AnalogWidth-8) * 3,(AnalogWidth-8)*3 );
m_scaleLayerBig = new QPixmap ( (AnalogWidth-8)*3, (AnalogWidth-8)*3 ); //
m_scaleLayerSmall = new QPixmap ( (AnalogWidth-8), (AnalogWidth-8)); //
m_wholeLayer = new QPixmap ( AnalogWidth-8, AnalogWidth-8 ); //
m_pointerLayerBig = new QPixmap ( (AnalogWidth-8)*3, (AnalogWidth-8)*3 ); //
m_pointerLayerSmall = new QPixmap ( (AnalogWidth-8), (AnalogWidth-8)); //
setDefaultArcColor(false); // sets standard registers // nastavime standartni registry
if (makeBG) {
paintBackGround();
m_showBackGround = true;
m_showPointer = true;
}
}
KNutAnalog::~KNutAnalog() {
delete (m_backgroudLayerBig);
delete (m_scaleLayerBig);
delete (m_scaleLayerSmall);
delete (m_pointerLayerBig);
delete (m_pointerLayerSmall);
delete (m_wholeLayer);
}
void KNutAnalog::makeBackground (bool run) {
paintBackGround();
m_showBackGround = true;
if (run) {
repaint();
}
}
void KNutAnalog::setText (QString inscription, QString text_up, bool run) {
m_inscription=inscription;
AnMJ=text_up;
if (run) {
paintBackGround();
m_showBackGround = true;
repaint();
}
}
void KNutAnalog::setDefaultArcColor(bool run) {
m_arcColors[0] = Qt::white;
m_arcColors[1] = Qt::green;
m_arcColors[2] = Qt::yellow;
m_arcColors[3] = Qt::red;
m_arcColors[4] = Qt::blue;
m_arcColors[5] = Qt::cyan;
m_arcColors[6] = Qt::magenta;
m_arcColors[7] = Qt::gray;
m_arcColors[8] = Qt::black;
if (run) {
paintBackGround();
m_showBackGround=true;
repaint();
}
}
void KNutAnalog::setArcColor(int reg, QColor color ) {
if ((reg > -1) && (reg < 9)) m_arcColors[reg] = color;
}
void KNutAnalog::addArc (double startOfCircle, double endOfCircle, int regColor, bool run) {
if (m_countOfColorParts < 5) {
m_extentOfDye[m_countOfColorParts].start=startOfCircle;
m_extentOfDye[m_countOfColorParts].end=endOfCircle;
if ((regColor <0) || (regColor > 8)) regColor=0;
m_extentOfDye[m_countOfColorParts++].color=regColor;
}
if (run) {
paintBackGround();
m_showBackGround = true;
repaint ();
}
}
void KNutAnalog::delArc (bool run) {
m_countOfColorParts = 0;
if (run) {
paintBackGround();
m_showBackGround = true;
repaint ();
}
}
void KNutAnalog::setRange (int Astart, int Aend , bool run) {
m_bottomLimit=Astart;
m_topLimit=Aend;
// pokud zmenime rozasah musime prekrelit i rucicku
m_showPointer = true;
if (run) {
paintBackGround();
m_showBackGround = true;
repaint ();
}
}
void KNutAnalog::setMember (int Count, bool run) {
m_countOfParts=Count;
if (run) {
paintBackGround();
m_showBackGround = true;
repaint ();
}
}
void KNutAnalog::setPointerColor (QColor pointerColor, bool run ) {
m_pointerColor = pointerColor;
paintPointer();
m_showPointer = true;
if (run) {
repaint ();
}
}
void KNutAnalog::repaintPointer ( bool run ) {
paintPointer();
m_showPointer = true;
if (run) {
repaint ();
}
}
void KNutAnalog::setFontColor (QColor fontColor, bool run ) {
m_textColor = fontColor;
// paintBackGround();
// m_showBackGround = true;
if (run) {
paintBackGround();
m_showBackGround = true;
repaint ();
}
}
void KNutAnalog::setScaleColor (QColor scaleColor, bool run) {
m_scaleColor = scaleColor;
if (run) {
paintBackGround();
m_showBackGround = true;
repaint ();
}
}
void KNutAnalog::setDigitalProcesing (int qualityOfPointer, bool run ) {
if (qualityOfPointer < 0) qualityOfPointer = 0;
if (qualityOfPointer > 4) qualityOfPointer = 4;
if ( qualityOfPointer==0) {
m_speedOfAAlias=none;
m_makeBlurMotion=false;
}
else {
if ((qualityOfPointer==2) || (qualityOfPointer== 4)) m_speedOfAAlias=slow; else m_speedOfAAlias=fast;
if ((qualityOfPointer==3) || (qualityOfPointer== 4)) m_makeBlurMotion=true; else m_makeBlurMotion=false;
}
paintPointer();
m_showPointer = true; // pri jakemkoliv prekresleni prekreslime rucicku
if (run) repaint ();
}
void KNutAnalog::setPointer (double pointerValue, bool run ) {
if (m_valueOfPointer != pointerValue) {
m_valueOfPointer = pointerValue;
paintPointer();
m_showPointer = true; // pri jakemkoliv prekresleni prekreslime rucicku
if (run) {
// paintPointer();
m_showPointer = true; // pri jakemkoliv prekresleni prekreslime rucicku
repaint ();
}
}
}
//************** PUBLIC SLOTS **********************************
void KNutAnalog::slotSetScaleFont(QFont newScaleFont){
m_scaleFont = newScaleFont;
paintBackGround();
m_showBackGround=true;
repaint();
}
void KNutAnalog::slotSetTextFont(QFont newTextFont){
m_textFont = newTextFont;
paintBackGround();
paintPointer(); // repaint values if pointer
m_showBackGround=true;
m_showPointer=true;
repaint();
}
void KNutAnalog::slotSetAllFont(QFont newAllFont){
m_scaleFont = newAllFont;
m_textFont = newAllFont;
paintBackGround();
paintPointer(); // repaint values if pointer
m_showBackGround=true;
m_showPointer=true;
repaint();
}
void KNutAnalog::repaintAll (void) {
paintBackGround();
m_showBackGround = true;
m_showPointer = true;
repaint ();
}
//************** protected ****************************
void KNutAnalog::resizeEvent( QResizeEvent * ) {
}
void KNutAnalog::paintEvent( QPaintEvent *e ) {
if (isVisible()) {
QFrame::paintEvent(e);
if ((m_showBackGround) || (m_showPointer)) { // novou kompletni vrstvu sestavime jen pokud doslo ke zmene
bitBlt( m_wholeLayer, 0, 0, m_scaleLayerSmall, 0, 0, m_widthOfBackGround, m_widthOfBackGround, CopyROP); //nakopirujeme vrstvu
bitBlt( m_wholeLayer, 0, 0, m_pointerLayerSmall, 0, 0, m_widthOfBackGround, m_widthOfBackGround, AndROP ); //nakopirujeme rucicku
}
bitBlt( this , m_startOfBackGround, m_startOfBackGround, m_wholeLayer, 0, 0, m_widthOfBackGround, m_widthOfBackGround, CopyROP); //nakopirujeme vrstvu
m_showBackGround = false;
m_showPointer = false;
}
}
//***************private ************************
void KNutAnalog::paintBackGround ( void ) {
QPainter paint;
QImage myImage; //big image
//qDebug ("KNutAnalog::paintBackGround");
m_scaleLayerBig->fill( this,0,0); //color if background
paint.begin ( m_scaleLayerBig );
paint.setBackgroundMode(Qt::OpaqueMode);
paint.setBackgroundColor(backgroundColor());
paintPartOfCircle(&paint, m_centerX*3, m_centerY*3,m_widthOfScale*3); //CMK pro inter
paintScale(&paint, m_centerX*3, m_centerY*3,m_widthOfScale*3); // Scale
paint.end();
myImage = m_scaleLayerBig->convertToImage();
makeMotionBlur(&myImage,myImage.pixel(1,1),m_typeOfView);
makeAntialiasing(&myImage,m_scaleLayerSmall,myImage.pixel(1,1),slow,m_typeOfView);
paint.begin( m_scaleLayerSmall ); // paint on layer of scale
// painting numbers
paintScaleNumbers( &paint ); //painting of numbers
// painting texts
paintText( &paint );
paint.end ();
}
void KNutAnalog::paintPointer ( void ) {
//qDebug ("KNutAnalog::paintPointer");
if (m_speedOfAAlias == none) paintPointerFastly (m_valueOfPointer);
else paintPointerSlowly ( m_valueOfPointer, m_centerX*3, m_centerY*3,m_widthOfScale*3);
}
void KNutAnalog::paintPointerSlowly ( double position, int centerX , int centerY, int widthOfCircle) {
QPainter paint;
QImage myImage; //big image
double angle;
int lengthOfPointer = widthOfCircle / 2 - 12;
if (position < m_bottomLimit) position=m_bottomLimit;
else {
if (position > m_topLimit) position = m_topLimit;
}
// painting of pointer
angle = ((m_angleOfViewer/(m_topLimit-m_bottomLimit))*(position-m_bottomLimit))*((-1)*m_direction)+m_startAngle;
m_pointerLayerBig->fill( Qt::white ); //color if beckground
paint.begin( m_pointerLayerBig ); // paints of pointer
paint.setBackgroundMode(Qt::TransparentMode);
paint.setBrush( m_pointerColor ); // sets color
paint.setPen ( m_pointerColor );
QPointArray pts;
// k posuvu a k otoceni pouziva funkce paintu
// for rotate and translate uses functions of paint
paint.translate (centerX, centerY);
paint.rotate(-angle);
pts.setPoints( 4, -6, 0, 0, -6, lengthOfPointer, 0, 0, 6 );
paint.drawConvexPolygon( pts );
paint.end ();
//m_pointerMutex.lock();
myImage = m_pointerLayerBig->convertToImage();
if (m_makeBlurMotion) makeMotionBlur(&myImage,myImage.pixel(1,1));
makeAntialiasing(&myImage,m_pointerLayerSmall,myImage.pixel(1,1),m_speedOfAAlias,0);
paint.begin( m_pointerLayerSmall ); // paints on layer's background
paintValueOfPointer ( &paint, m_valueOfPointer);
paint.end ();
// m_pointerMutex.unlock();
}
void KNutAnalog::paintPointerFastly (double position) {
QPainter paint;
double uhel;
int delka = m_widthOfScale / 2 - 4;
//m_pointerMutex.lock();
m_pointerLayerSmall->fill( Qt::white ); //background color
paint.begin( m_pointerLayerSmall ); // kreslime na plochu rucicky
paint.setBackgroundMode(Qt::TransparentMode);
paintValueOfPointer ( &paint, m_valueOfPointer);
if (position < m_bottomLimit) position=m_bottomLimit;
else {
if (position > m_topLimit) position = m_topLimit;
}
/* painting of pointer*/
uhel = ((m_angleOfViewer/(m_topLimit-m_bottomLimit))*(position-m_bottomLimit))*((-1)*m_direction)+m_startAngle;
paint.setBrush( m_pointerColor ); // nastavime barvu
paint.setPen ( m_pointerColor );
QPointArray pts;
// for translate a rotate uses functions of paint // k posuvu a k otoceni pouziva funkce paintu
paint.translate (m_centerX, m_centerY);
paint.rotate(-uhel);
pts.setPoints( 4, -2, 0, 0, -2, delka, 0, 0, 2 );
paint.drawPolygon( pts );
paint.end();
//m_pointerMutex.unlock();
}
void KNutAnalog::paintPartOfCircle ( QPainter *paint, int centerX , int centerY, int widthOfCircle ) {
double Astart, Aend;
// pocitani uhlu
//nula je ve 3 hodiny
// prirustek je kladny proti smeru hod rucicek
//int extent = m_topLimit-m_bottomLimit; //rozsah
// double extent = m_topLimit-m_bottomLimit; //rozsah
// double jednotka = ((double)m_angleOfViewer/extent);
double jednotka = ((double)m_angleOfViewer/(m_topLimit-m_bottomLimit));
bool painted = false;
// int smerMK = (-1)*m_direction;
// paints parts of circle
for (int i=0;i<m_countOfColorParts;i++) {
if ((m_extentOfDye[i].start < m_topLimit) && (m_extentOfDye[i].end > m_bottomLimit)) {
if (m_extentOfDye[i].start < m_bottomLimit) Astart = m_bottomLimit; else Astart = m_extentOfDye[i].start;
if (m_extentOfDye[i].end > m_topLimit) Aend = m_topLimit; else Aend = m_extentOfDye[i].end;
paint->setBrush ( m_arcColors[m_extentOfDye[i].color] );
paint->setPen (NoPen);
paint->drawPie((centerX-widthOfCircle/2),(centerY-widthOfCircle/2),widthOfCircle,widthOfCircle,(int)((((Astart-m_bottomLimit)*jednotka)*((-1)*m_direction)+m_startAngle)*16),(int)(((-1)*m_direction)*((Aend-Astart)*jednotka)*16));
painted = true; // bylo provedeno vykresleni
}
}
if ((m_countOfColorParts > 0) && (painted)) { // kreslime jen pokud bylo kreslena kruhova vysec
// musime vybarvit stred kotouce
//fills center of circle
paint->setBrush ( paint->backgroundColor() ); //The angles are 1/16th of a degree
paint->drawPie((centerX-(widthOfCircle/2)+18),(centerY-(widthOfCircle/2)+18),widthOfCircle-36,widthOfCircle-36,(int)(m_startAngle*16+90*m_direction),(int)((-m_direction)*(m_angleOfViewer*16+180)));
}
}
void KNutAnalog::paintScale ( QPainter *paint , int centerX , int centerY, int widthOfCircle) {
int bottomMax = widthOfCircle/2 - 29;
int bottom = widthOfCircle/2 -17 ;
int smer_stup = (-1)*m_direction;
paint->save();
paint->setPen ( m_scaleColor);
paint->translate( centerX, centerY );
double stupne = smer_stup * (m_angleOfViewer/(m_countOfParts*(m_countOfSubParts)));
// nakresleni prvni linky
//paints of the first line
paint->rotate( -m_startAngle);
paint->setBrush ( m_scaleColor );
paint->drawRect( bottomMax,-1,30,3 );
for ( int i=0; i<(m_countOfParts); i++ ) {
for ( int j=0; j<(m_countOfSubParts-1); j++) {
paint->rotate( -stupne );
paint->drawRect( bottom,-1,18,2 );
}
paint->rotate( -stupne );
paint->drawRect( bottomMax,-1,30,3 );
}
paint->restore();
}
void KNutAnalog::makeAntialiasing (QImage* bigImage, QPixmap* smallPixmap, const QRgb colorOfBG, speedOfAAlias speed, int typeOfView) {
ulong imageRed, imageGreen, imageBlue;
QRgb imageRgb;
QImage* smallImage;
bool computeAverage;
ulong sumOfRed, sumOfGreen, sumOfBlue;
if (speed == slow) {
sumOfRed = (qRed ( colorOfBG ))*9;
sumOfGreen = (qGreen ( colorOfBG ))*9;
sumOfBlue = (qBlue ( colorOfBG ))*9;
}
else {
sumOfRed = (qRed ( colorOfBG ))*16;
sumOfGreen = (qGreen ( colorOfBG ))*16;
sumOfBlue = (qBlue ( colorOfBG ))*16;
}
int smallImageWidth=bigImage->width()/3;
int smallImageHeight=bigImage->height()/3;
smallImage = new QImage(smallImageWidth,smallImageHeight, bigImage->depth());
// imageRgb = bigImage->pixel(1,1);
for (int x = 0; x < smallImageWidth; x++) {
for (int y = 0; y < smallImageHeight; y++) {
imageRed = 0;
imageGreen = 0;
imageBlue = 0;
switch (typeOfView) {
case 0:
//nothing
computeAverage=true;
break;
case 1:
if ((y>25) and (x >30) and (x < 92)) computeAverage=false;
else computeAverage=true;
break;
case 2:
if ((y < 15) || ((x+15) > y)) computeAverage=true;
else computeAverage=false;
break;
case 3:
//computes top part only
if ((y < 60) && (y>15)) computeAverage=true;
else computeAverage=false;
break;
default:
computeAverage=true;
}
if (speed == slow) {
//// uses divide, slowly compute
if (computeAverage) {
for (int xi = 0 ; xi < 3; xi ++) {
for (int yi = 0 ; yi < 3; yi ++) {
imageRgb = bigImage->pixel(x*3+xi,y*3+yi);
imageRed += qRed ( imageRgb );
imageGreen += qGreen ( imageRgb );
imageBlue += qBlue ( imageRgb );
}
}
if (((imageRed == sumOfRed) && (imageGreen == sumOfGreen) && (imageBlue == sumOfBlue))) {
smallImage->setPixel (x,y,colorOfBG);
}
else {
imageRed = imageRed / 9;
imageGreen = imageGreen/9;
imageBlue = imageBlue/9;
smallImage->setPixel (x,y,qRgb(imageRed,imageGreen,imageBlue));
}
}
else {
smallImage->setPixel (x,y,bigImage->pixel(x*3,y*3));
}
}
else {
//// uses bitmove, fastly compute
if (computeAverage) {
for (int xi = 0 ; xi < 3; xi ++) {
for (int yi = 0 ; yi < 3; yi ++) {
if ((xi == 1) && (yi == 1)) { // center of 3x3 area
imageRgb = bigImage->pixel(x*3+xi,y*3+yi);
imageRed += qRed ( imageRgb )*4;
imageGreen += qGreen ( imageRgb )*4;
imageBlue += qBlue ( imageRgb )*4;
}
else {
if ((xi == 1) || (yi == 1)) {
imageRgb = bigImage->pixel(x*3+xi,y*3+yi);
imageRed += qRed ( imageRgb )*2;
imageGreen += qGreen ( imageRgb )*2;
imageBlue += qBlue ( imageRgb )*2;
}
else {
imageRgb = bigImage->pixel(x*3+xi,y*3+yi);
imageRed += qRed ( imageRgb );
imageGreen += qGreen ( imageRgb );
imageBlue += qBlue ( imageRgb );
}
}
}
}
if ((imageRed == sumOfRed) && (imageGreen == sumOfGreen) && (imageBlue == sumOfBlue)) {
smallImage->setPixel (x,y,colorOfBG);
}
else {
imageRed = imageRed >> 4;
imageGreen = imageGreen >> 4;
imageBlue = imageBlue >> 4;
smallImage->setPixel (x,y,qRgb(imageRed,imageGreen,imageBlue));
}
}
else {
smallImage->setPixel (x,y,bigImage->pixel(x*3,y*3));
}
} //end of fastly
}
}
smallPixmap->convertFromImage(*smallImage);
delete smallImage;
}
void KNutAnalog::makeMotionBlur (QImage* image, const QRgb colorOfBG, int typeOfView) {
ulong imageRed, imageGreen, imageBlue;
QRgb imageRgb;
QImage *layerImageBlur;
bool computeAverage;
int startHeight, stopHeight;
ulong sumOfRed, sumOfGreen, sumOfBlue;
sumOfRed = (qRed ( colorOfBG ))*9;
sumOfGreen = (qGreen ( colorOfBG ))*9;
sumOfBlue = (qBlue ( colorOfBG ))*9;
int imageWidth=image->width();
int imageHeight=image->height();
layerImageBlur = new QImage(*image);
layerImageBlur->detach(); //costructor makes swallow copy, have to use detach
switch (typeOfView) {
case 0:
//nothing
startHeight =1;
stopHeight =imageHeight-2;
break;
case 2:
startHeight =1;
stopHeight =imageHeight-2;
break;
case 3:
startHeight =45;
stopHeight =180;
break;
default:
startHeight =1;
stopHeight =imageHeight-2;
}
for (int x = 1; x < imageWidth-2; x++) {
for (int y = startHeight; y < stopHeight; y++) {
imageRed = 0;
imageGreen = 0;
imageBlue = 0;
switch (typeOfView) {
case 0:
//nothing
computeAverage=true;
break;
case 1:
if ((y>75) and (x >90) and (x < 274)) computeAverage=false;
else computeAverage=true;
break;
case 2:
if ((y < 45) || ((x+45) > y)) computeAverage=true;
else computeAverage=false;
break;
case 3:
//computes top part only
if ((y < 180) && (y>45)) computeAverage=true;
else computeAverage=false;
break;
default:
computeAverage=true;
}
if (computeAverage) {
for (int xi = -1 ; xi < 2; xi ++) {
for (int yi = -1 ; yi < 2; yi ++) {
imageRgb = layerImageBlur->pixel(x+xi,y+yi);
imageRed += qRed ( imageRgb );
imageGreen += qGreen ( imageRgb );
imageBlue += qBlue ( imageRgb );
}
}
if (!((imageRed == sumOfRed) && (imageGreen == sumOfGreen) && (imageBlue == sumOfBlue))) {
imageRed = (int)(imageRed / 9);
imageGreen = (int)(imageGreen/9);
imageBlue = (int)(imageBlue/9);
image->setPixel (x,y,qRgb(imageRed,imageGreen,imageBlue));
}
}
}
}
delete layerImageBlur;
}
void KNutAnalog::paintScaleNumbers ( QPainter *paint ) {
//paintig of scaleNumbers
int poz_x, poz_y, r_vyska, r_sirka;
double posun, angle;
double upi = 0.0174532;
int smer_st = -m_direction;
paint->save(); // ulozime
QString cislo;
paint->setPen(m_textColor);
paint->setFont(m_scaleFont);
QFontMetrics fm = paint->fontMetrics();
r_vyska = ((fm.ascent()) / 2);
posun = ((double)(m_topLimit-m_bottomLimit))/m_countOfParts;
for (int i=0; i<=(m_countOfParts);i++) {
cislo.sprintf( "%3.0f",m_bottomLimit+i*posun);
cislo=cislo.stripWhiteSpace();
r_sirka = (fm.width(cislo))/2;
angle = (m_startAngle+ ((m_angleOfViewer/m_countOfParts)*i*smer_st))*upi;
poz_x = (int)((cos(angle)*m_radiusOfScaleNumbers+m_centerX) - r_sirka);
poz_y = (int)((m_centerY-sin(angle)*m_radiusOfScaleNumbers) + r_vyska);
paint->drawText (poz_x,poz_y,cislo);
}
paint->restore();
}
void KNutAnalog::paintText ( QPainter *paint ) {
QString nadpis1;
QString nadpis2;
int index;
if (m_inscription.length() >1) {
if ((index = m_inscription.find(" ")) != -1) {
// mezera nalezena space found
nadpis1 = m_inscription.left(index);
nadpis2 = m_inscription.mid(index+1,(uint)(m_inscription.length() - index - 1));
}
} else index = -1;
paint->setPen(m_textColor);
paint->setFont(m_textFont);
QFontMetrics fm = paint->fontMetrics();
int r_vyska = fm.height()/ 2;
switch (m_typeOfView) {
// kruznice - kreslime dve radky nad sebou cemtrovane
case 1 :
if (index == -1 ) paint->drawText( m_centerX - fm.width(m_inscription)/2, 104 + r_vyska , m_inscription);
else {
// mame dve slova
paint->drawText( m_centerX - fm.width(nadpis1)/2, 106 + r_vyska/2 - 2, nadpis1);
paint->drawText( m_centerX - fm.width(nadpis2)/2, 106 + (r_vyska*3)/2 + 2, nadpis2);
}
paint->drawText( m_centerX - fm.width(AnMJ)/2, 44 + r_vyska , AnMJ);
break;
// ctvrt oblouk kreslime dve radky nad sebou centrovane v pravem hornim rohu
case 2 :
if (index == -1 ) paint->drawText( 121 - fm.width(m_inscription) , 6 + r_vyska , m_inscription);
else {
paint->drawText( 121 - fm.width(nadpis1) , 6 + r_vyska , nadpis1);
paint->drawText( 121 - fm.width(nadpis2) , 10 + r_vyska*2 , nadpis2);
}
paint->drawText( m_centerX , 68 + r_vyska*2 , AnMJ);
break;
// horni oblouk
case 3 :
paint->drawText( m_centerX - fm.width(m_inscription)/2, 6 + r_vyska , m_inscription);
paint->drawText( m_widthOfBackGround -5 -fm.width(AnMJ), m_widthOfBackGround -r_vyska, AnMJ);
break;
}
}
void KNutAnalog::paintValueOfPointer ( QPainter *p, double value) {
QString cislo;
cislo.sprintf( "%5.1f",value);
cislo=cislo.stripWhiteSpace();
if (value < m_bottomLimit) value=m_bottomLimit;
else {
if (value > m_topLimit) value = m_topLimit;
}
/* nakresleni rucicky*/
// uhel = ((uhel_zobrazeni/(horni_mez-dolni_mez))*(value-dolni_mez))*((-1)*smer)+m_startAngle;
p->setPen(m_textColor);
p->setFont(m_textFont);
QFontMetrics fm = p->fontMetrics();
int r_vyska = fm.height()/ 2;
switch (m_typeOfView) {
case 1 :
p->drawText( m_centerX - fm.width(cislo)/2, 75 + r_vyska , cislo);
break;
case 2 :
p->drawText( m_centerX , 57 + r_vyska , cislo);
break;
case 3 :
p->drawText( 5, m_widthOfBackGround -r_vyska, cislo);
break;
}
}
#include "knutanalog.moc"

@ -0,0 +1,452 @@
/***************************************************************************
* Copyright (C) 2007 by Daniel Prynych *
* Daniel.Prynych@buzuluk.cz *
* *
* 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 KNUTANALOG_H
#define KNUTANALOG_H
#include <qframe.h>
#include <qpixmap.h> // po odladeni smazat
#include <qimage.h>
#include <qmutex.h>
class QPainter;
class QFont;
enum speedOfAAlias { none,fast,slow};
/**
* This class shows analog measuring panels
*
* @author Daniel Prynych
* @short analog measuring panels
* @version 0.1
*/
class KNutAnalog : public QFrame {
Q_OBJECT
public:
struct extentOfDyeDef {
double start,end;
int color;
};
/**
* Construct - makes object for analog measuring panel about size 130 x 130 points
* Konstruktor - vytvori objekt pro analogovy merici panel o rozmerech 130 x 130 bodu
*
* When you need paint or repainr panel you have to call functiin reapaint
* other functions calls this function theirself, when run = true
* Pokud je potreba vykreslit nebo prekreslit panel je nutno zavolat funkci repaint,
* ostatni funkce ji zavolaji sami pokud je run = TRUE.
*
* @param bottomLimit Is bottom value of scale..
* @param topLimit is end value of scale.
* @param typeOfView determine type view of scale 1- circle 2- right part of circle, 3 - top part of circle
* @param countOfParts determine count of big parts (parents parts) of scale.
* @param countOfSubParts determine count small parts (children parts) id scale, evere big part include e few small part.
* @param pointerColor determine color of pointer.
* @param scaleColor determine color of scale.
* @param textColor determine color of text.
* @param analogFonts determine fonts for text and scale.
* @param qualityOfPainter determine quality painting of pointer- 0 nothing. 1 fast antialiasing, 2 slow antialiasing, 3 blur motion + fast antialiasing, 4 blur motion + slow antialiasing
* @since 0.3
**/
KNutAnalog(QWidget *parent = 0, const char *name = 0, int Astart = 0, int topLimit = 100, int typeOfView = 1, int countOfParts = 5, int countOfSubParts = 0, QColor pointerColor = Qt::black, QColor m_scaleColor = Qt::black, QColor textColor = Qt::black, QFont *analogFonts = 0, int qualityOfPointer = 4, bool makeBG = false );
/**
* Destruktor
* @since 0.1
**/
~KNutAnalog();
/**
* Sets text for top and bottom text of panel.
* Nastavi text dolni a horni text na panelu.
*
* @param m_inscription determinuje inscription , bottom text , usually.
* @param m_inscription Udava nadpis, "dolni" text, obvykle co je mereno.
* @param text_up Udava mernou jednotku "horni" text, obvykle merna jednotka.
* @param run = TRUE makes immediately repaint of panel
* @param run = TRUE provede okamzite prekresleni panelu.
*
* @since 0.1
**/
void setText (QString m_inscription, QString text_up, bool run=false);
/**
* Makes background of analog panel.
* Vytvori pozadi analogoveho panelu.
*
* @param run = TRUE makes immediately repaint of panel
* @param run = TRUE provede okamzite prekresleni panelu.
*
* @since 0.2
**/
void makeBackground (bool run=false);
/**
* Repaint pointer of analog panel.
* Prekresli rucicku analogoveho panelu.
*
* @param run = TRUE makes immediately repaint of panel
* @param run = TRUE provede okamzite prekresleni panelu.
*
* @since 0.2
**/
void repaintPointer ( bool run );
/**
* Nastavuje devet zakladnich barev pro mezikruzi.
* Sets nine basic color for circle in scale
*
* @param run = TRUE provede okamzite prekresleni panelu.
* @param run = TRUE makes immediately repaint of panel
*
* @since 0.1
**/
void setDefaultArcColor(bool run=false);
/**
* Nastavi zakladni barvu pro mezikruzi.
* Sets basic color for circle in scale
*
* @param reg Poradove cislo barvy (barevneho registru).
* @param color Barva na kterou bude nastaven registr barvy.
*
* @since 0.1
**/
void setArcColor(int reg, QColor color );
/**
* Vybarvi cast stupnice zadanou barvou.
* Nastavi rozsah mezikruzi, podle stupnice od pocatecni hodnoty do koncove hodnoty stupnice
* Barevne casti se barvy postupne, podel poradoveho cisla, mohou se prekryvat.
* Je mozno nastavit jen 5 casti !!
*
* @param startOfCircle Urcuje zazatek mezikruzi.
* @param endOfCircle Urcuje konec mezikruzi.
* @param color Urcuje barvu.
* @param run = TRUE makes immediately repaint of panel
* @param run = TRUE provede okamzite prekresleni panelu.
*
* @since 0.2
**/
void addArc (double startOfCircle, double endOfCircle, int regColor, bool run=false);
/**
* Clear colors of scale
* Zrusi vybarveni stupnice.
*
* @param run = TRUE makes immediately repaint of panel
* @param run = TRUE provede okamzite prekresleni panelu.
*
* @since 0.1
**/
void delArc (bool run=false);
/**
*
* Nastavi rozsah stupnice.
*
* @param Astart Urcuje pocatecni hodnotu stupnice.
* @param AEND Urcuje koncovou hodnotu stupnice.
* @param run = TRUE makes immediately repaint of panel
* @param run = TRUE provede okamzite prekresleni panelu.
*
* @since 0.2
*/
void setRange (int Astart = 0, int Aend = 100, bool run=false);
/**
* Sets number of parts od scale
* Nastavi pocet dilku stupnice.
*
* @param Count Determine number of parts of pointer..
* @param Count Urcuje pocet casti stupnice.
* @param run = TRUE makes immediately repaint of panel
* @param run = TRUE provede okamzite prekresleni panelu.
*
* @since 0.1
*/
void setMember (int Count, bool run=false);
/**
* Sets color of analog pointer.
* Nastavi barvu analogove rucicky.
*
* @param pointerColor determine color of pointer.
* @param pointerColor Urcuje barvu rucicky.
* @param run = TRUE makes immediately repaint of panel
* @param run = TRUE provede okamzite prekresleni panelu.
* @since 0.2
*/
void setPointerColor (QColor pointerColor, bool run=false);
/**
* sets color of text;
* Nastavi barvu textu.
*
* @param fontColor determine color of font.
* @param fontColor urcuje barvu fontu.
* @param run = TRUE makes immediately repaint of panel
* @param run = TRUE provede okamzite prekresleni panelu.
*
* @since 0.1
*/
void setFontColor (QColor fontColor, bool run=false );
/**
* Sets color of scale
* Nastavi barvu stupnice.
*
* @param scaleColor determine color if scale.
* @param scaleColor urcuje barvu stupnice.
* @param run = TRUE makes immediately repaint of panel
* @param run = TRUE provede okamzite prekresleni panelu.
*
* @since 0.1
*/
void setScaleColor (QColor scaleColor, bool run=false);
/**
* Sets type of digital processing of pointer. 0 nothing. 1 fast antialiasing, 2 slow antialiasing, 3 blur motion + fast antialiasing, 4 blur motion + slow antialiasing.
*
* @param qualityOfPointer determine quality of pointer's digital procesing
* @param run = TRUE makes immediately repaint of panel
* @param run = TRUE provede okamzite prekresleni panelu.
*
* @since 0.1
*/
void setDigitalProcesing (int qualityOfPointer, bool run =false );
/**
* Sets pointer on value pointerValue.
* Posune rucicku na hodnotu pointerValue.
*
* @param pointerValue Urcuje hodnotu na jakou bude nastavena rucicka.
* @param run = TRUE makes immediately repaint of panel
* @param run = TRUE provede okamzite prekresleni panelu.
*
* @since 0.1
*/
void setPointer (double pointerValue, bool run=true );
/**
* Const. determines width of analog panel in points
* Konstanta, udava velikost analogoveho panelu v bodech.
*
* @since 0.1
*/
static const int AnalogWidth = 130;
public slots:
/**
* Sets font of scale, change is doing immediately
* Nastavi font stupnice, zmena je provedena okamzite.
*
* @param newScaleFont Urcuje novy font hodnot stupnice.
* @param newScaleFont Urcuje novy font hodnot stupnice.
*
* @since 0.1
*/
void slotSetScaleFont(QFont newScaleFont);
/**
* Sets font of text. change is doing immediately.
* Nastavi font textu, zmena je provedena okamzite.
*
* @param newTextFont Urcuje novy font pro texty.
*
* @since 0.1
*/
void slotSetTextFont(QFont newTextFont);
/**
* Nastavi font stupnice a textu, zmena je provedena okamzite.
*
* @param newTextFont Urcuje novy font pro texty a hodnoty stupnice.
*
* @since 0.1
*/
void slotSetAllFont(QFont newAllFont);
/**
* Repaint layer of backgroud and layer of pointer,
* all panel will be repainted
* Da povel k prekreseni urovne pozadi a urovne rucicky.
* To znamena, ze bude prekreslen kompletne cely panel.
*
* @since 0.1
*/
void repaintAll (void);
protected:
virtual void resizeEvent( QResizeEvent * );
virtual void paintEvent( QPaintEvent * );
private:
/**
* @internal
*/
void paintBackGround ( void );
/**
* @internal
*/
void paintPointer ( void );
/**
* @internal
*/
void paintPointerSlowly ( double position, int centerX , int centerY, int widthOfCircle);
/**
* @internal
*/
void paintPointerFastly ( double position);
/**
* @internal
*/
void paintPartOfCircle ( QPainter *paint, int centerX , int centerY, int widthOfCircle );
/**
* @internal
*/
void paintScale ( QPainter *paint , int centerX , int centerY, int widthOfCircle);
/**
* @internal
*/
void makeAntialiasing (QImage* myImage, QPixmap* smallPixmap, const QRgb colorOfBG, speedOfAAlias speed = slow , int typeOfView = 0);
/**
* @internal
*/
void makeMotionBlur (QImage* myImage, const QRgb colorOfBG, int typeOfView = 0);
/**
* @internal
*/
void paintScaleNumbers ( QPainter *paint );
/**
* @internal
*/
void paintText ( QPainter *paint );
/**
* @internal
*/
void paintValueOfPointer ( QPainter *p, double value);
static const int m_widthOfBackGround = 122;
static const int m_startOfBackGround = 4;
bool m_showBackGround;
bool m_showPointer;
int m_bottomLimit;
int m_topLimit;
int m_typeOfView; // udava typ meraku
int m_countOfParts; // pocet policek na stupnici
int m_countOfSubParts; // pocet dilku v policku na stupnici
QColor m_pointerColor, m_scaleColor, m_textColor; // colors of pointer, text and scale
QColor m_arcColors[9];
QString m_inscription;
QString AnMJ;
int m_countOfColorParts; // count of color parts on scale
double m_valueOfPointer; // position of pointer;
double m_angleOfViewer, m_startAngle; //pocatecni_uhel;
int m_centerX;
int m_centerY;
int m_direction;
int m_widthOfScale;
int m_radiusOfScaleNumbers;
speedOfAAlias m_speedOfAAlias;
bool m_makeBlurMotion;
QFont m_scaleFont;
QFont m_textFont;
QPixmap *m_wholeLayer;
QPixmap *m_backgroudLayerBig;
QPixmap *m_scaleLayerBig;
QPixmap *m_scaleLayerSmall;
QPixmap *m_pointerLayerBig;
QPixmap *m_pointerLayerSmall;
extentOfDyeDef m_extentOfDye[5];
QMutex m_pointerMutex;
};
#endif

File diff suppressed because it is too large Load Diff

@ -0,0 +1,20 @@
# KDE Config File
[Desktop Entry]
Encoding=UTF-8
Type=Application
Version=0.9.4
Exec=knutclient -caption "%c" %i %m
Icon=knutclient.png
MiniIcon=knutclient.png
DocPath=knutclient/index.html
Name=KNutClient
Name[de]=KNutClient
Name[cs]=KNutClient
Comment=Client for NUT
Comment[de]=
Comment[cs]=Klient pro UPS syst<73> NUT
Comment[es]=Cliente KDE para NUT
Terminal=0
X-KDE-StartupNotify=true
OnlyShowIn=KDE;
Categories=Qt;KDE;System;Monitor;

@ -0,0 +1,210 @@
/***************************************************************************
knutclient.h - description
-------------------
begin : Út srp 21 19:12:20 CEST 2001
copyright : (C) 2001 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef KNUTCLIENT_H
#define KNUTCLIENT_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "knutmainwindow.h"
#include "knutvardata.h"
#include "knutupsdata.h"
#include "knutnet.h"
#include "knutdock.h"
#include "knutprefdlg.h"
#include "knutmessagemanager.h"
#include <kapplication.h>
#include <qwidget.h>
#include <qtimer.h>
#include <qstringlist.h>
#include <qmutex.h>
const int countNextConnDelay = 10;
const int nextConnDelay[] = {
5, 5, 20, 30, 60, 60, 120, 300, 600, 900 };
class KNutClient : public QObject, public KSessionManaged {
Q_OBJECT
public:
KNutClient(bool noDock = false, QObject* parent=0,const char* name=0);
~KNutClient();
private slots:
void slotTimeout (void);
void slotReconnectTimeout (void);
void slotSetNewUPS (QString name);
void slotPreferenceUps(void);
void slotSetConfig (unsigned int changeSetting);
void slotPrintUPSVars(void);
void slotInstComms(void);
void slotRWVars(void);
void slotChangeRWVars( QString );
void slotSaveConf (void);
void slotExitApplication(void);
/**
*
* Calls function for repainting of icon in dock.
* Vola funkci pro prekresleni icony v doku.
*
* @since 0.1
**/
void slotTryFirstConnection (int maxCount);
/**
* This function is called when program repeats other connection;
* Calls function for repainting of icon in dock.
* Tata funkce je volana, kdyz program opakuje pokus o pripojeni.
* Vola funkci pro prekresleni icony v doku.
*
* @since 0.1
**/
void slotTryReepatFirstConnection (int number );
/**
* Nastavi hodnoty po prvem pripojeni na UPS, zavola prekresleni docku a nastartuje timer
* Sets values after the first conection to UPS ,calls to repaint of dock and starts timer
*
* @since 0.2
**/
void slotFirstConnection (void);
/**
* Zpracuje chybu spojeni
* Executes error of connection
*
* @since 0.1
**/
void slotErrorConnection (int error);
/**
* Zpracuje ukonceni spojeni, pokud spojeni bylo ukonceno druhou stranou.
* Executes end of connection, when connection was closed by the second side.
*
* @since 0.1
**/
void slotConnectionClosed(void);
/**
*
*
* @since 0.1
**/
void slotRefreshConnection(void);
void closeMainWindow (void);
void exitMainWindow (void);
void slotActiveMainWindow (void);
virtual bool commitData (QSessionManager&);
virtual bool saveState (QSessionManager&);
private:
/**
* Prepares and show main window.
* Pripravi a zobrazi hlavni okno.
*
* @since 0.1
**/
void makeMainWindow (void);
/**
* Sets all variables to initial values.
* Nastavi vsechny vsechny promenne na pocatecni hodnoty.
*
* @since 0.1
**/
void initVars (void);
void loadConfiguration ( void );
void saveConfiguration ( bool all = true );
void upsActivate (void);
void upsDeactivate (void);
void setActiveUpsVars (bool mWindow = true);
void setActiveXFerVars (bool activate);
void getUpsData (void);
void setActiveUpsInfo (QString name);
void addEventString (const QString text, const QString UPSAddress = QString::null);
void showStatusEvent(void);
/********* PRIVATE VARS****************/
// hlavni informace o upsce
// main informacion about UPS
KNutVarData::upsInfoDef m_mainUpsInfo;
// v teto strukture jsou ulozeny promene ktere nastavuji konfiguraci
// in this structure are saveing values, which setting configuration
KNutVarData::SettingDataDef settingData;
KNutDock* m_myDock;
KNutMainWindow* mainWindow;
KNutUpsData* upsRecords;
KNutVarData* analogRecords;
QTimer* m_upsTimer;
QTimer* m_reconnectTimer;
QStringList* m_listKNutEvent;
bool m_panelsAreZeroing; // indikuje zda je panel nulovany // use if analog panels is setting to zero
// kod posledni chyby spojeni zjistene v timeoutu
// nebere ohled zda byla chyba pri inicializaci
int m_lastError;
KNutMessageManager* m_myMessMan;
// mutex for reconnect, only one reconnect at a time
QMutex m_reconnectMutex;
QMutex m_upsDeactivateMutex;
};
#endif

@ -0,0 +1,24 @@
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="KNutClient" version="0.9.3">
<MenuBar>
<Menu name="file"><text>&amp;File</text>
<Action name="printupsvars" />
<Action name="instcomms" />
<Action name="rwvars" />
</Menu>
<Menu name="settings"><text>&amp;Settings</text>
<Separator/>
<Action name="use_description" />
</Menu>
<Menu name="connection"><text>&amp;Connection</text>
<Action name="reconnect" />
</Menu>
</MenuBar>
<ToolBar name="mainToolBar">
<Action name ="file_quit"/>
<Action name ="options_configure"/>
<Action name ="reconnect"/>
<Separator lineSeparator="true"/>
</ToolBar>
<StatusBar/>
</kpartgui>

@ -0,0 +1,58 @@
/***************************************************************************
knutconst.h - description
-------------------
begin : Tue Sep 24 2001
copyright : (C) 2003 by Daniel Prynych
email : Daniel@prynych.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef KNUTCONST_H
#define KNUTCONST_H
namespace knc {
const int StartPort =1024;
const int StopPort= 65535;
const int MinDelay = 2000;
const int MinCols = 1;
const int MaxCols = 5;
const int DefaultCountCols = 3; // prednastaveny pocet sloupcu analogovych meraku
const int DefaultPort = 3493; // default ports - prednastaveny port
const int DefaultDelay = 2000; //2000 msec
const int DefaultInputVoltage = 230;
const int DefaultInputFrequency = 50;
const int NumberOfTypes = 14; // count types of variables // pocet typu promenych (none,utility ....)
const int NumberOfVars = NumberOfTypes -1; // how many variables we can measure // kolik promenych muzeme merit
enum {VarNone,VarUtility,VarBattPct,VarUpsTemp,VarAcfreq,VarLoadPct,VarAmbTemp,VarAmbHumid,VarBattVolt,VarOutVolt,VarCurrent,VarOutFreq,VarBattTemp,VarBattCurrent};
const unsigned int maxCountKNutEvent = 100;
const int numberVarError = -1000;
enum upsDriverConnection { // state of connection to usbd, this isn't state of knutnet
connecting,
connected,
stale,
notConnected,
error
};
}
#endif

@ -0,0 +1,976 @@
/***************************************************************************
knutdock.cpp - description
-------------------
begin : Út zari 23 2003
copyright : (C) 2003 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#include "knutdock.h"
#include "knutnet.h"
//#include <kglobal.h>
#include <kiconloader.h>
#include <klocale.h>
#include <kapp.h>
#include <kaboutapplication.h>
#include <kmessagebox.h>
#include <qpainter.h>
#include <qtooltip.h>
#include <qpixmap.h>
#include <qbitmap.h>
#include <qstring.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
//#include <iostream>
KNutDock::KNutDock(KNutVarData::upsInfoDef* activeUpsInfo, KNutVarData::SettingDataDef* settingData, KNutUpsData* upsRecords){
QString valueName;
m_settingData = settingData;
m_upsRecords = upsRecords;
m_activeUpsInfo = activeUpsInfo;
//saves backgroundcolor of kicker
backgroundColor = paletteBackgroundColor();
m_typeOfIcon = m_settingData->typeOfKIcon;
if (!m_settingData->customKIconColor) m_myBGColor = backgroundColor;
else m_myBGColor = m_settingData->kIconBackgroundColor;
m_toolTipFlags=m_settingData->toolTipFlags;
clearValues();
KIconLoader *loader = KGlobal::iconLoader();
m_mainPix = loader->loadIcon ("knutclient",KIcon::Small,16);
// aplications's own icons
m_errorPix = UserIcon ("knc_error");
m_connectPix = UserIcon ("knc_conn");
m_upsPix = UserIcon ("knc_ups");
m_battPix = UserIcon ("knc_batt");
createMainMenu();
m_statusLayer = 0;
m_runtimeLayer = 0;
m_loadLayer = new QPixmap(24,24);
m_chargeLayer = new QPixmap(24,24);
m_mainLayer = new QPixmap(24,24);
initImage();
changeKIcon(); // this function calls function repaintIcon
}
KNutDock::~KNutDock(){
if (m_statusLayer) delete m_statusLayer;
if (m_runtimeLayer) delete m_runtimeLayer;
delete m_loadLayer;
delete m_chargeLayer;
delete m_mainLayer;
delete m_upsServerMenu;
delete m_menu;
}
void KNutDock::changeUps (void) {
m_upsServerMenu->clear();
createUpsMenu();
}
void KNutDock::clearDockValues(void){
initImage(); // paints standart icon
clearValues();
repaintDock(true);
}
void KNutDock::changeToolTip(void){
m_toolTipFlags=m_settingData->toolTipFlags;
toolTip(m_runtimeValue, m_statusValue, m_batteryChargeValue, m_upsLoadValue);
}
void KNutDock::changeKIBColor(void) {
if (!m_settingData->customKIconColor) m_myBGColor = backgroundColor;
else m_myBGColor = m_settingData->kIconBackgroundColor; // uses defined color
repaintDock(true);
}
void KNutDock::changeKIcon (void) {
m_typeOfIcon = m_settingData->typeOfKIcon;
if ( m_typeOfIcon == generalKI) {
if (m_mainLayer) {
delete m_mainLayer;
m_mainLayer=new QPixmap(24,24);
}
if (!m_statusLayer) {
m_statusLayer = new QPixmap(24,24);
}
if (!m_runtimeLayer) {
m_runtimeLayer = new QPixmap(24,24);
}
paintStatus(m_statusValue);
paintRuntime(m_runtimeValue, m_statusValue);
}
else { // picture Icon
delete m_statusLayer;
m_statusLayer = 0;
delete m_runtimeLayer;
m_runtimeLayer=0;
}
paintLoad(m_upsLoadValue);
paintCharge(m_batteryChargeValue);
m_statusWarningValue = m_statusValue & (KNutNet::CAL | KNutNet::TRIM | KNutNet::BOOST
| KNutNet::OVER | KNutNet::RB);
repaintDock(true);
}
void KNutDock::initImage(void) {
setPixmap(m_mainPix);
m_dataOk = idle;
m_dataOkOld = m_dataOk;
}
void KNutDock::setNewUPS(void) {
m_upsServerMenu->clear();
createUpsMenu();
}
void KNutDock::repaintDock (const bool always) {
QString nutStringVar;
int myRuntimeValue;
int myUpsLoadValue;
int myStatusValue;
int myStatusBatValue;
int myBatteryChargeValue;
bool repaintNow = false;
// value repaintNow is seted when some ups values are changed
bool okFloat;
QString valueName;
QPainter paint;
if (m_activeUpsInfo->upsNet == 0) { repaint(); return;}
m_dataOkOld=m_dataOk;
if ((m_activeUpsInfo->upsNet->getState() == KNutNet::Connected) // paints icons with information values
&& (!m_activeUpsInfo->netError)) {
// ups is connected dataOK is ok (program shows icon of connecting UPS)
m_dataOk = ok; // pro paint event udava ze mam pouzit nase ikony
if (!m_activeUpsInfo->upsNet->existName(m_activeUpsInfo->runtimeVar)) {
nutStringVar = m_activeUpsInfo->upsNet->readStringVar(m_activeUpsInfo->runtimeVar);
//std::cout << "KNutDock::repaintDock RUNTIME " << nutStringVar << std::endl;
if (nutStringVar.isEmpty()) myRuntimeValue=knc::numberVarError;
else {
myRuntimeValue = (int)nutStringVar.toFloat(&okFloat);
if (!okFloat) myRuntimeValue = knc::numberVarError;
}
}
else myRuntimeValue = knc::numberVarError;
myStatusValue = m_activeUpsInfo->upsNet->readStatus();
switch (m_typeOfIcon) {
case generalKI:
// *********STATUS****************
if (myStatusValue !=m_statusValue ) {
m_statusValue = myStatusValue;
paintStatus(m_statusValue);
repaintNow = true;
}
// **********RUNTIME***********
myStatusBatValue = myStatusValue & KNutNet::OB; // OB = UPS runs on battery
if ((myRuntimeValue != m_runtimeValue) || (myStatusBatValue != m_statusBatValue)) {
// when runtime is changed or flags OB is changed we must repaint icons
// when OB is changed same items in icon will change color
m_runtimeValue = myRuntimeValue; // runtime is old value of runtime, one is defined like global value of class
m_statusBatValue = myStatusBatValue;
paintRuntime(m_runtimeValue, m_statusValue);
repaintNow = true;
}
break;
case pictureKI:
// *********STATUS****************
if (myStatusValue !=m_statusValue ) {
m_statusValue = myStatusValue;
m_statusWarningValue = myStatusValue & (KNutNet::CAL | KNutNet::TRIM | KNutNet::BOOST
| KNutNet::OVER | KNutNet::RB);
repaintNow = true;
}
// **********RUNTIME***********
if (myRuntimeValue != m_runtimeValue) {
m_runtimeValue = myRuntimeValue;
repaintNow = true;
}
break;
} ///////////////////// end of models
// Other values are for all modes
// **********UPS LOAD***************
if (m_activeUpsInfo->nutVariables == 1) valueName = "LOADPCT";
else valueName = "ups.load";
if (!m_activeUpsInfo->upsNet->existName(valueName)) {
nutStringVar = m_activeUpsInfo->upsNet->readStringVar(valueName);
if (nutStringVar.isEmpty()) myUpsLoadValue=knc::numberVarError;
else {
myUpsLoadValue = (int)nutStringVar.toFloat(&okFloat);
if (!okFloat) myUpsLoadValue=knc::numberVarError;
}
}
else myUpsLoadValue=knc::numberVarError;
if (myUpsLoadValue != m_upsLoadValue) {
m_upsLoadValue = myUpsLoadValue;
if (m_typeOfIcon == generalKI) paintLoad(m_upsLoadValue);
repaintNow = true;
}
// *********BATTERY CHARGE****************
if (m_activeUpsInfo->nutVariables == 1) valueName="BATTPCT";
else valueName="battery.charge";
if (!m_activeUpsInfo->upsNet->existName(valueName)) {
nutStringVar = m_activeUpsInfo->upsNet->readStringVar(valueName);
if (nutStringVar.isEmpty()) myBatteryChargeValue=knc::numberVarError;
else {
myBatteryChargeValue = (int)nutStringVar.toFloat(&okFloat);
if (!okFloat) myBatteryChargeValue = knc::numberVarError;
}
}
else myBatteryChargeValue=knc::numberVarError;
if (myBatteryChargeValue != m_batteryChargeValue) {
m_batteryChargeValue = myBatteryChargeValue;
if (m_typeOfIcon == generalKI)paintCharge(m_batteryChargeValue);
repaintNow = true;
}
// ************* End of values********************
if (repaintNow || always || (m_dataOk != m_dataOkOld)) {
switch (m_typeOfIcon) {
case generalKI:
m_mainLayer->fill(m_myBGColor);
// copyBlt (m_mainLayer,0,0,m_runtimeLayer,0,0,24,24);
bitBlt (m_mainLayer,0,0,m_runtimeLayer,0,0,24,24,AndROP);
bitBlt (m_mainLayer,0,0,m_loadLayer,0,0,24,24,AndROP);
bitBlt (m_mainLayer,0,0,m_chargeLayer,0,0,24,24,AndROP);
bitBlt (m_mainLayer,0,0,m_statusLayer,0,0,24,24,AndROP);
break;
case pictureKI:
// if (m_statusValue & KNutNet::OL) bitBlt (m_mainLayer,0,0,m_loadLayer,0,0,24,24,AndROP); // icon of UPS
if (m_statusValue & KNutNet::OL) { // ONLINE - icon of UPS
int myLoad;
QPainter paint;
copyBlt (m_mainLayer,0,0,&m_upsPix,0,0,24,24); // icon of UPS
paint.begin(m_mainLayer);
if (m_upsLoadValue == knc::numberVarError) myLoad=0;
else myLoad = abs(m_upsLoadValue/10);
if (m_upsLoadValue != knc::numberVarError) {
if (myLoad > 12) myLoad=12;
if (myLoad > 10) myLoad++; // preskocime rysku pro 100 %
if (myLoad < 9) paint.setPen(QColor(0,192,0)); //green
else {
if (myLoad < 11) paint.setPen(QColor(255,255,0)); //yellow
else paint.setPen(QColor(255,0,0));//red
}
for (int i = 19; i < 22; i++) paint.drawLine(i,13,i,13-myLoad +1);
if (myLoad < 13) {
paint.setPen(QColor(168,220,255));
for (int i = 20; i < 23; i++ ) paint.drawLine(i,1,i,13-myLoad);
}
}
paint.setPen(QColor(Qt::black)); // line for 100 % load
paint.drawLine(19,3,22,3);
if (!m_statusWarningValue) paintOKPoint(paint);
else paintErrorPoint(paint);
paint.end();
}
else {
QPainter paint;
copyBlt (m_mainLayer,0,0,&m_battPix,0,0,24,24); // icon of Battery
paint.begin(m_mainLayer);
if (m_batteryChargeValue != knc::numberVarError) {
if (m_batteryChargeValue < 40) paint.setPen(Qt::red);
else paint.setPen(Qt::black);
if (m_batteryChargeValue < 40) paint.setPen(Qt::red);
else {
if (m_batteryChargeValue < 50) paint.setPen(Qt::yellow);
else paint.setPen(Qt::green);
}
int delka = abs((16*m_batteryChargeValue)/100);
delka += abs((delka-1)/4) -1;
paint.drawLine (2,7,2+delka,7);
paint.drawLine (2,8,2+delka,8);
paint.drawLine (2,9,2+delka,9);
}
paint.end();
}
break;
}
toolTip(m_runtimeValue, m_statusValue, m_batteryChargeValue, m_upsLoadValue);
setPixmap(*m_mainLayer);
}
}
else { // KNutNet->state isn't connected
// we must test activeUpsInfo->netError because error can rise higher level
if (m_activeUpsInfo->netError)
m_dataOk = error; // error is value not variable
else {
if ((m_activeUpsInfo->upsNet->getState() == KNutNet::Connecting) ||
(m_activeUpsInfo->upsNet->getState() == KNutNet::HostLookup))
m_dataOk = connecting;
else m_dataOk = idle;
}
if ((m_dataOk != m_dataOkOld) or always) {
toolTip(0, -1, 0, 0);
m_dataOkOld=m_dataOk;
if (m_dataOk == connecting) setPixmap(m_connectPix);
else {
if (m_dataOk == error) setPixmap(m_errorPix);
else {
setPixmap(m_mainPix);
}
}
}
}
repaint();
}
void KNutDock::toolTip (int runtime, int status, int batteryCharge, int upsLoad ) {
QString text;
QString manufacturer = "";
QString upsModel = "";
QString serial = "";
QString firmware = "";
int myNetErr = 0;
int min = abs(runtime/60);
int sec = runtime - (min*60);
if (m_activeUpsInfo->upsNet != 0) {
myNetErr= m_activeUpsInfo->upsNet->getError();
switch (m_activeUpsInfo->nutVariables) {
case 1:
manufacturer = m_activeUpsInfo->upsNet->readStringVar("MFR");
upsModel = m_activeUpsInfo->upsNet->readStringVar("MODEL");
serial = m_activeUpsInfo->upsNet->readStringVar("SERIAL");
firmware = m_activeUpsInfo->upsNet->readStringVar("FIRMREV");
break;
case 2:
manufacturer = m_activeUpsInfo->upsNet->readStringVar("ups.mfr");
upsModel = m_activeUpsInfo->upsNet->readStringVar("ups.model");
serial = m_activeUpsInfo->upsNet->readStringVar("ups.serial");
firmware = m_activeUpsInfo->upsNet->readStringVar("ups.firmware");
break;
}
}
text = i18n("Name")+" : "+m_activeUpsInfo->record.name + "\n"
+i18n("UPS name")+" : "+m_activeUpsInfo->record.upsName + "\n"
+i18n("UPS address")+" : "+m_activeUpsInfo->record.upsAddress +"\n"
+i18n("Status : ");
if (status == -1) {
text += i18n("Connection doesn't exist.");
}
else {
if (status & KNutNet::OL) {
text += i18n("UPS On line");
}
else {
if (status & KNutNet::OB) {
text += i18n("UPS On battery");
}
else {
if (status & KNutNet::OFF) {
text += i18n("UPS Of line");
}
}
}
if (status & KNutNet::LB) {
text += "\n" + i18n("Status : ") + i18n("UPS Battery is low");
}
if (status & KNutNet::RB) {
text += "\n" + i18n("Status : ") + i18n("Replace battery");
}
if (status & KNutNet::CAL) {
text += "\n" + i18n("Status : ") + i18n("UPS is performing calibration");
}
if (status & KNutNet::OVER) {
text += "\n" + i18n("Status : ") + i18n("UPS is Overload");
}
if (status & KNutNet::TRIM) {
text += "\n" + i18n("Status : ") + i18n("UPS is trimming voltage");
}
if (status & KNutNet::BOOST) {
text += "\n" + i18n("Status : ")+ i18n("UPS is boosting voltage");
}
}
if ((status == -1) && (myNetErr != KNutNet::NoError)) {
text += "\n" + i18n("Error : ")+ KNutVarData::errorToText(myNetErr);
}
if (m_toolTipFlags & TTMFR) text += "\n" + i18n("Manufac. : ")+ manufacturer;
if (m_toolTipFlags & TTModel) text += "\n" + i18n("Name")+" : "+ upsModel;
if (m_toolTipFlags & TTSerial) text += "\n" + i18n("Serial")+" : "+ serial;
if (m_toolTipFlags & TTFirm) text += "\n" + i18n("Firmware")+" : "+ firmware;
if (m_toolTipFlags & TTRun) {
if (runtime != knc::numberVarError)
text += "\n" + i18n("Runtime") + i18n(" : %1:%2 min").arg(min).arg(sec);
}
if (m_toolTipFlags & TTCharge) {
if (batteryCharge != knc::numberVarError)
text += "\n" + i18n("Battery Charge") + QString(" : %1 %").arg(batteryCharge);
}
if (m_toolTipFlags & TTLoad) {
if (upsLoad != knc::numberVarError)
text += "\n" + i18n("UPS Load") + QString(" : %1 %").arg(upsLoad);
}
QToolTip::remove(this);
QToolTip::add(this,text);
}
/*********************************************************************************************/
/* */
/* PRIVATE SLOTS */
/* */
/*********************************************************************************************/
void KNutDock::slotShowMyAbout() {
KAboutApplication *dialog;
dialog= new KAboutApplication;
dialog->exec();
delete dialog;
}
void KNutDock::slotExitApplication (void) {
if (m_settingData->areYouSure) {
if (KMessageBox::warningYesNo (0,i18n("Are you sure ?")) == 3)
emit endApplication();
}
else emit endApplication();
}
void KNutDock::slotUpsName(int i) {
emit UPSChanged(m_upsRecords->getName(i-101));
}
void KNutDock::slotMinimize(void) {
emit minimize ();
}
void KNutDock::slotPreferences(void) {
emit preferences();
}
void KNutDock::slotPrintUPSVars(void) {
emit printUPSVars();
}
void KNutDock::slotInstComms(void) {
emit instComms();
}
void KNutDock::slotRWVars(void) {
emit RWVars();
}
void KNutDock::slotRefreshConnection(void) {
emit makeRefreshConnection();
}
//------------------------------------------
void KNutDock::mousePressEvent(QMouseEvent *e) {
//qDebug("KNutDock::mousePressEvent");
if( e->button()==LeftButton ) emit activeMainWindow();
if( e->button()==RightButton ) m_menu->popup(e->globalPos());
}
void KNutDock::paintEvent (QPaintEvent *e) {
KSystemTray::paintEvent(e);
if ((m_activeUpsInfo->upsNet->getState() == KNutNet::Connected) and
(m_statusValue != KNutNet::NS)) { // When driver isn't connected, getState is connected and m_statusValue is NS // NONE STATUS
if (m_typeOfIcon == pictureKI) {
QPainter painter(this);
// painter.begin();
if (m_statusValue & KNutNet::OL) { // ONLINE - icon of UPS
painter.setPen(Qt::black);
paintNumbers (m_upsLoadValue, -2, 15, &painter );
}
else { // OFFLINE icon of battery
if (m_batteryChargeValue != knc::numberVarError) {
if (m_batteryChargeValue < 40) painter.setPen(Qt::red);
else painter.setPen(Qt::black);
paintNumbers(m_batteryChargeValue,-2,16,&painter);
}
else {
painter.setPen(Qt::black);
paintDash (3,16,&painter);
paintDash (8,16,&painter);
}
}
// painter.end();
}
}
}
/*********************************************************************************************/
/* */
/* PRIVATE FUNCTIONS */
/* */
/*********************************************************************************************/
void KNutDock::clearValues(void) {
m_batteryChargeValue = 0;
m_runtimeValue = 0;
m_upsLoadValue = 0;
m_statusValue = 0;
}
void KNutDock::createUpsMenu(void) {
int n = m_upsRecords->getCount();
for (int i =0; i < n; i++) {
if (m_activeUpsInfo->record.name == m_upsRecords->getName(i))
m_upsServerMenu->insertItem(kapp->miniIcon(),m_upsRecords->getName(i), this, SLOT(slotUpsName(int)),0,101+i);
else
m_upsServerMenu->insertItem(m_upsRecords->getName(i), this, SLOT(slotUpsName(int)),0,101+i);
}
}
void KNutDock::createMainMenu(void) {
m_menu = new KPopupMenu;
m_upsServerMenu = new KPopupMenu;
createUpsMenu();
m_menu->insertTitle (kapp->miniIcon(),"knutclient");
m_menu->insertSeparator();
m_menu->insertItem("UPS",m_upsServerMenu);
m_menu->insertSeparator();
m_menu->insertItem(i18n("&Showing UPS variables and commands"), this, SLOT(slotPrintUPSVars()));
m_menu->insertItem(i18n("&Running instant commands"), this, SLOT(slotInstComms()));
m_menu->insertItem(i18n("Setting R&W variables"), this, SLOT(slotRWVars()));
m_menu->insertSeparator();
m_menu->insertItem(SmallIcon("reload"),i18n("Reconnect"), this, SLOT(slotRefreshConnection()));
m_menu->insertSeparator();
m_menu->insertItem(SmallIcon("configure"),i18n("&Preferences"), this, SLOT(slotPreferences()));
m_menu->insertSeparator();
m_menu->insertItem(kapp->miniIcon(),i18n("&About KNutClient"), this, SLOT(slotShowMyAbout()));
m_menu->insertSeparator();
m_menu->insertItem(i18n("&Minimize"), this, SLOT(slotMinimize()));
m_menu->insertSeparator();
m_menu->insertItem (SmallIcon("exit"),i18n("&Exit"),this ,SLOT(slotExitApplication()));
}
void KNutDock::paintCharge (int charge ) {
QPainter paint;
m_chargeLayer->fill(Qt::white);
paint.begin(m_chargeLayer);
if (charge > 199) charge = 199;
if (m_typeOfIcon == generalKI) {
if (charge != knc::numberVarError) {
if (charge < 40) paint.setPen(Qt::red);
else paint.setPen(Qt::black);
paintNumbers(charge,8,2,&paint);
}
else {
paint.setPen(Qt::black);
paintDash (13,2,&paint);
paintDash (18,2,&paint);
}
}
else {
// picture version
if (charge != knc::numberVarError) {
if (charge < 40) paint.setPen(Qt::red);
else paint.setPen(Qt::black);
paintNumbers(charge,-2,16,&paint);
if (charge < 40) paint.setPen(Qt::red);
else {
if (charge < 50) paint.setPen(Qt::yellow);
else paint.setPen(Qt::green);
}
int delka = abs((16*charge)/100);
delka += abs((delka-1)/4) -1;
paint.drawLine (2,7,2+delka,7);
paint.drawLine (2,8,2+delka,8);
paint.drawLine (2,9,2+delka,9);
}
else {
paint.setPen(Qt::black);
paintDash (3,16,&paint);
paintDash (8,16,&paint);
}
}
paint.end();
}
void KNutDock::paintErrorPoint ( QPainter& paint ) {
paint.setPen(QColor(0,0,255));
paint.setPen(QColor(255,0,0));
paint.drawLine(19,18,21,18);
paint.drawLine(19,19,21,19);
paint.drawLine(19,20,21,20);
}
void KNutDock::paintOKPoint (QPainter& paint ) {
paint.setPen(QColor(0,255,0));
paint.drawLine(19,18,21,18);
paint.drawLine(19,19,21,19);
paint.drawLine(19,20,21,20);
}
void KNutDock::paintStatus (int status ) {
QPainter paint;
int lastPos = 0;
m_statusLayer->fill(Qt::white);
paint.begin(m_statusLayer);
if (status & KNutNet::OL) {
paint.setPen(Qt::black);
paintChar (1,2,'P',&paint);
}
else {
if (status & KNutNet::OB) {
paint.setPen(Qt::red);
paintChar (1,2,'B',&paint);
}
}
if (status & KNutNet::LB) {
paint.setPen(Qt::red);
paintChar (6,2,'L',&paint);
}
if ((lastPos <2) && (status & KNutNet::RB)) {
paint.setPen(Qt::red);
paintChar (6,2,'R',&paint);
lastPos++;
}
if ((lastPos <2) && (status & KNutNet::BOOST)) {
paint.setPen(Qt::red);
paintChar (6,2,'B',&paint);
lastPos++;
}
if ((lastPos <2) && (status & KNutNet::TRIM)) {
paint.setPen(Qt::red);
paintChar (6,2,'T',&paint);
lastPos++;
}
if ((lastPos <2) && (status & KNutNet::CAL)) {
paint.setPen(Qt::red);
paintChar (6,2,'C',&paint);
lastPos++;
}
paint.end();
}
void KNutDock::paintRuntime (int runtime, int status ) {
QPainter paint;
m_runtimeLayer->fill(Qt::white);
paint.begin(m_runtimeLayer);
if (status & KNutNet::OB)
paint.setPen(Qt::red);
else
paint.setPen(Qt::black);
if (runtime != knc::numberVarError) {
int min = abs(runtime/60);
int sec = runtime - (min*60);
paintNumber(1,11, abs(min/10) ,&paint);
paintNumber(6,11,min-((abs(min/10))*10) ,&paint);
paintNumber(13,11, abs(sec/10) ,&paint);
paintNumber(18,11,sec-((abs(sec/10))*10) ,&paint);
}
else {
paintDash (1,11,&paint);
paintDash (6,11,&paint);
paintDash (13,11,&paint);
paintDash (18,11,&paint);
}
paint.drawLine (11,12,11,13);
paint.drawLine (11,15,11,16);
paint.end();
}
void KNutDock::paintLoad (int load ) {
QPainter paint;
int myLoad;
// if (m_typeOfIcon != generalKI) bitBlt (m_loadLayer,0,0,m_upsLayer,0,0,24,24,AndROP);
m_loadLayer->fill(Qt::white);
paint.begin(m_loadLayer);
if (load == knc::numberVarError) myLoad=0;
else myLoad = abs(load/10);
if (m_typeOfIcon == generalKI) {
if (load != knc::numberVarError) {
if (myLoad > 11) myLoad=11;
if (myLoad < 9) paint.setPen(Qt::green);
else {
if (myLoad < 11) paint.setPen(Qt::yellow);
else paint.setPen(Qt::red);
}
paint.setPen(Qt::green.light(60));
for (int i = 0; i < myLoad; i++) {
paint.drawLine((i*2)+1,19,(i*2)+1,21);
}
paint.setPen(Qt::cyan.light(150));
for (int i = myLoad; i < 11; i++) {
paint.drawLine((i*2)+1,19,(i*2)+1,21);
}
}
}
paint.end();
}
void KNutDock::paintNumbers (int numbers, int x, int y, QPainter* p ) {
bool first = false;
if (numbers > 199) numbers = 199;
if (numbers != knc::numberVarError) {
if (numbers > 99) {
paintNumber (x,y,1,p);
numbers -= 100;
first=true;
}
int second = abs (numbers/10);
int third = numbers - (second * 10);
if ((second != 0) || (first)) paintNumber (x+5,y,second,p);
paintNumber (x+10,y,third,p);
}
else {
p->setPen(Qt::black);
paintDash (x+5,y,p);
paintDash (x+10,y,p);
}
}
void KNutDock::paintDash (int x, int y, QPainter *p) {
p->drawLine(x,y+3,x+3,y+3);
}
void KNutDock::paintNumber (int x, int y, int number, QPainter *p) {
// x and y are left top corner
if ((number > -1) && (number < 10)) {
// painting - kreslim
switch (number) {
case 0:
p->drawRect(x,y,4,7);
break;
case 1:
p->drawLine (x+3,y,x+3,y+6);
break;
case 2:
p->drawLine(x,y,x+3,y);
p->lineTo(x+3,y+3);
p->lineTo(x,y+3);
p->lineTo(x,y+6);
p->lineTo(x+3,y+6);
break;
case 3:
p->drawLine(x,y,x+3,y);
p->lineTo(x+3,y+6);
p->lineTo(x,y+6);
p->drawLine(x,y+3,x+3,y+3);
break;
case 4:
p->drawLine(x,y,x,y+3);
p->lineTo(x+3,y+3);
p->drawLine (x+3,y,x+3,y+6);
break;
case 5:
p->drawLine(x+3,y,x,y);
p->lineTo(x,y+3);
p->lineTo(x+3,y+3);
p->lineTo(x+3,y+6);
p->lineTo(x,y+6);
break;
case 6:
p->drawRect(x,y+3,4,4);
p->drawLine(x,y+3,x,y);
p->lineTo(x+3,y);
break;
case 7:
p->drawLine(x,y,x+3,y);
p->lineTo(x+3,y+6);
break;
case 8:
p->drawRect(x,y,4,7);
p->drawLine(x,y+3,x+3,y+3);
break;
case 9:
p->drawRect(x,y,4,4);
p->drawLine(x+3,y+3,x+3,y+6);
p->lineTo(x,y+6);
break;
}
}
}
void KNutDock::paintChar (int x, int y, char LCDChar, QPainter *p) {
// x and y are left up corner
switch (LCDChar) {
case 'L':
p->drawLine(x,y,x,y+6);
p->lineTo(x+3,y+6);
break;
case 'O':
p->drawRect(x,y,4,7);
break;
case 'B':
p->drawLine(x,y,x,y+6);
p->lineTo(x+2,y+6);
p->drawLine(x,y,x+2,y);
p->drawLine(x,y+3,x+2,y+3);
p->drawLine(x+3,y+1,x+3,y+2);
p->drawLine(x+3,y+4,x+3,y+5);
break;
case 'U':
p->drawLine(x,y,x,y+6);
p->lineTo(x+3,y+6);
p->lineTo(x+3,y);
break;
case 'C':
p->drawLine(x+3,y+1,x+3,y);
p->lineTo(x,y);
p->lineTo(x,y+6);
p->lineTo(x+3,y+6);
p->lineTo(x+3,y+5);
break;
case 'R':
p->drawLine(x,y,x,y+6);
p->drawLine(x,y,x+2,y);
p->drawLine(x,y+3,x+2,y+3);
p->drawLine(x+3,y+1,x+3,y+2);
p->drawLine(x+3,y+4,x+3,y+6);
break;
case 'P':
p->drawLine(x,y,x,y+6);
p->drawLine(x,y,x+2,y);
p->drawLine(x,y+3,x+2,y+3);
p->drawLine(x+3,y+1,x+3,y+2);
break;
case 'T':
p->drawLine(x+2,y,x+2,y+6);
p->drawLine(x,y,x+4,y);
break;
}
}
#include "knutdock.moc"

@ -0,0 +1,525 @@
/***************************************************************************
knutdock.h - description
-------------------
begin : Út zari 23 2003
copyright : (C) 2003 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef KNUTDOCK_H
#define KNUTDOCK_H
#include "knutupsdata.h"
#include "knutvardata.h"
#include "knutconst.h"
#include <ksystemtray.h>
#include <kpopupmenu.h>
#include <qobject.h>
class QString;
class QPixmap;
class QColor;
/**
* This class makes icons in dock.
* Tato trida zajistuje vytvoreni icony v docku.
*
* @author Daniel Prynych
* @short Dock's icons
* @version 0.3
*/
class KNutDock : public KSystemTray {
Q_OBJECT
public:
enum KNTDconst { DefaultToolTipFlags = 0x398};
enum upsConnection {
idle, // ups isn't connected
connecting, // ups is connecting
ok, // ups is connected
error // error of connecting
};
enum eTypeOfIcons { pictureKI = 0, generalKI};
enum toolTipItems {
TTMFR = 0x8, // 8, // FRM
TTModel = 0x10, // 16, // Model
TTSerial = 0x20, // 32, // Serial
TTFirm = 0x40, //64, // Firmware Revision
TTRun = 0x80,// 128, // Runtime
TTCharge = 0x100, // 256, // Charge
TTLoad = 0x200 // 512 // Load
};
/**
* Constructor - makes icon in dockbar.
* Konstruktor - vytvori iconu v docku.
*
* @param activeUpsInfo odkaz na structuru upsInfo
* @param activeUpsInfo pointer to structure upsInfo
* @param settingData odkaz na strukturu typu SettingDataDef
* @param settingData pointer to structure type of SettingDataDef
* @param upsRecord odkaz na instanci tridy tActiveUpsInfo
* @param upsRecord pointer to class tActiveUpsInfo
* @since 0.3
*/
KNutDock(KNutVarData::upsInfoDef* activeUpsInfo, KNutVarData::SettingDataDef* settingData, KNutUpsData* upsRecords);
/**
* Destruktor.
*
* @since 0.1.2
**/
~KNutDock();
/**
* Nastavi zakladni nastaveni pro dock.
* Sets basic setting for dock.
*
* @since 0.1
**/
void clearDockValues(void);
/**
* Vytvori menu (seznam) UPS.
* Makes menu (list) of UPS.
*
* @since 0.1
**/
void changeUps(void);
/**
* Zmeni styl/typ icon
* Changes style/type of icon
*
* @since 0.1
**/
void changeKIcon (void);
/**
* Zmeni pozadi icony v kickeru
* Changes background of icon in kicker
*
* @since 0.2
**/
void changeKIBColor(void);
/**
* Zmeni prvky v tooltip-u
* Changes items in toolTip
*
* @since 0.1
**/
void changeToolTip(void);
/**
* Provede nove zpracovani dat a jejich nakresli iconu docku, interni repaint je volan vzdy.
* Tato funkce take vola funkci ToolTip.
* Makes new processing of data and paints icons of dock, internal repaint is colled always.
* This function calls function ToolTips too.
* @param always Kdyz je true prorovede vykresleni vzdy, kde je false provede vykresleni jen kdyz je zmenena nejaka hodnota UPS.
* @param always When param is true, icon is made always, is one is false icon is makeing when same UPS's value is changed.
*
* @since 0.4
**/
void repaintDock ( const bool always = false);
/**
* Nastavi v Menu oznaceni pro aktivni UPS.
* Sets mark for active UPS in menu.
*
* @since 0.1
**/
void setNewUPS(void);
signals:
/**This signal is emited when end of application was selected in menu.
* Tento signal je vyslan pokud bylo vybrano v menu ukonceni aplikace.
*
*
* @since 0.1
**/
void endApplication(void);
/**
* Tento signal je vyslan pokud bylo vybrano v menu minimalizace aplikace.
* Tento signal is emited when minimize application was selected in menu.
*
*
* @since 0.1
**/
void minimize(void);
/**
* Tento signal je vyslan pokud bylo vybrano v menu polozka preferences.
* This signal is emited when item preferences was selected in menu.
*
* @since 0.1
**/
void preferences(void);
/**
* Tento signal je vyslan pokud byla vybrana activace hlavniho okna (Main Window).
*
* @since 0.1
**/
void activeMainWindow(void);
/**
* Tento signal je vyslan pokud bylo vybrano zobrazeni promennych;
* This signal is emited when showing values was selected.
*
* @since 0.1
**/
void printUPSVars(void);
/**
* Tento signal je vyslan pokud bylo vybrano provedeni okamziteho prikazu;
* This signal is emited when running instant command was selected.
*
* @since 0.1
**/
void instComms(void);
/**
* Tento signal je vyslan pokud bylo vybrana zmena RW promennych.
* This signal is emited when change of RW values was selected.
*
* @since 0.1
**/
void RWVars(void);
/**
* Tento signal je vyslan pokud bylo vybrana zmena RW promennych.
* This signal is emited when refresh connection was selected
*
* @since 0.1
**/
void makeRefreshConnection(void);
/**
* Tento signal je vyslan pokud je vybrana nova UPS;
* This signal is emited when new UPS is selected
*
* @since 0.1
**/
void UPSChanged(QString name);
protected slots:
virtual void mousePressEvent(QMouseEvent *e);
/**
* @internal
* Vola proceduru KAboutApplication, zobrazi informace o teto aplikaci a KDE.
* Calls procedure KAboutApplication, shows informations about this application and KDE.
*
* @since 0.1
**/
void slotShowMyAbout();
void slotExitApplication (void);
/**
* @internal
* Vysle signal minimize.
* Sends signal minimize.
*
* @since 0.1
**/
void slotMinimize (void);
/**
* @internal
* Vysle signal peferences.
* Sends signal preferences.
*
* @since 0.1
**/
void slotPreferences (void);
/**
* @internal
* Vysle signal printUPSVars.
* Sends signal printUPSVars.
*
* @since 0.1
**/
void slotPrintUPSVars(void);
/**
* @internal
* Vysle signal instComms.
* Sends signal instComms.
*
* @since 0.1
**/
void slotInstComms(void);
/**
* @internal
* Vysle signal RWVars.
* Sends signal RWVars.
*
* @since 0.1
**/
void slotRWVars(void);
/**
* @internal
* Vysle signal upsName
* Sends signal upsName.
*
* @since 0.1
**/
void slotUpsName(int i);
/**
* @internal
* Vysle signal makeRefreshConnection
* Sends signal makeRefreshConnection.
*
* @since 0.1
**/
void slotRefreshConnection(void);
protected:
/**
* @internal
* Nastavi vse pro vykresleni zakladni ikony.
* Tato ikona je kreslena dokud neni navazano spojeni
* Sets all for painting of basic icon.
* This icon is painted
*
* @since 0.2
**/
void initImage(void);
/**
* @internal
* Sets tooltip.
* Nastavi ToolTip.
*
* @since 0.1
**/
void toolTip (int runtime, int status, int batteryCharge, int upsLoad );
/**
* @internal
* Vytvori a hlavni menu panelu.
* Makes a main menu of panel
*
* @since 0.1
**/
void createMainMenu(void);
/**
* @internal
* Vytvori a podmenu pro seznam UPS-ek.
* Makes a submenu for list ig UPSes.
*
* @since 0.1
**/
void createUpsMenu(void);
/**
* @internal
* Paints a numbers.
* Vykresli cisla.
* @param number je hodnota cisla.
* @param x je leva souradnice cisla
* @param y je horni souradnice cisla
* @param p je ukazatel na painter
*
* @since 0.2
**/
void paintNumbers (int numbers, int x, int y, QPainter* p ); //x,y levy horni roh cisla 1
/**
* @internal
* Paints a number
* Vykresli cislici.
* @param number je hodnota cislice.
* @param x je leva souradnice cislice
* @param y je horni souradnice cislice
* @param p je ukazatel na painter
*
* @since 0.1
**/
void paintNumber (int x, int y, int number, QPainter *p);
/**
* @internal
* Paints a char.
* Vykresli znak.
* @param x je leva souradnice cislice
* @param y je horni souradnice cislice
* @param p je ukazatel na painter
* @param char je vykreslovany znak.
*
* @since 0.1
**/
void paintChar (int x, int y, char LCDChar, QPainter *p);
/**
* @internal
* Vykresli pomlcku.
* @param x je leva souradnice pomlcky
* @param y je horni souradnice pomlcky
* @param p je ukazatel na painter
*
* @since 0.1
**/
void paintDash (int x, int y, QPainter *p);
/**
* @internal
* Paints runtime layer.
* Vykresli vrstvu runtime.
*
* @since 0.1
**/
void paintRuntime (int runtime, int status);
/**
* @internal
* Paints layer for UPS Load
* Vykresli vrstvu pro UPS Load.
*
* @since 0.2
**/
void paintLoad (int load );
/**
* @internal
* Paints layer for Battery Charge, only for type general.
* Vykresli vrstvu pro Battery Charge.
*
* @since 0.2
**/
void paintCharge (int charge );
/**
* @internal
* Paints layer for UPS Status, only for type general
* Vykresli vrstvu pro UPS Status.
*
* @since 0.2
**/
void paintStatus (int status );
void paintEvent (QPaintEvent *);
/**
* @internal
* Paints green point into main layer, only for type picture.
* Vykresli do hlavni vrstvy zeleny bod.
* Ma vyznam jen pro typ picture.
*
* @since 0.3
**/
void paintErrorPoint ( QPainter& paint );
/**
* @internal
* Paints red point into main layer, only for type picture.
* Vykresli do hlavni vrstvy cerveny bod.
* Ma vyznam jen pro typ picture.
*
* @since 0.3
**/
void paintOKPoint ( QPainter& paint );
/**
* @internal
* Clean internal variables this class.
* Vycisti interni promene teto tridy.
*
* @since 0.1
**/
void clearValues(void);
KNutUpsData* m_upsRecords;
KNutVarData::SettingDataDef* m_settingData; // v teto strukture jsou ulozeny promene ktere nastavuji konfiguraci
KNutVarData::upsInfoDef* m_activeUpsInfo; // values for selected ups
QPixmap m_mainPix;
QPixmap m_errorPix;
QPixmap m_connectPix;
QPixmap m_upsPix;
QPixmap m_battPix;
QPixmap m_mainLayer1;
QColor backgroundColor;
KPopupMenu* m_menu;
KPopupMenu* m_upsServerMenu;
QPixmap *m_statusLayer;
QPixmap *m_runtimeLayer;
QPixmap *m_loadLayer;
QPixmap *m_chargeLayer;
QPixmap *m_mainLayer;
int m_runtimeValue;
int m_upsLoadValue;
int m_batteryChargeValue;
int m_statusValue;
int m_statusBatValue;
int m_statusWarningValue;
upsConnection m_dataOk; // selects one from four type of icons's view //idle, connecting, connected, error
upsConnection m_dataOkOld;
int m_typeOfIcon;
QColor m_myBGColor;
unsigned int m_toolTipFlags;
};
#endif

@ -0,0 +1,676 @@
/***************************************************************************
knutfrontpanel.cpp - description
-------------------
begin : Tue Aug 21 2001
copyright : (C) 2001 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#include "knutfrontpanel.h"
#include "knutvardata.h"
#include "knutnet.h"
#include <klocale.h>
#include <kapp.h>
#include <qtooltip.h>
#include <qstring.h>
#include <qpaintdevice.h>
#include <qlayout.h>
#include <qlcdnumber.h>
//#include <qframe.h>
#include <qlabel.h>
#include <qcolor.h>
#include <qfont.h>
#include <qpalette.h>
#include <qgroupbox.h>
#include <math.h>
KNutFrontPanel::KNutFrontPanel( QPalette* const paletteIn, QWidget *parent, const unsigned int flags, QFont* const panelFonts, const char *name) : QFrame( parent, name ), m_panelFlags(flags) {
m_myPalette = paletteIn->copy(); // makes deep copy of palette
m_upsOkColor = Qt::green;
m_upsErrorColor = Qt::red;
m_upsBackColor = Qt::white; //backgroundColor();
m_helpColor = Qt::black;
m_typeOfLCDColor=true;
m_LCDNumber1 = 0;
setFrameStyle( QFrame::Box | QFrame::Raised );
setLineWidth( 2 );
if (panelFonts == 0) {
m_panelFont =kapp->font(); // sets font - system font
m_panelBoldFont = kapp->font();
}
else {
m_panelFont = *panelFonts; // sets font / our selected font
m_panelBoldFont = *panelFonts; // change later
}
m_panelBoldFont.setBold (TRUE);
m_panelFont.setBold (FALSE); // sets no bold
m_mainLayout = new QVBoxLayout(this);
m_mainLayout->setMargin ( 10 );
m_mainLayout->setSpacing ( 10 );
// layer for bulbs
m_bulbsGroupBox = new QGroupBox(this);
m_mainLayout->addWidget(m_bulbsGroupBox);
m_bulbsGroupBox->setFrameStyle( QFrame::Panel + QFrame::Raised);
// m_bulbsGroupBox->setFrameStyle( QFrame::Panel + QFrame::Sunken);
m_bulbsGroupBox->setLineWidth(2);
QVBoxLayout* bulbsLayout = new QVBoxLayout(m_bulbsGroupBox);
bulbsLayout->setMargin( 5 );
m_textLabel1 = new QLabel( i18n("UPS On line"),m_bulbsGroupBox);
m_frameOL = new KLed (m_upsBackColor,KLed::Off,KLed::Sunken,KLed::Circular,m_bulbsGroupBox);
m_frameOL->setMaximumSize(30,30);
m_frameOL->setMinimumSize(25,25);
QToolTip::add(m_textLabel1,m_textLabel1->text());
QHBoxLayout* OLLayout = new QHBoxLayout(bulbsLayout);
OLLayout->addWidget(m_textLabel1);
OLLayout->addSpacing(10);
OLLayout->addWidget(m_frameOL);
OLLayout->setMargin (3);
OLLayout->setStretchFactor(m_textLabel1,20);
OLLayout->setStretchFactor(m_frameOL,5);
m_textLabel2 = new QLabel( i18n("UPS On battery"), m_bulbsGroupBox);
m_frameOB = new KLed (m_upsBackColor,KLed::Off,KLed::Sunken,KLed::Circular,m_bulbsGroupBox);
m_frameOB->setMaximumSize(30,30);
m_frameOB->setMinimumSize(25,25);
QToolTip::add(m_textLabel2,m_textLabel2->text());
QHBoxLayout* OBLayout = new QHBoxLayout(bulbsLayout);
OBLayout->addWidget(m_textLabel2);
OBLayout->addSpacing(10);
OBLayout->addWidget(m_frameOB);
OBLayout->setMargin (3);
OBLayout->setStretchFactor(m_textLabel2,20);
OBLayout->setStretchFactor(m_frameOB,5);
m_textLabel3 = new QLabel( i18n("UPS Overload"), m_bulbsGroupBox);
m_frameOVER = new KLed (m_upsBackColor,KLed::Off,KLed::Sunken,KLed::Circular,m_bulbsGroupBox);
m_frameOVER->setMaximumSize(30,30);
m_frameOVER->setMinimumSize(25,25);
QToolTip::add(m_textLabel3,m_textLabel3->text());
m_OLayout = new QHBoxLayout(bulbsLayout);
m_OLayout->addWidget(m_textLabel3);
m_OLayout->addSpacing(10);
m_OLayout->addWidget(m_frameOVER);
m_OLayout->setMargin (3);
m_OLayout->setStretchFactor(m_textLabel3,20);
m_OLayout->setStretchFactor(m_frameOVER,5);
m_textLabel4 = new QLabel( i18n("UPS Battery low"), m_bulbsGroupBox);
m_frameLB = new KLed (m_upsBackColor,KLed::Off,KLed::Sunken,KLed::Circular,m_bulbsGroupBox);
m_frameLB->setMaximumSize(30,30);
m_frameLB->setMinimumSize(25,25);
QToolTip::add(m_textLabel4,m_textLabel4->text());
m_LBLayout = new QHBoxLayout(bulbsLayout);
m_LBLayout->addWidget(m_textLabel4);
m_LBLayout->addSpacing(10);
m_LBLayout->addWidget(m_frameLB);
m_LBLayout->setMargin (3);
m_LBLayout->setStretchFactor(m_textLabel4,20);
m_LBLayout->setStretchFactor(m_frameLB,5);
m_textLabel5 = new QLabel( i18n("Replace battery"), m_bulbsGroupBox);
m_frameRB = new KLed (m_upsBackColor,KLed::Off,KLed::Sunken,KLed::Circular,m_bulbsGroupBox);
m_frameRB->setMaximumSize(30,30);
m_frameRB->setMinimumSize(25,25);
QToolTip::add(m_textLabel5,m_textLabel5->text());
m_RBLayout = new QHBoxLayout(bulbsLayout);
m_RBLayout->addWidget(m_textLabel5);
m_RBLayout->addSpacing(10);
m_RBLayout->addWidget(m_frameRB);
m_RBLayout->setMargin (3);
m_RBLayout->setStretchFactor(m_textLabel5,20);
m_RBLayout->setStretchFactor(m_frameRB,5);
m_textLabel6 = new QLabel( i18n("UPS calibration"), m_bulbsGroupBox);
m_frameCAL = new KLed (m_upsBackColor,KLed::Off,KLed::Sunken,KLed::Circular,m_bulbsGroupBox);
m_frameCAL->setMaximumSize(30,30);
m_frameCAL->setMinimumSize(25,25);
QToolTip::add(m_textLabel6,m_textLabel6->text());
m_CALLayout = new QHBoxLayout(bulbsLayout);
m_CALLayout->addWidget(m_textLabel6);
m_CALLayout->addSpacing(10);
m_CALLayout->addWidget(m_frameCAL);
m_CALLayout->setMargin (3);
m_CALLayout->setStretchFactor(m_textLabel6,20);
m_CALLayout->setStretchFactor(m_frameCAL,5);
m_messGroupBox = new QGroupBox(this);
m_mainLayout->addWidget(m_messGroupBox);
m_messGroupBox->setFrameStyle( QFrame::Panel + QFrame::Raised);
// m_messGroupBox->setFrameStyle( QFrame::Panel + QFrame::Sunken);
m_messGroupBox->setLineWidth(2);
QVBoxLayout* messLayout = new QVBoxLayout(m_messGroupBox);
messLayout->setMargin( 3 );
m_textLabel7 = new QLabel( "", m_messGroupBox);
QToolTip::add(m_textLabel7,m_textLabel7->text());
m_manufacModelLayout = new QHBoxLayout(messLayout);
m_manufacModelLayout->addWidget(m_textLabel7);
m_manufacModelLayout->setMargin ( 3 );
m_textLabelManufac = new QLabel( i18n("Manufac. : "), m_messGroupBox);
m_textLabel8 = new QLabel( "", m_messGroupBox);
QToolTip::add(m_textLabelManufac,m_textLabelManufac->text());
m_manufacLayout = new QHBoxLayout(messLayout);
m_manufacLayout->addWidget(m_textLabelManufac);
m_manufacLayout->addWidget(m_textLabel8);
m_manufacLayout->addStretch(20);
m_manufacLayout->setMargin ( 3 );
m_textLabelName = new QLabel( i18n("Name")+" : ", m_messGroupBox);
m_textLabel9 = new QLabel( "", m_messGroupBox);
QToolTip::add(m_textLabelName,m_textLabelName->text());
m_nameLayout = new QHBoxLayout(messLayout);
m_nameLayout->addWidget(m_textLabelName);
m_nameLayout->addWidget(m_textLabel9);
m_nameLayout->addStretch(20);
m_nameLayout->setMargin ( 3 );
m_textLabelSerial = new QLabel( i18n("Serial : "), m_messGroupBox);
m_textLabel10 = new QLabel( "", m_messGroupBox);
QToolTip::add(m_textLabelSerial,m_textLabelSerial->text());
m_serialLayout = new QHBoxLayout(messLayout);
m_serialLayout->addWidget(m_textLabelSerial);
m_serialLayout->addWidget(m_textLabel10);
m_serialLayout->addStretch(20);
m_serialLayout->setMargin ( 3 );
m_textLabelFirm = new QLabel( i18n("Firm. rev. : "), m_messGroupBox);
m_textLabel11 = new QLabel( "", m_messGroupBox);
QToolTip::add(m_textLabelFirm,m_textLabelFirm->text());
m_firmLayout = new QHBoxLayout(messLayout);
m_firmLayout->addWidget(m_textLabelFirm);
m_firmLayout->addWidget(m_textLabel11);
m_firmLayout->addStretch(20);
m_firmLayout->setMargin ( 3 );
m_valGroupBox = new QGroupBox(this);
m_mainLayout->addWidget(m_valGroupBox);
m_valGroupBox->setFrameStyle( QFrame::Panel + QFrame::Raised);
// m_bulbsGroupBox->setFrameStyle( QFrame::Panel + QFrame::Sunken);
m_valGroupBox->setLineWidth(2);
QVBoxLayout* valLayout = new QVBoxLayout(m_valGroupBox);
valLayout->setMargin( 3 );
m_textLabelRun = new QLabel( i18n("Runtime")+" : ", m_valGroupBox);
QToolTip::add(m_textLabelRun,m_textLabelRun->text());
m_LCDNumber1 = new QLCDNumber (5,m_valGroupBox);
m_LCDNumber1->setSegmentStyle (QLCDNumber::Flat);
m_LCDNumber1->setFrameStyle( QFrame::NoFrame );
m_LCDNumber1->setMinimumSize(50,20);
m_runLayout = new QHBoxLayout(valLayout);
m_runLayout->addWidget(m_textLabelRun);
m_runLayout->addStretch(20);
m_runLayout->addWidget(m_LCDNumber1);
m_runLayout->setMargin ( 5 );
m_mainLayout->addStretch(20);
m_mainLayout->addSpacing(5);
setAllPalettes();
changePanelFont();
paintPanel ();
}
KNutFrontPanel::~KNutFrontPanel(){
}
//************************************************************
void KNutFrontPanel::paintPanel( void ) {
if (m_panelFlags & PBOnLine) {
m_textLabel1->show();
m_frameOL->show();
}
else {
m_textLabel1->hide();
m_frameOL->hide();
}
if (m_panelFlags & PBOnBatt) {
m_textLabel2->show();
m_frameOB->show();
}
else {
m_textLabel2->hide();
m_frameOB->hide();
}
if (m_panelFlags & PBOver) {
m_OLayout->setMargin ( 3 );
m_textLabel3->show();
m_frameOVER->show();
}
else {
m_textLabel3->hide();
m_frameOVER->hide();
m_OLayout->setMargin ( 0 );
}
if (m_panelFlags & PBBattLow) {
m_textLabel4->show();
m_frameLB->show();
m_LBLayout->setMargin ( 3 );
}
else {
m_textLabel4->hide();
m_frameLB->hide();
m_LBLayout->setMargin ( 0 );
}
if (m_panelFlags & PBRepBatt) {
m_textLabel5->show();
m_frameRB->show();
m_RBLayout->setMargin ( 3 );
}
else {
m_textLabel5->hide();
m_frameRB->hide();
m_RBLayout->setMargin ( 0 );
}
if (m_panelFlags & PBCal) {
m_textLabel6->show();
m_frameCAL->show();
m_CALLayout->setMargin ( 3 );
}
else {
m_textLabel6->hide();
m_frameCAL->hide();
m_CALLayout->setMargin ( 0 );
}
if (m_panelFlags & PBMFRMod) {
m_textLabel7->show();
m_manufacModelLayout->setMargin ( 5 );
}
else {
m_textLabel7->hide();
m_manufacModelLayout->setMargin ( 0 );
}
if (m_panelFlags & PBMFR) {
m_textLabel8->show();
m_textLabelManufac->show();
m_manufacLayout->setMargin ( 5 );
}
else {
m_textLabel8->hide();
m_textLabelManufac->hide();
m_manufacLayout->setMargin ( 0 );
}
if (m_panelFlags & PBModel) {
m_textLabel9->show();
m_textLabelName->show();
m_nameLayout->setMargin ( 5 );
}
else {
m_textLabel9->hide();
m_textLabelName->hide();
m_nameLayout->setMargin ( 0 );
}
if (m_panelFlags & PBSerial) {
m_textLabel10->show();
m_textLabelSerial->show();
m_serialLayout->setMargin ( 5 );
}
else {
m_textLabel10->hide();
m_textLabelSerial->hide();
m_serialLayout->setMargin ( 0 );
}
if (m_panelFlags & PBFirm) {
m_textLabel11->show();
m_textLabelFirm->show();
m_firmLayout->setMargin ( 5 );
}
else {
m_textLabel11->hide();
m_textLabelFirm->hide();
m_firmLayout->setMargin ( 0 );
}
if ( (m_panelFlags & PBMFRMod) || (m_panelFlags & PBMFR) || (m_panelFlags & PBModel) || (m_panelFlags & PBSerial) ||(m_panelFlags & PBFirm))
m_messGroupBox->show();
else
m_messGroupBox->hide();
if (m_panelFlags & PBRun) {
// LCDNumber1->show();
// textLabelRun->show();
// runLayout->setMargin ( 5 );
m_valGroupBox->show();
}
else {
// LCDNumber1->hide();
// textLabelRun->hide();
// runLayout->setMargin ( 0 );
m_valGroupBox->hide();
}
}
int KNutFrontPanel::getPanelHeight( void) { return 0; } ///// correct !!!!!!!!
unsigned int KNutFrontPanel::getPanelFlags( void) { return m_panelFlags; }
void KNutFrontPanel::setPanelFlags(const int upsPanelFlags) { m_panelFlags = upsPanelFlags; }
void KNutFrontPanel::setAllNameUps(const QString panelUpsAllName ){
m_textLabel7->setText(panelUpsAllName);
QToolTip::remove(m_textLabel7);
QToolTip::add(m_textLabel7,panelUpsAllName);
}
void KNutFrontPanel::setMFRUps(const QString panelUpsFRM ){
m_textLabel8->setText(panelUpsFRM);
QToolTip::remove(m_textLabelManufac);
QToolTip::add(m_textLabelManufac,m_textLabelManufac->text()+panelUpsFRM);
}
void KNutFrontPanel::setNameUps(const QString panelUpsName ){
m_textLabel9->setText(panelUpsName);
QToolTip::remove(m_textLabelName);
QToolTip::add(m_textLabelName,m_textLabelName->text()+panelUpsName);
}
void KNutFrontPanel::setSerialUps(const QString panelUpsSerial ){
m_textLabel10->setText(panelUpsSerial);
QToolTip::remove(m_textLabelSerial);
QToolTip::add(m_textLabelSerial,m_textLabelSerial->text()+panelUpsSerial);
}
void KNutFrontPanel::setFirmRevUps(const QString upsPanelFormRev ){
m_textLabel11->setText(upsPanelFormRev);
QToolTip::remove(m_textLabelFirm);
QToolTip::add(m_textLabelFirm,m_textLabelFirm->text()+upsPanelFormRev);
}
void KNutFrontPanel::cleanPanel(void) {
m_textLabel7->setText("");
m_textLabel8->setText("");
m_textLabel9->setText("");
m_textLabel10->setText("");
m_textLabel11->setText("");
m_frameOL->setColor(m_upsBackColor);
m_frameOL->off();
m_frameOB->setColor(m_upsBackColor);
m_frameOB->off();
m_frameOVER->setColor(m_upsBackColor);
m_frameOVER->off();
m_frameLB->setColor(m_upsBackColor);
m_frameLB->off();
m_frameRB->setColor(m_upsBackColor);
m_frameRB->off();
m_frameCAL->setColor(m_upsBackColor);
m_frameCAL->off();
m_LCDNumber1->display("-:--");
m_LCDNumber1->setPalette (palette());
}
void KNutFrontPanel::setRuntime(const int runtime) {
QString runtimeString;
if (runtime != knc::numberVarError) {
int min = (int)floor(runtime/60);
int sec = runtime - (min*60);
runtimeString=QString("%1:%2").arg(min,2).arg(sec,2);
if (runtimeString[3] == ' ') runtimeString[3]='0';
}
else runtimeString="-:--";
m_LCDNumber1->display(runtimeString);
}
void KNutFrontPanel::setPanel(const int panelBulbs) {
// OFF - 1 ups je vypnuta
// OL - 2 ups je bezi na sit
// OB - 4 ups bezi na baterie
// LB - 8 baterie je vybyta (pokud je zaroven OB dojde k shutdownu)
// CAL - 16 je spustena calibrace
// OVER - 128 ups je pretizena
// RB - 256 ups pozaduje vymenu baterie
if (!(panelBulbs < 0)) {
// ups online /na sit
if (panelBulbs & KNutNet::OL) {
m_frameOL->setColor(m_upsOkColor);
m_frameOL->on();
m_LCDNumber1->setPalette (m_LCDPaletteOk);
m_typeOfLCDColor=true;
}
else {
m_frameOL->setColor(m_upsBackColor);
m_frameOL->off();
}
// ups ofline /na baterie
if (panelBulbs & KNutNet::OB) {
m_frameOB->setColor(m_upsErrorColor);
m_frameOB->on();
m_LCDNumber1->setPalette (m_LCDPaletteErr);
m_typeOfLCDColor=false;
}
else {
m_frameOB->setColor(m_upsBackColor);
m_frameOB->off();
}
if (panelBulbs & KNutNet::LB) {
m_frameLB->setColor(m_upsErrorColor);
m_frameLB->on();
}
else {
m_frameLB->setColor(m_upsBackColor);
m_frameLB->off();
}
if (panelBulbs & KNutNet::OVER) {
m_frameOVER->setColor(m_upsErrorColor);
m_frameOVER->on();
}
else {
m_frameOVER->setColor(m_upsBackColor);
m_frameOVER->off();
}
if (panelBulbs & KNutNet::RB) {
m_frameRB->setColor(m_upsErrorColor);
m_frameRB->on();
}
else {
m_frameRB->setColor(m_upsBackColor);
m_frameRB->off();
}
if (panelBulbs & KNutNet::CAL) {
m_frameCAL->setColor(m_upsErrorColor);
m_frameCAL->on();
}
else {
m_frameCAL->setColor(m_upsBackColor);
m_frameCAL->off();
}
}
}
/*********************************************************************************************/
/* */
/* PUBLIC SLOTS */
/* */
/*********************************************************************************************/
void KNutFrontPanel::slotSetPanelFont(QFont newPanelFont) {
m_panelFont = newPanelFont; // nastavime font
m_panelBoldFont = newPanelFont; // pozdeji zmenime
m_panelBoldFont.setBold (TRUE);
m_panelFont.setBold (FALSE); // Zrusime bold u panelu
changePanelFont(); // zmeni pismo
paintPanel();
}
/*********************************************************************************************/
/* */
/* PRIVATE FUNCTIONS */
/* */
/*********************************************************************************************/
void KNutFrontPanel::setLCDPalette (void) {
m_LCDPaletteOk = m_myPalette;
m_LCDPaletteErr = m_myPalette;
//Nastavime barvu pro OK system je online
QColorGroup activeColorGroup = m_LCDPaletteOk.active();
activeColorGroup.setColor( QColorGroup::Foreground, green);
m_LCDPaletteOk.setActive(activeColorGroup);
m_LCDPaletteOk.setInactive(activeColorGroup);
//Nastavime Barvu pro Error - System neni online
activeColorGroup = m_LCDPaletteErr.active();
activeColorGroup.setColor( QColorGroup::Foreground, red);
m_LCDPaletteErr.setActive(activeColorGroup);
m_LCDPaletteErr.setInactive(activeColorGroup);
}
void KNutFrontPanel::setPalette (const QPalette & p){
m_myPalette = p;
setAllPalettes();
}
void KNutFrontPanel::setAllPalettes (void){
QColor myColor;
QFrame::setPalette (m_myPalette);
//QColorGroup myColorGroup = myPalette.active();
// LCDPaletteOk = myPalette;
// LCDPaletteErr = myPalette;
setLCDPalette();
m_bulbsPalette = m_myPalette;
m_frameOL->setPalette(m_bulbsPalette);
// we must correct feature of KLed, KLed repaint background when color of item (function KLed::setColor()) is changed only
// when we change palette backround only, KLed ignore this change
myColor = m_frameOL->color();
m_frameOL->setColor(m_helpColor); // black is neutral (unprofitable) color for us
m_frameOL->setColor(myColor);
myColor = m_frameOB->color();
m_frameOB->setColor(m_helpColor);
m_frameOB->setColor(myColor);
myColor = m_frameLB->color();
m_frameLB->setColor(m_helpColor);
m_frameLB->setColor(myColor);
myColor = m_frameOVER->color();
m_frameOVER->setColor(m_helpColor);
m_frameOVER->setColor(myColor);
myColor = m_frameRB->color();
m_frameRB->setColor(m_helpColor);
m_frameRB->setColor(myColor);
myColor = m_frameCAL->color();
m_frameCAL->setColor(m_helpColor);
m_frameCAL->setColor(myColor);
if (m_LCDNumber1) {
if (m_typeOfLCDColor)
m_LCDNumber1->setPalette (m_LCDPaletteOk);
else
m_LCDNumber1->setPalette (m_LCDPaletteErr);
}
}
void KNutFrontPanel::changePanelFont (void) {
m_textLabel1->setFont(m_panelFont);
m_textLabel2->setFont(m_panelFont);
m_textLabel3->setFont(m_panelFont);
m_textLabel4->setFont(m_panelFont);
m_textLabel5->setFont(m_panelFont);
m_textLabel6->setFont(m_panelFont);
m_textLabelManufac->setFont(m_panelFont);
m_textLabelName->setFont (m_panelFont);
m_textLabelSerial->setFont (m_panelFont);
m_textLabelFirm->setFont (m_panelFont);
m_textLabelRun->setFont (m_panelFont);
m_textLabel7->setFont (m_panelBoldFont);
m_textLabel8->setFont (m_panelBoldFont);
m_textLabel9->setFont (m_panelBoldFont);
m_textLabel10->setFont (m_panelBoldFont);
m_textLabel11->setFont (m_panelBoldFont);
m_textLabelRun->setFont (m_panelFont);
}
#include "knutfrontpanel.moc"

@ -0,0 +1,333 @@
/***************************************************************************
knutfrontpanel.h - description
-------------------
begin : Tue Aug 21 2001
copyright : (C) 2001 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef KNUTFRONTPANEL_H
#define KNUTFRONTPANEL_H
#include <kled.h>
#include <qframe.h>
/**
*@author Daniel Prynych
*/
class QFont;
class QPalette;
class QColor;
class QLCDNumber;
class QLabel;
class QVBoxLayout;
class QHBoxLayout;
class QGroupBox;
/**
* Class is used for feature of panel, which shows informations about UPS.
* Trida slouzi pro zobrazeni panelu, ktery zobrazuje informace o UPS.
*
*
* @author Daniel Prynych
* @short Main panel
* @version 0.7.0
*/
class KNutFrontPanel : public QFrame {
Q_OBJECT
public:
enum KNFPConst { DefaultPanelFlags = 1615}; //1+2+4+8+64+512+1024
enum panelBulb {
PBOnLine = 1, // Panel Bulb On Line
PBOnBatt = 2, // Panel Bulb On Battery
PBOver = 4, // Panel Bulb Overloading
PBBattLow = 8, // Panel Bulb Battery Low
PBRepBatt = 16, // Panel Bulb Replace Battery
PBCal = 32, // Panel Bulb Calibration
PBMFRMod = 64, // FRM + Model
PBMFR = 128, // FRM
PBModel = 256, // Model
PBSerial = 512, // Serial
PBFirm = 1024, // Firmware Revision
PBRun=2048 // Panel LCD Number Runtime
};
/**
* Constructor - makes panel, which shows status of UPS
* Konstruktor - vytvori panel, ktery zobrazuje stav UPS-ky.
*
* @param flags Determine which parts will be shown.
* @param panelFonts Pointer to font, which is used for painnting, when one is 0 (zero) systems font is used.
* @param flags Udava ktere casti se maji na panelu zobrazit.
* @param panelFonts Odkaz na fonts ktery se ma pouzit pro vykreslovani, pokud je = 0 (nula) pouzije se systemovy font pri aplikaci.
* @since 0.8
*/
KNutFrontPanel( QPalette* const paletteIn, QWidget *parent = 0, const unsigned int flags = DefaultPanelFlags, QFont* const panelFonts = 0L ,const char *name = 0);
/**
* Destruktor
*
* @since 0.3
*/
~KNutFrontPanel();
/**
* Vykresli na panelu udaje.
* Paints values on panel.
*
* @since 0.4
*/
void paintPanel( void);
/**
* Gets height of panel.
* Vrati vysku panelu.
* Od verzi 0.4 je vracena vzdy 0. !!!!!!
* From version 0.4 always gets 0 !!!!!!!!!!!
*
* @since 0.4
*/
int getPanelHeight( void);
/**
* Vrati nastaveni panelu.
* Gets setting of panel (flags of panel).
*
* @since 0.2
*/
unsigned int getPanelFlags( void);
/**
* Nastavi priznaky(nastaveni) panelu. Tyto priznaky nastavuji ktere prvky budou na panelu zobrazeny.
* Sets flags of panel. This flags sets what items will be shown on panel.
*
* @param upsPanelFlags flags od panel.
* @param upsPanelFlags priznaky panelu.
*
* @since 0.2
*/
void setPanelFlags(const int upsPanelFlags);
/**
* Shows complete name (name of UPS and manufacturer) of UPS on panel.
* Zobrazi na panelu cele jmeno (jmeno UPS a vyrobce ) UPS-ky.
*
* @param upsPanelName Text which is showed on panel (address of UPS and manufacturer).
* @param upsPanelName Text ktery se zobrazi na panelu (adresa UPS-ky a vyrobce).
*
* @since 0.2
*/
void setAllNameUps(const QString panelUpsAllName);
/**
* Shows name of UPS on panel.
* Zobrazi na panelu jmeno UPS-ky.
*
* @param upsPanelName Text which is shown on panel (name of UPS).
* @param upsPanelName Text ktery se zobrazi na panelu (jmeno UPS-ky).
*
* @since 0.3
*/
void setNameUps(const QString panelUpsName );
/**
* Zobrazi na panelu jmeno vyrobce UPS-ky.
* Shows name of UPS's manufacturer on panel.
*
* @param panelUpsFRM Text ktery se zobrazi na panelu (vyrobce UPS).
* @param panelUpsFRM Text which is showed on panel (UPS's manufacturer).
*
* @since 0.2
*/
void setMFRUps(const QString panelUpsFRM );
/**
* Shows serial number of UPS on panel.
* Zobrazi na panelu seriove cislo UPS-ky.
*
* @param panelUpsSerial Text ktery se zobrazi na panelu (seriove cislo UPS-ky).
* @param panelUpsSerial Text which is showed on panel (serial number of UPS).
*
* @since 0.2
*/
void setSerialUps(const QString panelUpsSerial );
/**
* Zobrazi na panelu verzi firmwaru cislo UPS-ky.
*
* @param upsPanelFormRev Text ktery se zobrazi na panelu (verze firmwaru UPS-ky).
*
* @since 0.2
*/
void setFirmRevUps(const QString upsPanelFormRev );
/**
* Offs bulbs on panel. / Cleans panel.
* Zhasne indikacni prvky na panelu.
*
* @since 0.5
*/
void cleanPanel(void);
/**
* Shows bulbs on panel.
* Rozsviti indikacni prvky na panelu.
*
* @param panelBulbs Code for select lighted bulbs.
* @param panelBulbs Kod pro urceni rozsvicenych indikacnich prvku.
*
* @since 0.4
*/
void setPanel(const int panelBulbs);
/**
* Sets value of runtime.
* Nastavi hodnotu runtime.
*
* @param Runtime hodnota ktera se zobrazi jako runtime.
*
* @since 0.4
*/
void setRuntime(const int runtime);
/**
* Sets palette.
* Nastavi paletu (palette). Predefinovana funkce from QWidget.
*
* @param Palette which mail panel is painted.
* @param Paleta kterou ma byt vykreslen hlavni panel
*
* @since 0.1
*/
void setPalette (const QPalette & );
public slots:
/**
* Changes font for painting.
* Zmeni font pro vykresleni.
*
* @param panelFonts Novy font.
*
* @since 0.2
*/
void slotSetPanelFont(QFont newPanelFont);
private:
/**
* @internal
* Sets palettes for LCDLabel.
* Nastavi palety pro LCDLabel.
*
* @since 0.1
*/
void setLCDPalette (void);
/**
* @internal
* Makes change of palette of all items on based values m_myPalette
* Provede zmenu palety vsech prvku na zaklade promenne m_myPalette
*
* @since 0.1
*/
void setAllPalettes (void);
/**
* @internal
* Makes font's change of all items, based on values m_panelFont and m_panelBoldFont
* Provede zmenu fontu vsech prvku, na zaklade promennych m_panelFont and mpanelBoldFont
*
* @since 0.1
*/
void changePanelFont (void);
QLabel* m_textLabel1;
QLabel* m_textLabel2;
QLabel* m_textLabel3;
QLabel* m_textLabel4;
QLabel* m_textLabel5;
QLabel* m_textLabel6;
QLabel* m_textLabel7;
QLabel* m_textLabel8;
QLabel* m_textLabel9;
QLabel* m_textLabel10;
QLabel* m_textLabel11;
QLabel* m_textLabelManufac;
QLabel* m_textLabelName;
QLabel* m_textLabelSerial;
QLabel* m_textLabelFirm;
QLabel* m_textLabelRun;
KLed* m_frameOL;
KLed* m_frameOB;
KLed* m_frameOVER;
KLed* m_frameLB;
KLed* m_frameRB;
KLed* m_frameCAL;
QLCDNumber* m_LCDNumber1;
QPalette m_LCDPaletteOk, m_LCDPaletteErr;
QPalette m_bulbsPalette;
QColor m_upsOkColor, m_upsErrorColor, m_upsBackColor, m_helpColor;
QFont m_panelFont; // font pro header
QFont m_panelBoldFont; // font for date
unsigned int m_panelFlags; // selects which of rows will be shown/ urcuji ktera radka bude rozsvicena 1 OL, 2 OB, 3 OVER, 4 RB, CAL 5 ...
QPalette m_myPalette;
QGroupBox* m_bulbsGroupBox;
QGroupBox* m_messGroupBox;
QGroupBox* m_valGroupBox;
bool m_typeOfLCDColor;
QVBoxLayout* m_mainLayout;
QHBoxLayout* m_OLayout;
QHBoxLayout* m_LBLayout;
QHBoxLayout* m_RBLayout;
QHBoxLayout* m_CALLayout;
QHBoxLayout* m_manufacModelLayout;
QHBoxLayout* m_manufacLayout;
QHBoxLayout* m_nameLayout;
QHBoxLayout* m_serialLayout;
QHBoxLayout* m_firmLayout;
QHBoxLayout* m_runLayout;
};
#endif

@ -0,0 +1,137 @@
/***************************************************************************
knutinstcomms.cpp - description
-------------------
begin : ct ríj 24 2002
copyright : (C) 2002 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#include "knutinstcomms.h"
#include "knutprintupsvar.h"
#include "knutvardata.h"
#include <kcombobox.h>
#include <kmessagebox.h>
#include <qlayout.h>
#include <qframe.h>
#include <qlabel.h>
#include <qstring.h>
KNutInstComms::KNutInstComms(QString* userName, QString* userPassword, const QString uName, const QString password, KNutNet* const upsNet, QWidget* parent, const char* name, const bool modal)
: KDialogBase(Plain, i18n("Instant commands"),Ok|Cancel,Ok, parent, name, modal, true), m_upsNet(upsNet),m_oldUserName(userName), m_oldUserPassword(userPassword) {
upsICommDef upsIComm;
if (m_upsNet->getState() != KNutNet::Connected) { // no connection - no instant commnads
KNutVarData::showError (KNutNet::NotConnection);
m_upsConnectOk=false;
}
else {
m_upsConnectOk=true;
QFrame *page = plainPage();
QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() );
QLabel *label1 = new QLabel (i18n("RUN INSTANT COMMAND"),page,"label1");
label1->setAlignment(Qt::AlignHCenter);
topLayout->addWidget(label1);
QLabel *label2 = new QLabel (i18n("Command:"),page,"label2");
m_instCommBox = new KComboBox(page,"instcommbox");
QGridLayout *passLayout = new QGridLayout (3,2,5,"passLayout");
QLabel *labelName = new QLabel (i18n("User name:"),page,"labelName");
QLabel *labelPassword = new QLabel (i18n("Password:"),page,"labelPassword");
m_lineEditName = new KLineEdit( page, "LineEditName" );
m_lineEditPassword = new KLineEdit( page, "LineEditName" );
if (((*m_oldUserName) == "") && ((*m_oldUserPassword) == "")) {
m_lineEditName->setText(uName);
m_lineEditPassword->setText(password);
}
else {
m_lineEditName->setText(*m_oldUserName);
m_lineEditPassword->setText(*m_oldUserPassword);
m_lineEditName->setDisabled(true);
m_lineEditPassword->setDisabled(true);
}
// if (!((*oldUserName) == "") || !((*oldUserPassword) == "")) {
// if (!((*oldUserName) == "") && ((*oldUserPassword) == "")) {
// lineEditName->setDisabled(true);
// lineEditPassword->setDisabled(true);
// }
m_lineEditPassword->setEchoMode(QLineEdit::Password);
topLayout->addLayout(passLayout);
passLayout->addWidget(label2,0,0);
passLayout->addWidget(m_instCommBox,0,1);
passLayout->addWidget(labelName,1,0);
passLayout->addWidget(labelPassword,2,0);
passLayout->addWidget(m_lineEditName,1,1);
passLayout->addWidget(m_lineEditPassword,2,1);
topLayout->addStretch(10);
//loads ComboBox
int n = m_upsNet->readNumberComms()+1;
for (int i =1; i < n ; i++) { // for se testuje na zacatku pokud je n < 1 neprovede se ani jednou
if (!m_upsNet->readIComm(i, upsIComm))
m_instCommBox->insertItem(upsIComm.upsCommName);
}
}
}
KNutInstComms::~KNutInstComms(){
}
void KNutInstComms::slotOk() {
int error =0;
if (((*m_oldUserName) == "") && ((*m_oldUserPassword) == "")) {
// prvni propojeni nastavime jmeno a heslo
//for the first connection we have to set name and password
if (!( error = m_upsNet->instantCommand(m_instCommBox->currentText(),m_lineEditName->text(),m_lineEditPassword->text(),false))) {
(*m_oldUserName) = m_lineEditName->text();
(*m_oldUserPassword) = m_lineEditPassword->text();
accept();
}
}
else {
// for other connection name and password are not setted
if (((*m_oldUserName) == m_lineEditName->text()) && ((*m_oldUserPassword) == m_lineEditPassword->text())) {
// jen posleme prikaz // sends command only
if (!( error = m_upsNet->instantCommand(m_instCommBox->currentText(),m_lineEditName->text(),m_lineEditPassword->text(),true))) accept();
}
// az v pristi verzi
// else
// {
// // odpojime a pripojime
// // nastavime jmeno a heslo
// if (!( error = myUpsNet->instantCommand(instCommBox->currentText(),lineEditName->text(),lineEditPassword->text(),false))) {
// (*oldUserName) = lineEditName->text();
// (*oldUserPassword) = lineEditPassword->text();
// accept();
// }
// }
}
if (error) KNutVarData::showError (error);
}
//bool KNutInstComms::upsOk (void) { return m_upsConnectOk; }

@ -0,0 +1,97 @@
/***************************************************************************
knutinstcomms.h - description
-------------------
begin : ct ríj 24 2002
copyright : (C) 2002 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef KNUTINSTCOMMS_H
#define KNUTINSTCOMMS_H
#include "knutnet.h"
#include <kdialogbase.h>
#include <klineedit.h>
#include <kcombobox.h>
#include <klocale.h>
class QString;
/**
* This class is graphic interface for runinng of instant commands.
* Tato trida je graficke rozhrani pro spusteni okamzitych prikazu.
*
* @author Daniel Prynych
* @short Okamzite prikazy
* @version 0.4
*/
class KNutInstComms : public KDialogBase {
public:
/**
* Construktor - Creates window for select of instant command.
* Konstruktor - vytvori okno pro vyber okamziteho prikazu.
*
* @param uName Determines user name.
* @param password Determines passwprd.
* @param uName Urcuje uzivatelske jmeno.
* @param password Urcuje heslo.
* @param upsNet Je odkaz na instanci tridy KNutNet.
*
* @since 0.4
**/
KNutInstComms(QString* userName, QString* userPassword, const QString uName, const QString password, KNutNet* const upsNet, QWidget* parent = 0, const char* name = 0, bool const modal = TRUE);
/**
* Destruktor
*
* @since 0.3
**/
~KNutInstComms();
/**
* Vraci true pokud existuje pripojeni na server a vytvorilo se
* ovladaci okno pro odeslani prikazu.
*
* @since 0.3
**/
bool upsOk (void) { return m_upsConnectOk; };
private slots:
/**
* @internal
*
* Provede akci, da prikaz k provedeni okamziteho prikazu.
*/
virtual void slotOk();
private:
KLineEdit *m_lineEditName;
KLineEdit *m_lineEditPassword;
KComboBox *m_instCommBox;
KNutNet* m_upsNet;
bool m_upsConnectOk;
QString* m_oldUserName;
QString* m_oldUserPassword;
};
#endif

@ -0,0 +1,813 @@
/***************************************************************************
knutmainwindow.cpp - description
-------------------
begin : Po cen 16 2003
copyright : (C) 2003 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#include "knutmainwindow.h"
#include "knutvardata.h"
#include <kmessagebox.h>
#include <kstdaction.h>
#include <kconfig.h>
#include <ksimpleconfig.h>
#include <kstatusbar.h>
#include <kkeydialog.h>
#include <kprogress.h>
#include <qfont.h>
#include <qpalette.h>
#include <qbrush.h>
#include <qcolor.h>
#include <qstring.h>
#include <qscrollview.h>
#include <qlayout.h>
#include <qiconset.h>
#include <qstring.h>
#include <qstringlist.h>
#include <qlabel.h>
#include <qsplitter.h>
//#include <qprogressbar.h>
#include <math.h>
#include <stdlib.h>
#include <unistd.h>
#include <iostream>
extern const char *nameUpsVars1[];
extern const char *nameUpsVars2[];
const char *descrOfConnection = I18N_NOOP("test of conection from 5");
KNutMainWindow::KNutMainWindow(QStringList *tListKNutEvent, KNutVarData::upsInfoDef* tActiveUpsInfo, KNutVarData::SettingDataDef* tSettingData, KNutUpsData* tUpsRecords, KNutVarData* tAnalogRecords, QWidget* parent, const char *name) : KMainWindow(parent, name),
m_listKNutEvent(tListKNutEvent), m_activeUpsInfo(tActiveUpsInfo),m_settingData (tSettingData),
m_upsRecords(tUpsRecords), m_analogRecords (tAnalogRecords) {
m_settingData->activatedMainWindow=true; //information about state of mainWindow
initVars();
initStatusBar();
initAction();
// createGUI ("/home/dan/Projekty/knutclient/src/knutclientui.rc"); // pred distribuci nezapomenout odstranit retezec
// createGUI vytvori zakladni strukturu podle souboru knutclientui.rc
createGUI ();
initToolBar ();
m_descriptionAction->setChecked(m_settingData->useDescription);
//sets input frequency and input voltage
//nastavime vstupni frekvenci a vstupni napeti
m_analogRecords->setFrequency(m_settingData->inputFrequency);
m_analogRecords->setVoltage(m_settingData->inputVoltage);
//sets palette for analog panels
// nastavime paletu pro analogove panely
if (m_settingData->customBAnalogColor) {
m_aPanelPalette.setColor(QPalette::Active,QColorGroup::Background,m_settingData->aPanelBackgroundColor);
m_aPanelPalette.setColor(QPalette::Inactive,QColorGroup::Background,m_settingData->aPanelBackgroundColor);
}
if (m_settingData->customBColor) {
m_areaPalette.setColor(QPalette::Active,QColorGroup::Background,m_settingData->mainBackgroundColor);
m_areaPalette.setColor(QPalette::Inactive,QColorGroup::Background,m_settingData->mainBackgroundColor);
}
// makes main area // Vytvorime hlavni plochu
m_area = new QLabel (this);
setCentralWidget (m_area);
QHBoxLayout* mainLayout = new QHBoxLayout(m_area);
m_mainSplit = new QSplitter(Qt::Horizontal,m_area);
m_mainSplit->setOpaqueResize(true);
mainLayout->addWidget(m_mainSplit);
if (m_settingData->customBPanelColor) {
m_mPanelPalette.setColor(QPalette::Active,QColorGroup::Background,m_settingData->mPanelBackgroundColor);
m_mPanelPalette.setColor(QPalette::Inactive,QColorGroup::Background,m_settingData->mPanelBackgroundColor);
}
QScrollView* panelSV = new QScrollView(m_mainSplit,"panelSV");
if (m_settingData->customFont)
m_frontPanel = new KNutFrontPanel (&m_mPanelPalette,m_mainSplit,m_settingData->panelFlags,&(m_settingData->mPanelFont),"FrontPanel");
else
m_frontPanel = new KNutFrontPanel (&m_mPanelPalette,m_mainSplit,m_settingData->panelFlags,&(m_settingData->systemFont),"FrontPanel");
panelSV->addChild(m_frontPanel);
panelSV->setResizePolicy ( QScrollView::AutoOneFit ) ;
m_mainSplit->setResizeMode (panelSV,QSplitter::FollowSizeHint);
m_panelMeter = new KNutPanelMeter(m_aPanelPalette,m_activeUpsInfo,m_settingData,m_analogRecords,m_mainSplit);
m_mainSplit->setResizeMode (m_panelMeter,QSplitter::Stretch );
m_area->setPalette(m_areaPalette);
m_panelMeter->setPalette(m_areaPalette);
// sets Combo a actives connections to meter panels
// Nastavime COMBO a pripadne aktivujeme spojeni na merici panely
int activeUpsNameIndex = activeMainCombo ();
if (activeUpsNameIndex != -1) toolBar(0)->getCombo(1)->setCurrentItem( activeUpsNameIndex );
showUpsData();
setGeometry (m_settingData->x,m_settingData->y,m_settingData->width,m_settingData->height);
show();
//message has to include into status bar after showing window,
// only for KDE relase < 3.0.0
// jinak se nastavi minimalni velikost ne mensi nez delka aktivni zpravy.
initStatusBarMessage();
}
void KNutMainWindow::addComboStatusItem (const QString text, const QString name) {
if (m_infoCombo->count() >= (int)knc::maxCountKNutEvent) m_infoCombo->removeItem(0);
if (m_listKNutEvent->count() > knc::maxCountKNutEvent) m_listKNutEvent->remove(m_listKNutEvent->begin());
QString dateTime(QDate::currentDate().toString());
dateTime +=" " + QTime::currentTime().toString();
if (name.isEmpty()) {
m_infoCombo->insertItem(dateTime+" "+text);
m_listKNutEvent->append(dateTime+" "+text);
}
else {
m_infoCombo->insertItem(dateTime+" "+name+" : "+text);
m_listKNutEvent->append(dateTime+" "+name+" : "+text);
}
m_infoCombo->setCurrentItem(m_infoCombo->count()-1);
if (m_listKNutEvent->count() > knc::maxCountKNutEvent) m_listKNutEvent->remove(m_listKNutEvent->begin());
}
KNutMainWindow::~KNutMainWindow(void) {
m_settingData->height = height();
m_settingData->width = width();
m_settingData->y = y();
m_settingData->x = x();
delete m_frontPanel;
delete m_panelMeter;
}
void KNutMainWindow::setConfig (unsigned int changeSetting) {
//qDebug ("KNutMainWindow::setConfig");
KNutVarData::VarStrucDef analogMemberData;
bool repaintVoltagePanels = false;
bool repaintFrequencyPanels = false;
bool repaintAllPanels = false;
bool repaintOAPanels = false;
// Main Setting
// Nastavime zmenu barvy pozadi
// sets background color
if (changeSetting & KNutPrefDlg::ChangeCustomBColor) {
if (!m_settingData->customBColor) { // nastavime barvu pozadi podle systemu
m_area->setPalette (m_mainPalette); // we set background color based on system
m_panelMeter->setPalette (m_mainPalette);
repaint();
}
else {
m_areaPalette.setColor(QPalette::Active,QColorGroup::Background,m_settingData->mainBackgroundColor);
m_areaPalette.setColor(QPalette::Inactive,QColorGroup::Background,m_settingData->mainBackgroundColor);
m_area->setPalette (m_areaPalette);
m_panelMeter->setPalette (m_areaPalette);
repaint();
}
}
else {
if (changeSetting & KNutPrefDlg::ChangeMBColor ) {
m_areaPalette.setColor(QPalette::Active,QColorGroup::Background,m_settingData->mainBackgroundColor);
m_areaPalette.setColor(QPalette::Inactive,QColorGroup::Background,m_settingData->mainBackgroundColor);
m_area->setPalette (m_areaPalette);
m_panelMeter->setPalette (m_areaPalette);
repaint();
}
}
// Sets background for panels
// sets frequence
// sets voltage
// XFer is switch-on and one exist for this UPS
if ((changeSetting & KNutPrefDlg::ChangeXFer) || // je provedena nejaka zmena na napeti nebo frekvence
(changeSetting & KNutPrefDlg::ChangeVoltage) || (changeSetting & KNutPrefDlg::ChangeFrequency)) {
if ((changeSetting & KNutPrefDlg::ChangeXFer) && (m_settingData->lowHighXfer) && (m_existLowHighXfer)) {
// xfer was activated
if (changeSetting & KNutPrefDlg::ChangeXFer) {
if (abs((int)(230 - (m_lowXfer + (m_highXfer - m_lowXfer) /2))) > abs((int)(120 - (m_lowXfer + (m_highXfer - m_lowXfer) /2)))) {
m_analogRecords->setVoltage(120);
m_analogRecords->setFrequency(60);
}
else {
m_analogRecords->setVoltage(230);
m_analogRecords->setFrequency(50);
}
m_analogRecords->setXfer(m_lowXfer,m_highXfer);
repaintVoltagePanels = true;
repaintFrequencyPanels = true;
}
}
else {
// XFER neni aktivovano nebo je nepodporuje UPS
// XFER isn;t activated or XFER isn't supported by UPS
if ((changeSetting & KNutPrefDlg::ChangeVoltage) || ((changeSetting & KNutPrefDlg::ChangeXFer))) {
// byla aktivovana zmena napeti nebo zmena xfer a zaroven ho ups podporuje
m_analogRecords->setVoltage(m_settingData->inputVoltage);
repaintVoltagePanels=true;
}
if ((changeSetting & KNutPrefDlg::ChangeFrequency) || ((changeSetting & KNutPrefDlg::ChangeXFer))) {
// byla aktivovana zmena napeti nebo zmena xfer a zaroven ho ups podporuje
m_analogRecords->setFrequency(m_settingData->inputFrequency);
repaintFrequencyPanels=true;
}
}
}
// Analog setting
// now DigitalProcesing of pointer
if (changeSetting & KNutPrefDlg::ChangeTypeOfDigProcessing) { //type of digital processing was changed
m_panelMeter->changeAnalogPanelsDigProcessing(); //paint pointers with new digotal processing
}
if ((changeSetting & KNutPrefDlg::ChangeCustomAPanelBColor) || // barva panelu je zmenena, panel color is changed
(changeSetting & KNutPrefDlg::ChangeAPBColor)) {
if (m_settingData->customBAnalogColor) {
m_aPanelPalette.setColor(QPalette::Active,QColorGroup::Background,m_settingData->aPanelBackgroundColor);
m_aPanelPalette.setColor(QPalette::Inactive,QColorGroup::Background,m_settingData->aPanelBackgroundColor);
repaintAllPanels=true;
m_panelMeter->setAnalogBG(m_aPanelPalette);
}
else {
m_aPanelPalette = m_mainPalette;
repaintAllPanels=true;
m_panelMeter->setAnalogBG(m_aPanelPalette);
}
}
if ((changeSetting & KNutPrefDlg::ChangeCustomAPanelOColor) || // je provedena zmena barvy panelu
(changeSetting & KNutPrefDlg::ChangeAPOColor)) {
if (m_settingData->customOAnalogColor) {
repaintAllPanels=true;
repaintOAPanels=true;
}
else {
repaintAllPanels=true;
repaintOAPanels=true;
}
}
// regeneration of panel uses for setting Main and setting Analog
// pregenerovani panelu slozi pro setting Main a setting Analog
m_panelMeter->repaintAnalogPanels (repaintFrequencyPanels, repaintVoltagePanels, repaintAllPanels);
if (m_activeUpsInfo->record.name != "") {
m_panelMeter->setSize();
m_mainSplit->refresh();
}
// UPS Setting
if (changeSetting & KNutPrefDlg::ChangeUpsSetting ) activeMainCombo();
else {
if (changeSetting & KNutPrefDlg::ChangeUpsCount) activeMainCombo();
}
// Main Panel Setting
// change of background color
// zmena barvy pozadi;
if (changeSetting & KNutPrefDlg::ChangeCustomMPanelBColor) {
if (!m_settingData->customBPanelColor) { // nastavime barvu pozadi podle systemu
m_frontPanel->setPalette (m_mainPalette);
}
else {
m_mPanelPalette.setColor(QPalette::Active,QColorGroup::Background,m_settingData->mPanelBackgroundColor);
m_mPanelPalette.setColor(QPalette::Inactive,QColorGroup::Background,m_settingData->mPanelBackgroundColor);
m_frontPanel->setPalette (m_mPanelPalette);
}
}
else {
if (changeSetting & KNutPrefDlg::ChangeMPBColor ) {
m_mPanelPalette.setColor(QPalette::Active,QColorGroup::Background,m_settingData->mPanelBackgroundColor);
m_mPanelPalette.setColor(QPalette::Inactive,QColorGroup::Background,m_settingData->mPanelBackgroundColor);
m_frontPanel->setPalette (m_mPanelPalette);
}
}
if (changeSetting & KNutPrefDlg::ChangeMainPanelSetting ) {
if (m_settingData->panelFlags != m_frontPanel->getPanelFlags()) {
m_frontPanel->setPanelFlags(m_settingData->panelFlags);
//aktivujema a presuneme prvky panelu
// activates and moves items of panel
m_frontPanel->paintPanel();
}
}
// Font panel setting
if (changeSetting & KNutPrefDlg::ChangeAnalogFont ) {
QFont newAnalogFont;
if (m_settingData->customFont) {
newAnalogFont=m_settingData->aPanelFont;
}
else {
newAnalogFont=m_settingData->systemFont;
}
m_panelMeter->slotSetPanelsFont(newAnalogFont);
}
if (changeSetting & KNutPrefDlg::ChangePanelFont ) {
QFont newPanelFont;
if (m_settingData->customFont) {
m_frontPanel->slotSetPanelFont(m_settingData->mPanelFont);
}
else {
m_frontPanel->slotSetPanelFont(m_settingData->systemFont);
}
}
}
void KNutMainWindow::showUpsData (void) {
//qDebug ("KNutMainWindow::showUpsData start");
if ((m_activeUpsInfo->upsNet != 0L) && (!m_activeUpsInfo->netError) &&
(m_activeUpsInfo->upsDriverState == knc::connected)) {
int runtimeVal;
QString nutStringVar;
bool okFloat;
// activeUpsInfo->oldStatus=KNutNet::initStatus;
// Nastaveni nemenych dat jsou precteny pouze jednou, predpoklada se jejich nemenost
// setting of unchange data, ones are reading only one.
nutStringVar = m_activeUpsInfo->upsNet->readStringVar(m_activeUpsInfo->lowxferVar);
switch (m_activeUpsInfo->nutVariables) {
case 1:
m_manufacturer = m_activeUpsInfo->upsNet->readStringVar("MFR");
m_upsModel = m_activeUpsInfo->upsNet->readStringVar("MODEL");
m_serial = m_activeUpsInfo->upsNet->readStringVar("SERIAL");
m_firmrev = m_activeUpsInfo->upsNet->readStringVar("FIRMREV");
break;
case 2:
m_manufacturer = m_activeUpsInfo->upsNet->readStringVar("ups.mfr");
m_upsModel = m_activeUpsInfo->upsNet->readStringVar("ups.model");
m_serial = m_activeUpsInfo->upsNet->readStringVar("ups.serial");
m_firmrev = m_activeUpsInfo->upsNet->readStringVar("ups.firmware");
break;
}
QString allUpsName = m_manufacturer + " " + m_upsModel;
m_frontPanel->setAllNameUps (allUpsName);
m_frontPanel->setMFRUps (m_manufacturer);
m_frontPanel->setNameUps (m_upsModel);
m_frontPanel->setSerialUps (m_serial);
m_frontPanel->setFirmRevUps (m_firmrev);
// try if LOWXFER and HIGHXFER or our values are existed
//Zjistime zda existuji LOWXFER a HIGHXFER pripadne jeji hodnoty
if (nutStringVar.isNull()) {
m_lowXfer =-1;
m_highXfer=-1;
m_existLowHighXfer = false;
}
else {
m_lowXfer = atof(nutStringVar);
nutStringVar = m_activeUpsInfo->upsNet->readStringVar(m_activeUpsInfo->highxferVar);
if (nutStringVar.isEmpty()) {
m_highXfer = -1;
m_existLowHighXfer = false;
}
else {
m_highXfer = atof(nutStringVar);
m_existLowHighXfer = true;
}
}
int upsStatus=0;
if ((upsStatus = m_activeUpsInfo->upsNet->readStatus ()) != -1)
m_frontPanel->setPanel(upsStatus);
if ( !m_activeUpsInfo->upsNet->existName(m_activeUpsInfo->runtimeVar)) {
nutStringVar = m_activeUpsInfo->upsNet->readStringVar(m_activeUpsInfo->runtimeVar);
if (nutStringVar.isEmpty()) runtimeVal=knc::numberVarError;
else {
runtimeVal=(int)nutStringVar.toFloat(&okFloat);
if (!okFloat) runtimeVal = knc::numberVarError;
}
}
else runtimeVal=knc::numberVarError;
m_frontPanel->setRuntime(runtimeVal);
m_panelMeter->deActivateAnalogs();
// pokud je pouzito XFER nastavime hodnoty
// when XFER is used we set values
if (m_settingData->lowHighXfer) {
// xfer je nastaveno
// xfer is seted
if (m_existLowHighXfer) {
if (abs((int)(230 - (m_lowXfer + (m_highXfer - m_lowXfer) /2))) > abs((int)(120 - (m_lowXfer + (m_highXfer - m_lowXfer) /2)))) {
m_analogRecords->setVoltage(120);
m_analogRecords->setFrequency(60);
}
else {
m_analogRecords->setVoltage(230);
m_analogRecords->setFrequency(50);
}
m_analogRecords->setXfer(m_lowXfer,m_highXfer);
}
}
//qDebug ("KNutMainWindow::showUpsData 1");
m_panelMeter->activateAnalogs(); // makes panel and makes background of panel
repaintAnalogs(false);
//qDebug ("KNutMainWindow::showUpsData 2");
m_panelMeter->setSize(true);
//qDebug ("KNutMainWindow::showUpsData 3");
m_mainSplit->refresh();
// doesn't repaint analog pointers, because pointers will be repainted twice
//qDebug ("KNutMainWindow::showUpsData 4");
// repaintAnalogs(false); // don't make this
//qDebug ("KNutMainWindow::showUpsData 5");
}
else {
cleanPanels();
}
}
void KNutMainWindow::zeroingPanels (void) {
m_panelMeter->zeroingPanels();
m_frontPanel->setRuntime(knc::numberVarError);
m_frontPanel->setPanel(0);
}
void KNutMainWindow::hideUpsData (void) {
m_frontPanel->cleanPanel();
}
void KNutMainWindow::setCombo (QString name) {
if (toolBar(0)->getCombo(1)->currentText() != name) toolBar(0)->getCombo(1)->setCurrentText(name);
}
void KNutMainWindow::repaintPanel (void) {
QString nutStringVar;
if (m_activeUpsInfo->upsNet == 0) return;
if (!m_activeUpsInfo->upsNet->existName(m_activeUpsInfo->runtimeVar)) {
nutStringVar = m_activeUpsInfo->upsNet->readStringVar(m_activeUpsInfo->runtimeVar);
if (nutStringVar.isEmpty()) m_frontPanel->setRuntime(0);
else m_frontPanel->setRuntime( nutStringVar.toInt());
}
else m_frontPanel->setRuntime(knc::numberVarError);
// precteme status a nastavime zarovky panelu
int status = m_activeUpsInfo->upsNet->readStatus();
m_frontPanel->setPanel(status);
}
/// je volan vzdy po timeoutu
/// this function is called after timeout always
void KNutMainWindow::repaintAnalogs ( bool run ) {
//qDebug ("KNutMainWindow::repaintAnalogs");
QString nutStringVar;
float numVar;
bool newRange = false;
if ((m_settingData->lowHighXfer) && (m_existLowHighXfer)) {
QString nutStringVar;
nutStringVar = m_activeUpsInfo->upsNet->readStringVar(m_activeUpsInfo->lowxferVar);
if (! nutStringVar.isEmpty()) {
float helpLowXfer = nutStringVar.toFloat();
nutStringVar = m_activeUpsInfo->upsNet->readStringVar(m_activeUpsInfo->highxferVar);
if (! nutStringVar.isEmpty()) {
float helpHighXfer = nutStringVar.toFloat();
if ((helpLowXfer != m_lowXfer) || (helpHighXfer != m_highXfer)) {
m_lowXfer=helpLowXfer;
m_highXfer=helpHighXfer;
m_analogRecords->setXfer(m_lowXfer,m_highXfer);
newRange = true;
}
}
}
}
//qDebug ("KNutMainWindow::repaintAnalogs 1");
for (int i=0; i< knc::NumberOfVars; i++) {
if (m_activeUpsInfo->record.upsVarCode[i] != 0) { // jistota pokud by nam to nekde propadlo
switch (m_activeUpsInfo->nutVariables) {
case 1:
nutStringVar = m_activeUpsInfo->upsNet->readStringVar ((char *)nameUpsVars1[m_activeUpsInfo->record.upsVarCode[i]]);
break;
case 2:
nutStringVar = m_activeUpsInfo->upsNet->readStringVar ((char *)nameUpsVars2[m_activeUpsInfo->record.upsVarCode[i]]);
break;
}
//qDebug ("KNutMainWindow::repaintAnalogs 2 ");
if (nutStringVar.isEmpty()) numVar=0;
else numVar = nutStringVar.toFloat();
m_panelMeter->repaintScaleAnalogPanel (i, numVar);
if (newRange) m_panelMeter->repaintAnalogPanels (true, true, false); //freq volt
m_panelMeter->repaintAnalogPointer(i,numVar,run);
}
} // end for
//qDebug ("KNutMainWindow::repaintAnalogs 3 ");
}
void KNutMainWindow::cleanPanels (void) {
m_frontPanel->cleanPanel();
m_panelMeter->deActivateAnalogs();
m_panelMeter->setSize(false);
m_mainSplit->refresh();
}
void KNutMainWindow::startConnectPB ( const int count ) {
m_connectProggresBar->setTotalSteps(count);
m_connectProggresBar->setProgress(1);
m_connectProggresBar->show();
}
void KNutMainWindow::setProgressConnectPB ( const int progress ) {
m_connectProggresBar->setProgress(progress);
}
void KNutMainWindow::hideConnectPB ( void ) {
m_connectProggresBar->setProgress(0);
m_connectProggresBar->hide();
}
/*********************************************************************************************/
/* */
/* PRIVATE SLOTS */
/* */
/*********************************************************************************************/
//this SLOT is for older KDE only
void KNutMainWindow::slotShowToolBar(void) {
if(toolBar("mainToolBar")->isVisible()) toolBar("mainToolBar")->hide();
else toolBar("mainToolBar")->show();
}
void KNutMainWindow::slotShowStatusBar(void) {
if(statusBar()->isVisible()) {
statusBar()->hide();
}
else {
statusBar()->show();
}
}
void KNutMainWindow::slotDescription(void) {
if (m_descriptionAction->isChecked()) {
if (!m_activeUpsInfo->upsNet->isDescription()) m_activeUpsInfo->upsNet->getDescription();
m_settingData->useDescription=true;
}
else m_settingData->useDescription=false;
emit saveConf();
}
void KNutMainWindow::slotPrintUPSVars(void) {
emit showUPSVars();
}
void KNutMainWindow::slotInstComms(void) {
emit makeInstComms();
}
void KNutMainWindow::slotRWVars(void) {
emit makeRWVars();
}
void KNutMainWindow::slotRefreshConnection(void) {
emit makeRefreshConnection();
}
void KNutMainWindow::slotChangeRWVars ( QString ) {
}
void KNutMainWindow::closeEvent( QCloseEvent *e ){
m_settingData->activatedMainWindow=false; //information about state of mainWindow
e->accept();
}
void KNutMainWindow::slotConfigureKeys() {
KKeyDialog::configure( actionCollection(), this );
}
void KNutMainWindow::slotCloseKnutClient (void) {
if (m_settingData->areYouSure) {
if (KMessageBox::warningYesNo (0,i18n("Are you sure ?")) == 3)
emit endApplication();
}
else emit endApplication();
}
void KNutMainWindow::slotChangeUPS (const QString &name) {
emit UPSChanged (name);
}
void KNutMainWindow::slotPreferencesUps() {
emit preferenceUps();
}
/*********************************************************************************************/
/* */
/* PRIVATE FUNCTIONS */
/* */
/*********************************************************************************************/
void KNutMainWindow::initStatusBar ( void ) {
// sets main message if statusbar
// nastavime hlavni hlaseni v statusbaru
// QString progressString("%v ");// += descrOfConnection;
// progressString.append(descrOfConnection);
m_progressFormatString.append("%v ");
m_progressFormatString.append(descrOfConnection);
m_infoCombo = new KComboBox (statusBar(),"infoCombo");
m_infoCombo->setMaxCount(knc::maxCountKNutEvent+1); // nastavime maximalni pocet polozek v Combu
// pro rezervu pridame jeste jednu
//sets maximal if items in Combo
statusBar()->addWidget(m_infoCombo,10,false);
m_connectProggresBar = new KProgress(statusBar(),"connectProgressBar");
statusBar()->addWidget(m_connectProggresBar,5,false);
m_connectProggresBar->setProgress(0);
// m_connectProggresBar->setFormat("%v test of conection from 5");
m_connectProggresBar->setFormat(m_progressFormatString);
m_connectProggresBar->hide();
}
void KNutMainWindow::initStatusBarMessage ( void ) {
// loads data into comboBox
QStringList::iterator it;
for ( it = m_listKNutEvent->begin(); it != m_listKNutEvent->end(); ++it ) {
m_infoCombo->insertItem((*it));
}
statusBar()-> setItemAlignment(0,Qt::AlignHCenter|Qt::AlignVCenter);
m_infoCombo->setCurrentItem(m_infoCombo->count()-1);
}
void KNutMainWindow::initToolBar ( void ) {
QLabel *upsNazev = new QLabel ("UPS : ",toolBar("mainToolBar"));
// upsNazev is connected on toolBaar, dosn't need to call desctructor
toolBar ("mainToolBar")->insertWidget (0,upsNazev->sizeHint().width(),upsNazev);
toolBar ("mainToolBar")->insertCombo("",1,false, SIGNAL (activated (const QString &)),this,SLOT (slotChangeUPS (const QString &)));
// bude se pouze vybirat-------------------^^^
KComboBox *combo = toolBar("mainToolBar")->getCombo(1);
combo->clear();
toolBar("mainToolBar")->setBarPos (KToolBar::Top);
//sets toolbarr no movable / nastavime toolBar nepresouvatelny
setToolBarsMovable(false);
}
void KNutMainWindow::initAction ( void ) {
// KAction and KStdAction must be to make before command createGUI, function initToolBar is runed after create GUI
m_quit = KStdAction::quit (this, SLOT (slotCloseKnutClient()), actionCollection());
m_quit->setStatusText(i18n("Quits the application"));
m_preferencesUps = KStdAction::preferences (this, SLOT (slotPreferencesUps()), actionCollection(),"options_configure");
new KAction(i18n("&Showing UPS variables and commands"),0,this,SLOT(slotPrintUPSVars()),actionCollection(),"printupsvars");
new KAction(i18n("&Running instant commands"),0,this,SLOT(slotInstComms()),actionCollection(),"instcomms");
new KAction(i18n("Setting R&W variables"),0,this,SLOT(slotRWVars()),actionCollection(),"rwvars");
///////////////////
// KStdAction::showToolbar (this, SLOT (slotShowToolBar()), actionCollection());
// setStandardToolBarMenuEnabled(true); since KDE version 3.1
// since version 3.1
#if defined (KDE_VERSION_MAJOR)
#if KDE_VERSION_MAJOR >= 3
#if defined (KDE_VERSION_MINOR)
#if KDE_VERSION_MINOR >= 1
setStandardToolBarMenuEnabled(true);
#else
KStdAction::showToolbar (this, SLOT (slotShowToolBar()), actionCollection());
#endif
#else
KStdAction::showToolbar (this, SLOT (slotShowToolBar()), actionCollection());
#endif
#else
KStdAction::showToolbar (this, SLOT (slotShowToolBar()), actionCollection());
#endif
#else
KStdAction::showToolbar (this, SLOT (slotShowToolBar()), actionCollection());
#endif
KStdAction::showStatusbar (this, SLOT (slotShowStatusBar()), actionCollection());
m_descriptionAction = new KToggleAction(i18n("&Using descriptions"),0,this,SLOT(slotDescription()),actionCollection(),"use_description");
KStdAction::keyBindings( this, SLOT(slotConfigureKeys()),actionCollection());
new KAction (i18n("Reconnect"),"reload",Key_F5,this,SLOT(slotRefreshConnection()),actionCollection(),"reconnect");
}
void KNutMainWindow::initVars ( void ) {
//m_activeUpsIndex = -1;
//nastavime fonty
// sets fonts
m_mainPalette= kapp->palette();
m_areaPalette=m_mainPalette;
m_mPanelPalette=m_mainPalette;
m_aPanelPalette=m_mainPalette;
}
int KNutMainWindow::activeMainCombo (void) {
int activeUpsNameIndex = -1; // zadne upsName neni aktivni , any upsName is not active
KComboBox *combo = toolBar(0)->getCombo(1);
//naplnime comboBox
//loads comboBox
combo->clear();
for (int i=0; i < m_upsRecords->getCount (); i++) {
combo->insertItem (m_upsRecords->getName(i));
// ulozime si poradove cislo jmena aktivniho ups
// save serial number of active usp name
if ((m_upsRecords->getName(i)) == m_activeUpsInfo->record.name) activeUpsNameIndex = i;
}
return activeUpsNameIndex;
}
#include "knutmainwindow.moc"

@ -0,0 +1,346 @@
/***************************************************************************
knutmainwindow.h - description
-------------------
begin : Po cen 16 2003
copyright : (C) 2003 by Daniel Prynych
email : Daniel@prynych.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef KNUTMAINWINDOW_H
#define KNUTMAINWINDOW_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "knutprefdlg.h"
#include "knutupsdata.h"
#include "knutvardata.h"
#include "knutfrontpanel.h"
#include "knutnet.h"
#include "knutanalog.h"
#include "knutpanelmeter.h"
#include <kapp.h>
#include <kmainwindow.h>
#include <kaction.h>
//#include <kprogress.h>
#include <qwidget.h>
#include <qdatetime.h>
//#include <qprogressbar.h>
class QString;
class QStringList;
class QLabel;
class QPalette;
class QSplitter;
class KProgress;
//class QProgressBar;
/**
* Trida slouzi pro zobrazeni okna s informacemi o UPS.
* Class is used for view window with informations about UPS
*
* @author Daniel Prynych
* @short Hlavni okno
* @version 0.2.3
*/
class KNutMainWindow : public KMainWindow {
Q_OBJECT
public:
/**
* Constructor - makes main window.
* Konstruktor - vytvori hlavni okno.
*
* @param tListKNutEvent pointer on QStringList contain text information about events (drop connection, switch ..)
* @param tActiveUpsInfo pointer on data about active UPS
* @param tSettingData pointer on basic data of program (background color, intercircle, pointers...,fonts..)
* @param tAnalogRecords pointer in class which works with data about UPS
* @param tListKNutEvent ukazatel na QStringList obsahuje textove udaje o udalostech (ztrata spojeni, prepnuti atd.)
* @param tActiveUpsInfo ukazatel na data o aktivni UPS
* @param tSettingData ukazatel na zakladni data programu (barvy pozadi, mezikruzi, rucicky ... ,fonty atd )
* @param tAnalogRecords ukazatel na tridu ktera pracuje s daty o upsekach
*
* @since 0.3.1
**/
KNutMainWindow(QStringList* tListKNutEvent, KNutVarData::upsInfoDef* tActiveUpsInfo, KNutVarData::SettingDataDef* tSettingData, KNutUpsData* tUpsRecords, KNutVarData* tAnalogRecords, QWidget* parent=0,const char *name=0);
/**
* Destructor
*
* @since 0.1.1
**/
~KNutMainWindow();
/**
* Repaints information of main panel.
* Prekresli informace hlavniho panelu.
*
* @since 0.1.2
**/
void repaintPanel(void);
/**
* Repaints analog panels based on their status.
* Prekresli analogove panely na zaklade jejich stavu.
* @param run = TRUE makes immediately repaint of panel
*
* @since 0.3.1
**/
void repaintAnalogs ( bool run = true);
/**
* Da prikaz k prekresleni analogovych panelu, hlavniho panelu a nastavi jejich hodnoty na
* zaklade XFer hodnot.
* Give command to repaint analog panels, main panel and sets their values based on XFer values
* @param run = TRUE makes immediately repaint of analog panels
*
* @since 0.3.1
**/
void showUpsData (void);
/**
* Adds other line into list of events and shows them on bottom part of panel.
* Prida dalsi radku do seznamu udalosti a zobrazi je v dolni casti panelu.
*
* @param text text of event.
* @param name name of UPS, name which is list of UPSes.
* @param text udava text udalosti.
* @param name udava jmeno UPS-ky tak jak je vedena v seznamu UPS-ek tohoto programu
*
* @since 0.1
**/
void addComboStatusItem (const QString text, const QString name = QString::null);
/**
* Rebuilds main panel based on value changeSetting.
* This value generates config windies
* Prestavi hlavni panel na zaklade hodnoty changeSetting.
* Tuto hodnotu generuje konfiguracni okno.
*
* @param changeSetting tell which setting was changed.
* @param changeSetting udava jake nastaveni bylo zmeneno.
*
* @since 0.1.2
**/
void setConfig (unsigned int changeSetting);
/**
* Sets ComboBox (for name of UPS)
* Nastavi ComboBox (pro jmeno UPSky).
*
* &param name je jmeno UPSky ktere bude nastavena.
* &param name is name of ups which will be set.
*
* @since 0.1
**/
void setCombo(QString name);
/**
* Nastavi vsechny panely na nulovo hodnotu
* Sets all pannels to zero value
*
* @since 0.2
**/
void zeroingPanels (void);
/**
* Cleans front panel and panel meter (includes analog panels) .
*
* @since 0.1
**/
void cleanPanels (void);
/**
* Sets and shows connect progress bar.
* Nastavi a zobrazi connect progress bar.
*
* &param is count of parts of progress bar.
* &param je pocet casti progres baru.
*
* @since 0.1
**/
void startConnectPB ( const int count );
/**
* Hide connect progress bar.
* Schova connect progress bar.
*
* @since 0.1
**/
void hideConnectPB ( void );
/**
* Sets amount of progress for connect progress bar.
* Nastavi delku vyplne pro connect progresbar.
*
* &param is amount of progress.
* &param je delka vyplne.
*
* @since 0.1
**/
void setProgressConnectPB ( const int progress );
signals:
/**
* This signal is emited when other UPS was selected.
* Tento signal je vyslan pokud byla vybrana jina UPS-ka.
*
* @since 0.1
**/
void UPSChanged (QString);
/**
* This signal is emited when request for viewing preferences window was ordered from menu.
* Tento signal je vyslan pokud byl z menu zadan pozadavek na zobrazeni okna
* pro nastaveni programu (preference).
*
* @since 0.1
**/
void preferenceUps (void);
/**
* This signal is emited, when in menu was odered requirement for viewing list of values .
* Tento signal je vyslan, pokud byl z menu zadan pozadavek na zobrazeni seznamu promennych.
*
* @since 0.1
**/
void showUPSVars (void);
/**
* Tento signal je vyslan pokud byl z menu zadan pozadavek na zmenu RW promennych.
* This signal is emited when request for change RW varianles was orederd from menu.
*
* @since 0.1
**/
void makeRWVars(void);
/**
* Tento signal je vyslan pokud byl z menu vybran pozadavek na obnovu spojeni.
* This signal is emited when request for refreshing connection was selected from menu.
*
* @since 0.1
**/
void makeRefreshConnection(void);
/**
* This signal is emited when request for making instant commands was selected from menu.
* Tento signal je vyslan pokud byl z menu zadan pozadavek na provedeni okamzitych prikazu.
*
* @since 0.1
**/
void makeInstComms(void);
/**
* This signal is emited whem we need save configuration of program.
* Tento signal je vyslan pokud potrebujeme ulozit konfiguraci programuss.
*
* @since 0.1
**/
void saveConf(void);
/**
* This signal is emited whem request for ending all application was selected from menu.
* Tento signal je vyslan pokud byl z menu zadan pozadavek na ukonceni cele aplikace.
*
* @since 0.1
**/
void endApplication();
protected:
void closeEvent( QCloseEvent *e );
private slots:
void slotDescription(void);
void slotShowToolBar(void);
void slotShowStatusBar(void);
void slotPreferencesUps(void);
void slotPrintUPSVars(void);
void slotInstComms(void);
void slotRWVars(void);
void slotChangeRWVars ( QString );
void slotCloseKnutClient (void);
void slotChangeUPS (const QString &name);
void slotConfigureKeys(void);
void slotRefreshConnection(void);
/************** private common functions ************************/
private:
void activeConfiguration (void);
int activeMainCombo (void);
void hideUpsData (void);
/************ init functions ********************/
void initVars ( void );
void initAction ( void );
void initStatusBar ( void );
void initToolBar ( void );
void initStatusBarMessage ( void );
/************** private vars **************************/
// Nazvy promenych UPS cislovany jsou od 0 do 10 "NONE", "UTILITY", "BATTPCT", "UPSTEMP", "ACFREQ", "LOADPCT", "AMBTEMP", "AMBHUMID", "BATTVOLT", "OUTVOLT", "CURRENT"
QStringList* m_listKNutEvent;
KNutVarData::upsInfoDef* m_activeUpsInfo; // values for selected ups / hodnoty pro vybrane ups
KNutVarData::SettingDataDef* m_settingData; // v teto strukture jsou ulozeny promene ktere nastavuji konfiguraci
KNutUpsData* m_upsRecords;
KNutVarData* m_analogRecords;
KAction *m_quit;
KAction *m_preferencesUps;
KToggleAction *m_descriptionAction;
QLabel* m_area; // main arrea, on its will server main panel and analog panels
// hlavni plocha na ni umistime panel a analogove ukazatele
QSplitter* m_mainSplit;
KNutFrontPanel* m_frontPanel;
// nactene hodnoty promenych UPS, tyto promene se ctou jen jednou
// readly values of UPS's variables, these varieables is read only once
QString m_manufacturer, m_upsModel, m_serial, m_firmrev;
bool m_existLowHighXfer;
float m_lowXfer, m_highXfer;
QPalette m_mainPalette, m_areaPalette, m_mPanelPalette, m_aPanelPalette;
// Combo a pomocne struktury pro dolni radku
// Combo and help structures for bottom line.
KComboBox *m_infoCombo;
KNutPanelMeter* m_panelMeter;
KProgress* m_connectProggresBar;
QString m_progressFormatString;
};
#endif

@ -0,0 +1,95 @@
/***************************************************************************
knutmessage.cpp - description
-------------------
begin : So led 24 2004
copyright : (C) 2004 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#include "knutmessage.h"
#include <kglobal.h>
#include <kiconloader.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qframe.h>
#include <qpixmap.h>
#include <qtimer.h>
KNutMessage::KNutMessage(const QString messageText, const typeOfMessage type, const long int timeValidity, QWidget *parent, const char *name) : KDialogBase(Plain, "Messages",Ok,Ok, parent, name, false, false) {
setCaption("KNutClient");
m_messageTimer = 0;
KIconLoader *loader = KGlobal::iconLoader();
switch(type) {
case infoMess:
m_ret = loader->loadIcon("messagebox_info", KIcon::NoGroup, KIcon::SizeMedium, KIcon::DefaultState, 0, true);
break;
case warningMess:
m_ret = loader->loadIcon("messagebox_warning", KIcon::NoGroup, KIcon::SizeMedium, KIcon::DefaultState, 0, true);
break;
case criticalMess:
m_ret = loader->loadIcon("messagebox_critical", KIcon::NoGroup, KIcon::SizeMedium, KIcon::DefaultState, 0, true);
break;
}
QFrame *page = plainPage();
QVBoxLayout *setTopLayout = new QVBoxLayout( page, 10, spacingHint(), "setTopLayout" );
QHBoxLayout *setMessageLayout = new QHBoxLayout( setTopLayout, spacingHint(), "setMessageLayout" );
QLabel* picture = new QLabel (page);
QLabel* text = new QLabel (messageText,page);
picture->setPixmap(m_ret);
setMessageLayout->addWidget(picture);
setMessageLayout->addWidget(text);
if (timeValidity > 0 ) {
m_messageTimer = new QTimer(this);
if (timeValidity > maxTime)
m_messageTimer->start(maxTime*1000);
else
m_messageTimer->start(timeValidity*1000);
connect (m_messageTimer,SIGNAL(timeout()),this,SLOT(timeout()));
disableResize();
}
}
KNutMessage::~KNutMessage(){
}
void KNutMessage::timeout(void) {
if (m_messageTimer) m_messageTimer->stop();
emit endMessage();
}
void KNutMessage::slotOk (void) {
if (m_messageTimer) m_messageTimer->stop();
emit endMessage();
}
void KNutMessage::moveEvent ( QMoveEvent * e) {
KDialogBase::moveEvent (e);
emit messageMoved(x(),y());
}
#include "knutmessage.moc"

@ -0,0 +1,126 @@
/***************************************************************************
knutmessage.h - description
-------------------
begin : So led 24 2004
copyright : (C) 2004 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef KNUTMESSAGE_H
#define KNUTMESSAGE_H
#include <kdialogbase.h>
//#include <qpixmap.h>
//#include <qtimer.h>
/**
*@author Daniel Prynych
*/
class QTimer;
class QPixmap;
/**
* Tato trida zobrazi okno zpravy v modeless rezimu.
* Okno pracuje nezavisle na ostatnich oknech a NEPOZASTAVUJE jejich cinnost.
*
* @author Daniel Prynych
* @short window message
* @version 0.1
*/
class KNutMessage : public KDialogBase {
Q_OBJECT
public:
enum typeOfMessage {
infoMess,
warningMess,
criticalMess
};
/**
* Constructor - makes window of message.
* Konstruktor - vytvori okno zpravy.
* @param messageText is text of message
* @param type is type of message see on enum typeOfMessage
* @param timeValidity maximal time for showing window, if it is equal zere, time is unlimited.
*
* @param messageText je text zpravu.
* @param type je typ zpravy blize enum typeOfMessage
* @param timeValidity maximalni doba zobrazeni okna, je-li rovna nule je neomezena.
* @since 0.2
*/
KNutMessage(const QString messageText, const typeOfMessage type=infoMess, const long int timeValidity=0, QWidget *parent=0, const char *name=0);
/**
* Destruktor.
*
* @since 0.1.2
**/
~KNutMessage();
signals:
/**
* Je emitovan kdyz dojde ke stisku tlacitka OK, nebo vyprsi doba platnosti (timeValidity).
* Is emited, when button OK is pressed or time of validity is stopped.
*
* @since 0.1
**/
void endMessage(void);
/**
* Is emited when window of message is moved;
* Je emitovan kdyz dojde presunu okna.
*
* @since 0.1
**/
void messageMoved (int, int);
private slots:
/**
* @internal
* Je aktivivan, kdyz vyprsi doba platnosti (timeValidity).
*
* @since 0.1
**/
void timeout(void);
/**
* @internal
* Is activated when button OK was pressed
* Je aktivovan kdyz se stiskne tlacitko OK
*
* @since 0.1
**/
virtual void slotOk (void);
private:
// max rime for message window is 3600 sec or 60 min
static const int maxTime = 3600;
QPixmap m_ret;
QTimer* m_messageTimer;
protected:
void moveEvent ( QMoveEvent * e);
};
#endif

@ -0,0 +1,121 @@
/***************************************************************************
knutmessagemanager.cpp - description
-------------------
begin : So led 24 2004
copyright : (C) 2004 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#include "knutmessagemanager.h"
#include <qstring.h>
KNutMessageManager::KNutMessageManager( QObject *parent, const char *name) : QObject (parent, name) {
//qDebug("KNutMessageManager::KNutMessageManager");
m_myMess =0;
m_myMessLevel = knc::infoLevel;
m_xPos=0;
m_yPos=0;
}
KNutMessageManager::~KNutMessageManager(){
deleteMessage ();
}
void KNutMessageManager::deleteMessage (void) {
if (m_myMess) {
disconnect (m_myMess,SIGNAL(finished()),this,SLOT(slotFinishedMessage()));
disconnect (m_myMess,SIGNAL(endMessage()),this,SLOT(slotEndMessage()));
disconnect (m_myMess,SIGNAL(messageMoved(int,int)),this,SLOT(slotMessageMoved(int,int)));
m_myMess->hide();
delete m_myMess;
m_myMess = 0;
}
}
void KNutMessageManager::addMessage (QString text, knc::LevelOfMessage messageLevel, bool useInfoIcon, bool useShortTimeOfValidity) {
long int timeOfMessageValidity;
if (useShortTimeOfValidity) timeOfMessageValidity = ShortTimeOfValidity;
else timeOfMessageValidity = TimeOfValidity;
//qDebug("KNutMessageManager::addMessage");
deleteMessage();
if (useInfoIcon) m_myMess = new KNutMessage(text,KNutMessage::infoMess,timeOfMessageValidity);
else {
switch (messageLevel) {
case knc::infoLevel:
m_myMess = new KNutMessage(text,KNutMessage::infoMess,timeOfMessageValidity);
break;
case knc::lowWarningLevel:
m_myMess = new KNutMessage(text,KNutMessage::warningMess,timeOfMessageValidity);
break;
case knc::warningLevel:
m_myMess = new KNutMessage(text,KNutMessage::warningMess,timeOfMessageValidity);
break;
case knc::errorLevel:
m_myMess = new KNutMessage(text,KNutMessage::criticalMess,timeOfMessageValidity);
break;
case knc::criticalLevel:
m_myMess = new KNutMessage(text,KNutMessage::criticalMess,TimeOfValidity); //validity time of critical message has to be standard time of Validity, this time doesn't be short time
break;
}
}
m_myMessLevel=messageLevel;
if ((m_xPos != 0) && (m_yPos !=0)) {
m_myMess->move (m_xPos, m_yPos);
}
m_myMess->show();
connect (m_myMess,SIGNAL(finished()),this,SLOT(slotFinishedMessage()));
connect (m_myMess,SIGNAL(endMessage()),this,SLOT(slotEndMessage()));
connect (m_myMess,SIGNAL(messageMoved(int,int)),this,SLOT(slotMessageMoved(int,int)));
}
void KNutMessageManager::slotFinishedMessage (void) {
if (m_myMess) {
disconnect (m_myMess,SIGNAL(finished()),this,SLOT(slotFinishedMessage()));
disconnect (m_myMess,SIGNAL(endMessage()),this,SLOT(slotEndMessage()));
disconnect (m_myMess,SIGNAL(messageMoved(int,int)),this,SLOT(slotMessageMoved(int,int)));
m_myMess->hide();
m_myMess->deleteLater();
m_myMess=0;
}
}
void KNutMessageManager::slotEndMessage (void) {
//kdyz dojde ke stisku tlacitka OK, nebo vyprsi doba platnosti (timeValidity)
deleteMessage();
}
void KNutMessageManager::slotMessageMoved (int x,int y) {
//qDebug("KNutMessageManager::slotMessageMoved");
m_xPos=x;
m_yPos=y;
}
#include "knutmessagemanager.moc"

@ -0,0 +1,131 @@
/***************************************************************************
knutmessagemanager.h - description
-------------------
begin : So led 24 2004
copyright : (C) 2004 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef KNUTMESSAGEMANAGER_H
#define KNUTMESSAGEMANAGER_H
#include "knutmessage.h"
#include <qobject.h>
/**
*@author Daniel Prynych
*/
namespace knc {
enum LevelOfMessage {
infoLevel, // status RB, TRIM, CAL, TRIM
lowWarningLevel, // OVER,
warningLevel, // OB ..
errorLevel, // connection error
criticalLevel // Status BL, OFF
};
}
class QString;
/**
* Tato trida slouzi pro ovladani vyskakovacich oken (pop-up)
* Okno pracuji nezavisle na ostatnich oknech a NEPOZASTAVUJI jejich cinnost.
*
* @author Daniel Prynych
* @short window message manager
* @version 0.1
*/
class KNutMessageManager : public QObject {
Q_OBJECT
public:
/**
* Konstruktor - vytvori instanci tridy.
*
* @since 0.1
*/
KNutMessageManager( QObject *parent=0, const char *name=0);
/**
* Destruktor.
*
* @since 0.1.1
**/
~KNutMessageManager();
/**
* Pozada o zobrazeni okna. Pokud je zobrazeno okne s vyssi prioritou, neni funkce provedena.
*
* @param text Text of message, which will be showed in window
*
* @param text Text zpravy ktera se zobrazi v okne.
* @param messageLevel urcuje prioritu zpravy.
* @param useInfoIcon urcuje ktera icona se zobrazi. Pokud je nastaven na true, je vzdy zobrazena icona
* info, pokud je false je nastavena icona v zavislosti na priorite zpravy.
*
* @since 0.2
**/
void addMessage (QString text, knc::LevelOfMessage messageLevel = knc::infoLevel, bool useInfoIcon = false, bool useShortTimeOfValidity = false);
/**
* Close window, when one is existed
* Zrusi okno, pokud existuje;
*
* @since 0.1.1
**/
void deleteMessage (void);
private slots:
/**
* @internal
* Je aktivovan, kdyz bylo pozadano o zruseni okna stisknutim praveho widgetu nebo vnejsimi udalostmi (KDE Logout).
*
* @since 0.1.2
**/
void slotFinishedMessage (void);
/**
* @internal
* Je aktivovan, kdyz bylo pozadano o zruseni okna stsknutim OK nebo vyprsenim casoveho terminu
*
* @since 0.1.2
**/
void slotEndMessage (void);
/**
* @internal
/ Is activated when window was moved
* Je aktivovan, kdyz bylo okno presunuto
*
* @since 0.1.2
**/
void slotMessageMoved (int x,int y);
private:
static const long int TimeOfValidity = 600; //600 sec or 10n min
static const long int ShortTimeOfValidity = 60; // 60 sec or one min
KNutMessage* m_myMess;
knc::LevelOfMessage m_myMessLevel;
int m_xPos;
int m_yPos;
};
#endif

File diff suppressed because it is too large Load Diff

@ -0,0 +1,869 @@
/***************************************************************************
knutnet.h - description
-------------------
begin : Ne led 12 2003
copyright : (C) 2003 by Daniel Prynych
email : Daniel@prynych.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef KNUTNET_H
#define KNUTNET_H
//Od verze 3 je kapp jen odkaz na kapplication
//Since version 3 is kapp pointer on kapplication only
//#include <kapplication.h>
#include <kapp.h>
#include <qobject.h>
#include <qsocket.h>
#include <qsocketdevice.h>
#include <qnetworkprotocol.h>
#include <qmutex.h>
#include <qvaluevector.h>
struct upsVarDef {
QString upsVarName;
bool upsVarActivate;
bool upsVarType; // typ true(1) RO - false (0) RW (muzeme menit)
bool upsValueType; // typ true(1) char - false (0) enum (vyctova)
// ma vyznam jen pro RW promenne
int upsVarMax; // udave max delku string promenne nebo pocet moznosti pro enum promennou
// ma vyznam jen pro RW promenne
QString upsValue; // hodnota promene
QString upsDescription; // informace o promene
QValueVector<QString>* upsEnumValues;
};
struct upsICommDef {
QString upsCommName;
QString upsDescription;
};
class QString;
class QCString;
class QSocket;
class QTimer;
/**
*@author Daniel Prynych
*/
/**
* This class reads data from serveru NUT.
* Since version 0.5 is written and API is changet.
* Since 0.6.1 supports protocol client-server and variables for upsd >= nut 1.3
* Since 0.6.1 doesn't ups name like ups_name@host_address
* Since 0.7 doesn't support UDP
* Tato trida zajistuje cteni dat ze serveru NUT.
* Od verze 0.5 je uplne prepsana a je zmeneno i API.
* Od verze 0.6.1 proporuje take client-server protokol a promenne pro upsd >= nut 1.3
* Od verze 0.6.1 nepodporuje jmeno ups ve tvaru jmeno_ups@adresa_pc
* Od verze 0.7 neni podporovano UDP
*
* @author Daniel Prynych
* @short Communication with UPS - Komunikace s UPS
* @version 0.7
*/
class KNutNet : public QObject {
Q_OBJECT
public:
enum NetState {Idle, HostLookup, Connecting, Connected, ConnectError,Closing };
// idle is same like NotConnected
// neni pripojeno chyba pri pripojeni,pripojeno, pripojuji
enum typeOfVar {AllVars, ROVars, RWVars };
enum NetError {
NoError,
LowMem, // no memmory - nebyla pridelena pamet
NullAddress, // no address of host nebyla zadana adresa pocitace
NoSuchHost, // this host noexist neexistuje takovy pocitac
CantConnect, // I cannot connect to server Nemohu se spojit se serverem
SocketReadErr, // I cannot read data from socket - Nelze cist data ze soketu
ConnectErr, // connect isn't maked - Nejde provest connect
NutProtocolVarErr, // Nelze zjistit verze protokolu
NoUpsHere, // ni UPS on this address na teto adrese neni zadna UPS
ConnectionRefused, // server refused connection
ConnetionClosedByServer, // connection was closed by server upsd // by the second side
SendErr, // doesn't send date - Nelze odeslat data
RecvErr, // doesn't receive data - Nelze prijmout data
NoData, // no data was received, empty string was received - Nebyla prijmuta zadna data, byl prijmut prazdny retezec
UnknownAnswer, // Server answer no right - Server neodpovedel spravne
UnknownFormat, // Data hasn't got right structure - Data nemaji spravnou strukturu
UnknownFormatVer, //Data returned after command VER don't have right structure - Data vracena po prikazu VER nemaji spravnou strukturu
NoServerData, // doesn't read data from server (Server isn't answering) Nelze precist data ze serveru (Sever neodpovida)
NoUpsnetOk, // UpsNetOK is setting on faLse - je nastaven UpsNetOk na false
UnknownErr, // unknown error unknown text after ERR - neznama chyba - neznamy text za ERR
CommNotFind, // command hasn't been found in list of module's commands - prikaz nebyl nalezen v seznamu prikazu modulu
VarNotFind, // variable hasn't been found in list of module's variables promena nebyla nalezena v seznamu promenych modulu
EnumValueNotFind, //value of enumereted variable hasn't been found hodnota vyctove promene nebyla nalezena
// tyto zpravy vraci server
// this mesages is returned server upsd
AccessDenied, // access denied - pristup odmitnut
PasswordRequired, // password is required - pro akci je nutno zaslat heslo
PasswordIncorrect, // password is incorrect nespravane heslo
UnknownUps, // this ups isn't occured on address - tato ups neni na zadane adrese
AlreadyLoggedIn, // prihlaseni LOGIN jiz bylo provedeno
AlreadySetPassword, // password has been already entered - heslo jiz bylo zadano
AlreadySetUsername, // username has been already entered - uzivatelske jmeno jiz bylo zadano
DataStale, // data from module isn't got - neni mozne ziskat z modulu nove data
MissingArgument, // misses argument - chyby argument
UnknownType, // unknown type of variable -neznamy typ promene
UnknownCommand, // umknown command example: sends maybe "UPERNAME admin" - nezmamy prikaz pr: poslem treba "UPERNAME admin"
//tyto chyby se vztahuji k driveru pro danny typ UPS-ky
// this mistake is refered for selected driver of UPS
DriverNotConnected, // driver isn't connected - driver neni pripojen
NoResponse, // driver pro ups neodpovedel ve vymezenem case
UnknownReply, // unknown reply - neznama odpoved
NotImplemented, //
CommandFailed, // failed command - chybny prikaz
VarUnknown, // values isn't selected by driver - promena neni driverem podporovana
VarNotSupported, // cannot get data for this values - neni mozno zislat data pro tuto promenou
InvalidValue, // unknown value - nespravna hodnota
UnknownInstCmd, // unknown instant command / neznamy okamzity prikaz
CmdNotSupported, // this instant command isn't supported - tento okamzity prikaz neni podporovan
NotConnection, // operace nelze provest protoze neni provedeno pripojeni
// this not error
NoListVars}; //upsd doesn't return list of variables, variable for STATUS has got value WAIT
enum typeOfStatus {
NS = 0, // - NONE status of UPS wasn't read
OFF = 1, // - UPS is off (not supplying power)
OL = 2, // - UPS is online (supplying power from the line/mains)
OB = 4, // - UPS is on battery
LB = 8, // - UPS battery is low (with OB = shutdown situation)
CAL = 16, // - UPS is performing calibration
TRIM = 32, // - UPS is trimming incoming voltage (APC "SmartTrim")
BOOST = 64, // - UPS is boosting incoming voltage (APC "SmartBoost")
OVER = 128, // - UPS is overloaded
RB = 256, // - UPS battery needs to be replaced
WAIT = 512 // - UPS as for waiting
};
enum keyWord {
NONE,
OK,
ERR,
BEGIN,
END,
VAR,
TYPE,
DESC,
UPSDESC,
CMDDESC,
UPS,
LIST,
RW,
CMD,
ENUM,
STARTTLS,
BEGIN_LIST_VAR,
BEGIN_LIST_RW,
BEGIN_LIST_CMD,
BEGIN_LIST_UPS,
BEGIN_LIST_ENUM,
END_LIST_VAR,
END_LIST_RW,
END_LIST_CMD,
END_LIST_UPS,
END_LIST_ENUM
};
enum flagsVar {
RW_FLAG = 1,
ENUM_FLAG = 2,
STRING_FLAG = 4
};
/**
* Constructor sets basic variables and structures only, but doesn't read variables from server NUT
* Konstruktor pouze nastavi zakladni promene a struktury, ale necte promene se serveru NUT.
* @param upsName in name of UPS
* @param upsAddress Is address of UPS (adresa pocitace na ktery je UPS pripojena)
* netAddress can is entered like ip address or domain name
* example: localhost karel.domain,cz 194.212.25.55.
* @param tPort Is name if port, for NUT server (NUT is received on this port), default is 3493.
* @param delay is delay in msec. System waits before one tries to make connection again. When test of connection fails,
* @param countRepeat is maximal number of repeating for make connection.
*
* Since 0.7.5 version protocol UDP is not supported
* @param upsAddress Je adresa ups-ky (adresa pocitace na ktery je UPS pripojena)
* netAddress muze byt zadan jako ip adresa nebo domenove jmeno pocitace
* @param upsName je jmeno UPSky
* pr.: localhost karel.domena.cz 194.212.25.55.
* @param tPort je cislo portu na kterem nasloucha NUT server, default je 3493.
* @param delay je zpozdeni v msec, System ceka nez znovu pokusi ukutecnit spojeni. Kdyz pokus o spojeni selhal.
* @param countRepeat je maximalni pocet opakovani spojeni pro navazani spojeni.
* Od verze 0.7 neni podporovano UDP
*
* @since 0.7.5
**/
KNutNet (const QString upsAddress, const QString upsName="", const unsigned short port=3493, unsigned int countRepeat =0, const unsigned int delay = 200);
/**
* @since 0.5
**/
~KNutNet();
/**
* Zavre spojeni a nastavi hodnoty pro novou UPSku
* Closes conneting and sets values for new UPS
*
* @since 0.1
**/
void newUPS (const QString upsAddress, const QString upsName, const unsigned short port=3493);
/**
* Provadi spojeni
* Makes conneting
*
* @since 0.1
**/
void open (void);
/**
* Zavre spojeni
* Closes conneting
*
* @since 0.1
**/
void close (void);
/**
* Returns kod of error, which is setted after last colling of same function this calls.
* Error NotConnected isn't returned (not for function getError, getState).
* It means then error NotConnected isn't remembered.
* Vraci kod chyby, ktera nastala pri poslednim volani kterekoliv funkce
* teto tridy (s vyjimkou getError, getState ),
* chyba NotConnected neni vracena;
* To znamena ze chyba NotConnected neni zapamatovana.
*
*
* @since 0.5
**/
int getError ( void );
/**
* Vraci stav pripojeni.
* Returns state of connection.
*
* @since 0.5
**/
int getState ( void );
/**
* Returns state of description, if descriptions is loaded.
* Vraci stav popisu, zda je nahran;
*
* @since 0.5
**/
bool isDescription ( void );
/**
* Vraci zda doslo k prepnuti z UDP do TCP;
* Ma vyznam je pro verzi protokolu 2
*
* @since 0.1
**/
bool switchedToTCP ( void );
/**
* Vraci cislo protokolu pro komunikaci s NUT
* Returns nunber of protocol for comunications with NUT
* Od verze NUTu 1.3 je zmenen protokol
* Since version 1.3 protocol is changed
*
* @since 0.1
**/
int getNutProtocol ( void );
/**
* Return number of NUT's version
* Vraci cislo verze nazvu NUT-u
* Since version if nut 1.3 are changed names of values
* Od verze NUTu 1.3 jsou zmeneny nazvy promenych
*
* @since 0.1
**/
int getNutVariables ( void );
/**
* Nacte vsechny promene UPS-ky a nastavi jejich typ (znakove/char, vyctove/enum a status)
* Nastavi priznak aktivity jen pro status.
* Funkce vraci kod chyby nebo 0 pokud k chybe nedojde;
* Vzdy jsou nacteny i hodnoty promenych.
*
* @since 0.6.1
**/
int getUpsVars ( void);
/**
* Nacte hodnoty vsech promenych UPS-ky pokud je nastaven jejich priznak aktivity,
* nebo je nastaven allVars na true.
* Pozor po provedeni getUpsVars je priznak aktivity nastaven jen pro status.
*
* @param allVars Urcuje zda se prikaz tyka vsech promenych, nebo jen tech ktere
* maji nastaven priznak aktivity na TRUE.
*
* @since 0.6.1
**/
int getUpsValues (const bool allVars=true );
/**
* Nacte popisy pro kazdou promennou
* Read descriptions for every variable
*
* @param always Urcuje zda se nacteny provede vzdy nebo jen kdy popis jeste
* nebyl nacten.
*
* @since 0.6
**/
int getDescription (bool always = false);
/**
* Provede okamzity prikaz.
* Vraci 0 pokud provedeni skoncilo v poradku jinak kod chyby.
*
* @param command Udava nazev prikazu.
* @param userName Udava uzivatelske jmeno.
* @param password Udava heslo.
* @param onlyCommand udava zda ma byt poslan pouze prikaz, nebo i nastaveno uzivatelske jmeno a heslo.
* POZOR!! uzivatelske jmeno nejde zmenit bez odpojeni a znovu pripojeni.
*
* @since 0.7
**/
int instantCommand (const QString command, const QString userName, const QString password, const bool onlyCommand = false);
/**
* Nastavi RW promenou.
* Vraci 0 pokud provedeni skoncilo v poradku jinak kod chyby;
*
* @param variable Udava nazev promenne.
* @param value Udava hodnotu.
* @param userName Udava uzivatelske jmeno.
* @param password Udava heslo.
* @param onlyVariable udava zda ma byt poslana pouze zadost na zmenu promenne, nebo i nastaveno uzivatelske jmeno a heslo.
* POZOR!! uzivatelske jmeno nejde zmenit bez odpojeni a znovu pripojeni.
*
* @since 0.7
**/
int setVariable (const QString variable, const QString value, const QString userName, const QString password, const bool onlyVariable = false);
/**
* Returns number of UPS's variables. On error -1 is returned.
* Vrati pocet promenych UPS-ky. Pri chybe vraci -1.
*
* @param typVar Is type of variable, its number is found out.
* @param typVar Je typ promene pro ktere zjistujeme pocet
* muze se jednat o RO promenne RW promene nebo o vsechny promenne.
*
* @since 0.6
**/
int readNumberVars (typeOfVar typVar = AllVars);
/**
* Returns number of UPS's commands. On erroe -1 is returned.
* Vrati pocet prikazu UPS-ky. Pri chybe vraci -1.
*
* @since 0.6
**/
int readNumberComms (void);
/**
* Nastavi strukturu udavajici vsechny hodnoty pro prikaz.
* Pri chybe vrati kod chyby
*
* @param seqNumber Udava cislo promene.
* @param upsIComm Je struktura upsICommDef.
*
* @since 0.6
**/
int readIComm (const int seqNumber, upsICommDef& upsIComm);
/**
* Nastavi strukturu obsahujici vsechny udaje promene.
* Pri chybe vrati kod chyby.
*
* @param name Udava jmeno promene.
*
* @since 0.6
**/
int readVars (const QString name, struct upsVarDef& allVar);
/**
* Nastavi strukturu obsahujici vsechny udaje promene.
* Pri chybe vrati kod chyby.
*
* @param seqNumber Udava poradove cislo promene, ta zacina VZDY cislem 1.
* @param typVar Udava typ promene /RO/RW/ALL.
*
* @since 0.6
**/
int readVars (const int seqNumber, struct upsVarDef& allVar, const typeOfVar typVar = AllVars);
/**
* Vrati hodnotu promenne.
* Pri chybe vrati 0l.
*
* @param name Udava jmeno promene.
*
* @since 0.6.1
**/
QString readStringVar (const QString name);
/**
* Nacte jednu z hodnot vyctove promenne.
* Vraci jednu z hodnot vyctove promenne udanou poradovym cislem hodnoty.
* Pri chybe vrati 0l.
*
* @param name Udava nazev vyctove promenne.
* @param valueNumber Udava poradove cislo hodnoty vyctove promenne.
* @param enumValue Je naplnena hodnotou vyctove promenne.
*
* @since 0.6.1
**/
QString readEnumValueVar (const QString name, const int valueNumber);
/**
* Vraci kod stavu (statusu) UPS-ky
* kody je mozne scitat napt OB+LB = 12
* OFF = 1, UPS-ka je vypnuta
* OL = 2, UPS-ka bezi na sit
* OB = 4 UPS-ka bezi na baterie
* LB = 8 baterie je vybyta (pokud je zaroven OB dojde k shutdownu)
* CAL = je spustena kalibrace UPS-ky
* OVER =128 UPS-ka je pretizena
* RB = 256 UPS-ka pozaduje vymenu baterie
*
* @since 0.5
**/
int readStatus(void);
/**
* Nastavi priznak aktivity.
* Pri chybe vrati kod chyby.
*
* @param name Udava jmeno promene.
*
* @since 0.6
**/
int setActivate ( const QString name );
/**
* Zrusi nastaveni priznaku aktivity.
* Pri chybe vrati kod chyby.
*
* @param name Udava jmeno promene.
*
* @since 0.6
**/
int unSetActivate ( const QString name );
/**
* Zrusi nastaveni priznaku aktivity pro VSECHNY promene.
* Pri chybe vrati kod chyby.
*
* @since 0.6
**/
int unSetActivateAll ( void );
/**
* Testuje zda existuje promena danneho jmena.
* POZOR ZMENA v NAVRATOVYCH HODNOTACH
* Vraci 0 pokud existuje.
* Pokud neexistuje nebo pri chybe vrati kod chyby.
*
* @param name Udava jmeno promene.
*
* @since 0.6
**/
int existName ( const QString name );
/********* Consts ****************/
static const int initState = OL;
signals:
/**
* Signal je vyslan, kdyz dojde k chube.
* Signal is emited, when error is occurred
*
* param@ error je cislo chyby.
* param@ error je value of error.
**/
void connectionError(int error);
/**
* Signal je vyslan, kdyz druha starna uzavrela spojeni.
* Signal is emited, when other side closed connection.
*
* @since 0.1
**/
void connectionClosed (void);
/**
* Signal je vyslan, kdyz dojde k prvemu spojeni se serverem.
* Signal is emited, when the first connection with server is realized
*
* @since 0.1
**/
void firstConnection(void); /**
* Signal je vyslan, kdyz dojde k dalsimu spojeni se serverem, znovu pripojeni.
* Signal is emited, when next connection with server is realized, reconnect.
*
* @since 0.1
**/
void nextConnection(void);
/**
* Signal je vyslan, kdyz prevod jmena byl uspesny.
* Signal is emited, when host lookup has succeeded
*
* @since 0.1
**/
void hostFound(void);
/**
* Signal je vyslan, kdyz spojeni je opet zkouseno.
* Signal is emited, when connection is tried again.
*
* @since 0.1
**/
void tryRepeatFirstConnection( int );
/**
* Signal je vyslan, kdyz spojeni je zkouseno poprve.
* Signal is emited, when connection is tried at first.
*
* @since 0.1
**/
void tryFirstConnection( int);
// signals:
void getVarDesc (int count, int item);
/********* Private part **********/
private:
// internal funkcion
/**
* Cleans input buffer
* Vycisti vstupni buffer
*
* @since 0.1
**/
void cleanConnecting (void);
/**
* Prevede textovy nazev klice na jeho numerickou hodnotu
* Jen pro protokol verze 2.
* Funkce vraci kod klice;
* param@ line textovy nazev klice.
*
* @since 0.1
**/
int setKey (const QString line);
QString parseValue (const QString line);
/**
* Parsuje typ promenne (RW ENUM STRING).
* Jen pro protokol verze 2.
* Funkce vraci soucet kodu typu promenych;
* param@ line retezec ktery se parsuje.
* param@ lenString vraci maximalni delka promenne typu STRING.
*
* @since 0.1.1
**/
int parseTypeValue (QString line, int& lenString );
/**
* Parsuje navratovou hodnotu z upsd (protokol klient-server).
* Jen pro protokol verze 2.
* Funkce vraci kod prikazu (UPS, VAR BEGIN_LIST_VAR );
*
* @since 0.1
**/
int parseLine(QString& line, QString& upsName ,QString& varName, QString& value, int& typeValue, int& lenString);
/**
* Nacte popisy pro kazdou promennou
* Jen pro protokol verze 1.
*
* @param always Urcuje zda se nacteny provede vzdy nebo jen kdy popis jeste
* nebyl nacten.
*
* @since 0.1
**/
int getDescription1 (bool always = false);
/**
* Nacte popisy pro kazdou promennou
* Jen pro protokol verze 2.
*
* @param always Urcuje zda se nacteny provede vzdy nebo jen kdy popis jeste
* nebyl nacten.
*
* @since 0.1
**/
int getDescription2 (bool always = false);
/**
* internal
* Nacte nazev prvni UPS-ky na danne adrese.
* Jen pro protokol verze 2
* Funkce vraci kod chyby nebo 0 pokud k chybe nedojde;
*
* @since 0.1
**/
int getFirstUpsName (QString& firstUpsName);
/**
* internal
* Nacte vsechny promene UPS-ky a nastavi jejich typ (znakove/char, vyctove/enum a status)
* nastavi priznak aktivity jen pro status.
* Jen pro protokol verze 2
* Funkce vraci kod chyby nebo 0 pokud k chybe nedojde;
*
* @since 0.1
**/
int getUpsVars1 ( void);
/**
* internal
* Nacte vsechny promene UPS-ky a nastavi jejich typ (znakove/char, vyctove/enum a status)
* nastavi priznak aktivity jen pro status.
* Jen pro protokol verze 2
* Funkce vraci kod chyby nebo 0 pokud k chybe nedojde;
*
* @since 0.2
**/
int getUpsVars2 ( void);
/**
* Nacte hodnoty vsech promenych UPS-ky pokud je nastaven jejich priznak aktivity,
* nebo je nastaven allVars na true.
*
* @param allVars Urcuje zda se prikaz tyka vsech promenych, nebo jen tech ktere
* maji nastaven priznak aktivity na TRUE.
* Jen pro protokol verze 1
*
* @since 0.6
**/
int getUpsValues1 (const bool allVars );
/**
* Nacte hodnoty vsech promenych UPS-ky pokud je nastaven jejich priznak aktivity,
* nebo je nastaven allVars na true.
*
* @param allVars Urcuje zda se prikaz tyka vsech promenych, nebo jen tech ktere
* maji nastaven priznak aktivity na TRUE.
* Jen pro protokol verze 2
*
* @since 0.6
**/
int getUpsValues2 (const bool allVars );
/**
* @internal
* Zjisti verzi upsd
*
* @param countRepeat maximalni pocet pokusu (ne opakovani !!)
* @param delay zpozdeni, cas mezi opakovani
*/
int version (int countRepeat, const int delay);
/**
* @internal
* Nenastavuje promenou error.
* Doesn't set variable error
*/
int getUpsData (const QCString sbuffer, QString& rbuffer, const QCString endString=0);
/**
* @internal
*/
void setRWVars (const QString varName, const bool valueType, const int varMax, QValueVector<QString>* enumValues);
/**
* @internal
*/
void upsSetType (struct upsVarDef& upsVar, const QString name, const QString value = "");
/**
* @internal
*/
int upsTranslateError (const QString string);
/**
* @internal
*/
void deleteVars (void);
/**
* @internal
*/
int upsOldTranslateError (const QString string);
/**
* @internal
* Pro qt mensi nez 3.0.0 nemuze byt value const
*/
void genStatusFlags (QString value);
/**
* @internal
* Nenastavuje promenou error.
*/
int sendComm (const QString command, const QString arg1, const QString arg2, const bool useUpsName=false);
/**
* @internal
*/
int activate ( const QString name, const bool setActivate );
/**
* @internal
*/
int activateAll ( const bool setActivate );
/**
* @internal
*/
int newDescription (const QCString inBuffer, QString& upsDescription);
private slots:
void slotConnectionError(int error);
void slotConnected(void);
void slotTimerReconnect(void);
void slotHostFound(void);
void slotConnectionClosed(void);
void slotClosed (void);
private:
/******* CONST ********/
static const Q_ULONG rBufferLen = 1024;
QSocket *m_commandSocket;
QTimer* m_unConnectTimer;
/****** VARS *************/
QString m_upsAddress;
QString m_upsName;
unsigned int m_countRepeat;
unsigned short m_port;
unsigned int m_delay;
NetState m_state;
int m_error;
bool m_firstConnect;
unsigned int m_numberConnection;
int m_nutProtocol; // 1 for NUT <1.3, 2 for NUT => 1.3
int m_nutVariables; // 1 for NUT <1.3, 2 for NUT => 1.3
int m_numberVars; // number of all variables - pocet vsech promennych
int m_numberRWVars;
int m_numberIComms;
int m_upsStatusVar;
bool m_description;
bool m_switchToTCP;
QMutex m_getUpsDataMutex;
QValueVector<upsVarDef> m_listVars;
QValueVector<upsICommDef> m_listIComms;
/********* Pomocne promenne ***********/
int m_posChar;
};
#endif

@ -0,0 +1,294 @@
/***************************************************************************
knutnewupsdlg.cpp - description
-------------------
begin : Tue Aug 21 2001
copyright : (C) 2001 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#include "knutnewupsdlg.h"
#include <klocale.h>
#include <kmessagebox.h>
#include <kactionselector.h>
#include <qstring.h>
#include <qlayout.h>
#include <qframe.h>
#include <qlabel.h>
#include <qgroupbox.h>
//#include <qradiobutton.h>
#include <qbuttongroup.h>
#include <qcheckbox.h>
#include <qlistbox.h>
//#include <iostream>
KNutNewUpsDlg::KNutNewUpsDlg (KNutUpsData* const upsData, KNutVarData* const analogData, const bool add, QWidget* parent, const char* name, const bool modal)
: KDialogBase(Plain, i18n("New Ups"),Help|Ok|Cancel,Ok, parent, name, modal, true ), addMember(add), m_myUpsData(upsData) {
setName( "KupsNewUpsDlg" );
QFrame *page =plainPage();
QVBoxLayout *mainLayout = new QVBoxLayout( page, 0, spacingHint(), "mainLayout" );
QHBoxLayout *dataLayout = new QHBoxLayout(mainLayout, spacingHint(),"dataLayout");
QGroupBox *hostBox = new QGroupBox (page,"hostBox");
QGridLayout *hostLayout = new QGridLayout (hostBox, 5, 2, spacingHint () );
hostBox->setFrameStyle(QFrame::NoFrame);
dataLayout->addWidget(hostBox);
QHBoxLayout *portLayout = new QHBoxLayout(-1,"portLayout");
hostLayout->addLayout(portLayout,4,1);
QHBoxLayout *loginLayout = new QHBoxLayout(-1,"loginLayout");
hostLayout->addLayout(loginLayout,5,1);
QGroupBox* GroupBox2 = new QGroupBox( page, "GroupBox2" );
QVBoxLayout *vActionSelectorLayout = new QVBoxLayout( GroupBox2, 0, spacingHint(), "VActionLayout" );
vActionSelectorLayout->addSpacing(fontMetrics().lineSpacing());
QHBoxLayout *hActionSelectorLayout = new QHBoxLayout( vActionSelectorLayout, spacingHint(), "HActionLayout" );
vActionSelectorLayout->addSpacing(10);
QLabel* TextLabel1 = new QLabel( i18n("Name")+":",hostBox, "TextLabel1" );
hostLayout->addWidget (TextLabel1,1,0);
m_lineEdit1 = new KLineEdit( hostBox, "LineEdit1" );
m_lineEdit1->setEnabled( add );
// pokud se nejedna o pridani (add) neni jmeno aktivovani
// when makes adding name isn;t activated
hostLayout->addWidget (m_lineEdit1,1,1);
QLabel* TextLabel2 = new QLabel(i18n("UPS address")+":", hostBox, "TextLabel2" );
hostLayout->addWidget (TextLabel2,2,0);
m_lineEdit2 = new KLineEdit( hostBox, "LineEdit2" );
hostLayout->addWidget (m_lineEdit2,2,1);
// Name of UPS
QLabel* TextLabel7 = new QLabel(i18n("UPS name")+":", hostBox, "TextLabel7" );
hostLayout->addWidget (TextLabel7,3,0);
m_lineEdit7 = new KLineEdit( hostBox, "LineEdit7" );
hostLayout->addWidget (m_lineEdit7,3,1);
QLabel* TextLabel3 = new QLabel(i18n("Delay (ms):"), hostBox, "TextLabel3" );
hostLayout->addWidget (TextLabel3,4,0);
m_lineEdit3 = new KLineEdit( hostBox, "LineEdit3" );
m_lineEdit3->setText("5000");
portLayout->addWidget(m_lineEdit3);
portLayout->addSpacing(10);
QLabel* TextLabel4 = new QLabel(i18n("Port:"), hostBox, "TextLabel4" );
m_lineEdit4 = new KLineEdit( hostBox, "LineEdit4" );
m_lineEdit4->setText(QString("%1").arg(knc::DefaultPort));
portLayout->addWidget(TextLabel4);
portLayout->addWidget(m_lineEdit4);
QLabel* TextLabel5 = new QLabel(i18n("User name:"), hostBox, "TextLabel5" );
hostLayout->addWidget (TextLabel5,5,0);
m_lineEdit5 = new KLineEdit( hostBox, "LineEdit5" );
m_lineEdit5->setText("");
loginLayout->addWidget(m_lineEdit5);
loginLayout->addSpacing(10);
QLabel* TextLabel6 = new QLabel(i18n("Password:"), hostBox, "TextLabel6" );
m_lineEdit6 = new KLineEdit( hostBox, "LineEdit6" );
m_lineEdit6->setEchoMode(QLineEdit::Password);
m_lineEdit6->setText("");
loginLayout->addWidget(TextLabel6);
loginLayout->addWidget(m_lineEdit6);
m_savePassword = new QCheckBox (i18n("Store NUT password in configuration file"),page,"savePassword");
mainLayout->addWidget(m_savePassword);
mainLayout->addWidget(GroupBox2);
m_upsValueSelector = new KActionSelector(GroupBox2);
m_upsValueSelector->setAvailableLabel(i18n("Availabled UPS values"));
m_upsValueSelector->setSelectedLabel(i18n("Selected UPS values"));
m_upsValueSelector->setAvailableInsertionPolicy(KActionSelector::Sorted);
m_upsValueSelector->setSelectedInsertionPolicy(KActionSelector::AtBottom);
hActionSelectorLayout->addSpacing(10);
hActionSelectorLayout->addWidget(m_upsValueSelector);
hActionSelectorLayout->addSpacing(10);
mainLayout->addStretch(10);
GroupBox2->setTitle( i18n( "UPS Variables" ));
QListBox* aListBox = m_upsValueSelector->availableListBox();
for (int i=1; i < knc::NumberOfTypes; i++) { //values 0 is None, this values isn't showing
new KNutUpsBoxItem (aListBox,analogData->getNameAnalogData(i),i);
}
aListBox->sort(true);
}
KNutNewUpsDlg::~KNutNewUpsDlg() {
}
void KNutNewUpsDlg::moveToSelectedList (const int codeUpsVar) {
if (codeUpsVar == 0) return;
if (isExistSelectedItem(codeUpsVar)) return; //Value is moved yet
KNutUpsBoxItem * availableItem;
availableItem =(KNutUpsBoxItem*) m_upsValueSelector->availableListBox()->firstItem();
while (availableItem != 0) {
if (availableItem->getVarCode() == codeUpsVar) {
break;
}
availableItem=(KNutUpsBoxItem*)availableItem->next();
}
//remove item from left list
if (availableItem != 0) {
QListBox* sListBox = m_upsValueSelector->selectedListBox();
new KNutUpsBoxItem (sListBox,availableItem->text(),codeUpsVar);
m_upsValueSelector->availableListBox()->removeItem(m_upsValueSelector->availableListBox()->index(availableItem));
}
}
bool KNutNewUpsDlg::isExistSelectedItem (const int codeUpsVar) const {
KNutUpsBoxItem * selectedItem;
selectedItem =(KNutUpsBoxItem*) m_upsValueSelector->selectedListBox()->firstItem();
while (selectedItem != 0) {
if (selectedItem->getVarCode() == codeUpsVar) return true;
selectedItem=(KNutUpsBoxItem*)selectedItem->next();
}
return false;
}
void KNutNewUpsDlg::putData (const KNutUpsData::upsRecordDef upsRecord ) {
m_lineEdit1->setText(upsRecord.name);
m_lineEdit2->setText(upsRecord.upsAddress);
m_lineEdit7->setText(upsRecord.upsName);
QString delay, port;
delay.setNum(upsRecord.delay);
m_lineEdit3->setText(delay);
port.setNum(upsRecord.port);
m_lineEdit4->setText(port);
m_lineEdit5->setText(upsRecord.userName);
m_lineEdit6->setText(upsRecord.password);
// RadioButton1->setChecked( !upsInfo.tcp );
// RadioButton2->setChecked( upsInfo.tcp );
m_savePassword->setChecked(m_savePassword);
for (int j=0; j <knc::NumberOfVars; j++) moveToSelectedList (upsRecord.upsVarCode[j]);
}
KNutUpsData::upsRecordDef KNutNewUpsDlg::getData (void ) const {
KNutUpsData::upsRecordDef upsRecord;
upsRecord.name=m_lineEdit1->text();
upsRecord.upsAddress=m_lineEdit2->text();
upsRecord.upsName= m_lineEdit7->text();
upsRecord.delay=m_lineEdit3->text().toLong();
upsRecord.port=(short unsigned)m_lineEdit4->text().toUInt();
// upsInfo.tcp=RadioButton2->isChecked();
upsRecord.userName=m_lineEdit5->text();
upsRecord.password=m_lineEdit6->text();
upsRecord.savePassword=m_savePassword->isChecked();
int j =0;
KNutUpsBoxItem * selectedItem;
selectedItem =(KNutUpsBoxItem*) m_upsValueSelector->selectedListBox()->firstItem();
while (selectedItem != 0) {
upsRecord.upsVarCode[j++]=selectedItem->getVarCode();
selectedItem=(KNutUpsBoxItem*)selectedItem->next();
}
for (int i=j; i < knc::NumberOfVars; i++) {
upsRecord.upsVarCode[i]=0;
}
return upsRecord;
}
/*********************************************************************************************/
/* */
/* PRIVATE SLOTS */
/* */
/*********************************************************************************************/
void KNutNewUpsDlg::slotOk() {
bool ok;
// closes window
m_lineEdit1->setText(m_lineEdit1->text().stripWhiteSpace());
m_lineEdit2->setText(m_lineEdit2->text().stripWhiteSpace());
if ((m_lineEdit1->text().length() <1 )
|| (m_lineEdit2->text().length() <1 )) {
KMessageBox::sorry (0,i18n("No Name or UPS address"));
return;
}
if (addMember) {
// when UpsName is existed we cannot make new record
// pokud UpsName jiz existuje nemuzeme vytvorit novy zaznam
if ( m_myUpsData->findName(m_lineEdit1->text()) != 0L ) {
KMessageBox::sorry (0,i18n("This Name exist"));
return;
}
}
long delay = m_lineEdit3->text().toLong(&ok);
if (! ok) {
KMessageBox::sorry (0,i18n("Delay must be number"));
return;
}
long port = m_lineEdit4->text().toLong(&ok);
if (! ok) {
KMessageBox::sorry (0,i18n("Port must be number"));
return;
}
if ((port < knc::StartPort) || (port > knc::StopPort)) {
KMessageBox::sorry (0,i18n("Port must be from 1025 until 65535"));
return;
}
if (delay < knc::MinDelay) {
KMessageBox::sorry (0,i18n("Delay is too small"));
return;
}
accept ();
}
#include "knutnewupsdlg.moc"

@ -0,0 +1,160 @@
/***************************************************************************
knutnewupsdlg.h - description
-------------------
begin : Tue Aug 21 2001
copyright : (C) 2001 by Daniel Prynych
email : Daniel@prynych.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef KNUTNEWUPSDLG_H
#define KNUTNEWUPSDLG_H
#include "knutupsdata.h"
#include "knutvardata.h"
#include <kdialogbase.h>
#include <kcombobox.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <kactionselector.h>
#include <qlistbox.h>
class QLabel;
class QGroupBox;
class QButtonGroup;
class QCheckBox;
/**
* This class is dialog for makeing or correting informations about UPS.
* It can set address, port and seletcts values its values will be found,
* Tato trida je dialog pro vytvoreni nebo opravu informaci a UPS.
* Umoznuje nastavit adresu, port, a vybrat promennou jejiz hodnota se bude zjistovat.
* @author Daniel Prynych
* @short Panel for setting parameters of UPS
*
* @version 0.4
*/
class KNutNewUpsDlg : public KDialogBase
{
Q_OBJECT
public:
/**
* Constructor - makes configure dialog.
* Konstruktor - vytvori konfiguracni dialog.
*
* @param add Urcuje zda budeme data opravovat nebo pridavat.
* @param settingData pointer on structure, which includes values which is setted in dialog.
* @param upsdata is pointer on instance of class KNutUpsData.
* @param analogData is pointer on instance of class KNutVardata
* @param add Urcuje zda budeme data opravovat nebo pridavat.
* @param settingData Je odkaz na strukturu ktera obsahuje hodnoty nastavovane v dialogu.
* @param upsData Je odkaz na na instanci tridy KNutUpsData.
* @param analogData Je odkaz na na instanci tridy KNutVarData.
*
* @since 0.7
**/
KNutNewUpsDlg (KNutUpsData* const upsData, KNutVarData* const analogData, const bool add = TRUE, QWidget* parent = 0, const char* name = 0, const bool modal = TRUE);
/**
* @since 0.3
**/
~KNutNewUpsDlg();
/**
* Reads data from items of form.
* Precte data z polozek formulare.
*
* @param upRecordDef Struktura of UpsInfo - contains all items which is included in form.
* @param upsRecordDef Struktura UpsInfo - obsahuje vsechny polozky ktere jsou ve formulari.
*
* @since 0.4
**/
KNutUpsData::upsRecordDef getData (void ) const;
/**
* Puts date into intems of form
* Vlozi data do polozek formulare.
*
* @param upsRecord Struktura of upsRecordDef - contains all items which is included in form.
* @param upsRecord Struktura psRecordDef - obsahuje vsechny polozky ktere jsou ve formulari.
*
* @since 0.4
**/
void putData (const KNutUpsData::upsRecordDef upsRecord );
/********************* PRIVATE **************************/
private slots:
/**
* Is activated when button ok is pressed.
* Provede se pri stisknuti tlacitka ok.
*
* @since 0.1
**/
virtual void slotOk();
private:
/**
* This class is inner class for showing items.
* Add information about order number of UPS values.
* Tato trida je vnorena trida pro zobrazeni polozek.
* Pridava informaci o poradovem cisle UPS promennych.
* @author Daniel Prynych
* @short Item of listBox
*
* @version 0.1
*/
class KNutUpsBoxItem : public QListBoxText
{
private:
int m_ordVarCode;
public:
KNutUpsBoxItem ( QListBox* listbox, const QString & text=QString::null, const int ordVarCode = 0 ) :
QListBoxText (listbox, text), m_ordVarCode (ordVarCode) {};
KNutUpsBoxItem ( QListBox* listbox, const QString & text, QListBoxItem *after, const int ordVarCode = 0 ) :
QListBoxText (listbox, text, after), m_ordVarCode (ordVarCode) {};
int getVarCode (void) const {return m_ordVarCode;};
void putGetCode (const int ordVarCode) {m_ordVarCode = ordVarCode;};
// QString text () const {return QListBoxItem::text();};
};
void moveToSelectedList (const int codeUpsVar);
bool isExistSelectedItem (const int codeUpsVar) const;
bool addMember; // true pokud se pridava polozka, false edit
KNutUpsData* m_myUpsData; // Ups data object
KLineEdit* m_lineEdit1;
KLineEdit* m_lineEdit2;
KLineEdit* m_lineEdit3;
KLineEdit* m_lineEdit4;
KLineEdit* m_lineEdit5;
KLineEdit* m_lineEdit6;
KLineEdit* m_lineEdit7;
QCheckBox* m_savePassword;
KActionSelector* m_upsValueSelector;
};
#endif

@ -0,0 +1,353 @@
/***************************************************************************
knutpanelmeter.cpp - description
-------------------
begin : Út b?e 16 2004
copyright : (C) 2004 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#include "knutpanelmeter.h"
#include <kdebug.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qfont.h>
#include <math.h>
#include <stdlib.h>
#include <unistd.h>
//#include <iostream>
extern const char *nameUpsVars1[];
extern const char *nameUpsVars2[];
KNutPanelMeter::KNutPanelMeter(QPalette aPanelPalette, KNutVarData::upsInfoDef* activeUpsInfo, KNutVarData::SettingDataDef* settingData, KNutVarData* analogRecords, QWidget *parent, const char *name ) : QScrollView(parent,name,Qt::WResizeNoErase|Qt::WStaticContents) {
m_settingData = settingData;
m_activeUpsInfo = activeUpsInfo;
m_analogRecords = analogRecords;
m_aPanelPalette = aPanelPalette;
m_analogArea = new QLabel(this->viewport());
addChild(m_analogArea);
setResizePolicy ( QScrollView::AutoOneFit ) ;
////NUTNO PAK UPRAVIT ACTIVATE A DEAKTIVATE ANALOGS
m_analogPanels = new analogPanelRecordsDef;
for (int i=0; i< knc::NumberOfVars; i++)
m_analogPanels->upsAnalogs[i]=0L;
m_widthArea =0;
m_heightArea =0;
}
KNutPanelMeter::~KNutPanelMeter(){
deActivateAnalogs();
delete m_analogPanels;
m_analogPanels=0L;
}
void KNutPanelMeter::deActivateAnalogs (void) {
//std::cout << "KNutPanelMeter::deActivateAnalogs" << std::endl;
if (m_analogPanels) {
for (int i=0; i< knc::NumberOfVars; i++) {
if (m_analogPanels->upsAnalogs[i] != 0) {
delete m_analogPanels->upsAnalogs[i]; // uvolnime meraky
}
m_analogPanels->upsAnalogs[i]=0L;
}
}
m_widthArea =0;
m_heightArea =0;
}
void KNutPanelMeter::activateAnalogs (void) {
//qDebug ("KNutPanelMeter::activateAnalogs start");
KNutVarData::VarStrucDef analogMemberData;
int ii =0;
// deletes vatiables which ups doeasn't support
// vyjmeme promene ktere ups nepodporuje
//// nasledujici radka neni nutna
for (int i=0; i< knc::NumberOfVars; i++) m_analogPanels->upsAnalogs[i]=0L;
for (int i=0; i< knc::NumberOfVars; i++) {
// otestujeme zda dane UPS podporuje tuto promenou
// pokud existuje vrati 1
switch (m_activeUpsInfo->nutVariables) {
case 1:
if (!m_activeUpsInfo->upsNet->existName(nameUpsVars1[m_activeUpsInfo->record.upsVarCode[i]]))
m_activeUpsInfo->record.upsVarCode[ii++] = m_activeUpsInfo->record.upsVarCode[i];
break;
case 2:
if (!m_activeUpsInfo->upsNet->existName(nameUpsVars2[m_activeUpsInfo->record.upsVarCode[i]]))
m_activeUpsInfo->record.upsVarCode[ii++] = m_activeUpsInfo->record.upsVarCode[i];
break;
}
}
for (int i=ii; i< knc::NumberOfVars; i++) m_activeUpsInfo->record.upsVarCode[i]=0;// doplnime zbytek nulami to znamena zadna promena
for (int i=0; i< knc::NumberOfVars; i++) {
if (m_activeUpsInfo->record.upsVarCode[i] != 0) {
analogMemberData=m_analogRecords->getData (m_activeUpsInfo->record.upsVarCode[i]);
m_analogPanels->scaleEnd[i]=analogMemberData.end;
m_analogPanels->scaleStart[i]=analogMemberData.start;
QColor analogFingerColor, analogScaleColor, analogFontColor;
if (m_settingData->customOAnalogColor) {
analogFingerColor = m_settingData->analogFingerColor;
analogScaleColor = m_settingData->analogScaleColor;
analogFontColor = m_settingData->analogFontColor;
}
else {
analogFingerColor = DEFAULT_FINGER_COLOR;
analogScaleColor = DEFAULT_SCALE_COLOR;
analogFontColor = DEFAULT_FONT_COLOR;
}
if (m_settingData->customFont)
// doesn't make background
m_analogPanels->upsAnalogs[i] = new KNutAnalog( m_analogArea,0L,analogMemberData.start,analogMemberData.end,analogMemberData.typeAnalog,analogMemberData.numberItem,analogMemberData.numberInItem,analogFingerColor,analogScaleColor,analogFontColor,&(m_settingData->aPanelFont),m_settingData->typeDigitalProcessing);
else
m_analogPanels->upsAnalogs[i] = new KNutAnalog( m_analogArea,0L,analogMemberData.start,analogMemberData.end,analogMemberData.typeAnalog,analogMemberData.numberItem,analogMemberData.numberInItem,analogFingerColor,analogScaleColor,analogFontColor,&(m_settingData->systemFont),m_settingData->typeDigitalProcessing);
//nastavime barvu mezikruzi
if (m_settingData->customOAnalogColor) {
m_analogPanels->upsAnalogs[i]->setArcColor(1,m_settingData->analogOKColor); // doesn't make background
m_analogPanels->upsAnalogs[i]->setArcColor(2,m_settingData->analogWarnningColor); // doesn't make background
m_analogPanels->upsAnalogs[i]->setArcColor(3,m_settingData->analogErrorColor); // doesn't make background
}
// po vygenerovani panelu jsou standartni barvy nastaveny automaticky
//nastavime mezikruzi
for (int j = 0; j < 5; j++ ) {
if (!((analogMemberData.scaleStruct[j].start == 0) && (analogMemberData.scaleStruct[j].end ==0 ))) {
m_analogPanels->upsAnalogs[i]->addArc (analogMemberData.scaleStruct[j].start,analogMemberData.scaleStruct[j].end,analogMemberData.scaleStruct[j].scaleColor, false); // doesn't make background
}
}
m_analogPanels->upsAnalogs[i]->setText(analogMemberData.nameAnalog,analogMemberData.nameUnit);
m_analogPanels->upsAnalogs[i]->setPalette(m_aPanelPalette);
m_analogPanels->upsAnalogs[i]->makeBackground(false); // makes background of analog panel
}
}
//qDebug ( "KNutPanelMeter::activateAnalogs 1" );
m_analogArea->repaint(); //repaint all analog panels, background was made already
//qDebug ("KNutPanelMeter::activateAnalogs - end");
// analogSV->resizeContents(sizeHint().width(),sizeHint().height());
}
void KNutPanelMeter::setSize (bool showPanels) {
int row =0;
int col=0;
int maxCols =0;
int maxRows =0;
if (!m_activeUpsInfo->netError) {
for (int i=0; i< knc::NumberOfVars; i++) {
if (m_activeUpsInfo->record.upsVarCode[i] != 0) {
if (maxCols < m_settingData->countCols) maxCols++;
maxRows = row+1;
// jestlize upsAnalogs =0 nejsou aktivovany
if (m_analogPanels->upsAnalogs[i]) {
m_analogPanels->upsAnalogs[i]->move (SpacePanels + (SpacePanels)+(col*(KNutAnalog::AnalogWidth+SpacePanels)),SpacePanels+(row*(KNutAnalog::AnalogWidth+SpacePanels)));
if (showPanels) m_analogPanels->upsAnalogs[i]->show();
}
col++;
if (col > (m_settingData->countCols-1) ) {col=0; row++;}; // prechod na dalsi radku
}
}
}
// musime nastavit velikost
m_widthArea = (KNutAnalog::AnalogWidth + SpacePanels)*maxCols +2*SpacePanels; // sirka
m_heightArea = (KNutAnalog::AnalogWidth + SpacePanels)*(maxRows) + SpacePanels; // minimalni velikost podle mericich panelu
m_analogArea->setMinimumSize (m_widthArea,m_heightArea);
adjustSize();
resizeContents(m_widthArea,m_heightArea);
repaint();
}
void KNutPanelMeter::repaintScaleAnalogPanel (int panelNumber, float value) {
if (m_analogPanels->upsAnalogs[panelNumber] != 0L){
switch (m_activeUpsInfo->record.upsVarCode[panelNumber]) {
case knc::VarCurrent : // output.current
if (m_analogPanels->scaleEnd[panelNumber] < MaxCurrent) {
if (m_analogPanels->scaleEnd[panelNumber] < value) {
m_analogPanels->scaleEnd[panelNumber]=(static_cast<int>(floor((value+1)/5)))*5 +5;
if (m_analogPanels->scaleEnd[panelNumber] > MaxCurrent) m_analogPanels->scaleEnd[panelNumber]=MaxCurrent;
m_analogPanels->upsAnalogs[panelNumber]->setRange(m_analogPanels->scaleStart[panelNumber],m_analogPanels->scaleEnd[panelNumber],true);
}
}
break;
case knc::VarBattVolt : // battery.voltage
if (m_analogPanels->scaleEnd[panelNumber] < MaxBattVolt) {
if (m_analogPanels->scaleEnd[panelNumber] < value) {
m_analogPanels->scaleEnd[panelNumber]=(static_cast<int>(floor((value+1)/10)))*10 +10;
if (m_analogPanels->scaleEnd[panelNumber] > MaxBattVolt) m_analogPanels->scaleEnd[panelNumber]=MaxBattVolt;
m_analogPanels->upsAnalogs[panelNumber]->setRange(m_analogPanels->scaleStart[panelNumber],m_analogPanels->scaleEnd[panelNumber],true);
}
}
break;
case knc::VarBattCurrent : // battery.current
if (m_analogPanels->scaleEnd[panelNumber] < MaxBattCurrent) {
if ((m_analogPanels->scaleEnd[panelNumber] < value) || (m_analogPanels->scaleStart[panelNumber] > value)) {
if ((value >10) || (value <- 15)) {
if ((value >20) || (value < -30)) {
m_analogPanels->scaleEnd[panelNumber]=30;
m_analogPanels->scaleStart[panelNumber]=-45;
}
else {
m_analogPanels->scaleEnd[panelNumber]=20;
m_analogPanels->scaleStart[panelNumber]=-30;
}
m_analogPanels->upsAnalogs[panelNumber]->setPointer(value); // jistota pokud by nam to nekde propadlo
m_analogPanels->upsAnalogs[panelNumber]->hide();// schovame analogovy panel hides analog panel
m_analogPanels->upsAnalogs[panelNumber]->setRange (m_analogPanels->scaleStart[panelNumber],m_analogPanels->scaleEnd[panelNumber]);
m_analogPanels->upsAnalogs[panelNumber]->repaint(); // prekreslime , repaints panel
m_analogPanels->upsAnalogs[panelNumber]->show(); //zobrazime merak shows analog panel
}
}
}
break;
} // end switch
}
}
void KNutPanelMeter::repaintAnalogPointer (int panelNumber, float value, bool run) {
if (m_analogPanels->upsAnalogs[panelNumber] != 0L)
m_analogPanels->upsAnalogs[panelNumber]->setPointer (value,run); // nastavi hodnotu rucicky
}
void KNutPanelMeter::setAnalogBG(QPalette aPanelPalette) {
m_aPanelPalette = aPanelPalette;
for (int i=0; i< knc::NumberOfVars; i++) {
if ((m_activeUpsInfo->record.upsVarCode[i]) && (m_analogPanels->upsAnalogs[i]))
m_analogPanels->upsAnalogs[i]->setPalette(m_aPanelPalette);
}
}
void KNutPanelMeter::changeAnalogPanelsDigProcessing (void) {
if (m_analogPanels == 0) return;
for (int i=0; i< knc::NumberOfVars; i++) {
if (m_analogPanels->upsAnalogs[i] != 0L) m_analogPanels->upsAnalogs[i]->setDigitalProcesing(m_settingData->typeDigitalProcessing,true);
}
}
void KNutPanelMeter::repaintAnalogPanels (bool repaintFrequencyPanels, bool repaintVoltagePanels, bool repaintAllPanels) {
KNutVarData::VarStrucDef analogMemberData;
if (m_analogPanels == 0) return;
// pregenerovani panelu slouzi pro settingMain a setting Analog
for (int i=0; i< knc::NumberOfVars; i++) {
if ((m_activeUpsInfo->record.upsVarCode[i]) && (m_analogPanels->upsAnalogs[i])) {
//if upsAnalogs[x] is set to zero, this upsAnalog is not used
// record.upsVarCode contain list of code of analog meter
// 0 is code for none analog meter, 1 for Input Voltage, 2 for Battery Charge,
if (((m_activeUpsInfo->record.upsVarCode[i] == knc::VarAcfreq) && (repaintFrequencyPanels)) ||
((m_activeUpsInfo->record.upsVarCode[i] == knc::VarOutFreq) && (repaintFrequencyPanels)) ||
(((m_activeUpsInfo->record.upsVarCode[i] == knc::VarUtility) ||
(m_activeUpsInfo->record.upsVarCode[i] == knc::VarOutVolt)) && (repaintVoltagePanels))) {
analogMemberData=m_analogRecords->getData (m_activeUpsInfo->record.upsVarCode[i]); // nacteme data
m_analogPanels->upsAnalogs[i]->hide();// schovame analogovy panel
m_analogPanels->upsAnalogs[i]->delArc(); //zrusime segmenty
m_analogPanels->upsAnalogs[i]->setRange (analogMemberData.start,analogMemberData.end);
for (int j = 0; j < 5; j++ ) {
if (!((analogMemberData.scaleStruct[j].start == 0) && (analogMemberData.scaleStruct[j].end ==0 ))) {
m_analogPanels->upsAnalogs[i]->addArc (analogMemberData.scaleStruct[j].start,analogMemberData.scaleStruct[j].end,analogMemberData.scaleStruct[j].scaleColor, false);
} // end if (!
}// end for (int i=0
m_analogPanels->upsAnalogs[i]->makeBackground(false); // repaints analog meter
m_analogPanels->upsAnalogs[i]->repaintPointer(false); // repaints analog meter
m_analogPanels->upsAnalogs[i]->repaint(); // repaints analog meter
m_analogPanels->upsAnalogs[i]->show(); // shows analog meter
} // end if (((activeUpsInfo
if (repaintAllPanels) {
if (m_settingData->customOAnalogColor) {
m_analogPanels->upsAnalogs[i]->setPointerColor(m_settingData->analogFingerColor);
m_analogPanels->upsAnalogs[i]->setArcColor(1,m_settingData->analogOKColor);
m_analogPanels->upsAnalogs[i]->setArcColor(2,m_settingData->analogWarnningColor);
m_analogPanels->upsAnalogs[i]->setArcColor(3,m_settingData->analogErrorColor);
m_analogPanels->upsAnalogs[i]->setScaleColor(m_settingData->analogScaleColor);
m_analogPanels->upsAnalogs[i]->setFontColor(m_settingData->analogFontColor);
}
else {
m_analogPanels->upsAnalogs[i]->setPointerColor (DEFAULT_FINGER_COLOR);
m_analogPanels->upsAnalogs[i]->setDefaultArcColor();
m_analogPanels->upsAnalogs[i]->setScaleColor (DEFAULT_SCALE_COLOR);
m_analogPanels->upsAnalogs[i]->setFontColor (DEFAULT_FONT_COLOR);
}
m_analogPanels->upsAnalogs[i]->repaintAll();
}
}
} // end for
}
void KNutPanelMeter::zeroingPanels (void) {
if (m_analogPanels) {
for (int i=0; i< knc::NumberOfVars; i++) {
if ((m_analogPanels->upsAnalogs[i] != 0L) && (m_activeUpsInfo->record.upsVarCode[i] != 0)) // jistota pokud by nam to nekde propadlo
m_analogPanels->upsAnalogs[i]->setPointer (0); // nastavi hodnotu rucicky
}
}
}
QSize KNutPanelMeter::sizeHint (void){
return QSize(m_widthArea,m_heightArea);
}
void KNutPanelMeter::slotSetPanelsFont(QFont newFont) {
for (int i=0; i< knc::NumberOfVars; i++) {
if ((m_activeUpsInfo->record.upsVarCode[i]) && (m_analogPanels->upsAnalogs[i])) {
m_analogPanels->upsAnalogs[i]->slotSetAllFont(newFont);
// je nutno prekresli i rucicku
}
}
}
#include "knutpanelmeter.moc"

@ -0,0 +1,210 @@
/***************************************************************************
knutpanelmeter.h - description
-------------------
begin : Út b?e 16 2004
copyright : (C) 2004 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef KNUTPANELMETER_H
#define KNUTPANELMETER_H
#include "knutanalog.h"
#include "knutvardata.h"
//#include <qwidget.h>
#include <qscrollview.h>
class QLabel;
class QFont;
/**
*@author Daniel Prynych
*/
class KNutPanelMeter : public QScrollView {
Q_OBJECT
public:
/**
* Konstruktor
*
* Param taPanelPalette je paleta pozadi subpanelu MERAKU !!!
* @param activeUpsInfo ukazatel na data o aktivni UPS
* @param settingData ukazatel na zakladni data programu (barvy pozadi, mezikruzi, rucicky ... ,fonty atd )
* @param analogRecords ukazatel na tridu ktera pracuje s daty o upsekach
*
* @since 0.2
**/
KNutPanelMeter(QPalette aPanelPalette, KNutVarData::upsInfoDef* activeUpsInfo, KNutVarData::SettingDataDef* settingData, KNutVarData* analogRecords, QWidget *parent=0, const char *name=0);
/**
* Destruktor
*
* @since 0.1
**/
~KNutPanelMeter();
/**
* Zrusi analogove panely vcetne uvoneni pameti.
*
* @since 0.1
**/
void deActivateAnalogs (void);
/**
* Vytvori a inicializuje analogove panely.
*
* @since 0.1
**/
void activateAnalogs (void);
/**
* Rozmisti analogove panely po hlavnim panelu a spocte jeho rozmery.
*
* @param showPanels je true jsou rozsviceny (show) subpanely
* @since 0.2
**/
void setSize (bool showPanels = false);
/**
* Prekresli zmenu rozsahu pro dany analogovy panel (jenom jeden)
* Pokud panel nepodporuje zmeny rozsahu neprovede nic.
* Zmenu rozsahu podporuji nasledujici panely: Current,BattVolt,BattCurrent
*
* @param panelNumber je cislo analogoveho panelu.
* @param value je hodnota na kterou je panel nastaven.
*
* @since 0.1
**/
void repaintScaleAnalogPanel (int panelNumber, float value);
/**
* Paints pointer for selected analog panel
* Prekresli rucicku pro vybrany analogovy panel.
*
* @param panelNumber is number of analog panel.
* @param value is value of settimg amalog panel.
* @param run = TRUE makes immediately repaint of panel
* @param panelNumber je cislo analogoveho panelu.
* @param value je hodnota na kterou je panel nastaven.
* @param run = TRUE provede okamzite prekresleni
*
* @since 0.2
**/
void repaintAnalogPointer (int panelNumber, float value, bool run = true);
/**
* Repaints analog panels
* Repainting range of panel for frequency and voltage, based on current setting.
* Prekresli a prebarvi analogove panely.
* Prekresuje rozsah panelu pro frekvenci a nepeti na zaklade soucasneho nastaveni.
*
* @param repaintFrequencyPanels urcuje ze ma prekreslit panely ktere zobrazuji vstupni frequency.
* @param repaintVoltagePanels urcuje ze ma prekreslit panely ktere zobrazuji vstupni a vystupni napeti.
* @param repaintAllPanels urcuje ze ma prebarvit vsechny prvky panelu.
*
* @since 0.1
**/
void repaintAnalogPanels (bool repaintFrequencyPanels, bool repaintVoltagePanels, bool repaintAllPanels);
/**
* Changes type of digital processing of pointer and repaints it.
* Zmeni zpusob digitalniho zpracovani rucucky a prekresli ji
*
* @since 0.1
**/
void changeAnalogPanelsDigProcessing (void);
/**
* Sets value of panels to zero
* Nastavi hodnotu vsech panelu na nulu
*
* @since 0.1
**/
void zeroingPanels (void);
/**
* Repaints backgroud of analog panels
* Prebarvi pozadi analogovych panelu.
*
* @param taPanelPalette je hodnota nove palety pro pozadi
*
* @since 0.1
**/
void setAnalogBG(QPalette aPanelPalette);
/**
* Vraci soucasnou velikost panelu.
*
* @since 0.1
**/
virtual QSize sizeHint (void);
public slots:
/**
* Sets new font for all panels
* Nastavy novy font ve vsech panelech.
*
* @since 0.1
**/
void slotSetPanelsFont(QFont newFont);
private:
/************ private const *****************/
static const int SpacePanels = 2; //vzdalenost mezi meraky, length between panels
static const int MaxBattVolt = 350; // max battery.voltage
static const int MaxCurrent = 50; // max output.current
static const int MaxBattCurrent = 50; // max battery.current
/************ private struct ************************/
struct analogPanelRecordsDef {
int scaleEnd[knc::NumberOfVars];
int scaleStart[knc::NumberOfVars];
KNutAnalog* upsAnalogs[knc::NumberOfVars];
};
/*********** private vars *******************/
QLabel* m_analogArea;
analogPanelRecordsDef* m_analogPanels;
KNutVarData::upsInfoDef* m_activeUpsInfo; // values for selected ups -- hodnoty pro vybrane ups
KNutVarData::SettingDataDef* m_settingData; // v teto strukture jsou ulozeny promene ktere nastavuji konfiguraci
KNutVarData* m_analogRecords;
QPalette m_aPanelPalette;
int m_widthArea;
int m_heightArea;
};
#endif

@ -0,0 +1,979 @@
/***************************************************************************
knutprefdlg.cpp - description
-------------------
begin : Tue Aug 21 2001
copyright : (C) 2001 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#include "knutprefdlg.h"
#include "knutvardata.h"
#include "knutfrontpanel.h"
#include "knutdock.h"
#include <kiconloader.h>
#include <qlayout.h>
#include <qgroupbox.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <qfont.h>
#include <qlabel.h>
#include <qcheckbox.h>
#include <qspinbox.h>
#include <stdio.h>
//#include <iostream>
#define MAIN_PANEL_FONT 0
#define ANALOG_PANEL_FONT 1
KNutPrefDlg::KNutPrefDlg(KNutUpsData* const upsData, KNutVarData* const analogData, KNutVarData::SettingDataDef* const settingData,
const QString upsName, QWidget* parent, const char* name, const bool modal)
:KDialogBase(IconList, i18n("Preferences"),Help|Default|Apply|Ok|Cancel,Ok, parent, name, modal, true),
m_activeUpsName (upsName), m_myUpsData(upsData), m_myAnalogData(analogData), m_settingData(settingData) {
setName( "UpsMemberDlg" );
m_checked = false; // no change of definition of UPS // neni zadna zmena na definici UPS
m_checkedActiveUps = false; // change of active UPS hasn't been made // neni provedena zmena aktivni UPS
initSetting();
initUps();
initPanel();
initFonts();
initAnalog();
initDock(); // from 0.8 version
setMinimumSize (450, 300);
}
KNutPrefDlg::~KNutPrefDlg(){
delete m_listBox2;
}
/*********************************************************************************************/
/* */
/* PRIVATE SLOTS */
/* */
/*********************************************************************************************/
void KNutPrefDlg::slotSetPictureKI (bool on) {
if (!on) {
m_checkBoxCbi->setEnabled(true);
m_iconDockLabel->setEnabled(true);
m_BGIButton->setEnabled(m_checkBoxCbi->isChecked());
m_dockBackgroundColorLabel->setEnabled(m_checkBoxCbi->isChecked());
}
else {
m_checkBoxCbi->setEnabled(false);
m_iconDockLabel->setEnabled(false);
m_BGIButton->setEnabled(false);
m_dockBackgroundColorLabel->setEnabled(false);
}
}
void KNutPrefDlg::slotEnableVoltage(bool enable) { m_voltageGroup->setEnabled(!enable);}
void KNutPrefDlg::slotEnableFrequency(bool enable) { m_frequencyGroup->setEnabled(!enable);}
void KNutPrefDlg::slotUseCustomBColor(bool enable) {
m_BGButton->setEnabled(enable);
m_mainBackgroundColorLabel->setEnabled(enable);
}
void KNutPrefDlg::slotUseCustomBIconColor(bool enable) {
m_BGIButton->setEnabled(enable);
m_dockBackgroundColorLabel->setEnabled(enable);
}
void KNutPrefDlg::slotUseCustomBPanelColor(bool enable) {
m_BGPButton->setEnabled(enable);
m_panelBackgroundColorLabel->setEnabled(enable);
}
void KNutPrefDlg::slotUseCustomBAnalogColor(bool enable) {
m_BGAButton->setEnabled(enable);
m_analogBackgroundColorLabel->setEnabled(enable);
}
void KNutPrefDlg::slotUseCustomOAnalogColor(bool enable) {
m_AFingerButton->setEnabled(enable);
m_AOKButton->setEnabled(enable);
m_AWarnningButton->setEnabled(enable);
m_AErrorButton->setEnabled(enable);
m_AScaleButton->setEnabled(enable);
m_AFontButton->setEnabled(enable);
m_analogPointerColorLabel->setEnabled(enable);
m_analogOKColorLabel->setEnabled(enable);
m_analogWarningColorLabel->setEnabled(enable);
m_analogErrorColorLabel->setEnabled(enable);
m_analogScaleColorLabel->setEnabled(enable);
m_analogFontColorLabel->setEnabled(enable);
}
void KNutPrefDlg::slotChangeSettingFont(int index) {
if (m_settingFont != index) {
// vybirame jiny font
if (m_settingFont == MAIN_PANEL_FONT) {
m_mPanelFont=m_fontWidget->font();
m_fontWidget->setFont(m_aPanelFont);
}
else {
m_aPanelFont=m_fontWidget->font();
m_fontWidget->setFont(m_mPanelFont);
}
m_settingFont = index;
}
}
void KNutPrefDlg::slotDeleteUps() {
if (m_listBox2->currentItem() != -1) {
// smazeme policko
int ukListBox = m_listBox2->currentItem();
if ( m_activeUpsName == m_listBox2->currentText() ) m_checkedActiveUps = true;
m_myUpsData->deleteName(ukListBox);
m_listBox2->removeItem(ukListBox);
m_checked = true;
// when active ups is deleted, will set checkedActiveUps
// pokud smazeme aktivni UPS nastavime checkedActiveUps
}
}
void KNutPrefDlg::slotEditUps() {
if (m_listBox2->currentItem() != -1) {
KNutUpsData::upsRecordDef upsRecord;
// makes dialog
newUpsDlg = new KNutNewUpsDlg(m_myUpsData,m_myAnalogData,false);
// reads record
m_myUpsData->get(m_listBox2->currentItem(),upsRecord);
// sets parameters for edit / nastavime parametry pro edit
newUpsDlg->putData(upsRecord);
int result = newUpsDlg->exec();
if (result == Accepted) {
// adds into list after OK will be clicked
// reads data from form
upsRecord = newUpsDlg->getData();
// corrects data in list
m_myUpsData->put(m_listBox2->currentItem(),upsRecord);
// corrects data in window
m_listBox2->changeItem(upsRecord.name,m_listBox2->currentItem());
m_checked = true;
// if active UPS is changed, will set checkedActiveUps
// pokud zmenime aktivni UPS nastavime checkedActiveUps
if ( m_activeUpsName == m_listBox2->currentText() ) m_checkedActiveUps = true;
}
delete newUpsDlg;
}
}
void KNutPrefDlg::slotNewUps () {
KNutUpsData::upsRecordDef upsRecord;
// Zalozime novou UPS
// add new UPS
newUpsDlg = new KNutNewUpsDlg(m_myUpsData,m_myAnalogData);
int result = newUpsDlg->exec();
if (result == Accepted) {
// adds into list, when OK is pressed
//reads data from form
upsRecord = newUpsDlg->getData();
//pridame data do zaznamu
//adds data to record
m_myUpsData->add(upsRecord);
//add data to window
// pridame data do okenka
m_listBox2->insertItem(upsRecord.name);
// pokud pridame prvni prekreslime hlavni okno
// when adds the first sameone, will repaint window
m_checked = true;
if (m_myUpsData->getCount() ==1 ) m_checkedActiveUps = true;
}
delete newUpsDlg;
}
void KNutPrefDlg::slotOk() {
slotApply ();
accept();
}
void KNutPrefDlg::slotApply() {
// budeme emitovat signal podle toho co se deje
// will emit signal about situation
unsigned int changeSetting = 0;
// MainPage
if (m_settingData->countCols != m_numberOfColumns->value()) {
changeSetting += ChangeCountCols; // nastavime pocet sloupcu
m_settingData->countCols = m_numberOfColumns->value(); // nastavime pocet sloupcu
}
if (m_settingData->customBColor != m_checkBoxCbc->isChecked()) {
m_settingData->customBColor = m_checkBoxCbc->isChecked();
changeSetting += ChangeCustomBColor;
}
if (m_settingData->mainBackgroundColor != m_BGButton->color()) {
changeSetting += ChangeMBColor;
m_settingData->mainBackgroundColor = m_BGButton->color(); // nastavime barvu pozadi
}
// ovlivnuje jen ukonceni programu, neurcujeme type ChangeSetting
if (m_settingData->areYouSure != m_checkBoxAys->isChecked()) {
m_settingData->areYouSure = m_checkBoxAys->isChecked();
changeSetting = changeSetting | ChangeSomeThing;
}
//for next start only
if (m_comboBoxMainWindow->currentItem() != (int)m_settingData->useMainWindow) {
m_settingData->useMainWindow = (KNutVarData::mainWindowStartVariant)m_comboBoxMainWindow->currentItem();
changeSetting = changeSetting | ChangeSomeThing;
}
// if (m_prefData->useMainWindow != m_checkBoxMW->isChecked()) {
// m_prefData->useMainWindow = m_checkBoxMW->isChecked();
// changeSetting = changeSetting | ChangeSomeThing;
// }
//for next start only
if (m_settingData->useMessageWindow != m_checkBoxMesW->isChecked()) {
m_settingData->useMessageWindow = m_checkBoxMesW->isChecked();
changeSetting = changeSetting | ChangeSomeThing;
}
//for next start only
if (m_settingData->useMessageWindow != m_checkBoxMesW->isChecked()) {
m_settingData->useMessageWindow = m_checkBoxMesW->isChecked();
changeSetting = changeSetting | ChangeSomeThing;
}
int newInputVoltage, newInputFrequency;
if ( m_vRadioButton1->isChecked()) newInputVoltage = 230; else newInputVoltage = 120;
if ( m_fRadioButton1->isChecked()) newInputFrequency = 50; else newInputFrequency = 60;
if (m_settingData->inputVoltage != newInputVoltage) {
m_settingData->inputVoltage = newInputVoltage;
changeSetting += ChangeVoltage;
}
if (m_settingData->inputFrequency != newInputFrequency) {
m_settingData->inputFrequency = newInputFrequency;
changeSetting += ChangeFrequency;
}
if (m_settingData->lowHighXfer != m_xfer->isChecked()) changeSetting += ChangeXFer;
m_settingData->lowHighXfer = m_xfer->isChecked();
//Ups page
if ( m_checkedActiveUps ) { // zmena aktivni UPS
//change of active UPS or add the first UPS, because the first UPS is active always
changeSetting += ChangeUpsSetting;
}
else {
if (m_checked) changeSetting += ChangeUpsCount;
}
// panel Page
unsigned int prefPanelFlags = 3;
if (m_checkBoxOver->isChecked()) prefPanelFlags += KNutFrontPanel::PBOver;
if (m_checkBoxBL->isChecked()) prefPanelFlags += KNutFrontPanel::PBBattLow;
if (m_checkBoxRB->isChecked()) prefPanelFlags += KNutFrontPanel::PBRepBatt;
if (m_checkBoxCal->isChecked()) prefPanelFlags += KNutFrontPanel::PBCal;
if (m_checkBoxMFRM->isChecked()) prefPanelFlags += KNutFrontPanel::PBMFRMod;
if (m_checkBoxMFR->isChecked()) prefPanelFlags += KNutFrontPanel::PBMFR;
if (m_checkBoxModel->isChecked()) prefPanelFlags += KNutFrontPanel::PBModel;
if (m_checkBoxSerial->isChecked()) prefPanelFlags += KNutFrontPanel::PBSerial;
if (m_checkBoxFirm->isChecked()) prefPanelFlags += KNutFrontPanel::PBFirm;
if (m_checkBoxRun->isChecked()) prefPanelFlags += KNutFrontPanel::PBRun;
if (m_settingData->panelFlags != prefPanelFlags) {
m_settingData->panelFlags = prefPanelFlags;
changeSetting += ChangeMainPanelSetting;
}
if (m_settingData->customBPanelColor != m_checkBoxCbpc->isChecked()) {
m_settingData->customBPanelColor = m_checkBoxCbpc->isChecked();
changeSetting += ChangeCustomMPanelBColor;
}
if (m_settingData->mPanelBackgroundColor != m_BGPButton->color()) {
changeSetting += ChangeMPBColor;
m_settingData->mPanelBackgroundColor = m_BGPButton->color(); // sets color of background
}
// font Page:
unsigned int changeFonts;
changeFonts =0;
if (m_settingFont == MAIN_PANEL_FONT)
m_mPanelFont=m_fontWidget->font();
else
m_aPanelFont=m_fontWidget->font();
if ( m_customFont->isChecked() != m_settingData->customFont) {
// zmena typy fontu systemove <-> uzivatelske
m_settingData->customFont = m_customFont->isChecked();
if (m_settingData->customFont) {
// prejdeme na uzivatelske fonty
m_settingData->aPanelFont = m_aPanelFont;
m_settingData->mPanelFont = m_mPanelFont;
changeSetting += ChangeAnalogFont;
changeSetting += ChangePanelFont;
}
else {
// pouzijeme systemove fonty
changeSetting += ChangeAnalogFont;
changeSetting += ChangePanelFont;
}
}
else {
if ( m_settingData->customFont ) {
// otestujeme zda se zmenili nase fonty
if (m_aPanelFont != m_settingData->aPanelFont) {
m_settingData->aPanelFont = m_aPanelFont;
changeSetting += ChangeAnalogFont;
}
if (m_mPanelFont != m_settingData->mPanelFont) {
m_settingData->mPanelFont = m_mPanelFont;
changeSetting += ChangePanelFont;
}
}
}
// analog page
if (m_settingData->customBAnalogColor != m_checkBoxCbac->isChecked()) {
m_settingData->customBAnalogColor = m_checkBoxCbac->isChecked();
changeSetting += ChangeCustomAPanelBColor;
}
if (m_settingData->aPanelBackgroundColor != m_BGAButton->color()) {
changeSetting += ChangeAPBColor;
m_settingData->aPanelBackgroundColor = m_BGAButton->color(); // nastavime barvu pozadi
}
if (m_settingData->customOAnalogColor != m_checkBoxCoac->isChecked()) {
m_settingData->customOAnalogColor = m_checkBoxCoac->isChecked();
changeSetting += ChangeCustomAPanelOColor;
}
if ((m_settingData->analogFingerColor != m_AFingerButton->color()) ||
(m_settingData->analogOKColor != m_AOKButton->color()) ||
(m_settingData->analogWarnningColor != m_AWarnningButton->color()) ||
(m_settingData->analogErrorColor != m_AErrorButton->color()) ||
(m_settingData->analogScaleColor != m_AScaleButton->color()) ||
(m_settingData->analogFontColor != m_AFontButton->color())) {
changeSetting += ChangeAPOColor;
m_settingData->analogFingerColor = m_AFingerButton->color(); // sets color of pointers-- nastavime barvu rucicky
m_settingData->analogOKColor = m_AOKButton->color(); // sets color of OK -- nastavime barvu ok
m_settingData->analogWarnningColor = m_AWarnningButton->color(); // nastavime barvu varovano
m_settingData->analogErrorColor = m_AErrorButton->color(); // nastavime barvu chyby
m_settingData->analogScaleColor = m_AScaleButton->color(); // nastavime barvu stupnice
m_settingData->analogFontColor = m_AFontButton->color(); // nastavime barvu textu
}
if (m_settingData->typeDigitalProcessing != m_digitalProcesingOfPointers->currentItem()) {
m_settingData->typeDigitalProcessing = m_digitalProcesingOfPointers->currentItem();
changeSetting += ChangeTypeOfDigProcessing;
}
// Kicker Icon page
int stateKIcon;
if (m_iconRadioButton1->isChecked()) stateKIcon = KNutDock::pictureKI;
else stateKIcon = KNutDock::generalKI;
if (m_settingData->typeOfKIcon != stateKIcon) {
if (m_iconRadioButton1->isChecked()) m_settingData->typeOfKIcon = KNutDock::pictureKI;
if (m_iconRadioButton2->isChecked()) m_settingData->typeOfKIcon = KNutDock::generalKI;
changeSetting += ChangeTypeOfKIcon;
}
if (m_settingData->customKIconColor != m_checkBoxCbi->isChecked()) {
m_settingData->customKIconColor = m_checkBoxCbi->isChecked();
changeSetting += ChangeCustomKIconColor;
}
if (m_settingData->kIconBackgroundColor != m_BGIButton->color()) {
changeSetting += ChangeKIconBColor;
m_settingData->kIconBackgroundColor = m_BGIButton->color(); // nastavime barvu pozadi
}
unsigned int prefToolTipFlags = 0;
if (m_checkBoxTTMFR->isChecked()) prefToolTipFlags += KNutDock::TTMFR;
if (m_checkBoxTTModel->isChecked()) prefToolTipFlags += KNutDock::TTModel;
if (m_checkBoxTTSerial->isChecked()) prefToolTipFlags += KNutDock::TTSerial;
if (m_checkBoxTTFirm->isChecked()) prefToolTipFlags += KNutDock::TTFirm;
if (m_checkBoxTTRun->isChecked()) prefToolTipFlags += KNutDock::TTRun;
if (m_checkBoxTTCharge->isChecked()) prefToolTipFlags += KNutDock::TTCharge;
if (m_checkBoxTTLoad->isChecked()) prefToolTipFlags += KNutDock::TTLoad;
if (m_settingData->toolTipFlags != prefToolTipFlags) {
m_settingData->toolTipFlags = prefToolTipFlags;
changeSetting += ChangeToolTip;
}
if (changeSetting) emit signalChangeConfig( changeSetting );
}
void KNutPrefDlg::slotDefault() {
switch (activePageIndex()) {
case mainSettingPage:
m_numberOfColumns->setValue( knc::DefaultCountCols );
m_BGButton->setColor(DEFAULT_BG_COLOR);
m_checkBoxAys->setChecked ( false );
m_checkBoxMesW->setChecked ( false );
m_comboBoxMainWindow->setCurrentItem(KNutVarData::mw_no); // sets NO
m_vRadioButton1->setChecked( true );
m_fRadioButton1->setChecked( true );
m_xfer->setChecked( false );
break;
case panelSettingPage:
m_checkBoxOver->setChecked(KNutFrontPanel::DefaultPanelFlags & KNutFrontPanel::PBOver);
m_checkBoxBL->setChecked(KNutFrontPanel::DefaultPanelFlags & KNutFrontPanel::PBBattLow);
m_checkBoxRB->setChecked(KNutFrontPanel::DefaultPanelFlags & KNutFrontPanel::PBRepBatt);
m_checkBoxCal->setChecked(KNutFrontPanel::DefaultPanelFlags & KNutFrontPanel::PBCal);
m_checkBoxMFRM->setChecked(KNutFrontPanel::DefaultPanelFlags & KNutFrontPanel::PBMFRMod);
m_checkBoxMFR->setChecked(KNutFrontPanel::DefaultPanelFlags & KNutFrontPanel::PBMFR);
m_checkBoxModel->setChecked(KNutFrontPanel::DefaultPanelFlags & KNutFrontPanel::PBModel);
m_checkBoxSerial->setChecked(KNutFrontPanel::DefaultPanelFlags & KNutFrontPanel::PBSerial);
m_checkBoxFirm->setChecked(KNutFrontPanel::DefaultPanelFlags & KNutFrontPanel::PBFirm);
m_checkBoxCbpc->setChecked(false);
m_BGAButton->setColor(DEFAULT_BG_COLOR);
break;
case fontSettingPage:
m_customFont->setChecked(false);
break;
case analogSettingPage:
m_checkBoxCbac->setChecked(false);
m_BGAButton->setColor(DEFAULT_BG_COLOR);
m_checkBoxCoac->setChecked(false);
m_AFingerButton->setColor(DEFAULT_FINGER_COLOR);
m_AOKButton->setColor(DEFAULT_OK_COLOR);
m_AWarnningButton->setColor(DEFAULT_WARNNING_COLOR);
m_AErrorButton->setColor(DEFAULT_ERROR_COLOR);
m_AScaleButton->setColor(DEFAULT_SCALE_COLOR);
m_AFontButton->setColor(DEFAULT_FONT_COLOR);
break;
case kickerSettingPage:
m_checkBoxCbi->setChecked(false);
m_BGAButton->setColor(DEFAULT_KICON_COLOR);
m_checkBoxTTMFR->setChecked(KNutDock::DefaultToolTipFlags & KNutDock::TTMFR);
m_checkBoxTTModel->setChecked(KNutDock::DefaultToolTipFlags & KNutDock::TTModel);
m_checkBoxTTSerial->setChecked(KNutDock::DefaultToolTipFlags & KNutDock::TTSerial);
m_checkBoxTTFirm->setChecked(KNutDock::DefaultToolTipFlags & KNutDock::TTFirm);
m_checkBoxTTRun->setChecked(KNutDock::DefaultToolTipFlags & KNutDock::TTRun);
m_checkBoxTTCharge->setChecked(KNutDock::DefaultToolTipFlags & KNutDock::TTCharge);
m_checkBoxTTLoad->setChecked(KNutDock::DefaultToolTipFlags & KNutDock::TTLoad);
m_iconRadioButton1->setChecked( true );
break;
}
}
/*********************************************************************************************/
/* */
/* PRIVATE FUNCTIONS */
/* */
/*********************************************************************************************/
void KNutPrefDlg::initSetting () {
m_mSetPix = UserIcon ("knc_mset");
QFrame *page = addPage( i18n("Setting"),i18n("Main Setting"),m_mSetPix);
QVBoxLayout *setTopLayout = new QVBoxLayout( page, 10, spacingHint (), "setTopLayout" );
QGroupBox *dataBox = new QGroupBox (page ,"dataBox");
QGridLayout *dataLayout = new QGridLayout (dataBox,5,2,spacingHint());
dataBox->setFrameStyle(QFrame::NoFrame);
setTopLayout->addWidget(dataBox);
QButtonGroup *VFGroup = new QButtonGroup(i18n("Voltage/Frequency"),page,"VFGroup");
QGridLayout *setVoltFreqLayout = new QGridLayout (VFGroup, 4 , 2,spacingHint () );
m_xfer = new QCheckBox (i18n("&Use High-Low XFER"),VFGroup,"m_xfer");
QLabel *initSettingLabel1 = new QLabel(i18n("Number of columns :"),dataBox,"label1");
m_numberOfColumns = new QSpinBox(knc::MinCols,knc::MaxCols,1,dataBox);
QLabel *initSettingLabel2 = new QLabel(i18n("Use custom background color"),dataBox,"label2");
m_checkBoxCbc = new QCheckBox ("",dataBox,"checboxcbc");
m_mainBackgroundColorLabel = new QLabel(i18n("Color of background :"),dataBox,"label3");
m_BGButton = new KColorButton (dataBox);
m_BGButton->setColor (m_settingData->mainBackgroundColor);
QLabel *initSettingLabel4 = new QLabel(i18n("Use dialog \"Are you sure\""),dataBox,"m_areYouSureLabel");
m_checkBoxAys = new QCheckBox ("",dataBox,"checboxays");
QLabel *initSettingLabel5 = new QLabel(i18n("Use Main window when program is started"),dataBox,"initSettingLabel5");
// m_checkBoxMW = new QCheckBox ("",dataBox,"checboxmv");
QLabel *initSettingLabel6 = new QLabel(i18n("Show message window, when program reports error"),dataBox,"initSettingLabel6");
m_checkBoxMesW = new QCheckBox ("",dataBox,"checboxer");
m_comboBoxMainWindow = new KComboBox (dataBox);
m_comboBoxMainWindow->insertItem (i18n("Yes"));
m_comboBoxMainWindow->insertItem (i18n("No"));
m_comboBoxMainWindow->insertItem (i18n("Auto"));
m_voltageGroup = new QButtonGroup(i18n("Nominal Input Voltage"),VFGroup,"voltageGroup");
QGridLayout *voltLayout = new QGridLayout (m_voltageGroup, 3 , 1,spacingHint () );
m_vRadioButton1 = new QRadioButton(i18n("&230 V"), m_voltageGroup, "vRadioButton1" );
m_vRadioButton2 = new QRadioButton(i18n("&120 V"), m_voltageGroup, "vRadioButton2" );
m_frequencyGroup = new QButtonGroup(i18n("Nominal Input Frequency"),VFGroup,"frequencyGroup");
QGridLayout *freqLayout = new QGridLayout (m_frequencyGroup, 3 , 1,spacingHint () );
m_fRadioButton1 = new QRadioButton(i18n("&50 Hz"), m_frequencyGroup, "fRadioButton1" );
m_fRadioButton2 = new QRadioButton(i18n("&60 Hz"), m_frequencyGroup, "fRadioButton2" );
dataLayout->addWidget (initSettingLabel1,0,0);
dataLayout->addWidget (m_numberOfColumns,0,1);
dataLayout->addWidget (initSettingLabel2,1,0);
dataLayout->addWidget (m_checkBoxCbc,1,1);
dataLayout->addWidget (m_mainBackgroundColorLabel,2,0);
dataLayout->addWidget (m_BGButton,2,1);
dataLayout->addWidget (initSettingLabel4,3,0);
dataLayout->addWidget (m_checkBoxAys,3,1);
dataLayout->addWidget (initSettingLabel5,4,0);
dataLayout->addWidget (m_comboBoxMainWindow,4,1);
dataLayout->addWidget (initSettingLabel6,5,0);
dataLayout->addWidget (m_checkBoxMesW,5,1);
dataLayout->setColStretch(1,5);
voltLayout->addRowSpacing (0 ,fontMetrics().lineSpacing() );
voltLayout->addWidget ( m_vRadioButton1,1,0 );
voltLayout->addWidget ( m_vRadioButton2,2,0 );
freqLayout->addRowSpacing (0 ,fontMetrics().lineSpacing() );
freqLayout->addWidget ( m_fRadioButton1,1,0 );
freqLayout->addWidget ( m_fRadioButton2,2,0 );
setTopLayout->addWidget (VFGroup,10);
setVoltFreqLayout->addRowSpacing (0 ,fontMetrics().lineSpacing() );
setVoltFreqLayout->addWidget ( m_voltageGroup,1,0 );
setVoltFreqLayout->addWidget ( m_frequencyGroup,1,1 );
setVoltFreqLayout->addWidget ( m_xfer,2,0 );
setVoltFreqLayout->addRowSpacing (3 ,fontMetrics().lineSpacing() );
setTopLayout->addStretch( 20 );
//sets value
m_numberOfColumns->setValue(m_settingData->countCols);
m_BGButton->setColor(m_settingData->mainBackgroundColor); // sets color of backgound
m_checkBoxAys->setChecked(m_settingData->areYouSure);
m_checkBoxMesW->setChecked(m_settingData->useMessageWindow);
m_comboBoxMainWindow->setCurrentItem(m_settingData->useMainWindow);
if (m_settingData->inputVoltage == 230)
m_vRadioButton1->setChecked( true );
else
m_vRadioButton2->setChecked( true );
if (m_settingData->inputFrequency == 50)
m_fRadioButton1->setChecked( true );
else
m_fRadioButton2->setChecked( true );
m_xfer->setChecked(m_settingData->lowHighXfer);
m_voltageGroup->setEnabled(!m_settingData->lowHighXfer);
m_frequencyGroup->setEnabled(!m_settingData->lowHighXfer);
connect (m_xfer,SIGNAL(toggled(bool)),this,SLOT(slotEnableVoltage(bool)));
connect (m_xfer,SIGNAL(toggled(bool)),this,SLOT(slotEnableFrequency(bool)));
m_checkBoxCbc->setChecked(m_settingData->customBColor);
m_BGButton->setColor(m_settingData->mainBackgroundColor);
m_BGButton->setEnabled(m_settingData->customBColor);
m_mainBackgroundColorLabel->setEnabled(m_settingData->customBColor);
connect (m_checkBoxCbc,SIGNAL(toggled(bool)),this,SLOT(slotUseCustomBColor(bool)));
}
void KNutPrefDlg::initUps () {
m_upsesPix = UserIcon ("knc_upses");
QFrame *page = addPage( i18n("UPS"),i18n("UPS Setting"),m_upsesPix);
QHBoxLayout *upsTopLayout = new QHBoxLayout( page, 0, spacingHint (),"upsTopLayout" );
// makes box for names of UPS's / Vytvorime box pro jmena UPS-ek
m_listBox2 = new KListBox( page, "ListBox2" );
m_listBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, m_listBox2->sizePolicy().hasHeightForWidth() ) );
m_listBox2->setFrameShape( QListBox::StyledPanel );
m_listBox2->setFrameShadow( QListBox::Sunken );
m_listBox2->setMinimumSize (100,100);
// sets listbox
for (int i=0; i < m_myUpsData->getCount (); i++) m_listBox2->insertItem (m_myUpsData->getName(i));
//includes listbox into horizontal layout on the first place
upsTopLayout->addWidget( m_listBox2, 20 );
// makes vertical layout and includes it in horizontal layout into the second place
QVBoxLayout *upsLayout = new QVBoxLayout( upsTopLayout, spacingHint (),"upsLayout" );
// vytvorime tlacitka
KPushButton *newButton = new KPushButton (i18n("&Add"),page);
KPushButton *editButton = new KPushButton (i18n("&Edit"),page);
KPushButton *deleteButton = new KPushButton (i18n("&Delete"),page);
// includes buttons into layout / vlozime tlacitka do layoutu
upsLayout->addWidget( newButton );
upsLayout->addWidget( editButton );
upsLayout->addWidget( deleteButton );
upsLayout->addStretch( 10 );
connect (newButton,SIGNAL(clicked()),this,SLOT(slotNewUps()));
connect (editButton,SIGNAL(clicked()),this,SLOT(slotEditUps()));
connect (deleteButton,SIGNAL(clicked()),this,SLOT(slotDeleteUps()));
connect (m_listBox2,SIGNAL(doubleClicked(QListBoxItem*, const QPoint&)),this,SLOT(slotEditUps()));
}
void KNutPrefDlg::initDock () {
m_dockPix = UserIcon ("knc_dock");
QFrame *page = addPage( i18n("Dock bar"),i18n("Docking Setting"),m_dockPix);
QVBoxLayout *setTopLayout = new QVBoxLayout( page, 10, spacingHint (), "setTopLayout" );
QButtonGroup *typeGroup = new QButtonGroup(i18n("Type of dock's showing"),page,"typeGroup");
QGridLayout *typeLayout = new QGridLayout (typeGroup,2,2,spacingHint());
setTopLayout->addWidget(typeGroup);
QGroupBox *infoBox = new QGroupBox (i18n("Items of tooltip"),page ,"infoBox");
QGridLayout *infoLayout = new QGridLayout (infoBox,8,1,spacingHint());
setTopLayout->addWidget(infoBox);
QGridLayout *colorLayout = new QGridLayout (10,1,spacingHint(),"colorLayout");
setTopLayout->addLayout(colorLayout);
m_iconRadioButton1 = new QRadioButton(i18n("&Picture"), typeGroup, "iconRadioButton1" );
m_iconRadioButton2 = new QRadioButton(i18n("&General"), typeGroup, "iconRadioButton2" );
m_checkBoxTTMFR = new QCheckBox (i18n("M&anufacturer"),infoBox);
m_checkBoxTTMFR->setChecked((m_settingData->toolTipFlags) & KNutDock::TTMFR);
m_checkBoxTTModel = new QCheckBox (i18n("M&odel"),infoBox);
m_checkBoxTTModel->setChecked((m_settingData->toolTipFlags) & KNutDock::TTModel);
m_checkBoxTTSerial = new QCheckBox (i18n("&Serial"),infoBox);
m_checkBoxTTSerial->setChecked((m_settingData->toolTipFlags) & KNutDock::TTSerial);
m_checkBoxTTFirm = new QCheckBox (i18n("&Firm. rev."),infoBox);
m_checkBoxTTFirm->setChecked((m_settingData->toolTipFlags) & KNutDock::TTFirm);
m_checkBoxTTRun = new QCheckBox (i18n("&Runtime"),infoBox);
m_checkBoxTTRun->setChecked((m_settingData->toolTipFlags) & KNutDock::TTRun);
m_checkBoxTTCharge = new QCheckBox (i18n("&Battery Charge"),infoBox);
m_checkBoxTTCharge->setChecked((m_settingData->toolTipFlags) & KNutDock::TTCharge);
m_checkBoxTTLoad = new QCheckBox (i18n("&UPS Load"),infoBox);
m_checkBoxTTLoad->setChecked((m_settingData->toolTipFlags) & KNutDock::TTLoad);
m_iconDockLabel = new QLabel(i18n("Use custom icon's background color"),page,"label1");
m_checkBoxCbi = new QCheckBox ("",page,"checboxcbpc");
m_dockBackgroundColorLabel = new QLabel(i18n("Color of icon's background :"),page,"label12");
m_BGIButton = new KColorButton (page);
typeLayout->addRowSpacing (0 ,fontMetrics().lineSpacing() );
typeLayout->addWidget ( m_iconRadioButton1,1,0 );
typeLayout->addWidget ( m_iconRadioButton2,2,0 );
if (m_settingData->typeOfKIcon == KNutDock::pictureKI)
m_iconRadioButton1->setChecked( true );
if (m_settingData->typeOfKIcon == KNutDock::generalKI)
m_iconRadioButton2->setChecked( true );
infoLayout->addRowSpacing (0 ,fontMetrics().lineSpacing() );
infoLayout->addWidget ( m_checkBoxTTMFR ,1,0);
infoLayout->addWidget ( m_checkBoxTTModel ,2,0);
infoLayout->addWidget ( m_checkBoxTTSerial ,3,0);
infoLayout->addWidget ( m_checkBoxTTFirm ,4,0);
infoLayout->addWidget ( m_checkBoxTTRun ,5,0);
infoLayout->addWidget ( m_checkBoxTTCharge ,6,0);
infoLayout->addWidget ( m_checkBoxTTLoad ,7,0);
colorLayout->addWidget (m_iconDockLabel,0,0);
colorLayout->addWidget (m_checkBoxCbi,0,1);
colorLayout->addWidget (m_dockBackgroundColorLabel,1,0);
colorLayout->addWidget (m_BGIButton,1,1);
m_checkBoxCbi->setChecked(m_settingData->customKIconColor);
m_BGIButton->setColor(m_settingData->kIconBackgroundColor);
// m_BGIButton->setEnabled(m_prefData->customKIconColor);
// m_dockBackgroundColorLabel->setEnabled(m_prefData->customKIconColor);
if (m_iconRadioButton1->isChecked()) {
m_iconDockLabel->setEnabled(false);
m_checkBoxCbi->setEnabled(false);
m_BGIButton->setEnabled(false);
m_dockBackgroundColorLabel->setEnabled(false);
}
else {
m_iconDockLabel->setEnabled(true);
m_BGIButton->setEnabled(m_settingData->customKIconColor);
m_dockBackgroundColorLabel->setEnabled(m_settingData->customKIconColor);
}
setTopLayout->addStretch( 20 );
connect (m_checkBoxCbi,SIGNAL(toggled(bool)),this,SLOT(slotUseCustomBIconColor(bool)));
connect (m_iconRadioButton1,SIGNAL(toggled(bool)),this,SLOT(slotSetPictureKI(bool)));
}
void KNutPrefDlg::initPanel () {
m_panelPix = UserIcon ("knc_panel");
// QFrame *page = addPage( i18n("Panel"),i18n("Panel Setting"),DesktopIcon("panel_settings"));
QFrame *page = addPage( i18n("Panel"),i18n("Panel Setting"),m_panelPix);
QVBoxLayout *setTopLayout = new QVBoxLayout( page, 10, spacingHint (), "setTopLayout" );
QGroupBox *infoBox = new QGroupBox (page ,"infoBox");
QGridLayout *infoLayout = new QGridLayout (infoBox,10,1,spacingHint());
setTopLayout->addWidget(infoBox);
QGridLayout *colorLayout = new QGridLayout (10,1,spacingHint(),"colorLayout");
setTopLayout->addLayout(colorLayout);
// vytvorime widgety - Nazev Zatrhavaci box
//makes widgets - name checkbox
m_checkBoxOver = new QCheckBox (i18n("UPS &Overload"),infoBox);
m_checkBoxOver->setChecked((m_settingData->panelFlags) & KNutFrontPanel::PBOver);
m_checkBoxBL = new QCheckBox (i18n("UPS &Battery low"),infoBox);
m_checkBoxBL->setChecked((m_settingData->panelFlags) & KNutFrontPanel::PBBattLow);
m_checkBoxRB = new QCheckBox (i18n("R&eplace battery"),infoBox);
m_checkBoxRB->setChecked((m_settingData->panelFlags) & KNutFrontPanel::PBRepBatt);
m_checkBoxCal = new QCheckBox (i18n("Ups &calibration"),infoBox);
m_checkBoxCal->setChecked((m_settingData->panelFlags) & KNutFrontPanel::PBCal);
m_checkBoxMFRM = new QCheckBox (i18n("&Manufac. + Model"),infoBox);
m_checkBoxMFRM->setChecked((m_settingData->panelFlags) & KNutFrontPanel::PBMFRMod);
m_checkBoxMFR = new QCheckBox (i18n("M&anufacturer"),infoBox);
m_checkBoxMFR->setChecked((m_settingData->panelFlags) & KNutFrontPanel::PBMFR);
m_checkBoxModel = new QCheckBox (i18n("M&odel"),infoBox);
m_checkBoxModel->setChecked((m_settingData->panelFlags) & KNutFrontPanel::PBModel);
m_checkBoxSerial = new QCheckBox (i18n("&Serial"),infoBox);
m_checkBoxSerial->setChecked((m_settingData->panelFlags) & KNutFrontPanel::PBSerial);
m_checkBoxFirm = new QCheckBox (i18n("&Firm. rev."),infoBox);
m_checkBoxFirm->setChecked((m_settingData->panelFlags) & KNutFrontPanel::PBFirm);
m_checkBoxRun = new QCheckBox (i18n("&Runtime"),infoBox);
m_checkBoxRun->setChecked((m_settingData->panelFlags) & KNutFrontPanel::PBRun);
QLabel *initPanelLabel1 = new QLabel(i18n("Use custom background color"),page,"label1");
m_checkBoxCbpc = new QCheckBox ("",page,"checboxcbpc");
m_panelBackgroundColorLabel = new QLabel(i18n("Color of background :"),page,"m_panelBackgroundColorLabel");
m_BGPButton = new KColorButton (page);
// includes widgets
infoLayout->addWidget ( m_checkBoxOver, 0,0);
infoLayout->addWidget ( m_checkBoxBL ,1,0);
infoLayout->addWidget ( m_checkBoxRB ,2,0);
infoLayout->addWidget ( m_checkBoxCal ,3,0);
infoLayout->addWidget ( m_checkBoxMFRM ,4,0);
infoLayout->addWidget ( m_checkBoxMFR ,5,0);
infoLayout->addWidget ( m_checkBoxModel ,6,0);
infoLayout->addWidget ( m_checkBoxSerial ,7,0);
infoLayout->addWidget ( m_checkBoxFirm ,8,0);
infoLayout->addWidget ( m_checkBoxRun ,9,0);
colorLayout->addWidget (initPanelLabel1,0,0);
colorLayout->addWidget (m_checkBoxCbpc,0,1);
colorLayout->addWidget (m_panelBackgroundColorLabel,1,0);
colorLayout->addWidget (m_BGPButton,1,1);
setTopLayout->addStretch( 20 );
m_checkBoxCbpc->setChecked(m_settingData->customBPanelColor);
m_BGPButton->setColor(m_settingData->mPanelBackgroundColor);
m_BGPButton->setEnabled(m_settingData->customBPanelColor);
m_panelBackgroundColorLabel->setEnabled(m_settingData->customBPanelColor);
m_panelBackgroundColorLabel->setEnabled(m_settingData->customBPanelColor);
connect (m_checkBoxCbpc,SIGNAL(toggled(bool)),this,SLOT(slotUseCustomBPanelColor(bool)));
}
void KNutPrefDlg::initFonts () {
QFrame *page = addPage( i18n("Fonts"),i18n("Setting Fonts"),DesktopIcon("fonts"));
QVBoxLayout *setTopLayout = new QVBoxLayout( page, 10, spacingHint (), "setTopLayout" );
QHBoxLayout *setSysLayout = new QHBoxLayout( setTopLayout, spacingHint (), "setTypeLayout" );
QHBoxLayout *setTypeLayout = new QHBoxLayout( setTopLayout, spacingHint (), "setTypeLayout" );
QHBoxLayout *setFontLayout = new QHBoxLayout( setTopLayout, spacingHint (), "setFontLayout" );
m_customFont = new QCheckBox (i18n("&Use custom font"),page);
setSysLayout->addWidget ( m_customFont ,10);
setSysLayout->addStretch( 10 );
KComboBox *panelFonts = new KComboBox(page);
panelFonts->insertItem (i18n("Main panel"));
panelFonts->insertItem (i18n("Analog panels"));
setTypeLayout->addWidget ( panelFonts ,0);
m_fontWidget = new KFontChooser(page,"Font",false);
setFontLayout->addWidget (m_fontWidget ,0);
setTopLayout->addStretch( 20 );
// init items
m_customFont->setChecked(m_settingData->customFont);
m_aPanelFont = m_settingData->aPanelFont;
m_mPanelFont = m_settingData->mPanelFont;
m_settingFont = MAIN_PANEL_FONT; // sets font for Main Panel / nastavujeme font pro Main Panel
m_fontWidget->setFont(m_mPanelFont);
m_fontWidget->setEnabled(m_settingData->customFont);
connect (panelFonts,SIGNAL(activated(int)),this,SLOT(slotChangeSettingFont(int)));
connect (m_customFont,SIGNAL(toggled(bool)),m_fontWidget,SLOT(setEnabled(bool)));
}
void KNutPrefDlg::initAnalog () {
m_analogPix = UserIcon ("knc_analog");
QFrame *page = addPage( i18n("Analog"),i18n("Setting Analog panel"),m_analogPix);
// QFrame *page = addPage( i18n("Analog"),i18n("Setting Analog panel"),DesktopIcon("ksysguard"));
QVBoxLayout *setTopLayout = new QVBoxLayout( page, 10, spacingHint (), "setTopLayout" );
QGridLayout *setColorLayout = new QGridLayout( 9,2, spacingHint(),"setColorLayout");
setTopLayout->addLayout(setColorLayout);
setTopLayout->addStretch( 20 );
QLabel *initAnalogLabel1 = new QLabel(i18n("Use custom background color"),page,"initAnalogLabel1");
m_checkBoxCbac = new QCheckBox ("",page,"checboxcbac");
m_analogBackgroundColorLabel = new QLabel(i18n("Color of background :"),page,"m_backgroundColorLabel");
m_BGAButton = new KColorButton (page);
QLabel *initAnalogLabel12 = new QLabel(i18n("Use custom other colors"),page,"label12");
m_checkBoxCoac = new QCheckBox ("",page,"checboxcoac");
m_analogPointerColorLabel = new QLabel(i18n("Color of pointer :"),page,"m_analogPointerColorLabel");
m_AFingerButton = new KColorButton (page);
m_analogOKColorLabel = new QLabel(i18n("Color of OK range :"),page,"label7");
m_AOKButton = new KColorButton (page);
m_analogWarningColorLabel = new QLabel(i18n("Color of warning range :"),page,"label8");
m_AWarnningButton = new KColorButton (page);
m_analogErrorColorLabel= new QLabel(i18n("Color of error range :"),page,"label9");
m_AErrorButton = new KColorButton (page);
m_analogScaleColorLabel = new QLabel(i18n("Color of scale :"),page,"label10");
m_AScaleButton = new KColorButton (page);
m_analogFontColorLabel = new QLabel(i18n("Color of font :"),page,"label11");
m_AFontButton = new KColorButton (page);
m_digitalProcessingLabel = new QLabel(i18n("Digital processing of pointers :"),page,"label12");
m_digitalProcesingOfPointers = new KComboBox (page);
setColorLayout->addWidget ( initAnalogLabel1, 0,0);
setColorLayout->addWidget ( m_checkBoxCbac ,0,1);
setColorLayout->addWidget ( m_analogBackgroundColorLabel, 1,0);
setColorLayout->addWidget ( m_BGAButton ,1,1);
setColorLayout->addWidget ( initAnalogLabel12, 2,0);
setColorLayout->addWidget ( m_checkBoxCoac ,2,1);
setColorLayout->addWidget ( m_analogPointerColorLabel, 3,0);
setColorLayout->addWidget ( m_AFingerButton ,3,1);
setColorLayout->addWidget ( m_analogOKColorLabel, 4,0);
setColorLayout->addWidget ( m_AOKButton ,4,1);
setColorLayout->addWidget ( m_analogWarningColorLabel, 5,0);
setColorLayout->addWidget ( m_AWarnningButton ,5,1);
setColorLayout->addWidget ( m_analogErrorColorLabel, 6,0);
setColorLayout->addWidget ( m_AErrorButton ,6,1);
setColorLayout->addWidget ( m_analogScaleColorLabel, 7,0);
setColorLayout->addWidget ( m_AScaleButton ,7,1);
setColorLayout->addWidget ( m_analogFontColorLabel, 8,0);
setColorLayout->addWidget ( m_AFontButton ,8,1);
setColorLayout->addWidget ( m_digitalProcessingLabel, 9,0);
setColorLayout->addWidget ( m_digitalProcesingOfPointers, 9,1);
m_checkBoxCbac->setChecked(m_settingData->customBAnalogColor);
m_checkBoxCoac->setChecked(m_settingData->customOAnalogColor);
m_BGAButton->setColor(m_settingData->aPanelBackgroundColor);
m_BGAButton->setEnabled(m_settingData->customBAnalogColor);
m_AFingerButton->setColor(m_settingData->analogFingerColor);
m_AFingerButton->setEnabled(m_settingData->customOAnalogColor);
m_AOKButton->setColor(m_settingData->analogOKColor);
m_AOKButton->setEnabled(m_settingData->customOAnalogColor);
m_AWarnningButton->setColor(m_settingData->analogWarnningColor);
m_AWarnningButton->setEnabled(m_settingData->customOAnalogColor);
m_AErrorButton->setColor(m_settingData->analogErrorColor);
m_AErrorButton->setEnabled(m_settingData->customOAnalogColor);
m_AScaleButton->setColor(m_settingData->analogScaleColor);
m_AScaleButton->setEnabled(m_settingData->customOAnalogColor);
m_AFontButton->setColor(m_settingData->analogFontColor);
m_AFontButton->setEnabled(m_settingData->customOAnalogColor);
m_analogBackgroundColorLabel->setEnabled(m_settingData->customBAnalogColor);
m_analogPointerColorLabel->setEnabled(m_settingData->customOAnalogColor);
m_analogOKColorLabel->setEnabled(m_settingData->customOAnalogColor);
m_analogWarningColorLabel->setEnabled(m_settingData->customOAnalogColor);
m_analogErrorColorLabel->setEnabled(m_settingData->customOAnalogColor);
m_analogScaleColorLabel->setEnabled(m_settingData->customOAnalogColor);
m_analogFontColorLabel->setEnabled(m_settingData->customOAnalogColor);
m_digitalProcesingOfPointers->insertItem(i18n("Nothing processing"));
m_digitalProcesingOfPointers->insertItem(i18n("Fast antialiasing"));
m_digitalProcesingOfPointers->insertItem(i18n("Fine antialiasing"));
m_digitalProcesingOfPointers->insertItem(i18n("Fast antialiasing and blur motion"));
m_digitalProcesingOfPointers->insertItem(i18n("Fine antialiasing and blur motion"));
m_digitalProcesingOfPointers->setCurrentItem(m_settingData->typeDigitalProcessing);
connect (m_checkBoxCbac,SIGNAL(toggled(bool)),this,SLOT(slotUseCustomBAnalogColor(bool)));
connect (m_checkBoxCoac,SIGNAL(toggled(bool)),this,SLOT(slotUseCustomOAnalogColor(bool)));
}
#include "knutprefdlg.moc"

@ -0,0 +1,359 @@
/***************************************************************************
knutprefdlg.h - description
-------------------
begin : Tue Aug 21 2001
copyright : (C) 2001 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef KNUTPREFDLG_H
#define KNUTPREFDLG_H
#include "knutnewupsdlg.h"
#include "knutupsdata.h"
#include "knutvardata.h"
#include "knutconst.h"
#include <kdialogbase.h>
#include <kpushbutton.h>
#include <klistbox.h>
#include <klocale.h>
#include <kfontdialog.h>
#include <kcolorbtn.h>
#include <kcombobox.h>
#include <qwidget.h>
class QLabel;
class QFont;
class QCheckBox;
class QRadioButton;
class QSpinBox;
/**
*@author Daniel Prynych
*/
/**
* This class makes configure dialog
* Tato trida je vytvari konfiguracni dialog.
* @author Daniel Prynych
* @short Konfiguracni dialog
* @version 0.8
*/
class KNutPrefDlg : public KDialogBase
{
Q_OBJECT
public:
enum changePref {
ChangeCountCols = 0x1, //1,
ChangeCustomBColor = 0x2, //2,
ChangeMBColor = 0x4, //4,
ChangeVoltage = 0x8, // 8,
ChangeFrequency = 0x10, // 16,
ChangeXFer = 0x20, // 32,
ChangeUpsSetting = 0x40, // 64,
ChangeUpsCount = 0x80, // 128,
ChangeMainPanelSetting = 0x100, // 256,
ChangeCustomMPanelBColor = 0x200, // 512,
ChangeMPBColor = 0x400, // 1024,
ChangeAnalogFont = 0x800, // 2048,
ChangePanelFont = 0x1000, // 4096,
ChangeCustomAPanelBColor = 0x2000, // 8192,
ChangeAPBColor = 0x4000, // 16384,
ChangeCustomAPanelOColor = 0x8000, // 32768,
ChangeAPOColor = 0x10000, // 65536,
ChangeCustomKIconColor = 0x20000, // 131072,
ChangeKIconBColor = 0x40000, // 262144,
ChangeToolTip = 0x80000, // 524288,
ChangeTypeOfKIcon = 0x100000, // 1048576
ChangeTypeOfDigProcessing = 0x200000, // 1048576 *2
ChangeSomeThing = 0x400000 // 1048576 *4
};
/**
* Constructor makes configure dialog.
* Konstruktor vytvori konfiguracni dialog.
*
* @param upsData Is pointer on instance of class of KNutUpsData, which manage informations about UPSes.
* @param analogData Is pointer on instance of class of KNutVarData, which manages data about analog panels.
* @param settingData Is pointer on struct, which contain values is setted in dialog.
* @param upsName Is name of active UPS.
*
* @param upsData Je odkaz na instanci tridy KNutUpsData, ktera spravuje informace o UPS-kach.
* @param analogData Je odkaz na na instanci tridy KNutVarData, ktera spravuje data o analogovych panelech.
* @param settingData Je odkaz na strukturu ktera obsahuje hodnoty nastavovane v dialogu.
* @param upsName Je jmeno aktivni UPS-ky.
*
* @since 0.5
**/
KNutPrefDlg(KNutUpsData* const upsData, KNutVarData* const analogData, KNutVarData::SettingDataDef* const settingData, const QString upsName, QWidget* parent = 0, const char* name = 0, const bool modal = true);
/**
* @since 0.3
**/
~KNutPrefDlg();
signals:
/**
* Signal is emited when statement is changed same pages.
* Signal je aktivovan pokud je zmenen udaj na kterekoliv strance.
*
* @param changeSetting Declare, what item was changed.
* @param changeSetting Udava, ktery prvek byl zmenen.
*
* @since 0.2
**/
void signalChangeConfig (unsigned int changeSetting );
private slots:
/**
* @internal
*/
virtual void slotDefault();
/**
* @internal
*/
virtual void slotApply();
/**
* @internal
*/
virtual void slotOk();
/**
* @internal
*/
void slotChangeSettingFont(int index);
/**
* @internal
*/
void slotSetPictureKI (bool on);
/**
* @internal
*/
void slotEnableVoltage(bool enable);
/**
* @internal
*/
void slotEnableFrequency(bool enable);
/**
* @internal
*/
void slotUseCustomBColor(bool enable);
/**
* @internal
*/
void slotUseCustomBPanelColor(bool enable);
/**
* @internal
*/
void slotUseCustomBAnalogColor(bool enable);
/**
* @internal
*/
void slotUseCustomOAnalogColor(bool enable);
/**
* @internal
*/
void slotUseCustomBIconColor(bool enable);
/**
* @internal
*/
void slotNewUps();
/**
* @internal
*/
void slotEditUps();
/**
* @internal
*/
void slotDeleteUps();
private:
enum Page {
mainSettingPage =0,
upsSettingPage,
panelSettingPage,
fontSettingPage,
analogSettingPage,
kickerSettingPage
};
/**
* @internal
*/
void initSetting();
/**
* @internal
*/
void initUps();
/**
* @internal
*/
void initPanel();
/**
* @internal
*/
void initFonts();
/**
* @internal
*/
void initAnalog ();
/**
* @internal
*/
void initDock ();
// Private values
QString m_activeUpsName; // name of UPS which is active
KNutUpsData* m_myUpsData;
KNutVarData* m_myAnalogData;
KNutVarData::SettingDataDef* m_settingData;
KNutNewUpsDlg* newUpsDlg;
KListBox* m_listBox2; // uses in part UPS, contain name of UPS
bool m_checked; //it's settted when, definition(parameters) of UPS were chaged // nastaveno kdyz doslo k zmene v definici UPS
bool m_checkedActiveUps; //it's setted when, parameters of active UPS were changed // nastaveno pokud doslo ke zmene na aktivni UPS
QSpinBox *m_numberOfColumns;
KColorButton *m_BGButton;
QCheckBox *m_checkBoxCbc;
QCheckBox *m_checkBoxAys;
// QCheckBox *m_checkBoxMW;
QCheckBox *m_checkBoxMesW;
KComboBox *m_comboBoxMainWindow;
QCheckBox *m_xfer;
QCheckBox *m_checkBoxOver;
QCheckBox *m_checkBoxBL;
QCheckBox *m_checkBoxRB;
QCheckBox *m_checkBoxCal;
QCheckBox *m_checkBoxMFRM;
QCheckBox *m_checkBoxMFR;
QCheckBox *m_checkBoxModel;
QCheckBox *m_checkBoxSerial;
QCheckBox *m_checkBoxFirm;
QCheckBox *m_checkBoxRun;
QCheckBox *m_checkBoxCbpc;
QCheckBox* m_checkBoxCbac;
QCheckBox* m_checkBoxCoac;
QCheckBox *m_checkBoxCbi;
QCheckBox *m_checkBoxTTMFR;
QCheckBox *m_checkBoxTTModel;
QCheckBox *m_checkBoxTTSerial;
QCheckBox *m_checkBoxTTFirm;
QCheckBox *m_checkBoxTTRun;
QCheckBox *m_checkBoxTTCharge;
QCheckBox *m_checkBoxTTLoad;
QLabel *m_panelBackgroundColorLabel;
QLabel *m_mainBackgroundColorLabel;
QLabel *m_analogBackgroundColorLabel;
QLabel *m_dockBackgroundColorLabel;
QLabel *m_analogPointerColorLabel;
QLabel *m_analogOKColorLabel;
QLabel *m_analogWarningColorLabel;
QLabel *m_analogErrorColorLabel;
QLabel *m_analogScaleColorLabel;
QLabel *m_analogFontColorLabel;
QLabel *m_digitalProcessingLabel;
QLabel *m_iconDockLabel;
QRadioButton *m_vRadioButton1;
QRadioButton *m_vRadioButton2;
QRadioButton *m_fRadioButton1;
QRadioButton *m_fRadioButton2;
QRadioButton *m_iconRadioButton1;
QRadioButton *m_iconRadioButton2;
KColorButton *m_BGPButton;
KColorButton* m_BGAButton;
KColorButton* m_AFingerButton;
KColorButton* m_AOKButton;
KColorButton* m_AWarnningButton;
KColorButton* m_AErrorButton;
KColorButton* m_AScaleButton;
KColorButton* m_AFontButton;
KColorButton *m_BGIButton;
KComboBox* m_digitalProcesingOfPointers;
QButtonGroup *m_voltageGroup;
QButtonGroup *m_frequencyGroup;
QCheckBox* m_customFont; // User's font
KFontChooser *m_fontWidget;
QFont m_aPanelFont; // Analog panel font
QFont m_mPanelFont; // Main panel font
int m_settingFont; // which font is setted (selected)
QPixmap m_panelPix;
QPixmap m_mSetPix;
QPixmap m_upsesPix;
QPixmap m_analogPix;
QPixmap m_dockPix;
};
#endif

@ -0,0 +1,210 @@
/***************************************************************************
knutprintupsvar.cpp - description
-------------------
begin : St cec 3 2002
copyright : (C) 2002 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#include "knutprintupsvar.h"
#include "knutvardata.h"
#include <kmessagebox.h>
#include <kglobal.h>
#include <kiconloader.h>
#include <qgroupbox.h>
#include <qscrollview.h>
#include <qtooltip.h>
#include <qlabel.h>
#include <qframe.h>
#include <qpixmap.h>
#include <qstring.h>
//#include <iostream>
// od verze 0.6.0 nebudeme vytvaret vlastni spojeni
KNutPrintUpsVar::KNutPrintUpsVar(KNutNet* const upsNet, const bool useDescription, QWidget* parent, const char* name, const bool modal )
: KDialogBase(Plain, i18n("Variables"),User1|Cancel,Ok, parent, name, modal, true), myUpsNet(upsNet){
upsVarDef upsVar;
upsICommDef upsIComm;
dataVar pointerVar;
dataList.clear();
if (!upsNet) return;
setButtonText(User1,i18n("Reload Vars"));
setName( "knutprintupsvar" );
setCaption( i18n("UPS variables") );
//int error;
if (myUpsNet->getState() != KNutNet::Connected) {
KNutVarData::showError (KNutNet::NotConnection);
upsConnectOk = false;
page=0;
}
else {
upsConnectOk = true;
countVars=myUpsNet->readNumberVars(KNutNet::AllVars);
countRWVars=myUpsNet->readNumberVars(KNutNet::RWVars);
countIComms=myUpsNet->readNumberComms();
KIconLoader *loader = KGlobal::iconLoader();
dirPixmap=loader->loadIcon ("folder_open",KIcon::Small,16);
page = plainPage();
QHBoxLayout* upsVarsMainLayout = new QHBoxLayout(page);
table = new KListView(page);
table->setRootIsDecorated(true);
table->setAllColumnsShowFocus( TRUE );
table->setFullWidth ( true );
table->addColumn( i18n("Name") );
table->addColumn( i18n("Value") );
if (useDescription)
table->addColumn( i18n("Description") );
table->setSorting (-1);
upsVarsMainLayout->addWidget(table);
KListViewItem* myListItem;
if (countIComms) {
ICommList = new KListViewItem( table, i18n("Instant Commands"));
ICommList->setOpen(true);
for (int i=0; i<countIComms; i++) {
myUpsNet->readIComm(i+1,upsIComm);
myListItem = addListItem( ICommList,upsIComm.upsCommName,"");
if ((!upsVar.upsDescription.isEmpty()) && useDescription)
myListItem->setText(2,upsIComm.upsDescription);
}
}
if (countRWVars) {
RWVarsList = new KListViewItem( table, i18n("Read/Write Variables"));
RWVarsList->setOpen(true);
for (int i=0; i<countVars; i++) {
myUpsNet->readVars(i+1,upsVar);
if (!upsVar.upsVarType) {
pointerVar.myName=upsVar.upsVarName;
pointerVar.myValue = addListItem( RWVarsList,upsVar.upsVarName,upsVar.upsValue);
if ((!upsVar.upsDescription.isEmpty()) && useDescription)
pointerVar.myValue->setText(2,upsVar.upsDescription);
dataList.push_back(pointerVar);
}
}
}
ROVarsList = new KListViewItem( table, i18n("Read Only Variables"));
ROVarsList->setOpen(true);
for (int i=0; i<countVars; i++) {
myUpsNet->readVars(i+1,upsVar);
if (upsVar.upsVarType) {
pointerVar.myName=upsVar.upsVarName;
pointerVar.myValue = addListItem( ROVarsList,upsVar.upsVarName,upsVar.upsValue);
if ((!upsVar.upsDescription.isEmpty()) && useDescription)
pointerVar.myValue->setText(2,upsVar.upsDescription);
dataList.push_back(pointerVar);
}
}
connect (this,SIGNAL(user1Clicked()),this,SLOT(slotReloadVars()));
} // end else
}
KNutPrintUpsVar::~KNutPrintUpsVar(){
dataList.clear();
if (page) delete page;
}
void KNutPrintUpsVar::slotReloadVars (void) {
upsVarDef upsVar;
if (myUpsNet->getUpsValues(true) !=0)
KNutVarData::showError (myUpsNet->getError());
else {
QValueVector<dataVar>::const_iterator it;
for (it = dataList.begin(); it != dataList.end(); it++) {
myUpsNet->readVars((*it).myName, upsVar);
(*it).myValue->setText (1, upsVar.upsValue);
}
}
}
KListViewItem* KNutPrintUpsVar::addListItem (KListViewItem* table, QString varName, QString value) {
KListViewItem* myListItem;
KListViewItem* helpListItem;
QString left;
int n;
myListItem = table;
do {
n = varName.find(".");
if (n > 0) {
left = varName.left(n);
varName = varName.mid(n+1);
if (!(helpListItem = existListItem( myListItem,left))) {
myListItem = new KListViewItem( myListItem, left);
myListItem->setOpen(true);
}
else myListItem = helpListItem;
if (!myListItem->pixmap(0)) myListItem->setPixmap(0,dirPixmap);
}
else { // end part
helpListItem = new KListViewItem( myListItem, varName, value);
helpListItem->setOpen(true);
return helpListItem;
}
} while (n > -1);
return 0; // for compiler only
}
KListViewItem* KNutPrintUpsVar::existListItem (KListViewItem* listItem, QString name) {
KListViewItem* myItem;
if (!(myItem = (KListViewItem *)listItem->firstChild())) return 0l;
while (myItem) {
if (myItem->text(0) == name) return myItem;
myItem = (KListViewItem *)myItem->nextSibling();
}
return 0l;
}
bool KNutPrintUpsVar::upsOk (void) { return upsConnectOk; }
#include "knutprintupsvar.moc"

@ -0,0 +1,160 @@
/***************************************************************************
knutprintupsvar.h - description
-------------------
begin : St cec 3 2002
copyright : (C) 2002 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef KNUTPRINTUPSVAR_H
#define KNUTPRINTUPSVAR_H
//Od verze 3 je kapp jen odkaz na kapplication
//#include <kapplication.h>
#include <kapp.h>
#include "knutupsdata.h"
#include "knutnet.h"
#include <kdialogbase.h>
#include <kcombobox.h>
#include <kpushbutton.h>
#include <klistview.h>
#include <qvariant.h>
#include <qlayout.h>
#include <qvaluelist.h>
#include <qvaluevector.h>
class QLabel;
class QPixmap;
class QFramel;
class QString;
/**
*@author Daniel Prynych
*/
/**
* Tato trida zajistuje zobrazeni vsech promenych,
* ktere podporuje prislusny ovladac/driver/model (ovladac) NUTu
* pro urcenou UPS-ku
* @author Daniel Prynych
* @short NUT show UPS vars
* @version 0.3.2
*/
class KNutPrintUpsVar : public KDialogBase {
Q_OBJECT
public:
/**
* Constructor - makes window, reads values of variables
* and will write names and values of variables
* Konstruktor - vytvori okno, nacte hodnoty promennych,
* a vypise jmena a hodnoty promenych.
* @param upsnet Je odkaz na instanci KNutNet - obsahuje hodnoty promennych systemu NUT.
* @param useDescription Urcuje zda pouzit pro promenne a prikazy taky popis.
* pokud data o UPS-kach neexistuji vraci funkce upsOk vzdy false.
*
* since 0.3.1
**/
KNutPrintUpsVar(KNutNet* const upsNet, const bool useDescription, QWidget* parent = 0, const char* name = 0, const bool modal = true);
/**
* @since 0.1
**/
~KNutPrintUpsVar();
/**
* Vrati zda se povedlo pripojit na server NUT-u a nacist udaje.
*
* @since 0.1
**/
bool upsOk (void);
protected:
/****** protected vars ************/
int countVars;
int countIComms;
int countRWVars;
KNutNet* myUpsNet;
KPushButton* reloadButton;
struct dataVar {
QString myName;
KListViewItem* myValue;
};
QValueVector<dataVar> dataList;
KListViewItem* ROVarsList;
KListViewItem* RWVarsList;
KListViewItem* ICommList;
QFrame *page;
KListView* table;
QPixmap dirPixmap;
bool upsConnectOk;
/********** protected functions ****************/
/**
* @internal
* adds name into part of tree
* Prida jmeno do casti stromu.
* @param table is top of tree's part
* @param varName is text which is addes into tree on the first column
* @param varName is text which is addes into tree on the second column
* @param table je vrchol casti stromu.
* @param varName je text ktere se prida do stromu na prvni sloupec.
* @param value je text ktere se prida do stromu na druhy sloupec.
*
* @since 0.2.1
**/
KListViewItem* addListItem (KListViewItem* table, QString varName, QString value);
/**
* @internal
* Zjisti existenci jmena ve vetvi stromu
*
* listItem je vrcholovy prvek vetve.
* @param name je jmeno ktere se hleda ve strome.
*
* @since 0.2
**/
KListViewItem* existListItem (KListViewItem* listItem, QString name);
protected slots:
/**
* @internal
* Nacte a prepise hodnoty promenych
*
* @since 0.3
**/
void slotReloadVars (void);
};
#endif

@ -0,0 +1,217 @@
/***************************************************************************
knutrwvar.cpp - description
-------------------
begin : So ríj 26 2002
copyright : (C) 2002 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#include "knutrwvar.h"
#include "knutvardata.h"
#include "knutprintupsvar.h"
//Od verze 3 je kapp jen odkaz na kapplication
//#include <kapplication.h>
#include <kapp.h>
#include <kcombobox.h>
#include <kmessagebox.h>
#include <klocale.h>
#include <qframe.h>
#include <qlabel.h>
#include <qstring.h>
#include <qlayout.h>
//#include <iostream>
KNutRWVar::KNutRWVar(QString* userName, QString* userPassword, const QString uName, const QString password, KNutNet* const initUpsNet, QWidget* parent, const char* name, const bool modal)
: KDialogBase(Plain, i18n("RW variables"),Ok|Cancel|Default,Ok, parent, name, modal, true), m_upsNet(initUpsNet){
upsVarDef upsVar;
// int error;
if (m_upsNet->getState() != KNutNet::Connected) {
KNutVarData::showError (KNutNet::NotConnection);
m_upsConnectOk = false;
}
else {
m_oldUserName = userName;
m_oldUserPassword = userPassword;
m_upsConnectOk = true;
QFrame *page = plainPage();
QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() );
QLabel *label1 = new QLabel (i18n("SET RW VARIABLE"),page,"label1");
label1->setAlignment(Qt::AlignHCenter);
topLayout->addWidget(label1);
QLabel *label2 = new QLabel (i18n("Variable:"),page,"label2");
m_rWVarBox = new KComboBox(page,"rwvarbox");
QLabel *label3 = new QLabel (i18n("Value:"),page,"label2");
m_valueVarBox = new KComboBox(page,"valuevarbox");
m_valueVarLine = new KLineEdit(page,"valuevarLine");
m_valueVarLine->hide();
m_passLayout = new QGridLayout (4,2,5,"passLayout");
QLabel *labelName = new QLabel (i18n("User name:"),page,"labelName");
QLabel *labelPassword = new QLabel (i18n("Password:"),page,"labelPassword");
m_lineEditName = new KLineEdit( page, "LineEditName" );
m_lineEditPassword = new KLineEdit( page, "LineEditName" );
if (((*m_oldUserName) == "") && ((*m_oldUserPassword) == "")) {
m_lineEditName->setText(uName);
m_lineEditPassword->setText(password);
}
else {
m_lineEditName->setText(*m_oldUserName);
m_lineEditPassword->setText(*m_oldUserPassword);
}
if (!((*m_oldUserName) == "") || !((*m_oldUserPassword) == "")) {
m_lineEditName->setDisabled(true);
m_lineEditPassword->setDisabled(true);
}
m_lineEditPassword->setEchoMode(QLineEdit::Password);
topLayout->addLayout(m_passLayout);
m_passLayout->addWidget(label2,0,0);
m_passLayout->addWidget(m_rWVarBox,0,1);
m_passLayout->addWidget(label3,1,0);
m_passLayout->addWidget(labelName,2,0);
m_passLayout->addWidget(labelPassword,3,0);
m_passLayout->addWidget(m_lineEditName,2,1);
m_passLayout->addWidget(m_lineEditPassword,3,1);
topLayout->addStretch(10);
//loads ComboBox
int n;
if (( n = (m_upsNet->readNumberVars( KNutNet::RWVars )+1)) > 1 ) { // zvetsime si pocet o 1
for (int i =1; i < n ; i++) {
if (!m_upsNet->readVars(i, upsVar,KNutNet::RWVars))
m_rWVarBox->insertItem(upsVar.upsVarName);
}
slotChangeVar(0);
}
else {
m_passLayout->addWidget(m_valueVarLine,1,1);
m_valueVarLine->setMaxLength(upsVar.upsVarMax);
m_valueVarBox->hide();
m_valueVarLine->show();
m_upsValueType=true;
}
connect (m_rWVarBox,SIGNAL(activated(int)),this,SLOT(slotChangeVar(int)));
}
}
int KNutRWVar::findItem(const KComboBox *myBox, const QString text) {
int n;
if ((n=myBox->count())) {
for (int i =0; i < n; i++)
if (text == myBox->text(i)) return i;
}
return myBox->currentItem();
}
void KNutRWVar::slotDefault () {
upsVarDef upsVar;
int error;
QString varName = m_rWVarBox->currentText();
if (!( error = m_upsNet->readVars(varName,upsVar))) {
if (upsVar.upsValueType) m_valueVarLine->setText(upsVar.upsValue);
else m_valueVarBox->setCurrentItem(upsVar.upsValue);
}
else KNutVarData::showError (error);
}
void KNutRWVar::slotChangeVar(int item) {
upsVarDef upsVar;
QString varName = m_rWVarBox->text(item);
int error = m_upsNet->readVars(varName,upsVar);
m_upsValueType=upsVar.upsValueType;
if (error || (upsVar.upsValueType)) {
// char
m_valueVarBox->hide();
m_valueVarLine->show();
m_passLayout->addWidget(m_valueVarLine,1,1);
m_valueVarLine->setText(upsVar.upsValue);
}
else {
//enum
m_valueVarLine->hide();
m_valueVarBox->show();
m_passLayout->addWidget(m_valueVarBox,1,1);
m_valueVarBox->clear();
if (upsVar.upsVarMax) {
for (int i = 0 ; i < upsVar.upsVarMax; i++)
m_valueVarBox->insertItem(m_upsNet->readEnumValueVar(upsVar.upsVarName,i+1));
}
m_valueVarBox->setCurrentItem(upsVar.upsValue);
}
}
KNutRWVar::~KNutRWVar(){
}
bool KNutRWVar::upsOk (void) { return m_upsConnectOk; }
void KNutRWVar::slotOk() {
QString value;
int error =0;
if (m_upsValueType) value=m_valueVarLine->text();
else value=m_valueVarBox->currentText();
if (((*m_oldUserName) == "") && ((*m_oldUserPassword) == "")) {
//the first connection sets name and password
//prvni propojeni nastavime jmeno a heslo
if (!(error = m_upsNet->setVariable(m_rWVarBox->currentText(), value, m_lineEditName->text(),m_lineEditPassword->text(),false))) {
// vzhledem k asynchronimu spracovani asi zbytecne
// myUpsNet->getUpsValues(true);
emit signalChangeRWVars(m_rWVarBox->currentText());//emits command for loading of variable and repaint of panel
(*m_oldUserName) = m_lineEditName->text();
(*m_oldUserPassword) = m_lineEditPassword->text();
accept();
}
}
else {
if (((*m_oldUserName) == m_lineEditName->text()) && ((*m_oldUserPassword) == m_lineEditPassword->text())) {
if (!(error = m_upsNet->setVariable(m_rWVarBox->currentText(), value, m_lineEditName->text(),m_lineEditPassword->text(),true))) {
// next line isn't needed, maybe
// vzhledem k asynchronimu spracovani asi zbytecne
// myUpsNet->getUpsValues(true);
emit signalChangeRWVars(m_rWVarBox->currentText()); //emits command for loading of variable and repaint of panel
accept();
}
}
}
//Nahlasime chybu
// sends information about error
if (error) KNutVarData::showError (error);
}
#include "knutrwvar.moc"

@ -0,0 +1,140 @@
/***************************************************************************
knutrwvar.h - description
-------------------
begin : So ríj 26 2002
copyright : (C) 2002 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef KNUTRWVAR_H
#define KNUTRWVAR_H
#include "knutnet.h"
#include <kdialogbase.h>
#include <klineedit.h>
#include <klocale.h>
#include <kcombobox.h>
class QString;
class QGridLayout;
/**
* This class is graphics interface for changes of RW variables.
* Tato trida je graficke rozhrani pro zmenu RW promennych.
*
* @author Daniel Prynych
* @short RW promenne
* @version 0.2
*/
class KNutRWVar : public KDialogBase {
Q_OBJECT
public:
/**
* Constructor - makes window for change of RW variable.
* Konstruktor - vytvori okno pro zmenu RW promene.
*
* @param uName Describes user name.
* @param password Describes password.
* @param initUpsNet is pointer of intance of class KNutNet.
* @param userName Urcuje uzivatelske jmeno.
* @param userPassword Urcuje heslo.
* @param uName Urcuje uzivatelske jmeno.
* @param password Urcuje heslo.
* @param initUpsNet Je odkaz na instanci tridy KNutNet.
* @since 0.2
**/
KNutRWVar(QString* userName, QString* userPassword, const QString uName, const QString password, KNutNet* const initUpsNet, QWidget* parent = 0, const char* name = 0, const bool modal = TRUE);
/**
* Destructor
*
* @since 0.2
**/
~KNutRWVar();
/**
* Vraci true pokud existuje pripojeni na server a vytvorilo se
* ovladaci okno pro nastaveni promennych.
*
* @since 0.3
**/
bool upsOk (void);
private slots:
/**
* @internal
*
* Nastavi hodnotu a zpusob vyberu hodnoty promenne.
*/
void slotChangeVar(int item);
/**
* @internal
*
* Sets value of variable on default value
* Nastavi hodnotu promenne na puvodni hodnotu.
*/
virtual void slotDefault ();
/**
* @internal
*
* Provede akci
*/
virtual void slotOk();
/**
* @internal
*
* Find asked item in box
* Since at version 3.0.0 is not needed.
* Najde pozadovanou polozku v boxu.
* Ve verzi qt > 3.0.0 neni potreba.
*/
int findItem(const KComboBox *myBox ,const QString text);
signals:
/**
* Signal je aktivovam pokud je zmenen udaj na kterekoliv strance.
*
* @param changeSetting Udava co bylo zmeneno.
*
* @since 0.1
**/
void signalChangeRWVars (QString varName);
private:
KNutNet* m_upsNet;
KLineEdit *m_lineEditName;
KLineEdit *m_lineEditPassword;
KComboBox *m_rWVarBox;
KComboBox *m_valueVarBox;
KLineEdit *m_valueVarLine;
QGridLayout *m_passLayout;
bool m_upsValueType;
bool m_upsConnectOk;
QString* m_oldUserName;
QString* m_oldUserPassword;
};
#endif

@ -0,0 +1,78 @@
/***************************************************************************
knutupsdata.cpp - description
-------------------
begin : Tue Aug 21 2001
copyright : (C) 2001 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#include "knutupsdata.h"
#include "knutvardata.h"
#include <qstring.h>
KNutUpsData::KNutUpsData() {
// vytvori seznam UPS
m_listRecords.clear();
m_countUpsRecords = 0;
}
KNutUpsData::~KNutUpsData() { m_listRecords.clear(); }
void KNutUpsData::add (const upsRecordDef upsRecord) {
// vlozime ups na konec
m_countUpsRecords++;
m_listRecords.append(upsRecord);
}
void KNutUpsData::put (const int index, const upsRecordDef upsRecord ) {
if ((index > -1 ) && (index < m_countUpsRecords)) {
m_listRecords[index] = (upsRecord);
}
}
void KNutUpsData::get (const int index, upsRecordDef& upsRecord ) {
if ((index > -1 ) && (index < m_countUpsRecords)) upsRecord=m_listRecords[index];
}
QString KNutUpsData::getName (const int index) {
if ((index > -1 ) && (index < m_countUpsRecords)) return m_listRecords[index].name;
else return 0L;
}
void KNutUpsData::deleteName (const int index) {
if ((index > -1 ) && (index < m_countUpsRecords)) {
QValueList<upsRecordDef>::Iterator it = m_listRecords.begin();
for (int i =0; i < index; i++) it++;
m_listRecords.remove(it);
m_countUpsRecords--;
}
}
int KNutUpsData::getCount ( void ) { return m_countUpsRecords; }
KNutUpsData::upsRecordDef* KNutUpsData::findName (const QString name) {
QValueList<upsRecordDef>::Iterator it;
for (it = m_listRecords.begin(); it != m_listRecords.end(); it++) {
if ((*it).name == name) {
return &(*it); // vratime adresu
}
}
return 0l;
}

@ -0,0 +1,161 @@
/***************************************************************************
knutupsdata.h - description
-------------------
begin : Tue Aug 21 2001
copyright : (C) 2001 by Daniel Prynych
email : Daniel@prynych.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef KNUTUPSDATA_H
#define KNUTUPSDATA_H
#include "knutconst.h"
#include "knutanalog.h"
#include <qstring.h>
#include <qvaluelist.h>
class QString;
/**
*@author Daniel Prynych
*/
/**
* Trida obsahuje data o UPS-kach,
* nazev, adresu port, protokol, promenne atd.
* Class includes data about UPSes like name. address, port, protocol, variables ...
*
* @author Daniel Prynych
* @short Information about UPS
* @version 0.4
**/
class KNutUpsData {
public:
struct upsRecordDef { //include information about one UPS
QString name; // name
QString upsName; // name of UPSky <> mojeups
QString upsAddress; // address of UPS <> muj.pc.cz
long delay; // time between read date from UPS
unsigned short port; // port for connecting server
QString userName;
QString password;
bool savePassword; //save password into configuration
int upsVarCode[knc::NumberOfVars];
};
/**
* Konstruktor
*
* @since 0.3
**/
KNutUpsData();
/**
* Destruktor
*
* @since 0.3
**/
~KNutUpsData();
/**
* Adds record
* Prida zaznam.
*
* @param upsRecord are data of record in structure of upsRecordStruct.
* @param upsRecord jsou data zaznamu ve strukture upsRecordStruct.
* @since 0.4
**/
void add (const upsRecordDef upsRecord);
/**
* Rewrites record
* Prepise zaznam.
*
* @param index Describes order number od record.
* @param index Udava poradove cislo zaznamu..
* @param upsRecord are data of record in structure of upsRecordStruct.
* @param upsRecord jsou data zaznamu ve strukture upsRecordStruct.
* @since 0.4
**/
void put (const int index, const upsRecordDef upsRecord );
/**
* Returns record.
* Vrati zaznam.
*
* @param index Describes order number od record.
* @param index Udava poradove cislo zaznamu.
* @param upsRecord are data of record in structure upsRecordStruct.
* @param upsRecord jsou data zaznamu ve strukture upsRecordStruct.
*
* @since 0.4
**/
void get (const int index, upsRecordDef& upsRecord );
/**
* Returns name of record.
* Vrati jmeno zaznamu.
*
* @param index Describes order number od record.
* @param index Udava poradove cislo zaznamu.
* @since 0.3
**/
QString getName (const int index);
/**
* Deletes record;
* Zrusi zaznam.
*
* @param index Describes order number od record.
* @param index Udava poradove cislo zaznamu.
*
* @since 0.3
**/
void deleteName (const int index);
/**
* Returns count of records
* Vrati pocet zaznamu.
*
* @since 0.3
**/
int getCount ( void );
/**
* Returns pointer on record, when record is not existed returns 0
* Vrati ukazatel na zaznam, pokud zaznam neexistuje vrati 0.
*
* @param name Is name of list.
* @param name Je jmeno zaznamu.
* @since 0.3
**/
upsRecordDef* findName (const QString name);
private:
int m_countUpsRecords;
QValueList<upsRecordDef> m_listRecords;
};
#endif

@ -0,0 +1,242 @@
/***************************************************************************
knutvardata.cpp - description
-------------------
begin : Tue Aug 21 2001
copyright : (C) 2001 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#include "knutvardata.h"
#include "knutnet.h"
#include <klocale.h>
#include <kmessagebox.h>
#include <qcolor.h>
//#include <iostream>
const char *nameUpsVars1[] = {
"NONE", "UTILITY", "BATTPCT", "UPSTEMP", "ACFREQ", "LOADPCT", "AMBTEMP", "AMBHUMID","BATTVOLT","OUTVOLT","CURRENT","NONE","BATT_TEMP","BATT_CURRENT"};
const char *nameUpsVars2[] = {
"none", "input.voltage", "battery.charge", "ups.temperature", "input.frequency", "ups.load", "ambient.temperature", "ambient.humidity","battery.voltage","output.voltage","output.current","output.frequency","battery.temperature","battery.current"};
/*
* Nic,Vstupni Napeti,Baterie,Teplota UPSky,
* Vstupni frekvence,Zatizeni,Vnejsi teplota,
* Vnejsi vlhkost,Napeti baterie, Vystupni napeti
* Vystupni proud, Teplota baterie, Proud baterie
*/
KNutVarData::KNutVarData(){
m_upsVarNameAnalog[0] = i18n("None");
m_upsVarNameAnalog[1] = i18n("Input Voltage");
m_upsVarNameAnalog[2] = i18n("Battery Charge");
m_upsVarNameAnalog[3] = i18n("UPS Temperature");
m_upsVarNameAnalog[4] = i18n("Input Frequency");
m_upsVarNameAnalog[5] = i18n("UPS Load");
m_upsVarNameAnalog[6] = i18n("Outside Temperature");
m_upsVarNameAnalog[7] = i18n("Outside Humidity");
m_upsVarNameAnalog[8] = i18n("Battery Voltage");
m_upsVarNameAnalog[9] = i18n("Output Voltage");
m_upsVarNameAnalog[10] = i18n("Output Current");
m_upsVarNameAnalog[11] = i18n("Output Frequency");
m_upsVarNameAnalog[12] = i18n("Battery Temperature");
m_upsVarNameAnalog[13] = i18n("Battery Current");
static const QString upsVarNameUnit[] = {"", "V", "%", "C", "Hz", "%", "C", "%", "V", "V", "A","Hz","C", "A"};
static const int upsVarType[] = {0,3,2,1,1,2,1,1,3,3,2,1,1,2}; //typ panelu
static const int upsVarItem[] = {5,4,5,5,6,6,5,5,5,4,5,6,5,5}; // pocet velkych policek na stupnici
static const int upsVarInItem[] = {0,3,0,0,4,0,0,0,0,3,5,4,0,5}; // pocet malych policek ve velkem policku na stupnici
static const int upsVarStart[] = {0,170,0,-10,20,0,-10,0,0,170,0,20,-10,-15};
static const int upsVarEnd[] = {0,290,100,90,80,120,70,100,10,290,5,80,90,10};
static const int upsVarScaleStart[ knc::NumberOfTypes ][5] = {{0,0,0,0,0},{0,210,0,0,0},{50,0,40,0,0},{-100,50,0,0,0},{0,40,45,0,0},{0,80,100,0,0},{-100,50,0,0,0},{0,0,0,0,0},{0,0,0,0,0},{210,0,250,0,0},{0,0,0,0,0},{0,40,45,0,0},{-100,50,0,0,0},{0,0,0,0,0}};
static const int upsVarScaleEnd[ knc::NumberOfTypes ][5] = {{0,0,0,0,0},{400,250,0,0,0},{120,40,50,0,0},{50,100,0,0,0},{90,60,55,0,0},{80,100,120,0,0},{50,70,0,0,0},{0,0,0,0,0},{0,0,0,0,0},{250,210,400,0,0},{0,0,0,0,0},{90,60,55,0,0},{50,100,0,0,0},{0,0,0,0,0}};
int upsVarScaleColor[ knc::NumberOfTypes ][5] = {{aRegWhite,aRegWhite,aRegWhite,aRegWhite,aRegWhite},
{aRegRed,aRegGreen,aRegWhite,aRegWhite,aRegWhite},
{aRegGreen,aRegRed,aRegYellow,aRegWhite,aRegWhite},
{aRegGreen,aRegRed,aRegWhite,aRegWhite,aRegWhite},
{aRegRed,aRegYellow,aRegGreen,aRegWhite,aRegWhite},
{aRegGreen,aRegYellow,aRegRed,aRegWhite,aRegWhite},
{aRegGreen,aRegRed,aRegWhite,aRegWhite,aRegWhite},
{aRegWhite,aRegWhite,aRegWhite,aRegWhite,aRegWhite},
{aRegGreen,aRegRed,aRegRed,aRegWhite,aRegWhite},
{aRegGreen,aRegRed,aRegRed,aRegWhite,aRegWhite},
{aRegWhite,aRegWhite,aRegWhite,aRegWhite,aRegWhite},
{aRegRed,aRegYellow,aRegGreen,aRegWhite,aRegWhite},
{aRegGreen,aRegRed,aRegWhite,aRegWhite,aRegWhite},
{aRegWhite,aRegWhite,aRegWhite,aRegWhite,aRegWhite}};
for (int i=0;i < knc::NumberOfTypes; i++) {
m_dataVar[i].nameAnalog = m_upsVarNameAnalog[i];
m_dataVar[i].nameUnit = upsVarNameUnit[i];
m_dataVar[i].typeAnalog = upsVarType[i];
m_dataVar[i].numberItem = upsVarItem[i];
m_dataVar[i].numberInItem = upsVarInItem[i];
m_dataVar[i].start = upsVarStart[i];
m_dataVar[i].end = upsVarEnd[i];
for (int j=0; j< 5; j++) {
m_dataVar[i].scaleStruct[j].start=upsVarScaleStart[i][j];
m_dataVar[i].scaleStruct[j].end=upsVarScaleEnd[i][j];
m_dataVar[i].scaleStruct[j].scaleColor=upsVarScaleColor[i][j];
}
}
m_dataVarVoltage[U230V]=m_dataVar[knc::VarUtility];
m_dataVarVoltage[U120V]=m_dataVar[knc::VarUtility];
m_dataVarVoltage[U120V].start=90;
m_dataVarVoltage[U120V].end=150;
m_dataVarVoltage[U120V].scaleStruct[0].start=0;
m_dataVarVoltage[U120V].scaleStruct[1].start=110;
m_dataVarVoltage[U120V].scaleStruct[0].end=200;
m_dataVarVoltage[U120V].scaleStruct[1].end=130;
m_dataVarFrequence[F50HZ]=m_dataVar[knc::VarAcfreq];
m_dataVarFrequence[F60HZ]=m_dataVar[knc::VarAcfreq];
m_dataVarFrequence[F60HZ].start=30;
m_dataVarFrequence[F60HZ].end=90;
m_dataVarFrequence[F60HZ].scaleStruct[0].start=0;
m_dataVarFrequence[F60HZ].scaleStruct[1].start=50;
m_dataVarFrequence[F60HZ].scaleStruct[2].start=55;
m_dataVarFrequence[F60HZ].scaleStruct[0].end=100;
m_dataVarFrequence[F60HZ].scaleStruct[1].end=70;
m_dataVarFrequence[F60HZ].scaleStruct[2].end=65;
}
KNutVarData::~KNutVarData(){
}
KNutVarData::VarStrucDef KNutVarData::getData (const int seqNumber) const {
int i = seqNumber;
if (i < 1) i = 1;
else {if (i > (knc::NumberOfTypes-1)) i = knc::NumberOfTypes - 1;};
return m_dataVar[i];
}
QString KNutVarData::getNameAnalogData (const int seqNumber) {
if ((seqNumber >= 0) && (seqNumber < knc::NumberOfTypes))
return m_upsVarNameAnalog[seqNumber];
else
return "";
}
void KNutVarData::putData (const int seqNumber, VarStrucDef& varStruc) {
if (seqNumber > 0 && seqNumber < knc::NumberOfTypes) m_dataVar[seqNumber] = varStruc;
}
void KNutVarData::setVoltage (const int typeVoltage) {
if (typeVoltage == 230) {
m_dataVar[knc::VarUtility] = m_dataVarVoltage[U230V];
m_dataVar[knc::VarOutVolt] = m_dataVarVoltage[U230V];
// m_dataVar[knc::VarOutVolt].nameAnalog = upsVarNameAnalog[knc::VarOutVolt]; // je nutno nastavit nazev
}
if (typeVoltage == 120) {
m_dataVar[knc::VarUtility] = m_dataVarVoltage[U120V];
m_dataVar[knc::VarOutVolt] = m_dataVarVoltage[U120V];
// dataVar[knc::VarOutVolt].nameAnalog = upsVarNameAnalog[knc::VarOutVolt]; // je nutno nastavit nazev
}
m_dataVar[knc::VarOutVolt].nameAnalog = m_upsVarNameAnalog[knc::VarOutVolt]; // je nutno nastavit nazev
}
void KNutVarData::setFrequency (const int typeFrequence) {
if (typeFrequence == 50) {
m_dataVar[knc::VarAcfreq] = m_dataVarFrequence[F50HZ];
m_dataVar[knc::VarOutFreq] = m_dataVarFrequence[F50HZ];
}
if (typeFrequence == 60) {
m_dataVar[knc::VarAcfreq] = m_dataVarFrequence[F60HZ];
m_dataVar[knc::VarOutFreq] = m_dataVarFrequence[F60HZ];
}
m_dataVar[knc::VarOutFreq].nameAnalog = m_upsVarNameAnalog[knc::VarOutFreq]; // je nutno nastavit nazev
}
void KNutVarData::setXfer (const float lowXfer, const float highXfer) {
m_dataVar[knc::VarUtility].scaleStruct[1].start=(int)lowXfer;
m_dataVar[knc::VarUtility].scaleStruct[1].end=(int)highXfer;
m_dataVar[knc::VarOutVolt].scaleStruct[1].start=(int)lowXfer;
m_dataVar[knc::VarOutVolt].scaleStruct[1].end=(int)highXfer;
}
const QString KNutVarData::errorToText (const int error) {
switch (error) {
// knutclient error
case KNutNet::LowMem: return i18n("No memory.");
case KNutNet::NullAddress: return i18n("No address.");
case KNutNet::NoSuchHost: return i18n("Unknown address.");
case KNutNet::SocketReadErr: // socket
case KNutNet::ConnectErr: // connect
return i18n("Error of connection.");
case KNutNet::CantConnect:
return i18n("No connection with server.");
case KNutNet::NutProtocolVarErr: return i18n("Server-client protocol or variables of NUT are unknown.");
case KNutNet::NoUpsHere: return i18n("No UPS on this address.");
case KNutNet::ConnectionRefused: return i18n("Connection was refused by server.");
case KNutNet::SendErr: return i18n("Server doesn't receive data.");
case KNutNet::RecvErr: return i18n("Server doesn't send data.");
case KNutNet::NoServerData: return i18n("Server doesn't answer.");
case KNutNet::UnknownFormat: return i18n("Server returns data with unknown format.");
case KNutNet::UnknownAnswer: return i18n("Server returns unknown data.");
case KNutNet::UnknownFormatVer: return i18n("Command VER returns data with unknown format.");
case KNutNet::NoData: return i18n("No data.");
case KNutNet::NotConnection: return i18n("Connection doesn't exist.");
// server error
case KNutNet::AccessDenied: return i18n("Access denied. Failed password ?");
case KNutNet::DataStale: return i18n("UPS doesn't sent data to server (Data Stale).");
case KNutNet::UnknownCommand: return i18n("Server doesn't know this command.");
// driver error
case KNutNet::DriverNotConnected: return i18n("UPS's driver isn't connected.");
case KNutNet::PasswordRequired: return i18n("Server required password.");
case KNutNet::PasswordIncorrect: return i18n("Incorrect password.");
case KNutNet::NoResponse: return i18n("UPS doesn't response.");
case KNutNet::CommandFailed: return i18n("Command failed.");
case KNutNet::UnknownInstCmd: return i18n("UPS doesn't know this instant command.");
case KNutNet::CmdNotSupported: return i18n("UPS doesn't support this instant command.");
case KNutNet::VarUnknown: return i18n("UPS doesn't known this variable.");
case KNutNet::VarNotSupported: return i18n("UPS doesn't support this variable.");
case KNutNet::InvalidValue: return i18n("UPS doesn't support this value in this variable.");
case KNutNet::UnknownUps: return i18n("Name of UPS is unknown.");
case KNutNet::AlreadySetUsername: return i18n("Username has been already entered.");
case KNutNet::AlreadySetPassword: return i18n("Password has been already entered.");
case KNutNet::NoListVars: return i18n("Server doesn't send list of variables.");
//default
default: return i18n("Unknown error.");
}
}
void KNutVarData::showError (const int error) {
KMessageBox::sorry (0,errorToText(error));
}

@ -0,0 +1,261 @@
/***************************************************************************
knutvardata.h - description
-------------------
begin : Tue Aug 21 2001
copyright : (C) 2001 by Daniel Prynych
email : Daniel@prynych.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef KNUTVARDATA_H
#define KNUTVARDATA_H
/*******************************/
/* GLOBAL DEFINE */
/*******************************/
#define DEFAULT_BG_COLOR Qt::lightGray
#define DEFAULT_FINGER_COLOR Qt::black
#define DEFAULT_OK_COLOR Qt::green
#define DEFAULT_WARNNING_COLOR Qt::yellow
#define DEFAULT_ERROR_COLOR Qt::red
#define DEFAULT_SCALE_COLOR Qt::black
#define DEFAULT_FONT_COLOR Qt::black
#define DEFAULT_KICON_COLOR Qt::white
#include <klocale.h>
#include "knutnet.h"
#include "knutupsdata.h"
#include "knutconst.h"
#include <qcolor.h>
#include <qfont.h>
#include <qstring.h>
// const char *nameUpsVars1[] = {
// "NONE", "UTILITY", "BATTPCT", "UPSTEMP", "ACFREQ", "LOADPCT", "AMBTEMP", "AMBHUMID","BATTVOLT","OUTVOLT","CURRENT","BATT_TEMP","BATT_CURRENT"};
// const char *nameUpsVars2[] = {
// "none", "input.voltage", "battery.charge", "ups.temperature", "input.frequency", "ups.load", "ambient.temperature", "ambient.humidity","battery.voltage","output.voltage","output.current","battery.temperature","battery.current"};
/**
*@author Daniel Prynych
*/
/**
* Class contain data about analog panels,
* name, ..
* Describes view of panel.
* Trida obsahuje data o analogovych panelech,
* nazev, atd.
* Popisuje jak ma prislusny panel vypadat
*
* @author Daniel Prynych
* @short Information about analog panels
* @version 0.4
**/
class QString;
class QColor;
class QFont;
class KNutVarData {
public:
enum mainWindowStartVariant{
mw_yes=0,
mw_no,
mw_auto
};
struct ScaleStructDef {
int start;
int end;
int scaleColor;
};
struct SettingDataDef {
int countCols;
int x;
int y;
int width;
int height;
QColor mainBackgroundColor;
QColor mPanelBackgroundColor;
QColor aPanelBackgroundColor;
QColor analogFingerColor;
QColor analogOKColor;
QColor analogWarnningColor;
QColor analogErrorColor;
QColor analogScaleColor;
QColor analogFontColor;
unsigned int panelFlags;
int inputVoltage;
int inputFrequency;
bool lowHighXfer;
bool areYouSure;
mainWindowStartVariant useMainWindow;
int useMessageWindow;
bool customBColor;
bool customBPanelColor;
bool customBAnalogColor;
bool customOAnalogColor;
QFont mPanelFont; // main panel font
QFont aPanelFont; // analog panel font
QFont systemFont; // system font
bool customFont; // use custom font
bool useDescription;
unsigned int toolTipFlags;
bool customKIconColor;
QColor kIconBackgroundColor;
int typeOfKIcon;
int typeDigitalProcessing;
bool activatedMainWindow;
};
struct upsInfoDef{ //include generally informations about active (selected) UPS
KNutNet *upsNet; // pointer to instance of KNutNet
KNutUpsData::upsRecordDef record; // include information about information of ups (name, address, login, password ...)
int netError; // kod chyby pri spojeni // kode if error of conection
bool errorUpsData;
// state of connection to usbd, this isn't state of knutnet
knc::upsDriverConnection upsDriverState; // defined in knutconst.h
int oldState; // code of lost state of UPS kod posledniho stavu UPS
QString name;
QString password;
int nutVariables;
int nutProtocol;
QString runtimeVar;
QString lowxferVar;
QString highxferVar;
QString statusVar;
QString upsLoadVar;
bool reconnecting; // is true when program is in reconnecting stage
int reconnectCount;
};
struct VarStrucDef {
QString nameAnalog; // jmeno promene v meraku napr. UPS Load
QString nameUnit; // merna jednotka napr %
int typeAnalog; //typ meraku
int numberItem; //pocet casti stupnice neni v souvislosti barvou
int numberInItem; //pocet casti stupnice uvnitr dilku stupnice
int start; // pocatecni hodnota v meraku
int end; // konecna hodnota v meraku
struct ScaleStructDef scaleStruct[5];
};
KNutVarData();
~KNutVarData();
/**
* Gets data of analog measure panel, type of measure panel,
* Vrati data analogoveho mericiho panelu.
* typ meraku, pocet dilku stupnice, merici jedntotku atd
* data je mozno take nastavovat
* @param seqNumber Kod typu meraky.
* @return Data pro zadany typ panelu.
* @since 0.1
**/
VarStrucDef getData (const int seqNumber) const;
/**
* Puts data of analog measure panel
* Nastavi data analogoveho mericiho panelu.
*
* @param seqNumber Kod typu meraky.
* @param data Data pro zadany typ panelu.
*
* @since 0.1
**/
void putData (const int seqNumber, VarStrucDef& varStruc);
/**
* Sets data of analog measure panel for input and output voltage
* Nastavi data analogoveho mericiho panelu pro vstupni a vystupni napeti.
*
* @param typeVoltage Typ vstupniho napeti 230/120.
*
* @since 0.1
**/
void setVoltage (const int typeVoltage);
/**
* Sets data of analog measure panel for input frequence
* Nastavi data analogoveho mericiho panelu pro vstupni frekvence.
*
* @param typeFrequence Typ vstupni frekvence 50/60.
*
* @since 0.1
**/
void setFrequency (const int typeFrequence);
/**
* Nastavi vnitrni cast vybarveni podle low/high xfer,
* low/high-XFER udava rozpeti pri kterem UPS zpracovava napeti ze site.
*
* @param lowXfer Pocatecni hodnota.
* @param highXfer Konecna hodnota.
* @since 0.1
**/
void setXfer (const float lowXfer, const float highXfer);
/**
* Vrati dlouhy nazev analogoveho panelu,
* je to jmeno merene veliciny
*
* @param seqNumber Kod typu merakuss.
* @since 0.1
**/
QString getNameAnalogData (const int seqNumber);
/**
* Prevede kod chyby na jeho textovou reprezentaci
*
* @since 0.2
**/
static const QString errorToText (const int error);
/**
* Zobrazi jmeno chyby na zaklade jeho cisla.
*
* @since 0.1.2
**/
static void showError (const int error);
private:
enum {aRegWhite,aRegGreen,aRegYellow,aRegRed,aRegBlue,aRegCyan,aRegMagenta,aRegBlack};
VarStrucDef m_dataVar[ knc::NumberOfTypes ]; /* udrzuje popis Anagovych meraku pro danou promenou jmeno zabarveni typ meraky */
VarStrucDef m_dataVarVoltage[2];
VarStrucDef m_dataVarFrequence[2];
static const int U230V = 0;
static const int U120V = 1;
static const int F50HZ = 0;
static const int F60HZ = 1;
QString m_upsVarNameAnalog[ knc::NumberOfTypes ];//array of strings - includes name of analog meters
};
#endif

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,78 @@
/***************************************************************************
main.cpp - description
-------------------
begin : Út srp 21 19:12:20 CEST 2001
copyright : (C) 2001 by Daniel Prynych
email : Daniel.Prynych@alo.cz
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#include <kcmdlineargs.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <klocale.h>
#include <kapp.h>
#include <kuniqueapplication.h>
#include "knutclient.h"
#include <stdio.h>
#include <stdlib.h>
static const char *description =
I18N_NOOP("Client for Network UPS Tool");
// INSERT A DESCRIPTION FOR YOUR APPLICATION HERE
static KCmdLineOptions options[] =
{
{"nodock",I18N_NOOP("Don't dock in Kicker"),0},
{ 0, 0, 0 }
// INSERT YOUR COMMANDLINE OPTIONS HERE
};
int main(int argc, char *argv[])
{
KAboutData aboutData( "knutclient", I18N_NOOP("KNutClient"),
VERSION, description, KAboutData::License_GPL,
"(c) 2002 - 2009 Daniel Prynych", "Zajecov, Czech Republic", 0, "Daniel@prynych.cz");
aboutData.addAuthor("Daniel Prynych",0, "Daniel@prynych.cz","http://www.knut.noveradsl.cz/knutclient/");
aboutData.addCredit("Arnaud Quette",0,"arnaud.quette@free.fr","http://www.networkupstools.org/");
aboutData.addCredit("MGE",0,0,"http://opensource.mgeups.com");
KCmdLineArgs::init( argc, argv, &aboutData );
KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
KUniqueApplication::addCmdLineOptions();
KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
bool noDock = args->isSet("dock");
args->clear();
// main KUApp this is remark
if (!KUniqueApplication::start()) {
fprintf(stderr,"Sorry : KNutClient is already running!\n");
exit(0);
}
KUniqueApplication a;
// next line is for testing only.
// I don't debug KUniqueApplication
// KApplication a;
//
KNutClient *knutclient = new KNutClient(!noDock);
int returnCode = a.exec();
delete knutclient;
return returnCode;
}
Loading…
Cancel
Save