summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-19 18:17:02 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-19 18:17:02 +0000
commitf867212c1762e156553d039319b904a17f7b563d (patch)
tree461c1a743b3ff8291e03360742dbbfb4cc0087e4
downloadknutclient-f867212c.tar.gz
knutclient-f867212c.zip
Added KDE3 version of knutclient
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/knutclient@1092914 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rwxr-xr-xAUTHORS4
-rwxr-xr-xCOPYING340
-rwxr-xr-xChangeLog129
-rwxr-xr-xINSTALL167
-rw-r--r--Makefile.am24
-rw-r--r--Makefile.cvs10
-rw-r--r--NEWS0
-rwxr-xr-xREADME1
-rwxr-xr-xTODO0
-rw-r--r--acinclude.m411862
-rw-r--r--config.guess1561
-rwxr-xr-xconfig.h.in244
-rw-r--r--config.log361
-rw-r--r--config.sub1686
-rw-r--r--configure.files2
-rw-r--r--configure.in126
-rwxr-xr-xconfigure.in.in6
-rwxr-xr-xdoc/Makefile.am6
-rwxr-xr-xdoc/cs/Makefile.am2
-rwxr-xr-xdoc/cs/asetting-cs.pngbin0 -> 22228 bytes
-rwxr-xr-xdoc/cs/fsetting-cs.pngbin0 -> 23450 bytes
-rwxr-xr-xdoc/cs/index.docbook1332
-rwxr-xr-xdoc/cs/knutclient-cs.pngbin0 -> 42103 bytes
-rw-r--r--doc/cs/ksetting-cs.pngbin0 -> 21873 bytes
-rw-r--r--doc/cs/mkicker-cs.pngbin0 -> 33881 bytes
-rwxr-xr-xdoc/cs/msetting-cs.pngbin0 -> 22388 bytes
-rwxr-xr-xdoc/cs/new-cs.pngbin0 -> 14626 bytes
-rwxr-xr-xdoc/cs/psetting-cs.pngbin0 -> 21681 bytes
-rw-r--r--doc/cs/tkicker-cs.pngbin0 -> 11405 bytes
-rwxr-xr-xdoc/cs/usetting-cs.pngbin0 -> 17963 bytes
-rw-r--r--doc/cs/variables-cs.pngbin0 -> 18185 bytes
-rwxr-xr-xdoc/en/Makefile.am2
-rwxr-xr-xdoc/en/asetting-en.pngbin0 -> 21098 bytes
-rwxr-xr-xdoc/en/fsetting-en.pngbin0 -> 22067 bytes
-rwxr-xr-xdoc/en/index.docbook1288
-rwxr-xr-xdoc/en/knutclient-en.pngbin0 -> 41328 bytes
-rw-r--r--doc/en/ksetting-en.pngbin0 -> 21169 bytes
-rw-r--r--doc/en/mkicker-en.pngbin0 -> 38389 bytes
-rwxr-xr-xdoc/en/msetting-en.pngbin0 -> 21737 bytes
-rwxr-xr-xdoc/en/new-en.pngbin0 -> 14297 bytes
-rwxr-xr-xdoc/en/psetting-en.pngbin0 -> 21043 bytes
-rw-r--r--doc/en/tkicker-en.pngbin0 -> 13544 bytes
-rwxr-xr-xdoc/en/usetting-en.pngbin0 -> 17076 bytes
-rw-r--r--doc/en/variables-en.pngbin0 -> 18492 bytes
-rwxr-xr-xinstallDeb.sh9
-rwxr-xr-xinstallFedora.sh9
-rwxr-xr-xinstallMandriva.sh9
-rwxr-xr-xinstallMandriva4.sh13
-rw-r--r--pics/Makefile.am8
-rw-r--r--pics/knc_analog.pngbin0 -> 1495 bytes
-rw-r--r--pics/knc_batt.pngbin0 -> 263 bytes
-rw-r--r--pics/knc_conn.pngbin0 -> 865 bytes
-rw-r--r--pics/knc_dock.pngbin0 -> 704 bytes
-rw-r--r--pics/knc_error.pngbin0 -> 521 bytes
-rw-r--r--pics/knc_main.pngbin0 -> 731 bytes
-rw-r--r--pics/knc_mpref.pngbin0 -> 1333 bytes
-rw-r--r--pics/knc_mset.pngbin0 -> 1599 bytes
-rw-r--r--pics/knc_panel.pngbin0 -> 1344 bytes
-rw-r--r--pics/knc_ups.pngbin0 -> 529 bytes
-rw-r--r--pics/knc_upses.pngbin0 -> 943 bytes
-rw-r--r--po/Makefile.am3
-rw-r--r--po/cs.po837
-rw-r--r--po/de.po842
-rw-r--r--po/es.po1029
-rw-r--r--po/fr.po858
-rw-r--r--po/it.po864
-rw-r--r--po/knutclient.pot836
-rw-r--r--po/pl.po837
-rw-r--r--po/pt_BR.po843
-rw-r--r--po/ru.po917
-rw-r--r--po/uk.po918
-rw-r--r--specs/Makefile.am6
-rw-r--r--specs/knutclient.spec.fedora.1058
-rw-r--r--specs/knutclient.spec.fedora.556
-rw-r--r--specs/knutclient.spec.fedora.860
-rw-r--r--specs/knutclient.spec.fedora.960
-rw-r--r--specs/knutclient.spec.mandrake.10.1100
-rw-r--r--specs/knutclient.spec.mandriva.2006111
-rwxr-xr-xspecs/knutclient.spec.mandriva.2009124
-rw-r--r--src/Makefile.am41
-rw-r--r--src/hi16-app-knutclient.pngbin0 -> 313 bytes
-rwxr-xr-xsrc/hi16-app-knutclientconn.pngbin0 -> 865 bytes
-rw-r--r--src/hi16-app-knutclienterr.pngbin0 -> 521 bytes
-rw-r--r--src/hi32-app-knutclient.pngbin0 -> 523 bytes
-rw-r--r--src/hi48-app-knutclient.pngbin0 -> 962 bytes
-rw-r--r--src/knutanalog.cpp911
-rw-r--r--src/knutanalog.h452
-rwxr-xr-xsrc/knutclient.cpp1237
-rw-r--r--src/knutclient.desktop20
-rwxr-xr-xsrc/knutclient.h210
-rw-r--r--src/knutclientui.rc24
-rwxr-xr-xsrc/knutconst.h58
-rwxr-xr-xsrc/knutdock.cpp976
-rwxr-xr-xsrc/knutdock.h525
-rwxr-xr-xsrc/knutfrontpanel.cpp676
-rwxr-xr-xsrc/knutfrontpanel.h333
-rwxr-xr-xsrc/knutinstcomms.cpp137
-rwxr-xr-xsrc/knutinstcomms.h97
-rw-r--r--src/knutmainwindow.cpp813
-rw-r--r--src/knutmainwindow.h346
-rw-r--r--src/knutmessage.cpp95
-rw-r--r--src/knutmessage.h126
-rw-r--r--src/knutmessagemanager.cpp121
-rw-r--r--src/knutmessagemanager.h131
-rwxr-xr-xsrc/knutnet.cpp1941
-rwxr-xr-xsrc/knutnet.h869
-rw-r--r--src/knutnewupsdlg.cpp294
-rw-r--r--src/knutnewupsdlg.h160
-rw-r--r--src/knutpanelmeter.cpp353
-rw-r--r--src/knutpanelmeter.h210
-rw-r--r--src/knutprefdlg.cpp979
-rw-r--r--src/knutprefdlg.h359
-rw-r--r--src/knutprintupsvar.cpp210
-rwxr-xr-xsrc/knutprintupsvar.h160
-rwxr-xr-xsrc/knutrwvar.cpp217
-rwxr-xr-xsrc/knutrwvar.h140
-rw-r--r--src/knutupsdata.cpp78
-rw-r--r--src/knutupsdata.h161
-rwxr-xr-xsrc/knutvardata.cpp242
-rwxr-xr-xsrc/knutvardata.h261
-rw-r--r--src/lo16-app-knutclient.pngbin0 -> 167 bytes
-rw-r--r--src/lo16-app-knutclientconn.pngbin0 -> 648 bytes
-rw-r--r--src/lo16-app-knutclienterr.pngbin0 -> 262 bytes
-rw-r--r--src/lo32-app-knutclient.pngbin0 -> 330 bytes
-rw-r--r--src/main.cpp78
-rwxr-xr-xstamp-h.in0
126 files changed, 42601 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100755
index 0000000..93a78fa
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,4 @@
+Daniel Prynych
+<Daniel@prynych.cz>
+<Daniel.Prynych@buzuluk.cz>
+
diff --git a/COPYING b/COPYING
new file mode 100755
index 0000000..c13faf0
--- /dev/null
+++ b/COPYING
@@ -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.
diff --git a/ChangeLog b/ChangeLog
new file mode 100755
index 0000000..8956f4b
--- /dev/null
+++ b/ChangeLog
@@ -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.
+
+
+
+
diff --git a/INSTALL b/INSTALL
new file mode 100755
index 0000000..02a4a07
--- /dev/null
+++ b/INSTALL
@@ -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.
+
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..195d5b6
--- /dev/null
+++ b/Makefile.am
@@ -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
diff --git a/Makefile.cvs b/Makefile.cvs
new file mode 100644
index 0000000..4c0afd1
--- /dev/null
+++ b/Makefile.cvs
@@ -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:
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/NEWS
diff --git a/README b/README
new file mode 100755
index 0000000..3051dc1
--- /dev/null
+++ b/README
@@ -0,0 +1 @@
+Knutclient is GUI client for UPS system NUT. \ No newline at end of file
diff --git a/TODO b/TODO
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/TODO
diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644
index 0000000..094ebf5
--- /dev/null
+++ b/acinclude.m4
@@ -0,0 +1,11862 @@
+## -*- autoconf -*-
+
+dnl This file is part of the KDE libraries/packages
+dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
+dnl (C) 1997,98,99 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.
+
+dnl IMPORTANT NOTE:
+dnl Please do not modify this file unless you expect your modifications to be
+dnl carried into every other module in the repository.
+dnl
+dnl Single-module modifications are best placed in configure.in for kdelibs
+dnl and kdebase or configure.in.in if present.
+
+# KDE_PATH_X_DIRECT
+dnl Internal subroutine of AC_PATH_X.
+dnl Set ac_x_includes and/or ac_x_libraries.
+AC_DEFUN([KDE_PATH_X_DIRECT],
+[
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+if test "$ac_x_includes" = NO; then
+ # Guess where to find include files, by looking for this one X11 .h file.
+ test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
+
+ # First, try using that file with no special directory specified.
+AC_TRY_CPP([#include <$x_direct_test_include>],
+[# We can compile using X headers with no special include directory.
+ac_x_includes=],
+[# Look for the header file in a standard set of common directories.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ for ac_dir in \
+ /usr/X11/include \
+ /usr/X11R6/include \
+ /usr/X11R5/include \
+ /usr/X11R4/include \
+ \
+ /usr/include/X11 \
+ /usr/include/X11R6 \
+ /usr/include/X11R5 \
+ /usr/include/X11R4 \
+ \
+ /usr/local/X11/include \
+ /usr/local/X11R6/include \
+ /usr/local/X11R5/include \
+ /usr/local/X11R4/include \
+ \
+ /usr/local/include/X11 \
+ /usr/local/include/X11R6 \
+ /usr/local/include/X11R5 \
+ /usr/local/include/X11R4 \
+ \
+ /usr/X386/include \
+ /usr/x386/include \
+ /usr/XFree86/include/X11 \
+ \
+ /usr/include \
+ /usr/local/include \
+ /usr/unsupported/include \
+ /usr/athena/include \
+ /usr/local/x11r5/include \
+ /usr/lpp/Xamples/include \
+ \
+ /usr/openwin/include \
+ /usr/openwin/share/include \
+ ; \
+ do
+ if test -r "$ac_dir/$x_direct_test_include"; then
+ ac_x_includes=$ac_dir
+ break
+ fi
+ done])
+fi # $ac_x_includes = NO
+
+if test "$ac_x_libraries" = NO; then
+ # Check for the libraries.
+
+ test -z "$x_direct_test_library" && x_direct_test_library=Xt
+ test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
+
+ # See if we find them without any special options.
+ # Don't add to $LIBS permanently.
+ ac_save_LIBS="$LIBS"
+ LIBS="-l$x_direct_test_library $LIBS"
+AC_TRY_LINK([#include <X11/Intrinsic.h>], [${x_direct_test_function}(1)],
+[LIBS="$ac_save_LIBS"
+# We can link X programs with no special library path.
+ac_x_libraries=],
+[LIBS="$ac_save_LIBS"
+# First see if replacing the include by lib works.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${kdelibsuff}/` \
+ /usr/X11/lib${kdelibsuff} \
+ /usr/X11R6/lib${kdelibsuff} \
+ /usr/X11R5/lib${kdelibsuff} \
+ /usr/X11R4/lib${kdelibsuff} \
+ \
+ /usr/lib${kdelibsuff}/X11 \
+ /usr/lib${kdelibsuff}/X11R6 \
+ /usr/lib${kdelibsuff}/X11R5 \
+ /usr/lib${kdelibsuff}/X11R4 \
+ \
+ /usr/local/X11/lib${kdelibsuff} \
+ /usr/local/X11R6/lib${kdelibsuff} \
+ /usr/local/X11R5/lib${kdelibsuff} \
+ /usr/local/X11R4/lib${kdelibsuff} \
+ \
+ /usr/local/lib${kdelibsuff}/X11 \
+ /usr/local/lib${kdelibsuff}/X11R6 \
+ /usr/local/lib${kdelibsuff}/X11R5 \
+ /usr/local/lib${kdelibsuff}/X11R4 \
+ \
+ /usr/X386/lib${kdelibsuff} \
+ /usr/x386/lib${kdelibsuff} \
+ /usr/XFree86/lib${kdelibsuff}/X11 \
+ \
+ /usr/lib${kdelibsuff} \
+ /usr/local/lib${kdelibsuff} \
+ /usr/unsupported/lib${kdelibsuff} \
+ /usr/athena/lib${kdelibsuff} \
+ /usr/local/x11r5/lib${kdelibsuff} \
+ /usr/lpp/Xamples/lib${kdelibsuff} \
+ /lib/usr/lib${kdelibsuff}/X11 \
+ \
+ /usr/openwin/lib${kdelibsuff} \
+ /usr/openwin/share/lib${kdelibsuff} \
+ ; \
+do
+dnl Don't even attempt the hair of trying to link an X program!
+ for ac_extension in a so sl; do
+ if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
+ ac_x_libraries=$ac_dir
+ break 2
+ fi
+ done
+done])
+fi # $ac_x_libraries = NO
+])
+
+
+dnl ------------------------------------------------------------------------
+dnl Find a file (or one of more files in a list of dirs)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_FIND_FILE],
+[
+$3=NO
+for i in $2;
+do
+ for j in $1;
+ do
+ echo "configure: __oline__: $i/$j" >&AC_FD_CC
+ if test -r "$i/$j"; then
+ echo "taking that" >&AC_FD_CC
+ $3=$i
+ break 2
+ fi
+ done
+done
+])
+
+dnl KDE_FIND_PATH(program-name, variable-name, list-of-dirs,
+dnl if-not-found, test-parameter, prepend-path)
+dnl
+dnl Look for program-name in list-of-dirs+$PATH.
+dnl If prepend-path is set, look in $PATH+list-of-dirs instead.
+dnl If found, $variable-name is set. If not, if-not-found is evaluated.
+dnl test-parameter: if set, the program is executed with this arg,
+dnl and only a successful exit code is required.
+AC_DEFUN([KDE_FIND_PATH],
+[
+ AC_MSG_CHECKING([for $1])
+ if test -n "$$2"; then
+ kde_cv_path="$$2";
+ else
+ kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
+
+ AC_CACHE_VAL(kde_cv_path_$kde_cache,
+ [
+ kde_cv_path="NONE"
+ kde_save_IFS=$IFS
+ IFS=':'
+ dirs=""
+ for dir in $PATH; do
+ dirs="$dirs $dir"
+ done
+ if test -z "$6"; then dnl Append dirs in PATH (default)
+ dirs="$3 $dirs"
+ else dnl Prepend dirs in PATH (if 6th arg is set)
+ dirs="$dirs $3"
+ fi
+ IFS=$kde_save_IFS
+
+ for dir in $dirs; do
+ if test -x "$dir/$1"; then
+ if test -n "$5"
+ then
+ evalstr="$dir/$1 $5 2>&1 "
+ if eval $evalstr; then
+ kde_cv_path="$dir/$1"
+ break
+ fi
+ else
+ kde_cv_path="$dir/$1"
+ break
+ fi
+ fi
+ done
+
+ eval "kde_cv_path_$kde_cache=$kde_cv_path"
+
+ ])
+
+ eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
+
+ fi
+
+ if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
+ AC_MSG_RESULT(not found)
+ $4
+ else
+ AC_MSG_RESULT($kde_cv_path)
+ $2=$kde_cv_path
+
+ fi
+])
+
+AC_DEFUN([KDE_MOC_ERROR_MESSAGE],
+[
+ AC_MSG_ERROR([No Qt meta object compiler (moc) found!
+Please check whether you installed Qt correctly.
+You need to have a running moc binary.
+configure tried to run $ac_cv_path_moc and the test didn't
+succeed. If configure shouldn't have tried this one, set
+the environment variable MOC to the right one before running
+configure.
+])
+])
+
+AC_DEFUN([KDE_UIC_ERROR_MESSAGE],
+[
+ AC_MSG_WARN([No Qt ui compiler (uic) found!
+Please check whether you installed Qt correctly.
+You need to have a running uic binary.
+configure tried to run $ac_cv_path_uic and the test didn't
+succeed. If configure shouldn't have tried this one, set
+the environment variable UIC to the right one before running
+configure.
+])
+])
+
+
+AC_DEFUN([KDE_CHECK_UIC_FLAG],
+[
+ AC_MSG_CHECKING([whether uic supports -$1 ])
+ kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
+ AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
+ [
+ cat >conftest.ui <<EOT
+ <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
+EOT
+ ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
+ if AC_TRY_EVAL(ac_uic_testrun); then
+ eval "kde_cv_prog_uic_$kde_cache=yes"
+ else
+ eval "kde_cv_prog_uic_$kde_cache=no"
+ fi
+ rm -f conftest*
+ ])
+
+ if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
+ AC_MSG_RESULT([yes])
+ :
+ $3
+ else
+ AC_MSG_RESULT([no])
+ :
+ $4
+ fi
+])
+
+
+dnl ------------------------------------------------------------------------
+dnl Find the meta object compiler and the ui compiler in the PATH,
+dnl in $QTDIR/bin, and some more usual places
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_PATH_QT_MOC_UIC],
+[
+ AC_REQUIRE([KDE_CHECK_PERL])
+ qt_bindirs=""
+ for dir in $kde_qt_dirs; do
+ qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
+ done
+ qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
+ if test ! "$ac_qt_bindir" = "NO"; then
+ qt_bindirs="$ac_qt_bindir $qt_bindirs"
+ fi
+
+ KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
+ if test -z "$UIC_NOT_NEEDED"; then
+ KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
+ if test -z "$UIC_PATH" ; then
+ KDE_UIC_ERROR_MESSAGE
+ exit 1
+ else
+ UIC=$UIC_PATH
+
+ if test $kde_qtver = 3; then
+ KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
+ KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
+
+ if test x$ac_uic_supports_libpath = xyes; then
+ UIC="$UIC -L \$(kde_widgetdir)"
+ fi
+ if test x$ac_uic_supports_nounload = xyes; then
+ UIC="$UIC -nounload"
+ fi
+ fi
+ fi
+ else
+ UIC="echo uic not available: "
+ fi
+
+ AC_SUBST(MOC)
+ AC_SUBST(UIC)
+
+ UIC_TR="i18n"
+ if test $kde_qtver = 3; then
+ UIC_TR="tr2i18n"
+ fi
+
+ AC_SUBST(UIC_TR)
+])
+
+AC_DEFUN([KDE_1_CHECK_PATHS],
+[
+ KDE_1_CHECK_PATH_HEADERS
+
+ KDE_TEST_RPATH=
+
+ if test -n "$USE_RPATH"; then
+
+ if test -n "$kde_libraries"; then
+ KDE_TEST_RPATH="-R $kde_libraries"
+ fi
+
+ if test -n "$qt_libraries"; then
+ KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
+ fi
+
+ if test -n "$x_libraries"; then
+ KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
+ fi
+
+ KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
+ fi
+
+AC_MSG_CHECKING([for KDE libraries installed])
+ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5'
+
+if AC_TRY_EVAL(ac_link) && test -s conftest; then
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_ERROR([your system fails at linking a small KDE application!
+Check, if your compiler is installed correctly and if you have used the
+same compiler to compile Qt and kdelibs as you did use now.
+For more details about this problem, look at the end of config.log.])
+fi
+
+if eval `KDEDIR= ./conftest 2>&5`; then
+ kde_result=done
+else
+ kde_result=problems
+fi
+
+KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
+kde_have_all_paths=yes
+
+KDE_SET_PATHS($kde_result)
+
+])
+
+AC_DEFUN([KDE_SET_PATHS],
+[
+ kde_cv_all_paths="kde_have_all_paths=\"yes\" \
+ kde_htmldir=\"$kde_htmldir\" \
+ kde_appsdir=\"$kde_appsdir\" \
+ kde_icondir=\"$kde_icondir\" \
+ kde_sounddir=\"$kde_sounddir\" \
+ kde_datadir=\"$kde_datadir\" \
+ kde_locale=\"$kde_locale\" \
+ kde_cgidir=\"$kde_cgidir\" \
+ kde_confdir=\"$kde_confdir\" \
+ kde_kcfgdir=\"$kde_kcfgdir\" \
+ kde_mimedir=\"$kde_mimedir\" \
+ kde_toolbardir=\"$kde_toolbardir\" \
+ kde_wallpaperdir=\"$kde_wallpaperdir\" \
+ kde_templatesdir=\"$kde_templatesdir\" \
+ kde_bindir=\"$kde_bindir\" \
+ kde_servicesdir=\"$kde_servicesdir\" \
+ kde_servicetypesdir=\"$kde_servicetypesdir\" \
+ kde_moduledir=\"$kde_moduledir\" \
+ kde_styledir=\"$kde_styledir\" \
+ kde_widgetdir=\"$kde_widgetdir\" \
+ xdg_appsdir=\"$xdg_appsdir\" \
+ xdg_menudir=\"$xdg_menudir\" \
+ xdg_directorydir=\"$xdg_directorydir\" \
+ kde_result=$1"
+])
+
+AC_DEFUN([KDE_SET_DEFAULT_PATHS],
+[
+if test "$1" = "default"; then
+
+ if test -z "$kde_htmldir"; then
+ kde_htmldir='\${datadir}/doc/kde/HTML'
+ fi
+ if test -z "$kde_appsdir"; then
+ kde_appsdir='\${datadir}/applnk'
+ fi
+ if test -z "$kde_icondir"; then
+ kde_icondir='\${datadir}/icons'
+ fi
+ if test -z "$kde_sounddir"; then
+ kde_sounddir='\${datadir}/sounds'
+ fi
+ if test -z "$kde_datadir"; then
+ kde_datadir='\${datadir}/apps'
+ fi
+ if test -z "$kde_locale"; then
+ kde_locale='\${datadir}/locale'
+ fi
+ if test -z "$kde_cgidir"; then
+ kde_cgidir='\${exec_prefix}/cgi-bin'
+ fi
+ if test -z "$kde_confdir"; then
+ kde_confdir='\${datadir}/config'
+ fi
+ if test -z "$kde_kcfgdir"; then
+ kde_kcfgdir='\${datadir}/config.kcfg'
+ fi
+ if test -z "$kde_mimedir"; then
+ kde_mimedir='\${datadir}/mimelnk'
+ fi
+ if test -z "$kde_toolbardir"; then
+ kde_toolbardir='\${datadir}/toolbar'
+ fi
+ if test -z "$kde_wallpaperdir"; then
+ kde_wallpaperdir='\${datadir}/wallpapers'
+ fi
+ if test -z "$kde_templatesdir"; then
+ kde_templatesdir='\${datadir}/templates'
+ fi
+ if test -z "$kde_bindir"; then
+ kde_bindir='\${exec_prefix}/bin'
+ fi
+ if test -z "$kde_servicesdir"; then
+ kde_servicesdir='\${datadir}/services'
+ fi
+ if test -z "$kde_servicetypesdir"; then
+ kde_servicetypesdir='\${datadir}/servicetypes'
+ fi
+ if test -z "$kde_moduledir"; then
+ if test "$kde_qtver" = "2"; then
+ kde_moduledir='\${libdir}/kde2'
+ else
+ kde_moduledir='\${libdir}/kde3'
+ fi
+ fi
+ if test -z "$kde_styledir"; then
+ kde_styledir='\${libdir}/kde3/plugins/styles'
+ fi
+ if test -z "$kde_widgetdir"; then
+ kde_widgetdir='\${libdir}/kde3/plugins/designer'
+ fi
+ if test -z "$xdg_appsdir"; then
+ xdg_appsdir='\${datadir}/applications/kde'
+ fi
+ if test -z "$xdg_menudir"; then
+ xdg_menudir='\${sysconfdir}/xdg/menus'
+ fi
+ if test -z "$xdg_directorydir"; then
+ xdg_directorydir='\${datadir}/desktop-directories'
+ fi
+
+ KDE_SET_PATHS(defaults)
+
+else
+
+ if test $kde_qtver = 1; then
+ AC_MSG_RESULT([compiling])
+ KDE_1_CHECK_PATHS
+ else
+ AC_MSG_ERROR([path checking not yet supported for KDE 2])
+ fi
+
+fi
+])
+
+AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS],
+[ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
+ test -z "$kde_icondir" || test -z "$kde_sounddir" ||
+ test -z "$kde_datadir" || test -z "$kde_locale" ||
+ test -z "$kde_cgidir" || test -z "$kde_confdir" ||
+ test -z "$kde_kcfgdir" ||
+ test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
+ test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
+ test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
+ test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
+ test -z "$kde_styledir" || test -z "kde_widgetdir" ||
+ test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" ||
+ test "x$kde_have_all_paths" != "xyes"; then
+ kde_have_all_paths=no
+ fi
+])
+
+AC_DEFUN([KDE_MISSING_PROG_ERROR],
+[
+ AC_MSG_ERROR([The important program $1 was not found!
+Please check whether you installed KDE correctly.
+])
+])
+
+AC_DEFUN([KDE_MISSING_ARTS_ERROR],
+[
+ AC_MSG_ERROR([The important program $1 was not found!
+Please check whether you installed aRts correctly or use
+--without-arts to compile without aRts support (this will remove functionality).
+])
+])
+
+AC_DEFUN([KDE_SET_DEFAULT_BINDIRS],
+[
+ kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde3/bin /usr/kde/bin /usr/local/kde/bin"
+ test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs"
+ if test -n "$KDEDIRS"; then
+ kde_save_IFS=$IFS
+ IFS=:
+ for dir in $KDEDIRS; do
+ kde_default_bindirs="$dir/bin $kde_default_bindirs "
+ done
+ IFS=$kde_save_IFS
+ fi
+])
+
+AC_DEFUN([KDE_SUBST_PROGRAMS],
+[
+ AC_ARG_WITH(arts,
+ AC_HELP_STRING([--without-arts],[build without aRts [default=no]]),
+ [build_arts=$withval],
+ [build_arts=yes]
+ )
+ AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
+ if test "$build_arts" = "no"; then
+ AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts])
+ fi
+
+ KDE_SET_DEFAULT_BINDIRS
+ kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs"
+ KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
+ KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
+ if test "$build_arts" '!=' "no"; then
+ KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
+ KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
+ fi
+ KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
+
+ kde32ornewer=1
+ kde33ornewer=1
+ if test -n "$kde_qtver" && test "$kde_qtver" -lt 3; then
+ kde32ornewer=
+ kde33ornewer=
+ else
+ if test "$kde_qtver" = "3"; then
+ if test "$kde_qtsubver" -le 1; then
+ kde32ornewer=
+ fi
+ if test "$kde_qtsubver" -le 2; then
+ kde33ornewer=
+ fi
+ if test "$KDECONFIG" != "compiled"; then
+ if test `$KDECONFIG --version | grep KDE | sed 's/KDE: \(...\).*/\1/'` = 3.2; then
+ kde33ornewer=
+ fi
+ fi
+ fi
+ fi
+
+ if test -n "$kde32ornewer"; then
+ KDE_FIND_PATH(kconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kconfig_compiler)])
+ KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
+ fi
+ if test -n "$kde33ornewer"; then
+ KDE_FIND_PATH(makekdewidgets, MAKEKDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(makekdewidgets)])
+ AC_SUBST(MAKEKDEWIDGETS)
+ fi
+ KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""])
+
+ if test -n "$MEINPROC" -a "$MEINPROC" != "compiled"; then
+ kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
+ test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
+ AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
+ if test "$KDE_XSL_STYLESHEET" = "NO"; then
+ KDE_XSL_STYLESHEET=""
+ else
+ KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
+ fi
+ fi
+
+ DCOP_DEPENDENCIES='$(DCOPIDL)'
+ if test -n "$kde32ornewer"; then
+ KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)'
+ DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)'
+ AC_SUBST(KCONFIG_COMPILER)
+ AC_SUBST(KCFG_DEPENDENCIES)
+ AC_SUBST(DCOPIDLNG)
+ fi
+ AC_SUBST(DCOPIDL)
+ AC_SUBST(DCOPIDL2CPP)
+ AC_SUBST(DCOP_DEPENDENCIES)
+ AC_SUBST(MCOPIDL)
+ AC_SUBST(ARTSCCONFIG)
+ AC_SUBST(MEINPROC)
+ AC_SUBST(KDE_XSL_STYLESHEET)
+ AC_SUBST(XMLLINT)
+])dnl
+
+AC_DEFUN([AC_CREATE_KFSSTND],
+[
+AC_REQUIRE([AC_CHECK_RPATH])
+
+AC_MSG_CHECKING([for KDE paths])
+kde_result=""
+kde_cached_paths=yes
+AC_CACHE_VAL(kde_cv_all_paths,
+[
+ KDE_SET_DEFAULT_PATHS($1)
+ kde_cached_paths=no
+])
+eval "$kde_cv_all_paths"
+KDE_CHECK_PATHS_FOR_COMPLETENESS
+if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
+ # wrong values were cached, may be, we can set better ones
+ kde_result=
+ kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
+ kde_datadir= kde_locale= kde_cgidir= kde_confdir= kde_kcfgdir=
+ kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
+ kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
+ kde_have_all_paths=
+ kde_styledir=
+ kde_widgetdir=
+ xdg_appsdir = xdg_menudir= xdg_directorydir=
+ KDE_SET_DEFAULT_PATHS($1)
+ eval "$kde_cv_all_paths"
+ KDE_CHECK_PATHS_FOR_COMPLETENESS
+ kde_result="$kde_result (cache overridden)"
+fi
+if test "$kde_have_all_paths" = "no"; then
+ AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
+Since it had compiled and linked before, it must be a strange problem on your system.
+Look at config.log for details. If you are not able to fix this, look at
+http://www.kde.org/faq/installation.html or any www.kde.org mirror.
+(If you're using an egcs version on Linux, you may update binutils!)
+])
+else
+ rm -f conftest*
+ AC_MSG_RESULT($kde_result)
+fi
+
+bindir=$kde_bindir
+
+KDE_SUBST_PROGRAMS
+
+])
+
+AC_DEFUN([AC_SUBST_KFSSTND],
+[
+AC_SUBST(kde_htmldir)
+AC_SUBST(kde_appsdir)
+AC_SUBST(kde_icondir)
+AC_SUBST(kde_sounddir)
+AC_SUBST(kde_datadir)
+AC_SUBST(kde_locale)
+AC_SUBST(kde_confdir)
+AC_SUBST(kde_kcfgdir)
+AC_SUBST(kde_mimedir)
+AC_SUBST(kde_wallpaperdir)
+AC_SUBST(kde_bindir)
+dnl X Desktop Group standards
+AC_SUBST(xdg_appsdir)
+AC_SUBST(xdg_menudir)
+AC_SUBST(xdg_directorydir)
+dnl for KDE 2
+AC_SUBST(kde_templatesdir)
+AC_SUBST(kde_servicesdir)
+AC_SUBST(kde_servicetypesdir)
+AC_SUBST(kde_moduledir)
+AC_SUBST(kdeinitdir, '$(kde_moduledir)')
+AC_SUBST(kde_styledir)
+AC_SUBST(kde_widgetdir)
+if test "$kde_qtver" = 1; then
+ kde_minidir="$kde_icondir/mini"
+else
+# for KDE 1 - this breaks KDE2 apps using minidir, but
+# that's the plan ;-/
+ kde_minidir="/dev/null"
+fi
+dnl AC_SUBST(kde_minidir)
+dnl AC_SUBST(kde_cgidir)
+dnl AC_SUBST(kde_toolbardir)
+])
+
+AC_DEFUN([KDE_MISC_TESTS],
+[
+ dnl Checks for libraries.
+ AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD
+ AC_SUBST(LIBUTIL)
+ AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
+ AC_SUBST(LIBCOMPAT)
+ kde_have_crypt=
+ AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
+ AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
+ AC_MSG_WARN([you have no crypt in either libcrypt or libc.
+You should install libcrypt from another source or configure with PAM
+support])
+ kde_have_crypt=no
+ ]))
+ AC_SUBST(LIBCRYPT)
+ if test $kde_have_crypt = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
+ fi
+ AC_CHECK_SOCKLEN_T
+ AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
+ if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+ AC_CHECK_LIB(dnet_stub, dnet_ntoa,
+ [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
+ fi
+ AC_CHECK_FUNC(inet_ntoa)
+ if test $ac_cv_func_inet_ntoa = no; then
+ AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
+ fi
+ AC_CHECK_FUNC(connect)
+ if test $ac_cv_func_connect = no; then
+ AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
+ $X_EXTRA_LIBS)
+ fi
+
+ AC_CHECK_FUNC(remove)
+ if test $ac_cv_func_remove = no; then
+ AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
+ fi
+
+ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+ AC_CHECK_FUNC(shmat, ,
+ AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
+
+ # more headers that need to be explicitly included on darwin
+ AC_CHECK_HEADERS(sys/types.h stdint.h)
+
+ # sys/bitypes.h is needed for uint32_t and friends on Tru64
+ AC_CHECK_HEADERS(sys/bitypes.h)
+
+ # darwin requires a poll emulation library
+ AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
+
+ # for some image handling on Mac OS X
+ AC_CHECK_HEADERS(Carbon/Carbon.h)
+
+ # CoreAudio framework
+ AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
+ AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
+ FRAMEWORK_COREAUDIO="-Wl,-framework,CoreAudio"
+ ])
+
+ AC_CHECK_RES_INIT
+ AC_SUBST(LIB_POLL)
+ AC_SUBST(FRAMEWORK_COREAUDIO)
+ LIBSOCKET="$X_EXTRA_LIBS"
+ AC_SUBST(LIBSOCKET)
+ AC_SUBST(X_EXTRA_LIBS)
+ AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
+ AC_SUBST(LIBUCB)
+
+ case $host in dnl this *is* LynxOS specific
+ *-*-lynxos* )
+ AC_MSG_CHECKING([LynxOS header file wrappers])
+ [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
+ AC_MSG_RESULT(disabled)
+ AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
+ ;;
+ esac
+
+ KDE_CHECK_TYPES
+ KDE_CHECK_LIBDL
+ KDE_CHECK_STRLCPY
+ KDE_CHECK_PIE_SUPPORT
+
+# darwin needs this to initialize the environment
+AC_CHECK_HEADERS(crt_externs.h)
+AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
+
+AH_VERBATIM(_DARWIN_ENVIRON,
+[
+#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
+# include <sys/time.h>
+# include <crt_externs.h>
+# define environ (*_NSGetEnviron())
+#endif
+])
+
+AH_VERBATIM(_AIX_STRINGS_H_BZERO,
+[
+/*
+ * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
+ * that defines bzero.
+ */
+
+#if defined(_AIX)
+#include <strings.h>
+#endif
+])
+
+AC_CHECK_FUNCS([vsnprintf snprintf])
+
+AH_VERBATIM(_TRU64,[
+/*
+ * 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
+])
+
+])
+
+dnl ------------------------------------------------------------------------
+dnl Find the header files and libraries for X-Windows. Extended the
+dnl macro AC_PATH_X
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([K_PATH_X],
+[
+AC_REQUIRE([KDE_MISC_TESTS])dnl
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+AC_ARG_ENABLE(
+ embedded,
+ AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]),
+ kde_use_qt_emb=$enableval,
+ kde_use_qt_emb=no
+)
+
+AC_ARG_ENABLE(
+ qtopia,
+ AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]),
+ kde_use_qt_emb_palm=$enableval,
+ kde_use_qt_emb_palm=no
+)
+
+AC_ARG_ENABLE(
+ mac,
+ AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]),
+ kde_use_qt_mac=$enableval,
+ kde_use_qt_mac=no
+)
+
+# used to disable x11-specific stuff on special platforms
+AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
+
+if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
+
+AC_MSG_CHECKING(for X)
+
+AC_CACHE_VAL(kde_cv_have_x,
+[# One or both of the vars are not set, and there is no cached value.
+if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
+ kde_x_includes=NO
+else
+ kde_x_includes=$x_includes
+fi
+if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
+ kde_x_libraries=NO
+else
+ kde_x_libraries=$x_libraries
+fi
+
+# below we use the standard autoconf calls
+ac_x_libraries=$kde_x_libraries
+ac_x_includes=$kde_x_includes
+
+KDE_PATH_X_DIRECT
+dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
+dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
+dnl location. The correct location is /usr/lib32 or an undefined value
+dnl (the linker is smart enough to pick the correct default library).
+dnl Things work just fine if you use just AC_PATH_X_DIRECT.
+dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
+dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
+dnl x_includes should be left alone.
+case "$host" in
+mips-sgi-irix6*)
+ ;;
+*-*-solaris*)
+ ;;
+*)
+ _AC_PATH_X_XMKMF
+ if test -z "$ac_x_includes"; then
+ ac_x_includes="."
+ fi
+ if test -z "$ac_x_libraries"; then
+ ac_x_libraries="/usr/lib${kdelibsuff}"
+ fi
+esac
+#from now on we use our own again
+
+# when the user already gave --x-includes, we ignore
+# what the standard autoconf macros told us.
+if test "$kde_x_includes" = NO; then
+ kde_x_includes=$ac_x_includes
+fi
+
+# for --x-libraries too
+if test "$kde_x_libraries" = NO; then
+ kde_x_libraries=$ac_x_libraries
+fi
+
+if test "$kde_x_includes" = NO; then
+ AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
+fi
+
+if test "$kde_x_libraries" = NO; then
+ AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
+fi
+
+# Record where we found X for the cache.
+kde_cv_have_x="have_x=yes \
+ kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
+])dnl
+
+eval "$kde_cv_have_x"
+
+if test "$have_x" != yes; then
+ AC_MSG_RESULT($have_x)
+ no_x=yes
+else
+ AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
+fi
+
+if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
+ X_INCLUDES=""
+ x_includes="."; dnl better than nothing :-
+ else
+ x_includes=$kde_x_includes
+ X_INCLUDES="-I$x_includes"
+fi
+
+if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
+ X_LDFLAGS=""
+ x_libraries="/usr/lib"; dnl better than nothing :-
+ else
+ x_libraries=$kde_x_libraries
+ X_LDFLAGS="-L$x_libraries"
+fi
+all_includes="$X_INCLUDES"
+all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED $LDFLAGS_NEW_DTAGS"
+
+# Check for libraries that X11R6 Xt/Xaw programs need.
+ac_save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS $X_LDFLAGS"
+# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+# check for ICE first), but we must link in the order -lSM -lICE or
+# we get undefined symbols. So assume we have SM if we have ICE.
+# These have to be linked with before -lX11, unlike the other
+# libraries we check for below, so use a different variable.
+# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
+AC_CHECK_LIB(ICE, IceConnectionNumber,
+ [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
+LDFLAGS="$ac_save_LDFLAGS"
+
+LIB_X11='-lX11 $(LIBSOCKET)'
+
+AC_MSG_CHECKING(for libXext)
+AC_CACHE_VAL(kde_cv_have_libXext,
+[
+kde_ldflags_safe="$LDFLAGS"
+kde_libs_safe="$LIBS"
+
+LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
+LIBS="-lXext -lX11 $LIBSOCKET"
+
+AC_TRY_LINK([
+#include <stdio.h>
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+#endif
+],
+[
+printf("hello Xext\n");
+],
+kde_cv_have_libXext=yes,
+kde_cv_have_libXext=no
+)
+
+LDFLAGS=$kde_ldflags_safe
+LIBS=$kde_libs_safe
+])
+
+AC_MSG_RESULT($kde_cv_have_libXext)
+
+if test "$kde_cv_have_libXext" = "no"; then
+ AC_MSG_ERROR([We need a working libXext to proceed. Since configure
+can't find it itself, we stop here assuming that make wouldn't find
+them either.])
+fi
+
+LIB_XEXT="-lXext"
+QTE_NORTTI=""
+
+elif test "$kde_use_qt_emb" = "yes"; then
+ dnl We're using QT Embedded
+ CPPFLAGS=-DQWS
+ CXXFLAGS="$CXXFLAGS -fno-rtti"
+ QTE_NORTTI="-fno-rtti -DQWS"
+ X_PRE_LIBS=""
+ LIB_X11=""
+ LIB_XEXT=""
+ LIB_XRENDER=""
+ LIBSM=""
+ X_INCLUDES=""
+ X_LDFLAGS=""
+ x_includes=""
+ x_libraries=""
+elif test "$kde_use_qt_mac" = "yes"; then
+ dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
+ dnl be included to get the information) --Sam
+ CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
+ CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
+ X_PRE_LIBS=""
+ LIB_X11=""
+ LIB_XEXT=""
+ LIB_XRENDER=""
+ LIBSM=""
+ X_INCLUDES=""
+ X_LDFLAGS=""
+ x_includes=""
+ x_libraries=""
+fi
+AC_SUBST(X_PRE_LIBS)
+AC_SUBST(LIB_X11)
+AC_SUBST(LIB_XRENDER)
+AC_SUBST(LIBSM)
+AC_SUBST(X_INCLUDES)
+AC_SUBST(X_LDFLAGS)
+AC_SUBST(x_includes)
+AC_SUBST(x_libraries)
+AC_SUBST(QTE_NORTTI)
+AC_SUBST(LIB_XEXT)
+
+])
+
+AC_DEFUN([KDE_PRINT_QT_PROGRAM],
+[
+AC_REQUIRE([KDE_USE_QT])
+cat > conftest.$ac_ext <<EOF
+#include "confdefs.h"
+#include <qglobal.h>
+#include <qapplication.h>
+EOF
+if test "$kde_qtver" = "2"; then
+cat >> conftest.$ac_ext <<EOF
+#include <qevent.h>
+#include <qstring.h>
+#include <qstyle.h>
+EOF
+
+if test $kde_qtsubver -gt 0; then
+cat >> conftest.$ac_ext <<EOF
+#if QT_VERSION < 210
+#error 1
+#endif
+EOF
+fi
+fi
+
+if test "$kde_qtver" = "3"; then
+cat >> conftest.$ac_ext <<EOF
+#include <qcursor.h>
+#include <qstylefactory.h>
+#include <private/qucomextra_p.h>
+EOF
+fi
+
+echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
+cat >> conftest.$ac_ext <<EOF
+#error 1
+#endif
+
+int main() {
+EOF
+if test "$kde_qtver" = "2"; then
+cat >> conftest.$ac_ext <<EOF
+ QStringList *t = new QStringList();
+ Q_UNUSED(t);
+EOF
+if test $kde_qtsubver -gt 0; then
+cat >> conftest.$ac_ext <<EOF
+ QString s;
+ s.setLatin1("Elvis is alive", 14);
+EOF
+fi
+fi
+if test "$kde_qtver" = "3"; then
+cat >> conftest.$ac_ext <<EOF
+ (void)QStyleFactory::create(QString::null);
+ QCursor c(Qt::WhatsThisCursor);
+EOF
+fi
+cat >> conftest.$ac_ext <<EOF
+ return 0;
+}
+EOF
+])
+
+AC_DEFUN([KDE_USE_QT],
+[
+if test -z "$1"; then
+ # Current default Qt version: 3.3
+ kde_qtver=3
+ kde_qtsubver=3
+else
+ kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
+ # following is the check if subversion isnt found in passed argument
+ if test "$kde_qtsubver" = "$1"; then
+ kde_qtsubver=1
+ fi
+ kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
+ if test "$kde_qtver" = "1"; then
+ kde_qtsubver=42
+ fi
+fi
+
+if test -z "$2"; then
+ if test "$kde_qtver" = "2"; then
+ if test $kde_qtsubver -gt 0; then
+ kde_qt_minversion=">= Qt 2.2.2"
+ else
+ kde_qt_minversion=">= Qt 2.0.2"
+ fi
+ fi
+ if test "$kde_qtver" = "3"; then
+ if test $kde_qtsubver -gt 0; then
+ if test $kde_qtsubver -gt 1; then
+ if test $kde_qtsubver -gt 2; then
+ kde_qt_minversion=">= Qt 3.3 and < 4.0"
+ else
+ kde_qt_minversion=">= Qt 3.2 and < 4.0"
+ fi
+ else
+ kde_qt_minversion=">= Qt 3.1 (20021021) and < 4.0"
+ fi
+ else
+ kde_qt_minversion=">= Qt 3.0 and < 4.0"
+ fi
+ fi
+ if test "$kde_qtver" = "1"; then
+ kde_qt_minversion=">= 1.42 and < 2.0"
+ fi
+else
+ kde_qt_minversion="$2"
+fi
+
+if test -z "$3"; then
+ if test $kde_qtver = 3; then
+ if test $kde_qtsubver -gt 0; then
+ kde_qt_verstring="QT_VERSION >= 0x03@VER@00 && QT_VERSION < 0x040000"
+ qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
+ kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
+ else
+ kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000"
+ fi
+ fi
+ if test $kde_qtver = 2; then
+ if test $kde_qtsubver -gt 0; then
+ kde_qt_verstring="QT_VERSION >= 222"
+ else
+ kde_qt_verstring="QT_VERSION >= 200"
+ fi
+ fi
+ if test $kde_qtver = 1; then
+ kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
+ fi
+else
+ kde_qt_verstring="$3"
+fi
+
+if test $kde_qtver = 4; then
+ kde_qt_dirs="$QTDIR /usr/lib/qt4 /usr/lib/qt /usr/share/qt4"
+fi
+if test $kde_qtver = 3; then
+ kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt /usr/share/qt3"
+fi
+if test $kde_qtver = 2; then
+ kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
+fi
+if test $kde_qtver = 1; then
+ kde_qt_dirs="$QTDIR /usr/lib/qt"
+fi
+])
+
+AC_DEFUN([KDE_CHECK_QT_DIRECT],
+[
+AC_REQUIRE([KDE_USE_QT])
+AC_MSG_CHECKING([if Qt compiles without flags])
+AC_CACHE_VAL(kde_cv_qt_direct,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
+ac_LIBRARY_PATH="$LIBRARY_PATH"
+ac_cxxflags_safe="$CXXFLAGS"
+ac_ldflags_safe="$LDFLAGS"
+ac_libs_safe="$LIBS"
+
+CXXFLAGS="$CXXFLAGS -I$qt_includes"
+LDFLAGS="$LDFLAGS $X_LDFLAGS"
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
+else
+LIBS="$LIBQT $LIBSOCKET"
+fi
+LD_LIBRARY_PATH=
+export LD_LIBRARY_PATH
+LIBRARY_PATH=
+export LIBRARY_PATH
+
+KDE_PRINT_QT_PROGRAM
+
+if AC_TRY_EVAL(ac_link) && test -s conftest; then
+ kde_cv_qt_direct="yes"
+else
+ kde_cv_qt_direct="no"
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat conftest.$ac_ext >&AC_FD_CC
+fi
+
+rm -f conftest*
+CXXFLAGS="$ac_cxxflags_safe"
+LDFLAGS="$ac_ldflags_safe"
+LIBS="$ac_libs_safe"
+
+LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
+export LD_LIBRARY_PATH
+LIBRARY_PATH="$ac_LIBRARY_PATH"
+export LIBRARY_PATH
+AC_LANG_RESTORE
+])
+
+if test "$kde_cv_qt_direct" = "yes"; then
+ AC_MSG_RESULT(yes)
+ $1
+else
+ AC_MSG_RESULT(no)
+ $2
+fi
+])
+
+dnl ------------------------------------------------------------------------
+dnl Try to find the Qt headers and libraries.
+dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
+dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_PATH_QT_1_3],
+[
+AC_REQUIRE([K_PATH_X])
+AC_REQUIRE([KDE_USE_QT])
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+dnl ------------------------------------------------------------------------
+dnl Add configure flag to enable linking to MT version of Qt library.
+dnl ------------------------------------------------------------------------
+
+AC_ARG_ENABLE(
+ mt,
+ AC_HELP_STRING([--disable-mt],[link to non-threaded Qt (deprecated)]),
+ kde_use_qt_mt=$enableval,
+ [
+ if test $kde_qtver = 3; then
+ kde_use_qt_mt=yes
+ else
+ kde_use_qt_mt=no
+ fi
+ ]
+)
+
+USING_QT_MT=""
+
+dnl ------------------------------------------------------------------------
+dnl If we not get --disable-qt-mt then adjust some vars for the host.
+dnl ------------------------------------------------------------------------
+
+KDE_MT_LDFLAGS=
+KDE_MT_LIBS=
+if test "x$kde_use_qt_mt" = "xyes"; then
+ KDE_CHECK_THREADING
+ if test "x$kde_use_threading" = "xyes"; then
+ CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
+ KDE_MT_LDFLAGS="$USE_THREADS"
+ KDE_MT_LIBS="$LIBPTHREAD"
+ else
+ kde_use_qt_mt=no
+ fi
+fi
+AC_SUBST(KDE_MT_LDFLAGS)
+AC_SUBST(KDE_MT_LIBS)
+
+kde_qt_was_given=yes
+
+dnl ------------------------------------------------------------------------
+dnl If we haven't been told how to link to Qt, we work it out for ourselves.
+dnl ------------------------------------------------------------------------
+if test -z "$LIBQT_GLOB"; then
+ if test "x$kde_use_qt_emb" = "xyes"; then
+ LIBQT_GLOB="libqte.*"
+ else
+ LIBQT_GLOB="libqt.*"
+ fi
+fi
+
+dnl ------------------------------------------------------------
+dnl If we got --enable-embedded then adjust the Qt library name.
+dnl ------------------------------------------------------------
+if test "x$kde_use_qt_emb" = "xyes"; then
+ qtlib="qte"
+else
+ qtlib="qt"
+fi
+
+kde_int_qt="-l$qtlib"
+
+if test -z "$LIBQPE"; then
+dnl ------------------------------------------------------------
+dnl If we got --enable-palmtop then add -lqpe to the link line
+dnl ------------------------------------------------------------
+ if test "x$kde_use_qt_emb" = "xyes"; then
+ if test "x$kde_use_qt_emb_palm" = "xyes"; then
+ LIB_QPE="-lqpe"
+ else
+ LIB_QPE=""
+ fi
+ else
+ LIB_QPE=""
+ fi
+fi
+
+dnl ------------------------------------------------------------------------
+dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
+dnl ------------------------------------------------------------------------
+
+if test "x$kde_use_qt_mt" = "xyes"; then
+ LIBQT="-l$qtlib-mt"
+ kde_int_qt="-l$qtlib-mt"
+ LIBQT_GLOB="lib$qtlib-mt.*"
+ USING_QT_MT="using -mt"
+else
+ LIBQT="-l$qtlib"
+fi
+
+if test $kde_qtver != 1; then
+
+ AC_REQUIRE([AC_FIND_PNG])
+ AC_REQUIRE([AC_FIND_JPEG])
+ LIBQT="$LIBQT $LIBPNG $LIBJPEG"
+fi
+
+if test $kde_qtver = 3; then
+ AC_REQUIRE([KDE_CHECK_LIBDL])
+ LIBQT="$LIBQT $LIBDL"
+fi
+
+AC_MSG_CHECKING([for Qt])
+
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
+fi
+ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
+qt_libraries=""
+qt_includes=""
+AC_ARG_WITH(qt-dir,
+ AC_HELP_STRING([--with-qt-dir=DIR],[where the root of Qt is installed ]),
+ [ ac_qt_includes="$withval"/include
+ ac_qt_libraries="$withval"/lib${kdelibsuff}
+ ac_qt_bindir="$withval"/bin
+ ])
+
+AC_ARG_WITH(qt-includes,
+ AC_HELP_STRING([--with-qt-includes=DIR],[where the Qt includes are. ]),
+ [
+ ac_qt_includes="$withval"
+ ])
+
+kde_qt_libs_given=no
+
+AC_ARG_WITH(qt-libraries,
+ AC_HELP_STRING([--with-qt-libraries=DIR],[where the Qt library is installed.]),
+ [ ac_qt_libraries="$withval"
+ kde_qt_libs_given=yes
+ ])
+
+AC_CACHE_VAL(ac_cv_have_qt,
+[#try to guess Qt locations
+
+qt_incdirs=""
+for dir in $kde_qt_dirs; do
+ qt_incdirs="$qt_incdirs $dir/include $dir"
+done
+qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 /usr/include/qt3 $x_includes"
+if test ! "$ac_qt_includes" = "NO"; then
+ qt_incdirs="$ac_qt_includes $qt_incdirs"
+fi
+
+if test "$kde_qtver" != "1"; then
+ kde_qt_header=qstyle.h
+else
+ kde_qt_header=qglobal.h
+fi
+
+AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
+ac_qt_includes="$qt_incdir"
+
+qt_libdirs=""
+for dir in $kde_qt_dirs; do
+ qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir"
+done
+qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
+if test ! "$ac_qt_libraries" = "NO"; then
+ qt_libdir=$ac_qt_libraries
+else
+ qt_libdirs="$ac_qt_libraries $qt_libdirs"
+ # if the Qt was given, the chance is too big that libqt.* doesn't exist
+ qt_libdir=NONE
+ for dir in $qt_libdirs; do
+ try="ls -1 $dir/${LIBQT_GLOB}"
+ if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
+ done
+fi
+for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
+ if test -e "$a"; then
+ LIBQT="$LIBQT ${kde_int_qt}_incremental"
+ break
+ fi
+done
+
+ac_qt_libraries="$qt_libdir"
+
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+
+ac_cxxflags_safe="$CXXFLAGS"
+ac_ldflags_safe="$LDFLAGS"
+ac_libs_safe="$LIBS"
+
+CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
+LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
+LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
+
+KDE_PRINT_QT_PROGRAM
+
+if AC_TRY_EVAL(ac_link) && test -s conftest; then
+ rm -f conftest*
+else
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat conftest.$ac_ext >&AC_FD_CC
+ ac_qt_libraries="NO"
+fi
+rm -f conftest*
+CXXFLAGS="$ac_cxxflags_safe"
+LDFLAGS="$ac_ldflags_safe"
+LIBS="$ac_libs_safe"
+
+AC_LANG_RESTORE
+if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
+ ac_cv_have_qt="have_qt=no"
+ ac_qt_notfound=""
+ missing_qt_mt=""
+ if test "$ac_qt_includes" = NO; then
+ if test "$ac_qt_libraries" = NO; then
+ ac_qt_notfound="(headers and libraries)";
+ else
+ ac_qt_notfound="(headers)";
+ fi
+ else
+ if test "x$kde_use_qt_mt" = "xyes"; then
+ missing_qt_mt="
+Make sure that you have compiled Qt with thread support!"
+ ac_qt_notfound="(library $qtlib-mt)";
+ else
+ ac_qt_notfound="(library $qtlib)";
+ fi
+ fi
+
+ AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
+For more details about this problem, look at the end of config.log.$missing_qt_mt])
+else
+ have_qt="yes"
+fi
+])
+
+eval "$ac_cv_have_qt"
+
+if test "$have_qt" != yes; then
+ AC_MSG_RESULT([$have_qt]);
+else
+ ac_cv_have_qt="have_qt=yes \
+ ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
+ AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
+
+ qt_libraries="$ac_qt_libraries"
+ qt_includes="$ac_qt_includes"
+fi
+
+if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then
+ KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
+fi
+
+AC_SUBST(qt_libraries)
+AC_SUBST(qt_includes)
+
+if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
+ QT_INCLUDES=""
+else
+ QT_INCLUDES="-I$qt_includes"
+ all_includes="$QT_INCLUDES $all_includes"
+fi
+
+if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
+ QT_LDFLAGS=""
+else
+ QT_LDFLAGS="-L$qt_libraries"
+ all_libraries="$QT_LDFLAGS $all_libraries"
+fi
+test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
+
+AC_SUBST(QT_INCLUDES)
+AC_SUBST(QT_LDFLAGS)
+AC_PATH_QT_MOC_UIC
+
+KDE_CHECK_QT_JPEG
+
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
+else
+LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)'
+fi
+test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
+for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
+ if test -e "$a"; then
+ LIB_QT="$LIB_QT ${kde_int_qt}_incremental"
+ break
+ fi
+done
+
+AC_SUBST(LIB_QT)
+AC_SUBST(LIB_QPE)
+
+AC_SUBST(kde_qtver)
+])
+
+AC_DEFUN([AC_PATH_QT],
+[
+AC_PATH_QT_1_3
+])
+
+AC_DEFUN([KDE_CHECK_UIC_PLUGINS],
+[
+AC_REQUIRE([AC_PATH_QT_MOC_UIC])
+
+if test x$ac_uic_supports_libpath = xyes; then
+
+AC_MSG_CHECKING([if UIC has KDE plugins available])
+AC_CACHE_VAL(kde_cv_uic_plugins,
+[
+cat > actest.ui << EOF
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>NewConnectionDialog</class>
+<widget class="QDialog">
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>testInput</cstring>
+ </property>
+ </widget>
+</widget>
+</UI>
+EOF
+
+
+
+kde_cv_uic_plugins=no
+kde_line="$UIC_PATH -L $kde_widgetdir"
+if test x$ac_uic_supports_nounload = xyes; then
+ kde_line="$kde_line -nounload"
+fi
+kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
+if AC_TRY_EVAL(kde_line); then
+ # if you're trying to debug this check and think it's incorrect,
+ # better check your installation. The check _is_ correct - your
+ # installation is not.
+ if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
+ kde_cv_uic_plugins=yes
+ fi
+fi
+rm -f actest.ui actest.cpp
+])
+
+AC_MSG_RESULT([$kde_cv_uic_plugins])
+if test "$kde_cv_uic_plugins" != yes; then
+ AC_MSG_ERROR([
+you need to install kdelibs first.
+
+If you did install kdelibs, then the Qt version that is picked up by
+this configure is not the same version you used to compile kdelibs.
+The Qt Plugin installed by kdelibs is *ONLY* loadable if it is the
+_same Qt version_, compiled with the _same compiler_ and the same Qt
+configuration settings.
+])
+fi
+fi
+])
+
+AC_DEFUN([KDE_CHECK_FINAL],
+[
+ AC_ARG_ENABLE(final,
+ AC_HELP_STRING([--enable-final],
+ [build size optimized apps (experimental - needs lots of memory)]),
+ kde_use_final=$enableval, kde_use_final=no)
+
+ if test "x$kde_use_final" = "xyes"; then
+ KDE_USE_FINAL_TRUE=""
+ KDE_USE_FINAL_FALSE="#"
+ else
+ KDE_USE_FINAL_TRUE="#"
+ KDE_USE_FINAL_FALSE=""
+ fi
+ AC_SUBST(KDE_USE_FINAL_TRUE)
+ AC_SUBST(KDE_USE_FINAL_FALSE)
+])
+
+AC_DEFUN([KDE_CHECK_CLOSURE],
+[
+ AC_ARG_ENABLE(closure,
+ AC_HELP_STRING([--enable-closure],[delay template instantiation]),
+ kde_use_closure=$enableval, kde_use_closure=no)
+
+ KDE_NO_UNDEFINED=""
+ if test "x$kde_use_closure" = "xyes"; then
+ KDE_USE_CLOSURE_TRUE=""
+ KDE_USE_CLOSURE_FALSE="#"
+# CXXFLAGS="$CXXFLAGS $REPO"
+ else
+ KDE_USE_CLOSURE_TRUE="#"
+ KDE_USE_CLOSURE_FALSE=""
+ KDE_NO_UNDEFINED=""
+ case $host in
+ *-*-linux-gnu)
+ KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined],
+ [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined],
+ [KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"],
+ [KDE_NO_UNDEFINED=""])],
+ [KDE_NO_UNDEFINED=""])
+ ;;
+ esac
+ fi
+ AC_SUBST(KDE_USE_CLOSURE_TRUE)
+ AC_SUBST(KDE_USE_CLOSURE_FALSE)
+ AC_SUBST(KDE_NO_UNDEFINED)
+])
+
+dnl Check if the linker supports --enable-new-dtags and --as-needed
+AC_DEFUN([KDE_CHECK_NEW_LDFLAGS],
+[
+ AC_ARG_ENABLE(new_ldflags,
+ AC_HELP_STRING([--enable-new-ldflags],
+ [enable the new linker flags]),
+ kde_use_new_ldflags=$enableval,
+ kde_use_new_ldflags=no)
+
+ LDFLAGS_AS_NEEDED=""
+ LDFLAGS_NEW_DTAGS=""
+ if test "x$kde_use_new_ldflags" = "xyes"; then
+ LDFLAGS_NEW_DTAGS=""
+ KDE_CHECK_COMPILER_FLAG([Wl,--enable-new-dtags],
+ [LDFLAGS_NEW_DTAGS="-Wl,--enable-new-dtags"],)
+
+ KDE_CHECK_COMPILER_FLAG([Wl,--as-needed],
+ [LDFLAGS_AS_NEEDED="-Wl,--as-needed"],)
+ fi
+ AC_SUBST(LDFLAGS_AS_NEEDED)
+ AC_SUBST(LDFLAGS_NEW_DTAGS)
+])
+
+AC_DEFUN([KDE_CHECK_NMCHECK],
+[
+ AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]),
+ kde_use_nmcheck=$enableval, kde_use_nmcheck=no)
+
+ if test "$kde_use_nmcheck" = "yes"; then
+ KDE_USE_NMCHECK_TRUE=""
+ KDE_USE_NMCHECK_FALSE="#"
+ else
+ KDE_USE_NMCHECK_TRUE="#"
+ KDE_USE_NMCHECK_FALSE=""
+ fi
+ AC_SUBST(KDE_USE_NMCHECK_TRUE)
+ AC_SUBST(KDE_USE_NMCHECK_FALSE)
+])
+
+AC_DEFUN([KDE_EXPAND_MAKEVAR], [
+savex=$exec_prefix
+test "x$exec_prefix" = xNONE && exec_prefix=$prefix
+tmp=$$2
+while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done
+exec_prefix=$savex
+])
+
+dnl ------------------------------------------------------------------------
+dnl Now, the same with KDE
+dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
+dnl and $(kde_includes) will be the kdehdrlocation (if needed)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_BASE_PATH_KDE],
+[
+AC_REQUIRE([KDE_CHECK_STL])
+AC_REQUIRE([AC_PATH_QT])dnl
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+AC_CHECK_RPATH
+AC_MSG_CHECKING([for KDE])
+
+if test "${prefix}" != NONE; then
+ kde_includes=${includedir}
+ KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir)
+
+ kde_libraries=${libdir}
+ KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir)
+
+else
+ ac_kde_includes=
+ ac_kde_libraries=
+ kde_libraries=""
+ kde_includes=""
+fi
+
+AC_CACHE_VAL(ac_cv_have_kde,
+[#try to guess kde locations
+
+if test "$kde_qtver" = 1; then
+ kde_check_header="ksock.h"
+ kde_check_lib="libkdecore.la"
+else
+ kde_check_header="ksharedptr.h"
+ kde_check_lib="libkio.la"
+fi
+
+if test -z "$1"; then
+
+kde_incdirs="$kde_libs_prefix/include /opt/kde3/include/kde /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes $qt_includes"
+test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
+kde_incdirs="$ac_kde_includes $kde_incdirs"
+AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
+ac_kde_includes="$kde_incdir"
+
+if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
+ AC_MSG_ERROR([
+in the prefix, you've chosen, are no KDE headers installed. This will fail.
+So, check this please and use another prefix!])
+fi
+
+kde_libdirs="$kde_libs_prefix/lib${kdelibsuff} /usr/lib/kde/lib${kdelibsuff} /usr/local/kde/lib${kdelibsuff} /usr/kde/lib${kdelibsuff} /usr/lib${kdelibsuff}/kde /usr/lib${kdelibsuff}/kde3 /usr/lib${kdelibsuff} /usr/X11R6/lib${kdelibsuff} /usr/local/lib${kdelibsuff} /opt/kde3/lib${kdelibsuff} /opt/kde/lib${kdelibsuff} /usr/X11R6/kde/lib${kdelibsuff}"
+test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs"
+kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
+AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
+ac_kde_libraries="$kde_libdir"
+
+kde_widgetdir=NO
+dnl this might be somewhere else
+AC_FIND_FILE("kde3/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir)
+
+if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
+AC_MSG_ERROR([
+in the prefix, you've chosen, are no KDE libraries installed. This will fail.
+So, check this please and use another prefix!])
+fi
+
+if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/kde3/plugins/designer/kdewidgets.la"; then
+AC_MSG_ERROR([
+I can't find the designer plugins. These are required and should have been installed
+by kdelibs])
+fi
+
+if test -n "$kde_widgetdir"; then
+ kde_widgetdir="$kde_widgetdir/kde3/plugins/designer"
+fi
+
+
+if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
+ ac_cv_have_kde="have_kde=no"
+else
+ ac_cv_have_kde="have_kde=yes \
+ ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
+fi
+
+else dnl test -z $1, e.g. from kdelibs
+
+ ac_cv_have_kde="have_kde=no"
+
+fi
+])dnl
+
+eval "$ac_cv_have_kde"
+
+if test "$have_kde" != "yes"; then
+ if test "${prefix}" = NONE; then
+ ac_kde_prefix="$ac_default_prefix"
+ else
+ ac_kde_prefix="$prefix"
+ fi
+ if test "$exec_prefix" = NONE; then
+ ac_kde_exec_prefix="$ac_kde_prefix"
+ AC_MSG_RESULT([will be installed in $ac_kde_prefix])
+ else
+ ac_kde_exec_prefix="$exec_prefix"
+ AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
+ fi
+
+ kde_libraries="${libdir}"
+ kde_includes="${includedir}"
+
+else
+ ac_cv_have_kde="have_kde=yes \
+ ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
+ AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
+
+ kde_libraries="$ac_kde_libraries"
+ kde_includes="$ac_kde_includes"
+fi
+AC_SUBST(kde_libraries)
+AC_SUBST(kde_includes)
+
+if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" || test "$kde_includes" = "/usr/include"; then
+ KDE_INCLUDES=""
+else
+ KDE_INCLUDES="-I$kde_includes"
+ all_includes="$KDE_INCLUDES $all_includes"
+fi
+
+KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION"
+
+KDE_LDFLAGS="-L$kde_libraries"
+if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then
+ all_libraries="$KDE_LDFLAGS $all_libraries"
+fi
+
+AC_SUBST(KDE_LDFLAGS)
+AC_SUBST(KDE_INCLUDES)
+
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+all_libraries="$all_libraries $USER_LDFLAGS"
+all_includes="$all_includes $USER_INCLUDES"
+AC_SUBST(all_includes)
+AC_SUBST(all_libraries)
+
+if test -z "$1"; then
+KDE_CHECK_UIC_PLUGINS
+fi
+
+ac_kde_libraries="$kde_libdir"
+
+AC_SUBST(AUTODIRS)
+
+
+])
+
+AC_DEFUN([KDE_CHECK_EXTRA_LIBS],
+[
+AC_MSG_CHECKING(for extra includes)
+AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]),
+ kde_use_extra_includes="$withval",
+ kde_use_extra_includes=NONE
+)
+kde_extra_includes=
+if test -n "$kde_use_extra_includes" && \
+ test "$kde_use_extra_includes" != "NONE"; then
+
+ ac_save_ifs=$IFS
+ IFS=':'
+ for dir in $kde_use_extra_includes; do
+ kde_extra_includes="$kde_extra_includes $dir"
+ USER_INCLUDES="$USER_INCLUDES -I$dir"
+ done
+ IFS=$ac_save_ifs
+ kde_use_extra_includes="added"
+else
+ kde_use_extra_includes="no"
+fi
+AC_SUBST(USER_INCLUDES)
+
+AC_MSG_RESULT($kde_use_extra_includes)
+
+kde_extra_libs=
+AC_MSG_CHECKING(for extra libs)
+AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]),
+ kde_use_extra_libs=$withval,
+ kde_use_extra_libs=NONE
+)
+if test -n "$kde_use_extra_libs" && \
+ test "$kde_use_extra_libs" != "NONE"; then
+
+ ac_save_ifs=$IFS
+ IFS=':'
+ for dir in $kde_use_extra_libs; do
+ kde_extra_libs="$kde_extra_libs $dir"
+ KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
+ USER_LDFLAGS="$USER_LDFLAGS -L$dir"
+ done
+ IFS=$ac_save_ifs
+ kde_use_extra_libs="added"
+else
+ kde_use_extra_libs="no"
+fi
+
+AC_SUBST(USER_LDFLAGS)
+
+AC_MSG_RESULT($kde_use_extra_libs)
+
+])
+
+AC_DEFUN([KDE_1_CHECK_PATH_HEADERS],
+[
+ AC_MSG_CHECKING([for KDE headers installed])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+cat > conftest.$ac_ext <<EOF
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+#endif
+#include <stdio.h>
+#include "confdefs.h"
+#include <kapp.h>
+
+int main() {
+ printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
+ printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
+ printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
+ printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
+ printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
+ printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
+ printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
+ printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
+ printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
+ printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
+ printf("kde_wallpaperdir=\\"%s\\"\n",
+ KApplication::kde_wallpaperdir().data());
+ printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
+ printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
+ printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
+ printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
+ printf("kde_moduledir=\\"/tmp/dummy\\"\n");
+ printf("kde_styledir=\\"/tmp/dummy\\"\n");
+ printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
+ printf("xdg_appsdir=\\"/tmp/dummy\\"\n");
+ printf("xdg_menudir=\\"/tmp/dummy\\"\n");
+ printf("xdg_directorydir=\\"/tmp/dummy\\"\n");
+ printf("kde_kcfgdir=\\"/tmp/dummy\\"\n");
+ return 0;
+ }
+EOF
+
+ ac_save_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="$all_includes $CPPFLAGS"
+ if AC_TRY_EVAL(ac_compile); then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_ERROR([your system is not able to compile a small KDE application!
+Check, if you installed the KDE header files correctly.
+For more details about this problem, look at the end of config.log.])
+ fi
+ CPPFLAGS=$ac_save_CPPFLAGS
+
+ AC_LANG_RESTORE
+])
+
+AC_DEFUN([KDE_CHECK_KDEQTADDON],
+[
+AC_MSG_CHECKING(for kde-qt-addon)
+AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
+[
+ kde_ldflags_safe="$LDFLAGS"
+ kde_libs_safe="$LIBS"
+ kde_cxxflags_safe="$CXXFLAGS"
+
+ LIBS="-lkde-qt-addon $LIBQT $LIBS"
+ CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
+ LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
+
+ AC_TRY_LINK([
+ #include <qdom.h>
+ ],
+ [
+ QDomDocument doc;
+ ],
+ kde_cv_have_kdeqtaddon=yes,
+ kde_cv_have_kdeqtaddon=no
+ )
+
+ LDFLAGS=$kde_ldflags_safe
+ LIBS=$kde_libs_safe
+ CXXFLAGS=$kde_cxxflags_safe
+])
+
+AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
+
+if test "$kde_cv_have_kdeqtaddon" = "no"; then
+ AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
+It is a separate package (and CVS module) named kde-qt-addon.])
+fi
+])
+
+AC_DEFUN([KDE_CREATE_LIBS_ALIASES],
+[
+ AC_REQUIRE([KDE_MISC_TESTS])
+ AC_REQUIRE([KDE_CHECK_LIBDL])
+ AC_REQUIRE([K_PATH_X])
+
+if test $kde_qtver = 3; then
+ case $host in
+ *cygwin*) lib_kded="-lkdeinit_kded" ;;
+ *) lib_kded="" ;;
+ esac
+ AC_SUBST(LIB_KDED, $lib_kded)
+ AC_SUBST(LIB_KDECORE, "-lkdecore")
+ AC_SUBST(LIB_KDEUI, "-lkdeui")
+ AC_SUBST(LIB_KIO, "-lkio")
+ AC_SUBST(LIB_KJS, "-lkjs")
+ AC_SUBST(LIB_SMB, "-lsmb")
+ AC_SUBST(LIB_KAB, "-lkab")
+ AC_SUBST(LIB_KABC, "-lkabc")
+ AC_SUBST(LIB_KHTML, "-lkhtml")
+ AC_SUBST(LIB_KSPELL, "-lkspell")
+ AC_SUBST(LIB_KPARTS, "-lkparts")
+ AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
+ AC_SUBST(LIB_KUTILS, "-lkutils")
+ AC_SUBST(LIB_KDEPIM, "-lkdepim")
+ AC_SUBST(LIB_KIMPROXY, "-lkimproxy")
+ AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff")
+ AC_SUBST(LIB_KDNSSD, "-lkdnssd")
+ AC_SUBST(LIB_KUNITTEST, "-lkunittest")
+# these are for backward compatibility
+ AC_SUBST(LIB_KSYCOCA, "-lkio")
+ AC_SUBST(LIB_KFILE, "-lkio")
+elif test $kde_qtver = 2; then
+ AC_SUBST(LIB_KDECORE, "-lkdecore")
+ AC_SUBST(LIB_KDEUI, "-lkdeui")
+ AC_SUBST(LIB_KIO, "-lkio")
+ AC_SUBST(LIB_KSYCOCA, "-lksycoca")
+ AC_SUBST(LIB_SMB, "-lsmb")
+ AC_SUBST(LIB_KFILE, "-lkfile")
+ AC_SUBST(LIB_KAB, "-lkab")
+ AC_SUBST(LIB_KHTML, "-lkhtml")
+ AC_SUBST(LIB_KSPELL, "-lkspell")
+ AC_SUBST(LIB_KPARTS, "-lkparts")
+ AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
+else
+ AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)")
+ AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)")
+ AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)")
+ AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)")
+ AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)")
+fi
+])
+
+AC_DEFUN([AC_PATH_KDE],
+[
+ AC_BASE_PATH_KDE
+ AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]),
+ [
+ if test "$enableval" = "no";
+ then ac_use_path_checking="default"
+ else ac_use_path_checking=""
+ fi
+ ],
+ [
+ if test "$kde_qtver" = 1;
+ then ac_use_path_checking=""
+ else ac_use_path_checking="default"
+ fi
+ ]
+ )
+
+ AC_CREATE_KFSSTND($ac_use_path_checking)
+
+ AC_SUBST_KFSSTND
+ KDE_CREATE_LIBS_ALIASES
+])
+
+dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
+AC_DEFUN([KDE_CHECK_FUNC_EXT],
+[
+AC_MSG_CHECKING(for $1)
+AC_CACHE_VAL(kde_cv_func_$1,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+save_CXXFLAGS="$CXXFLAGS"
+kde_safe_LIBS="$LIBS"
+LIBS="$LIBS $X_EXTRA_LIBS"
+if test "$GXX" = "yes"; then
+CXXFLAGS="$CXXFLAGS -pedantic-errors"
+fi
+AC_TRY_COMPILE([
+$2
+],
+[
+$3
+],
+kde_cv_func_$1=yes,
+kde_cv_func_$1=no)
+CXXFLAGS="$save_CXXFLAGS"
+LIBS="$kde_safe_LIBS"
+AC_LANG_RESTORE
+])
+
+AC_MSG_RESULT($kde_cv_func_$1)
+
+AC_MSG_CHECKING([if $1 needs custom prototype])
+AC_CACHE_VAL(kde_cv_proto_$1,
+[
+if test "x$kde_cv_func_$1" = xyes; then
+ kde_cv_proto_$1=no
+else
+ case "$1" in
+ setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
+ kde_cv_proto_$1="yes - in libkdefakes"
+ ;;
+ *)
+ kde_cv_proto_$1=unknown
+ ;;
+ esac
+fi
+
+if test "x$kde_cv_proto_$1" = xunknown; then
+
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ kde_safe_libs=$LIBS
+ LIBS="$LIBS $X_EXTRA_LIBS"
+ AC_TRY_LINK([
+$2
+
+extern "C" $4;
+],
+[
+$3
+],
+[ kde_cv_func_$1=yes
+ kde_cv_proto_$1=yes ],
+ [kde_cv_proto_$1="$1 unavailable"]
+)
+LIBS=$kde_safe_libs
+AC_LANG_RESTORE
+fi
+])
+AC_MSG_RESULT($kde_cv_proto_$1)
+
+if test "x$kde_cv_func_$1" = xyes; then
+ AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
+ $6
+fi
+if test "x$kde_cv_proto_$1" = xno; then
+ AC_DEFINE(HAVE_$5_PROTO, 1,
+ [Define if you have the $1 prototype])
+fi
+
+AH_VERBATIM([_HAVE_$5_PROTO],
+[
+#if !defined(HAVE_$5_PROTO)
+#ifdef __cplusplus
+extern "C" {
+#endif
+$4;
+#ifdef __cplusplus
+}
+#endif
+#endif
+])
+])
+
+AC_DEFUN([AC_CHECK_SETENV],
+[
+ KDE_CHECK_FUNC_EXT(setenv, [
+#include <stdlib.h>
+],
+ [setenv("VAR", "VALUE", 1);],
+ [int setenv (const char *, const char *, int)],
+ [SETENV])
+])
+
+AC_DEFUN([AC_CHECK_UNSETENV],
+[
+ KDE_CHECK_FUNC_EXT(unsetenv, [
+#include <stdlib.h>
+],
+ [unsetenv("VAR");],
+ [void unsetenv (const char *)],
+ [UNSETENV])
+])
+
+AC_DEFUN([AC_CHECK_GETDOMAINNAME],
+[
+ KDE_CHECK_FUNC_EXT(getdomainname, [
+#include <stdlib.h>
+#include <unistd.h>
+#include <netdb.h>
+],
+ [
+char buffer[200];
+getdomainname(buffer, 200);
+],
+ [#include <sys/types.h>
+ int getdomainname (char *, size_t)],
+ [GETDOMAINNAME])
+])
+
+AC_DEFUN([AC_CHECK_GETHOSTNAME],
+[
+ KDE_CHECK_FUNC_EXT(gethostname, [
+#include <stdlib.h>
+#include <unistd.h>
+],
+ [
+char buffer[200];
+gethostname(buffer, 200);
+],
+ [int gethostname (char *, unsigned int)],
+ [GETHOSTNAME])
+])
+
+AC_DEFUN([AC_CHECK_USLEEP],
+[
+ KDE_CHECK_FUNC_EXT(usleep, [
+#include <unistd.h>
+],
+ [
+usleep(200);
+],
+ [int usleep (unsigned int)],
+ [USLEEP])
+])
+
+
+AC_DEFUN([AC_CHECK_RANDOM],
+[
+ KDE_CHECK_FUNC_EXT(random, [
+#include <stdlib.h>
+],
+ [
+random();
+],
+ [long int random(void)],
+ [RANDOM])
+
+ KDE_CHECK_FUNC_EXT(srandom, [
+#include <stdlib.h>
+],
+ [
+srandom(27);
+],
+ [void srandom(unsigned int)],
+ [SRANDOM])
+
+])
+
+AC_DEFUN([AC_CHECK_INITGROUPS],
+[
+ KDE_CHECK_FUNC_EXT(initgroups, [
+#include <sys/types.h>
+#include <unistd.h>
+#include <grp.h>
+],
+ [
+char buffer[200];
+initgroups(buffer, 27);
+],
+ [int initgroups(const char *, gid_t)],
+ [INITGROUPS])
+])
+
+AC_DEFUN([AC_CHECK_MKSTEMPS],
+[
+ KDE_CHECK_FUNC_EXT(mkstemps, [
+#include <stdlib.h>
+#include <unistd.h>
+],
+ [
+mkstemps("/tmp/aaaXXXXXX", 6);
+],
+ [int mkstemps(char *, int)],
+ [MKSTEMPS])
+])
+
+AC_DEFUN([AC_CHECK_MKSTEMP],
+[
+ KDE_CHECK_FUNC_EXT(mkstemp, [
+#include <stdlib.h>
+#include <unistd.h>
+],
+ [
+mkstemp("/tmp/aaaXXXXXX");
+],
+ [int mkstemp(char *)],
+ [MKSTEMP])
+])
+
+AC_DEFUN([AC_CHECK_MKDTEMP],
+[
+ KDE_CHECK_FUNC_EXT(mkdtemp, [
+#include <stdlib.h>
+#include <unistd.h>
+],
+ [
+mkdtemp("/tmp/aaaXXXXXX");
+],
+ [char *mkdtemp(char *)],
+ [MKDTEMP])
+])
+
+
+AC_DEFUN([AC_CHECK_RES_INIT],
+[
+ AC_MSG_CHECKING([if res_init needs -lresolv])
+ kde_libs_safe="$LIBS"
+ LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
+ AC_TRY_LINK(
+ [
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+ ],
+ [
+ res_init();
+ ],
+ [
+ LIBRESOLV="-lresolv"
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
+ ],
+ [ AC_MSG_RESULT(no) ]
+ )
+ LIBS=$kde_libs_safe
+ AC_SUBST(LIBRESOLV)
+
+ KDE_CHECK_FUNC_EXT(res_init,
+ [
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+ ],
+ [res_init()],
+ [int res_init(void)],
+ [RES_INIT])
+])
+
+AC_DEFUN([AC_CHECK_STRLCPY],
+[
+ KDE_CHECK_FUNC_EXT(strlcpy, [
+#include <string.h>
+],
+[ char buf[20];
+ strlcpy(buf, "KDE function test", sizeof(buf));
+],
+ [unsigned long strlcpy(char*, const char*, unsigned long)],
+ [STRLCPY])
+])
+
+AC_DEFUN([AC_CHECK_STRLCAT],
+[
+ KDE_CHECK_FUNC_EXT(strlcat, [
+#include <string.h>
+],
+[ char buf[20];
+ buf[0]='\0';
+ strlcat(buf, "KDE function test", sizeof(buf));
+],
+ [unsigned long strlcat(char*, const char*, unsigned long)],
+ [STRLCAT])
+])
+
+AC_DEFUN([AC_CHECK_RES_QUERY],
+[
+ KDE_CHECK_FUNC_EXT(res_query, [
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+#include <netdb.h>
+],
+[
+res_query(NULL, 0, 0, NULL, 0);
+],
+ [int res_query(const char *, int, int, unsigned char *, int)],
+ [RES_QUERY])
+])
+
+AC_DEFUN([AC_CHECK_DN_SKIPNAME],
+[
+ KDE_CHECK_FUNC_EXT(dn_skipname, [
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+],
+[
+dn_skipname (NULL, NULL);
+],
+ [int dn_skipname (unsigned char *, unsigned char *)],
+ [DN_SKIPNAME])
+])
+
+
+AC_DEFUN([AC_FIND_GIF],
+ [AC_MSG_CHECKING([for giflib])
+AC_CACHE_VAL(ac_cv_lib_gif,
+[ac_save_LIBS="$LIBS"
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
+else
+LIBS="$all_libraries -lgif"
+fi
+AC_TRY_LINK(dnl
+[
+#ifdef __cplusplus
+extern "C" {
+#endif
+int GifLastError(void);
+#ifdef __cplusplus
+}
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+],
+ [return GifLastError();],
+ eval "ac_cv_lib_gif=yes",
+ eval "ac_cv_lib_gif=no")
+LIBS="$ac_save_LIBS"
+])dnl
+if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
+else
+ AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
+fi
+])
+
+AC_DEFUN([KDE_FIND_JPEG_HELPER],
+[
+AC_MSG_CHECKING([for libjpeg$2])
+AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
+[
+ac_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(
+[
+#ifdef __cplusplus
+extern "C" {
+#endif
+void jpeg_CreateDecompress();
+#ifdef __cplusplus
+}
+#endif
+],
+[jpeg_CreateDecompress();],
+ eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
+ eval "ac_cv_lib_jpeg_$1=no")
+LIBS="$ac_save_LIBS"
+CFLAGS="$ac_save_CFLAGS"
+])
+
+if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
+ LIBJPEG="$ac_cv_lib_jpeg_$1"
+ AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
+else
+ AC_MSG_RESULT(no)
+ $3
+fi
+
+])
+
+AC_DEFUN([AC_FIND_JPEG],
+[
+dnl first look for libraries
+KDE_FIND_JPEG_HELPER(6b, 6b,
+ KDE_FIND_JPEG_HELPER(normal, [],
+ [
+ LIBJPEG=
+ ]
+ )
+)
+
+dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
+dnl requires system dependent includes loaded before it)
+jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
+AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
+test "x$jpeg_incdir" = xNO && jpeg_incdir=
+
+dnl if headers _and_ libraries are missing, this is no error, and we
+dnl continue with a warning (the user will get no jpeg support in khtml)
+dnl if only one is missing, it means a configuration error, but we still
+dnl only warn
+if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
+ AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
+else
+ if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
+ AC_MSG_WARN([
+There is an installation error in jpeg support. You seem to have only one
+of either the headers _or_ the libraries installed. You may need to either
+provide correct --with-extra-... options, or the development package of
+libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
+Disabling JPEG support.
+])
+ else
+ AC_MSG_WARN([libjpeg not found. disable JPEG support.])
+ fi
+ jpeg_incdir=
+ LIBJPEG=
+fi
+
+AC_SUBST(LIBJPEG)
+AH_VERBATIM(_AC_CHECK_JPEG,
+[/*
+ * 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
+])
+])
+
+AC_DEFUN([KDE_CHECK_QT_JPEG],
+[
+if test -n "$LIBJPEG"; then
+AC_MSG_CHECKING([if Qt needs $LIBJPEG])
+AC_CACHE_VAL(kde_cv_qt_jpeg,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
+LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
+ac_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(
+[#include <qapplication.h>],
+ [
+ int argc;
+ char** argv;
+ QApplication app(argc, argv);],
+ eval "kde_cv_qt_jpeg=no",
+ eval "kde_cv_qt_jpeg=yes")
+LIBS="$ac_save_LIBS"
+CXXFLAGS="$ac_save_CXXFLAGS"
+AC_LANG_RESTORE
+fi
+])
+
+if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
+ AC_MSG_RESULT(yes)
+ LIBJPEG_QT='$(LIBJPEG)'
+else
+ AC_MSG_RESULT(no)
+ LIBJPEG_QT=
+fi
+
+])
+
+AC_DEFUN([AC_FIND_ZLIB],
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_MSG_CHECKING([for libz])
+AC_CACHE_VAL(ac_cv_lib_z,
+[
+kde_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
+kde_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(dnl
+[
+#include<zlib.h>
+],
+[
+ char buf[42];
+ gzFile f = (gzFile) 0;
+ /* this would segfault.. but we only link, don't run */
+ (void) gzgets(f, buf, sizeof(buf));
+
+ return (zlibVersion() == ZLIB_VERSION);
+],
+ eval "ac_cv_lib_z='-lz'",
+ eval "ac_cv_lib_z=no")
+LIBS="$kde_save_LIBS"
+CFLAGS="$kde_save_CFLAGS"
+])dnl
+if test ! "$ac_cv_lib_z" = no; then
+ AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
+ LIBZ="$ac_cv_lib_z"
+ AC_MSG_RESULT($ac_cv_lib_z)
+else
+ AC_MSG_ERROR(not found.
+ Possibly configure picks up an outdated version
+ installed by XFree86. Remove it from your system.
+
+ Check your installation and look into config.log)
+ LIBZ=""
+fi
+AC_SUBST(LIBZ)
+])
+
+AC_DEFUN([KDE_TRY_TIFFLIB],
+[
+AC_MSG_CHECKING([for libtiff $1])
+
+AC_CACHE_VAL(kde_cv_libtiff_$1,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+kde_save_LIBS="$LIBS"
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
+else
+LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
+fi
+kde_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
+
+AC_TRY_LINK(dnl
+[
+#include<tiffio.h>
+],
+ [return (TIFFOpen( "", "r") == 0); ],
+[
+ kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
+], [
+ kde_cv_libtiff_$1=no
+])
+
+LIBS="$kde_save_LIBS"
+CXXFLAGS="$kde_save_CXXFLAGS"
+AC_LANG_RESTORE
+])
+
+if test "$kde_cv_libtiff_$1" = "no"; then
+ AC_MSG_RESULT(no)
+ LIBTIFF=""
+ $3
+else
+ LIBTIFF="$kde_cv_libtiff_$1"
+ AC_MSG_RESULT(yes)
+ AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
+ $2
+fi
+
+])
+
+AC_DEFUN([AC_FIND_TIFF],
+[
+AC_REQUIRE([K_PATH_X])
+AC_REQUIRE([AC_FIND_ZLIB])
+AC_REQUIRE([AC_FIND_JPEG])
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+KDE_TRY_TIFFLIB(tiff, [],
+ KDE_TRY_TIFFLIB(tiff34))
+
+AC_SUBST(LIBTIFF)
+])
+
+AC_DEFUN([KDE_FIND_LIBEXR],
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_REQUIRE([AC_FIND_ZLIB])
+AC_CACHE_VAL(ac_cv_libexr,
+[
+ if test -z "$PKG_CONFIG"; then
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+ fi
+
+ AC_MSG_CHECKING([for OpenEXR libraries])
+
+ if test "$PKG_CONFIG" = "no" ; then
+ AC_MSG_RESULT(no)
+ echo "*** The pkg-config script could not be found. Make sure it is"
+ echo "*** in your path, or set the PKG_CONFIG environment variable"
+ echo "*** to the full path to pkg-config."
+ echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+ else
+ if !(`$PKG_CONFIG --exists OpenEXR`) ; then
+ AC_MSG_RESULT(no)
+ EXRSTATUS=no
+ else
+ if !(`$PKG_CONFIG --atleast-version="1.1.1" OpenEXR`) ; then
+ AC_MSG_RESULT(no)
+ EXRSTATUS=old
+ else
+ kde_save_LIBS="$LIBS"
+ LIBS="$LIBS $all_libraries $USER_LDFLAGS `pkg-config --libs OpenEXR` $LIBZ"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ kde_save_CXXFLAGS="$CXXFLAGS"
+ EXR_FLAGS=`$PKG_CONFIG --cflags OpenEXR`
+ CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES $EXR_FLAGS"
+
+ AC_TRY_LINK(dnl
+ [
+ #include <ImfRgbaFile.h>
+ ],
+ [
+ using namespace Imf;
+ RgbaInputFile file ("dummy");
+ return 0;
+ ],
+ eval "ac_cv_libexr='`pkg-config --libs OpenEXR`'",
+ eval "ac_cv_libexr=no"
+ )
+ LIBS="$kde_save_LIBS"
+ CXXFLAGS="$kde_save_CXXFLAGS"
+ AC_LANG_RESTORE
+ ])dnl
+ if eval "test ! \"`echo $ac_cv_libexr`\" = no"; then
+ AC_DEFINE_UNQUOTED(HAVE_EXR, 1, [Define if you have OpenEXR])
+ LIB_EXR="$ac_cv_libexr"
+ AC_MSG_RESULT($ac_cv_libexr)
+ else
+ AC_MSG_RESULT(no)
+ LIB_EXR=""
+ fi
+ fi
+ fi
+ fi
+ AC_SUBST(LIB_EXR)
+ AC_SUBST(EXR_FLAGS)
+])
+
+
+
+AC_DEFUN([AC_FIND_PNG],
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_REQUIRE([AC_FIND_ZLIB])
+AC_MSG_CHECKING([for libpng])
+AC_CACHE_VAL(ac_cv_lib_png,
+[
+kde_save_LIBS="$LIBS"
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
+else
+LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
+fi
+kde_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+
+AC_TRY_LINK(dnl
+ [
+ #include<png.h>
+ ],
+ [
+ png_structp png_ptr = png_create_read_struct( /* image ptr */
+ PNG_LIBPNG_VER_STRING, 0, 0, 0 );
+ return( png_ptr != 0 );
+ ],
+ eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
+ eval "ac_cv_lib_png=no"
+)
+LIBS="$kde_save_LIBS"
+CFLAGS="$kde_save_CFLAGS"
+])dnl
+if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
+ AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
+ LIBPNG="$ac_cv_lib_png"
+ AC_SUBST(LIBPNG)
+ AC_MSG_RESULT($ac_cv_lib_png)
+else
+ AC_MSG_RESULT(no)
+ LIBPNG=""
+ AC_SUBST(LIBPNG)
+fi
+])
+
+
+AC_DEFUN([AC_FIND_JASPER],
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_REQUIRE([AC_FIND_JPEG])
+AC_MSG_CHECKING([for jasper])
+AC_CACHE_VAL(ac_cv_jasper,
+[
+kde_save_LIBS="$LIBS"
+LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm"
+kde_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+
+AC_TRY_LINK(dnl
+ [
+ #include<jasper/jasper.h>
+ ],
+ [
+ return( jas_init() );
+ ],
+ eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'",
+ eval "ac_cv_jasper=no"
+)
+LIBS="$kde_save_LIBS"
+CFLAGS="$kde_save_CFLAGS"
+])dnl
+if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then
+ AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper])
+ LIB_JASPER="$ac_cv_jasper"
+ AC_MSG_RESULT($ac_cv_jasper)
+else
+ AC_MSG_RESULT(no)
+ LIB_JASPER=""
+fi
+AC_SUBST(LIB_JASPER)
+])
+
+AC_DEFUN([AC_CHECK_BOOL],
+[
+ AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
+])
+
+AC_DEFUN([AC_CHECK_GNU_EXTENSIONS],
+[
+AC_MSG_CHECKING(if you need GNU extensions)
+AC_CACHE_VAL(ac_cv_gnu_extensions,
+[
+cat > conftest.c << EOF
+#include <features.h>
+
+#ifdef __GNU_LIBRARY__
+yes
+#endif
+EOF
+
+if (eval "$ac_cpp conftest.c") 2>&5 |
+ egrep "yes" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_gnu_extensions=yes
+else
+ ac_cv_gnu_extensions=no
+fi
+])
+
+AC_MSG_RESULT($ac_cv_gnu_extensions)
+if test "$ac_cv_gnu_extensions" = "yes"; then
+ AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
+fi
+])
+
+AC_DEFUN([KDE_CHECK_COMPILER_FLAG],
+[
+AC_MSG_CHECKING([whether $CXX supports -$1])
+kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
+AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
+[
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -$1"
+ AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
+ CXXFLAGS="$save_CXXFLAGS"
+ AC_LANG_RESTORE
+])
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ :
+ $2
+else
+ AC_MSG_RESULT(no)
+ :
+ $3
+fi
+])
+
+AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG],
+[
+AC_MSG_CHECKING([whether $CC supports -$1])
+kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
+AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache,
+[
+ AC_LANG_SAVE
+ AC_LANG_C
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -$1"
+ AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], [])
+ CFLAGS="$save_CFLAGS"
+ AC_LANG_RESTORE
+])
+if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ :
+ $2
+else
+ AC_MSG_RESULT(no)
+ :
+ $3
+fi
+])
+
+
+dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
+dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
+dnl it's all white-space separated
+AC_DEFUN([AC_REMOVE_FORBIDDEN],
+[ __val=$$1
+ __forbid=" $2 "
+ if test -n "$__val"; then
+ __new=""
+ ac_save_IFS=$IFS
+ IFS=" "
+ for i in $__val; do
+ case "$__forbid" in
+ *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
+ *) # Careful to not add spaces, where there were none, because otherwise
+ # libtool gets confused, if we change e.g. CXX
+ if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
+ esac
+ done
+ IFS=$ac_save_IFS
+ $1=$__new
+ fi
+])
+
+
+AC_DEFUN([KDE_CHECK_FOR_BAD_COMPILER],
+[
+ AC_MSG_CHECKING([whether $CC is blacklisted])
+
+ dnl In theory we have tu run this test against $CC and $CXX
+ dnl in C and in C++ mode, because its perfectly legal for
+ dnl the user to mix compiler versions, since C has a defined
+ dnl ABI.
+ dnl
+ dnl For now, we assume the user is not on crack.
+
+ AC_TRY_COMPILE([
+#ifdef __GNUC__
+#if __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 0
+choke me
+#endif
+#endif
+], ,
+ kde_bad_compiler=no,
+ kde_bad_compiler=yes
+)
+
+ AC_MSG_RESULT($kde_bad_compiler)
+
+if test "$kde_bad_compiler" = "yes"; then
+ AC_MSG_ERROR([
+
+This particular compiler version is blacklisted because it
+is known to miscompile KDE. Please use a newer version, or
+if that is not yet available, choose an older version.
+
+Please do not report a bug or bother us reporting this
+configure error. We know about it, and we introduced
+it by intention to avoid untraceable bugs or crashes in KDE.
+
+])
+fi
+
+])
+
+
+AC_DEFUN([KDE_CHECK_FOR_OPT_NOINLINE_MATCH],
+[
+ AC_CACHE_CHECK([whether system headers can cope with -O2 -fno-inline],
+ kde_cv_opt_noinline_match,
+ [
+ kde_cv_opt_noinline_match=irrelevant
+ dnl if we don't use both -O2 and -fno-inline, this check is moot
+ if echo "$CFLAGS" | grep -e -O2 >/dev/null 2>/dev/null \
+ && echo "$CFLAGS" | grep -e -fno-inline >/dev/null 2>/dev/null ; then
+
+ ac_cflags_save="$CFLAGS"
+ CFLAGS="$CFLAGS -D_USE_GNU"
+
+ AC_TRY_LINK([
+ #include <string.h>
+], [ const char *pt, *et;
+ et = __extension__ ({ char __a0, __a1, __a2; (__builtin_constant_p ( ";," ) && ((size_t)(const void *)(( ";," )+ 1) - (size_t)(const void *)( ";," ) == 1) ? ((__a0 =((__const char *) ( ";," ))[0], __a0 == '\0') ? ((void) ( pt ),((void *)0) ) : ((__a1 = ((__const char *) ( ";," ))[1], __a1== '\0') ? (__extension__ (__builtin_constant_p ( __a0 ) && ( __a0 ) == '\0' ? (char *) __rawmemchr ( pt , __a0) : strchr( pt , __a0 ))) : ((__a2 = ((__const char *) ( ";," ))[2], __a2 == '\0') ? __strpbrk_c2 ( pt , __a0, __a1) :(((__const char *) ( ";," ))[3] == '\0' ? __strpbrk_c3 ( pt ,__a0, __a1, __a2): strpbrk ( pt , ";," ))))) : strpbrk ( pt , ";," )); }) ;
+],
+ kde_cv_opt_noinline_match=yes,
+ kde_cv_opt_noinline_match=no
+ )
+
+ CFLAGS="$ac_cflags_save"
+ fi
+ ])
+])
+
+
+dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
+AC_DEFUN([AC_VALIDIFY_CXXFLAGS],
+[dnl
+if test "x$kde_use_qt_emb" != "xyes"; then
+ AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
+ AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
+else
+ AC_REMOVE_FORBIDDEN(CXX, [-rpath])
+ AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
+fi
+])
+
+AC_DEFUN([AC_CHECK_COMPILERS],
+[
+ AC_ARG_ENABLE(debug,
+ AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]),
+ [
+ case $enableval in
+ yes)
+ kde_use_debug_code="yes"
+ kde_use_debug_define=no
+ ;;
+ full)
+ kde_use_debug_code="full"
+ kde_use_debug_define=no
+ ;;
+ *)
+ kde_use_debug_code="no"
+ kde_use_debug_define=yes
+ ;;
+ esac
+ ],
+ [kde_use_debug_code="no"
+ kde_use_debug_define=no
+ ])
+
+ dnl Just for configure --help
+ AC_ARG_ENABLE(dummyoption,
+ AC_HELP_STRING([--disable-debug],
+ [disables debug output and debug symbols [default=no]]),
+ [],[])
+
+ AC_ARG_ENABLE(strict,
+ AC_HELP_STRING([--enable-strict],
+ [compiles with strict compiler options (may not work!)]),
+ [
+ if test $enableval = "no"; then
+ kde_use_strict_options="no"
+ else
+ kde_use_strict_options="yes"
+ fi
+ ], [kde_use_strict_options="no"])
+
+ AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similar]),
+ [
+ if test $enableval = "no"; then
+ kde_use_warnings="no"
+ else
+ kde_use_warnings="yes"
+ fi
+ ], [kde_use_warnings="yes"])
+
+ dnl enable warnings for debug build
+ if test "$kde_use_debug_code" != "no"; then
+ kde_use_warnings=yes
+ fi
+
+ AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]),
+ [kde_use_profiling=$enableval],
+ [kde_use_profiling="no"]
+ )
+
+ dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
+ CFLAGS=" $CFLAGS"
+
+ AC_PROG_CC
+
+ AC_PROG_CPP
+
+ if test "$GCC" = "yes"; then
+ if test "$kde_use_debug_code" != "no"; then
+ if test $kde_use_debug_code = "full"; then
+ CFLAGS="-g3 -fno-inline $CFLAGS"
+ else
+ CFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CFLAGS"
+ fi
+ else
+ CFLAGS="-O2 $CFLAGS"
+ fi
+ fi
+
+ if test "$kde_use_debug_define" = "yes"; then
+ CFLAGS="-DNDEBUG $CFLAGS"
+ fi
+
+
+ case "$host" in
+ *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
+ *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
+ esac
+
+ if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
+ LDFLAGS=""
+ fi
+
+ CXXFLAGS=" $CXXFLAGS"
+
+ AC_PROG_CXX
+
+ KDE_CHECK_FOR_BAD_COMPILER
+
+ if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
+ if test "$kde_use_debug_code" != "no"; then
+ if test "$CXX" = "KCC"; then
+ CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
+ else
+ if test "$kde_use_debug_code" = "full"; then
+ CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
+ else
+ CXXFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CXXFLAGS"
+ fi
+ fi
+ KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
+
+ dnl convenience compiler flags
+ KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
+ AC_SUBST(WOVERLOADED_VIRTUAL)
+ else
+ if test "$CXX" = "KCC"; then
+ CXXFLAGS="+K3 $CXXFLAGS"
+ else
+ CXXFLAGS="-O2 $CXXFLAGS"
+ fi
+ fi
+ fi
+
+ if test "$kde_use_debug_define" = "yes"; then
+ CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
+ fi
+
+ if test "$kde_use_profiling" = "yes"; then
+ KDE_CHECK_COMPILER_FLAG(pg,
+ [
+ CFLAGS="-pg $CFLAGS"
+ CXXFLAGS="-pg $CXXFLAGS"
+ ])
+ fi
+
+ if test "$kde_use_warnings" = "yes"; then
+ if test "$GCC" = "yes"; then
+ CXXFLAGS="-Wall -W -Wpointer-arith $CXXFLAGS"
+ case $host in
+ *-*-linux-gnu)
+ CFLAGS="-std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
+ CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts $CXXFLAGS"
+ KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
+ KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
+ ;;
+ esac
+ KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
+ KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
+ dnl ### FIXME: revert for KDE 4
+ KDE_CHECK_COMPILER_FLAG(Wno-non-virtual-dtor,[CXXFLAGS="$CXXFLAGS -Wno-non-virtual-dtor"])
+ fi
+ fi
+
+ if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
+ CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
+ fi
+
+ AC_ARG_ENABLE(pch,
+ AC_HELP_STRING([--enable-pch],
+ [enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]),
+ [ kde_use_pch=$enableval ],[ kde_use_pch=no ])
+
+ HAVE_GCC_VISIBILITY=0
+ AC_SUBST([HAVE_GCC_VISIBILITY])
+
+ if test "$GXX" = "yes"; then
+ gcc_no_reorder_blocks=NO
+ KDE_CHECK_COMPILER_FLAG(fno-reorder-blocks,[gcc_no_reorder_blocks=YES])
+ if test $kde_use_debug_code != "no" && \
+ test $kde_use_debug_code != "full" && \
+ test "YES" = "$gcc_no_reorder_blocks" ; then
+ CXXFLAGS="$CXXFLAGS -fno-reorder-blocks"
+ CFLAGS="$CFLAGS -fno-reorder-blocks"
+ fi
+ KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
+ KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
+ KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
+ KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
+ ENABLE_PERMISSIVE_FLAG="-fpermissive"
+
+ if test "$kde_use_pch" = "yes"; then
+ AC_MSG_CHECKING(whether gcc supports precompiling c header files)
+ echo >conftest.h
+ if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then
+ kde_gcc_supports_pch=yes
+ AC_MSG_RESULT(yes)
+ else
+ kde_gcc_supports_pch=no
+ AC_MSG_RESULT(no)
+ fi
+ if test "$kde_gcc_supports_pch" = "yes"; then
+ AC_MSG_CHECKING(whether gcc supports precompiling c++ header files)
+ if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then
+ kde_gcc_supports_pch=yes
+ AC_MSG_RESULT(yes)
+ else
+ kde_gcc_supports_pch=no
+ AC_MSG_RESULT(no)
+ fi
+ fi
+ rm -f conftest.h conftest.h.gch
+ fi
+
+ KDE_CHECK_FOR_OPT_NOINLINE_MATCH
+ if test "x$kde_cv_opt_noinline_match" = "xno" ; then
+ CFLAGS="`echo "$CFLAGS" | sed "s/ -fno-inline//"`"
+ fi
+ fi
+ AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
+ if test "$CXX" = "KCC"; then
+ dnl unfortunately we currently cannot disable exception support in KCC
+ dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
+ dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
+ dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= )
+
+ if test "$kde_use_pch" = "yes"; then
+ dnl TODO: support --pch-dir!
+ KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
+ dnl the below works (but the dir must exist), but it's
+ dnl useless for a whole package.
+ dnl The are precompiled headers for each source file, so when compiling
+ dnl from scratch, it doesn't make a difference, and they take up
+ dnl around ~5Mb _per_ sourcefile.
+ dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
+ dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
+ fi
+ dnl this flag controls inlining. by default KCC inlines in optimisation mode
+ dnl all implementations that are defined inside the class {} declaration.
+ dnl because of templates-compatibility with broken gcc compilers, this
+ dnl can cause excessive inlining. This flag limits it to a sane level
+ KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
+ KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
+ KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
+ KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
+ dnl Some source files are shared between multiple executables
+ dnl (or libraries) and some of those need template instantiations.
+ dnl In that case KCC needs to compile those sources with
+ dnl --one_instantiation_per_object. To make it easy for us we compile
+ dnl _all_ objects with that flag (--one_per is a shorthand).
+ KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
+ fi
+ AC_SUBST(USE_EXCEPTIONS)
+ dnl obsolete macro - provided to keep things going
+ USE_RTTI=
+ AC_SUBST(USE_RTTI)
+
+ case "$host" in
+ *-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
+ *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
+ *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
+ *-*-solaris*)
+ if test "$GXX" = yes; then
+ libstdcpp=`$CXX -print-file-name=libstdc++.so`
+ if test ! -f $libstdcpp; then
+ AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with KDE. Please recompile gcc with --enable-shared to receive a libstdc++.so])
+ fi
+ fi
+ ;;
+ esac
+
+ AC_VALIDIFY_CXXFLAGS
+
+ AC_PROG_CXXCPP
+
+ if test "$GCC" = yes; then
+ NOOPT_CFLAGS=-O0
+ fi
+ KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
+
+ AC_ARG_ENABLE(coverage,
+ AC_HELP_STRING([--enable-coverage],[use gcc coverage testing]), [
+ if test "$am_cv_CC_dependencies_compiler_type" = "gcc3"; then
+ ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
+ ac_coverage_linker="-lgcc"
+ elif test "$am_cv_CC_dependencies_compiler_type" = "gcc"; then
+ ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
+ ac_coverage_linker=""
+ else
+ AC_MSG_ERROR([coverage with your compiler is not supported])
+ fi
+ CFLAGS="$CFLAGS $ac_coverage_compiler"
+ CXXFLAGS="$CXXFLAGS $ac_coverage_compiler"
+ LDFLAGS="$LDFLAGS $ac_coverage_linker"
+ ])
+
+ AC_SUBST(NOOPT_CXXFLAGS)
+ AC_SUBST(NOOPT_CFLAGS)
+ AC_SUBST(ENABLE_PERMISSIVE_FLAG)
+
+ KDE_CHECK_NEW_LDFLAGS
+ KDE_CHECK_FINAL
+ KDE_CHECK_CLOSURE
+ KDE_CHECK_NMCHECK
+
+ ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
+])
+
+AC_DEFUN([KDE_CHECK_VISIBILITY_GCC_BUG],
+ [
+ AC_CACHE_CHECK([for gcc -fvisibility-inlines-hidden bug], kde_cv_val_gcc_visibility_bug,
+ [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ safe_CXXFLAGS=$CXXFLAGS
+ safe_LDFLAGS=$LDFLAGS
+ CXXFLAGS="$CXXFLAGS -fPIC -fvisibility-inlines-hidden -O0"
+ LDFLAGS="$LDFLAGS -shared -fPIC"
+
+ AC_TRY_LINK(
+ [
+ /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */
+ #include <string>
+ int some_function( void ) __attribute__ ((visibility("default")));
+ int some_function( void )
+ {
+ std::string s("blafasel");
+ return 0;
+ }
+ ], [/* elvis is alive */],
+ kde_cv_val_gcc_visibility_bug=no, kde_cv_val_gcc_visibility_bug=yes)
+
+ CXXFLAGS=$safe_CXXFLAGS
+ LDFLAGS=$safe_LDFLAGS
+ AC_LANG_RESTORE
+ ]
+ )
+
+ if test x$kde_cv_val_gcc_visibility_bug = xno; then
+ CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
+ fi
+ ]
+)
+
+AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
+[
+ AC_BEFORE([AC_PATH_QT_1_3], [KDE_ENABLE_HIDDEN_VISIBILITY])
+
+ AC_MSG_CHECKING([grepping for visibility push/pop in headers])
+
+ if test "x$GXX" = "xyes"; then
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_EGREP_CPP(
+ [GCC visibility push],
+ [ #include <exception>
+ ],
+ [
+ AC_MSG_RESULT(yes)
+ kde_stdc_visibility_patched=yes ],
+ [
+ AC_MSG_RESULT(no)
+ AC_MSG_WARN([Your libstdc++ doesn't appear to be patched for
+ visibility support. Disabling -fvisibility=hidden])
+
+ kde_stdc_visibility_patched=no ])
+
+ AC_LANG_RESTORE
+
+ kde_have_gcc_visibility=no
+ KDE_CHECK_COMPILER_FLAG(fvisibility=hidden,
+ [
+ kde_have_gcc_visibility=yes
+ dnl the whole toolchain is just a mess, gcc is just too buggy
+ dnl to handle STL with visibility enabled. Lets reconsider
+ dnl when gcc 4.2 is out or when things get fixed in the compiler.
+ dnl Contact mueller@kde.org for details.
+ AC_ARG_ENABLE(gcc-hidden-visibility,
+ AC_HELP_STRING([--enable-gcc-hidden-visibility],[toolchain hidden visibility [default=no]]),
+ [kde_have_gcc_visibility=$enableval],
+ [kde_have_gcc_visibility=no])
+
+ AC_CACHE_CHECK([if Qt is patched for -fvisibility], kde_cv_val_qt_gcc_visibility_patched,
+ [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ safe_CXXFLAGS=$CXXFLAGS
+ CXXFLAGS="$CXXFLAGS $all_includes"
+
+ AC_TRY_COMPILE(
+ [
+#include <qglobal.h>
+#if Q_EXPORT - 0 != 0
+/* if this compiles, then Q_EXPORT is undefined */
+/* if Q_EXPORT is nonempty, this will break compilation */
+#endif
+ ], [/* elvis is alive */],
+ kde_cv_val_qt_gcc_visibility_patched=no, kde_cv_val_qt_gcc_visibility_patched=yes)
+
+ CXXFLAGS=$safe_CXXFLAGS
+ AC_LANG_RESTORE
+ ]
+ )
+
+ if test x$kde_have_gcc_visibility = "xyes" && test x$kde_stdc_visibility_patched = "xyes" && test x$kde_cv_val_qt_gcc_visibility_patched = "xyes"; then
+ CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
+ KDE_CHECK_VISIBILITY_GCC_BUG
+ HAVE_GCC_VISIBILITY=1
+ AC_DEFINE_UNQUOTED(__KDE_HAVE_GCC_VISIBILITY, "$HAVE_GCC_VISIBILITY", [define to 1 if -fvisibility is supported])
+ fi
+ ])
+ fi
+])
+
+AC_DEFUN([KDE_ADD_DEPENDENCIES],
+[
+ [A]M_DEPENDENCIES(CC)
+ [A]M_DEPENDENCIES(CXX)
+])
+
+dnl just a wrapper to clean up configure.in
+AC_DEFUN([KDE_PROG_LIBTOOL],
+[
+AC_REQUIRE([AC_CHECK_COMPILERS])
+AC_REQUIRE([AC_ENABLE_SHARED])
+AC_REQUIRE([AC_ENABLE_STATIC])
+
+AC_REQUIRE([AC_LIBTOOL_DLOPEN])
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+AC_OBJEXT
+AC_EXEEXT
+
+AM_PROG_LIBTOOL
+AC_LIBTOOL_CXX
+
+LIBTOOL_SHELL="/bin/sh ./libtool"
+# LIBTOOL="$LIBTOOL --silent"
+KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
+AC_SUBST(KDE_PLUGIN)
+
+# This hack ensures that libtool creates shared libs for kunittest plugins. By default check_LTLIBRARIES makes static libs.
+KDE_CHECK_PLUGIN="\$(KDE_PLUGIN) -rpath \$(libdir)"
+AC_SUBST(KDE_CHECK_PLUGIN)
+
+# we patch configure quite some so we better keep that consistent for incremental runs
+AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure')
+])
+
+AC_DEFUN([KDE_CHECK_LIB64],
+[
+ AC_ARG_ENABLE(libsuffix,
+ AC_HELP_STRING([--enable-libsuffix],
+ [/lib directory suffix (64,32,none,auto[=default])]),
+ kdelibsuff=$enableval, kdelibsuff="auto")
+
+ if test "$kdelibsuff" = "auto"; then
+
+cat > conftest.c << EOF
+#include <stdio.h>
+int main() {
+ return 0;
+}
+EOF
+ kdelibsuff=`$CC conftest.c -o conftest.out; ldd conftest.out |sed -ne '/libc.so/{
+ s,.*/lib\([[^\/]]*\)/.*,\1,
+ p
+}'`
+ rm -rf conftest.*
+ fi
+
+ if test "$kdelibsuff" = "no" || test "$kdelibsuff" = "none"; then
+ kdelibsuff=
+ fi
+ if test -z "$kdelibsuff"; then
+ AC_MSG_RESULT([not using lib directory suffix])
+ AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
+ else
+ if test "$libdir" = '${exec_prefix}/lib'; then
+ libdir="$libdir${kdelibsuff}"
+ AC_SUBST([libdir], ["$libdir"]) dnl ugly hack for lib64 platforms
+ fi
+ AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${kdelibsuff}"], Suffix for lib directories)
+ AC_MSG_RESULT([using lib directory suffix $kdelibsuff])
+ fi
+])
+
+AC_DEFUN([KDE_CHECK_TYPES],
+[ AC_CHECK_SIZEOF(int, 4)dnl
+ AC_CHECK_SIZEOF(short)dnl
+ AC_CHECK_SIZEOF(long, 4)dnl
+ AC_CHECK_SIZEOF(char *, 4)dnl
+])dnl
+
+dnl Not used - kept for compat only?
+AC_DEFUN([KDE_DO_IT_ALL],
+[
+AC_CANONICAL_SYSTEM
+AC_ARG_PROGRAM
+AM_INIT_AUTOMAKE($1, $2)
+AM_DISABLE_LIBRARIES
+AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
+AC_CHECK_COMPILERS
+KDE_PROG_LIBTOOL
+AM_KDE_WITH_NLS
+AC_PATH_KDE
+])
+
+AC_DEFUN([AC_CHECK_RPATH],
+[
+AC_MSG_CHECKING(for rpath)
+AC_ARG_ENABLE(rpath,
+ AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]),
+ USE_RPATH=$enableval, USE_RPATH=yes)
+
+if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
+
+ KDE_RPATH="-R \$(libdir)"
+
+ if test "$kde_libraries" != "$libdir"; then
+ KDE_RPATH="$KDE_RPATH -R \$(kde_libraries)"
+ fi
+
+ if test -n "$qt_libraries"; then
+ KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
+ fi
+ dnl $x_libraries is set to /usr/lib in case
+ if test -n "$X_LDFLAGS"; then
+ X_RPATH="-R \$(x_libraries)"
+ KDE_RPATH="$KDE_RPATH $X_RPATH"
+ fi
+ if test -n "$KDE_EXTRA_RPATH"; then
+ KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
+ fi
+fi
+AC_SUBST(KDE_EXTRA_RPATH)
+AC_SUBST(KDE_RPATH)
+AC_SUBST(X_RPATH)
+AC_MSG_RESULT($USE_RPATH)
+])
+
+dnl Check for the type of the third argument of getsockname
+AC_DEFUN([AC_CHECK_SOCKLEN_T],
+[
+ AC_MSG_CHECKING(for socklen_t)
+ AC_CACHE_VAL(kde_cv_socklen_t,
+ [
+ AC_LANG_PUSH(C++)
+ kde_cv_socklen_t=no
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ ],
+ [
+ socklen_t len;
+ getpeername(0,0,&len);
+ ],
+ [
+ kde_cv_socklen_t=yes
+ kde_cv_socklen_t_equiv=socklen_t
+ ])
+ AC_LANG_POP(C++)
+ ])
+ AC_MSG_RESULT($kde_cv_socklen_t)
+ if test $kde_cv_socklen_t = no; then
+ AC_MSG_CHECKING([for socklen_t equivalent for socket functions])
+ AC_CACHE_VAL(kde_cv_socklen_t_equiv,
+ [
+ kde_cv_socklen_t_equiv=int
+ AC_LANG_PUSH(C++)
+ for t in int size_t unsigned long "unsigned long"; do
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ ],
+ [
+ $t len;
+ getpeername(0,0,&len);
+ ],
+ [
+ kde_cv_socklen_t_equiv="$t"
+ break
+ ])
+ done
+ AC_LANG_POP(C++)
+ ])
+ AC_MSG_RESULT($kde_cv_socklen_t_equiv)
+ fi
+ AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv,
+ [type to use in place of socklen_t if not defined])
+ AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv,
+ [type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)])
+])
+
+dnl This is a merge of some macros out of the gettext aclocal.m4
+dnl since we don't need anything, I took the things we need
+dnl the copyright for them is:
+dnl >
+dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+dnl This Makefile.in is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+dnl >
+dnl for this file it is relicensed under LGPL
+
+AC_DEFUN([AM_KDE_WITH_NLS],
+ [
+ dnl If we use NLS figure out what method
+
+ AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
+ [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
+ AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+
+ if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
+ AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
+ GMSGFMT=":"
+ fi
+ MSGFMT=$GMSGFMT
+ AC_SUBST(GMSGFMT)
+ AC_SUBST(MSGFMT)
+
+ AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+
+ dnl Test whether we really found GNU xgettext.
+ if test "$XGETTEXT" != ":"; then
+ dnl If it is no GNU xgettext we define it as : so that the
+ dnl Makefiles still can work.
+ if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+ : ;
+ else
+ AC_MSG_RESULT(
+ [found xgettext programs is not GNU xgettext; ignore it])
+ XGETTEXT=":"
+ fi
+ fi
+ AC_SUBST(XGETTEXT)
+
+ ])
+
+# Search path for a program which passes the given test.
+# Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+# serial 1
+# Stephan Kulow: I appended a _KDE against name conflicts
+
+dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
+dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE],
+[# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+ /*)
+ ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in ifelse([$5], , $PATH, [$5]); do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if [$3]; then
+ ac_cv_path_$1="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+ ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test -n "[$]$1"; then
+ AC_MSG_RESULT([$]$1)
+else
+ AC_MSG_RESULT(no)
+fi
+AC_SUBST($1)dnl
+])
+
+
+# Check whether LC_MESSAGES is available in <locale.h>.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+
+# serial 1
+
+AC_DEFUN([AM_LC_MESSAGES],
+ [if test $ac_cv_header_locale_h = yes; then
+ AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+ [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+ am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+ if test $am_cv_val_LC_MESSAGES = yes; then
+ AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
+ fi
+ fi])
+
+dnl From Jim Meyering.
+dnl FIXME: migrate into libit.
+
+AC_DEFUN([AM_FUNC_OBSTACK],
+[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
+ [AC_TRY_LINK([#include "obstack.h"],
+ [struct obstack *mem;obstack_free(mem,(char *) 0)],
+ am_cv_func_obstack=yes,
+ am_cv_func_obstack=no)])
+ if test $am_cv_func_obstack = yes; then
+ AC_DEFINE(HAVE_OBSTACK)
+ else
+ LIBOBJS="$LIBOBJS obstack.o"
+ fi
+])
+
+dnl From Jim Meyering. Use this if you use the GNU error.[ch].
+dnl FIXME: Migrate into libit
+
+AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
+[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
+ [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
+ am_cv_lib_error_at_line=yes,
+ am_cv_lib_error_at_line=no)])
+ if test $am_cv_lib_error_at_line = no; then
+ LIBOBJS="$LIBOBJS error.o"
+ fi
+ AC_SUBST(LIBOBJS)dnl
+])
+
+# Macro to add for using GNU gettext.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+
+# serial 1
+# Stephan Kulow: I put a KDE in it to avoid name conflicts
+
+AC_DEFUN([AM_KDE_GNU_GETTEXT],
+ [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+ AC_REQUIRE([AC_PROG_RANLIB])dnl
+ AC_REQUIRE([AC_HEADER_STDC])dnl
+ AC_REQUIRE([AC_TYPE_OFF_T])dnl
+ AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+ AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+ AC_REQUIRE([AC_FUNC_MMAP])dnl
+ AC_REQUIRE([AM_KDE_WITH_NLS])dnl
+ AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
+ AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
+__argz_count __argz_stringify __argz_next])
+
+ AC_MSG_CHECKING(for stpcpy)
+ AC_CACHE_VAL(kde_cv_func_stpcpy,
+ [
+ kde_safe_cxxflags=$CXXFLAGS
+ CXXFLAGS="-Werror"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+ #include <string.h>
+ ],
+ [
+ char buffer[200];
+ stpcpy(buffer, buffer);
+ ],
+ kde_cv_func_stpcpy=yes,
+ kde_cv_func_stpcpy=no)
+ AC_LANG_RESTORE
+ CXXFLAGS=$kde_safe_cxxflags
+ ])
+ AC_MSG_RESULT($kde_cv_func_stpcpy)
+ if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
+ AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
+ fi
+
+ AM_LC_MESSAGES
+
+ if test "x$CATOBJEXT" != "x"; then
+ if test "x$ALL_LINGUAS" = "x"; then
+ LINGUAS=
+ else
+ AC_MSG_CHECKING(for catalogs to be installed)
+ NEW_LINGUAS=
+ for lang in ${LINGUAS=$ALL_LINGUAS}; do
+ case "$ALL_LINGUAS" in
+ *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
+ esac
+ done
+ LINGUAS=$NEW_LINGUAS
+ AC_MSG_RESULT($LINGUAS)
+ fi
+
+ dnl Construct list of names of catalog files to be constructed.
+ if test -n "$LINGUAS"; then
+ for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+ fi
+ fi
+
+ ])
+
+AC_DEFUN([AC_HAVE_XPM],
+ [AC_REQUIRE_CPP()dnl
+ AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+ test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
+ test -z "$XPM_INCLUDE" && XPM_INCLUDE=
+
+ AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]),
+ xpm_test=$withval, xpm_test="yes")
+ if test "x$xpm_test" = xno; then
+ ac_cv_have_xpm=no
+ else
+ AC_MSG_CHECKING(for XPM)
+ AC_CACHE_VAL(ac_cv_have_xpm,
+ [
+ ac_save_ldflags="$LDFLAGS"
+ ac_save_cflags="$CFLAGS"
+ if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+ LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
+ else
+ LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
+ fi
+ CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
+ test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
+ AC_TRY_LINK([#include <X11/xpm.h>],[],
+ ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
+ LDFLAGS="$ac_save_ldflags"
+ CFLAGS="$ac_save_cflags"
+ ])dnl
+
+ if test "$ac_cv_have_xpm" = no; then
+ AC_MSG_RESULT(no)
+ XPM_LDFLAGS=""
+ XPMINC=""
+ $2
+ else
+ AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
+ if test "$XPM_LDFLAGS" = ""; then
+ XPMLIB='-lXpm $(LIB_X11)'
+ else
+ XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
+ fi
+ if test "$XPM_INCLUDE" = ""; then
+ XPMINC=""
+ else
+ XPMINC="-I$XPM_INCLUDE"
+ fi
+ AC_MSG_RESULT(yes)
+ $1
+ fi
+ fi
+ AC_SUBST(XPMINC)
+ AC_SUBST(XPMLIB)
+])
+
+AC_DEFUN([AC_HAVE_DPMS],
+ [AC_REQUIRE_CPP()dnl
+ AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+ test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
+ test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
+ DPMS_LIB=
+
+ AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]),
+ dpms_test=$withval, dpms_test="yes")
+ if test "x$dpms_test" = xno; then
+ ac_cv_have_dpms=no
+ else
+ AC_MSG_CHECKING(for DPMS)
+ dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
+ dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
+ AC_CACHE_VAL(ac_cv_have_dpms,
+ [
+ if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then
+ AC_MSG_RESULT(no)
+ ac_cv_have_dpms="no"
+ else
+ ac_save_ldflags="$LDFLAGS"
+ ac_save_cflags="$CFLAGS"
+ ac_save_libs="$LIBS"
+ LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries"
+ LIBS="-lX11 -lXext $LIBSOCKET"
+ CFLAGS="$CFLAGS $X_INCLUDES"
+ test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
+ AC_TRY_LINK([
+ #include <X11/Xproto.h>
+ #include <X11/X.h>
+ #include <X11/Xlib.h>
+ #include <X11/extensions/dpms.h>
+ int foo_test_dpms()
+ { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
+ ac_cv_have_dpms="yes", [
+ LIBS="-lXdpms $LIBS"
+ AC_TRY_LINK([
+ #include <X11/Xproto.h>
+ #include <X11/X.h>
+ #include <X11/Xlib.h>
+ #include <X11/extensions/dpms.h>
+ int foo_test_dpms()
+ { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
+ [
+ ac_cv_have_dpms="-lXdpms"
+ ],ac_cv_have_dpms="no")
+ ])
+ LDFLAGS="$ac_save_ldflags"
+ CFLAGS="$ac_save_cflags"
+ LIBS="$ac_save_libs"
+ fi
+ ])dnl
+
+ if test "$ac_cv_have_dpms" = no; then
+ AC_MSG_RESULT(no)
+ DPMS_LDFLAGS=""
+ DPMSINC=""
+ $2
+ else
+ AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
+ if test "$ac_cv_have_dpms" = "-lXdpms"; then
+ DPMS_LIB="-lXdpms"
+ fi
+ if test "$DPMS_LDFLAGS" = ""; then
+ DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
+ else
+ DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
+ fi
+ if test "$DPMS_INCLUDE" = ""; then
+ DPMSINC=""
+ else
+ DPMSINC="-I$DPMS_INCLUDE"
+ fi
+ AC_MSG_RESULT(yes)
+ $1
+ fi
+ fi
+ ac_save_cflags="$CFLAGS"
+ CFLAGS="$CFLAGS $X_INCLUDES"
+ test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
+ AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO,
+ [Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h>])
+ AC_CHECK_DECL(DPMSCapable,
+ AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),,
+ [#include <X11/Xlib.h>
+ #include <X11/extensions/dpms.h>])
+ AH_TEMPLATE(HAVE_DPMSINFO_PROTO,
+ [Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h>])
+ AC_CHECK_DECL(DPMSInfo,
+ AC_DEFINE(HAVE_DPMSINFO_PROTO),,
+ [#include <X11/Xlib.h>
+ #include <X11/extensions/dpms.h>])
+ CFLAGS="$ac_save_cflags"
+ AC_SUBST(DPMSINC)
+ AC_SUBST(DPMSLIB)
+])
+
+AC_DEFUN([AC_HAVE_GL],
+ [AC_REQUIRE_CPP()dnl
+ AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+ test -z "$GL_LDFLAGS" && GL_LDFLAGS=
+ test -z "$GL_INCLUDE" && GL_INCLUDE=
+
+ AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]),
+ gl_test=$withval, gl_test="yes")
+ if test "x$kde_use_qt_emb" = "xyes"; then
+ # GL and Qt Embedded is a no-go for now.
+ ac_cv_have_gl=no
+ elif test "x$gl_test" = xno; then
+ ac_cv_have_gl=no
+ else
+ AC_MSG_CHECKING(for GL)
+ AC_CACHE_VAL(ac_cv_have_gl,
+ [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_ldflags=$LDFLAGS
+ ac_save_cxxflags=$CXXFLAGS
+ ac_save_libs=$LIBS
+ LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries"
+ LIBS="$LIBS -lGL -lGLU"
+ test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LIBS="$LIBS -lX11"
+ LIBS="$LIBS $LIB_XEXT -lm $LIBSOCKET"
+ CXXFLAGS="$CFLAGS $X_INCLUDES"
+ test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
+ AC_TRY_LINK([#include <GL/gl.h>
+#include <GL/glu.h>
+], [],
+ ac_cv_have_gl="yes", ac_cv_have_gl="no")
+ AC_LANG_RESTORE
+ LDFLAGS=$ac_save_ldflags
+ CXXFLAGS=$ac_save_cxxflags
+ LIBS=$ac_save_libs
+ ])dnl
+
+ if test "$ac_cv_have_gl" = "no"; then
+ AC_MSG_RESULT(no)
+ GL_LDFLAGS=""
+ GLINC=""
+ $2
+ else
+ AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
+ if test "$GL_LDFLAGS" = ""; then
+ GLLIB='-lGLU -lGL $(LIB_X11)'
+ else
+ GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
+ fi
+ if test "$GL_INCLUDE" = ""; then
+ GLINC=""
+ else
+ GLINC="-I$GL_INCLUDE"
+ fi
+ AC_MSG_RESULT($ac_cv_have_gl)
+ $1
+ fi
+ fi
+ AC_SUBST(GLINC)
+ AC_SUBST(GLLIB)
+])
+
+
+ dnl shadow password and PAM magic - maintained by ossi@kde.org
+
+AC_DEFUN([KDE_PAM], [
+ AC_REQUIRE([KDE_CHECK_LIBDL])
+
+ want_pam=
+ AC_ARG_WITH(pam,
+ AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]),
+ [ if test "x$withval" = "xyes"; then
+ want_pam=yes
+ pam_service=kde
+ elif test "x$withval" = "xno"; then
+ want_pam=no
+ else
+ want_pam=yes
+ pam_service=$withval
+ fi
+ ], [ pam_service=kde ])
+
+ use_pam=
+ PAMLIBS=
+ if test "x$want_pam" != xno; then
+ AC_CHECK_LIB(pam, pam_start, [
+ AC_CHECK_HEADER(security/pam_appl.h,
+ [ pam_header=security/pam_appl.h ],
+ [ AC_CHECK_HEADER(pam/pam_appl.h,
+ [ pam_header=pam/pam_appl.h ],
+ [
+ AC_MSG_WARN([PAM detected, but no headers found!
+Make sure you have the necessary development packages installed.])
+ ]
+ )
+ ]
+ )
+ ], , $LIBDL)
+ if test -z "$pam_header"; then
+ if test "x$want_pam" = xyes; then
+ AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!])
+ fi
+ else
+ AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
+ PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
+ use_pam=yes
+
+ dnl darwin claims to be something special
+ if test "$pam_header" = "pam/pam_appl.h"; then
+ AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
+ fi
+
+ dnl test whether struct pam_message is const (Linux) or not (Sun)
+ AC_MSG_CHECKING(for const pam_message)
+ AC_EGREP_HEADER([struct pam_message], $pam_header,
+ [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
+ [AC_MSG_RESULT([const: Linux-type PAM])],
+ [AC_MSG_RESULT([nonconst: Sun-type PAM])
+ AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
+ )],
+ [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
+ fi
+ fi
+
+ AC_SUBST(PAMLIBS)
+])
+
+dnl DEF_PAM_SERVICE(arg name, full name, define name)
+AC_DEFUN([DEF_PAM_SERVICE], [
+ AC_ARG_WITH($1-pam,
+ AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]),
+ [ if test "x$use_pam" = xyes; then
+ $3_PAM_SERVICE=$withval
+ else
+ AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
+You may want to enforce it by using --with-pam.])
+ fi
+ ],
+ [ if test "x$use_pam" = xyes; then
+ $3_PAM_SERVICE="$pam_service"
+ fi
+ ])
+ if test -n "$$3_PAM_SERVICE"; then
+ AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
+ AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
+ fi
+ AC_SUBST($3_PAM_SERVICE)
+])
+
+AC_DEFUN([KDE_SHADOWPASSWD], [
+ AC_REQUIRE([KDE_PAM])
+
+ AC_CHECK_LIB(shadow, getspent,
+ [ LIBSHADOW="-lshadow"
+ ac_use_shadow=yes
+ ],
+ [ dnl for UnixWare
+ AC_CHECK_LIB(gen, getspent,
+ [ LIBGEN="-lgen"
+ ac_use_shadow=yes
+ ],
+ [ AC_CHECK_FUNC(getspent,
+ [ ac_use_shadow=yes ],
+ [ ac_use_shadow=no ])
+ ])
+ ])
+ AC_SUBST(LIBSHADOW)
+ AC_SUBST(LIBGEN)
+
+ AC_MSG_CHECKING([for shadow passwords])
+
+ AC_ARG_WITH(shadow,
+ AC_HELP_STRING([--with-shadow],[If you want shadow password support]),
+ [ if test "x$withval" != "xno"; then
+ use_shadow=yes
+ else
+ use_shadow=no
+ fi
+ ], [
+ use_shadow="$ac_use_shadow"
+ ])
+
+ if test "x$use_shadow" = xyes; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
+ else
+ AC_MSG_RESULT(no)
+ LIBSHADOW=
+ LIBGEN=
+ fi
+
+ dnl finally make the relevant binaries setuid root, if we have shadow passwds.
+ dnl this still applies, if we could use it indirectly through pam.
+ if test "x$use_shadow" = xyes ||
+ ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
+ case $host in
+ *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
+ SETUIDFLAGS="-m 4755 -o root";;
+ *)
+ SETUIDFLAGS="-m 4755";;
+ esac
+ fi
+ AC_SUBST(SETUIDFLAGS)
+
+])
+
+AC_DEFUN([KDE_PASSWDLIBS], [
+ AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
+ AC_REQUIRE([KDE_PAM])
+ AC_REQUIRE([KDE_SHADOWPASSWD])
+
+ if test "x$use_pam" = "xyes"; then
+ PASSWDLIBS="$PAMLIBS"
+ else
+ PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
+ fi
+
+ dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
+ dnl /etc/master.passwd holds the actual passwords. /etc/master.passwd requires
+ dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
+ dnl may need to read /etc/master.passwd).
+ case $host in
+ *-*-freebsd*)
+ SETUIDFLAGS="-m 4755 -o root"
+ ;;
+ *)
+ ;;
+ esac
+
+ AC_SUBST(PASSWDLIBS)
+])
+
+AC_DEFUN([KDE_CHECK_LIBDL],
+[
+AC_CHECK_LIB(dl, dlopen, [
+LIBDL="-ldl"
+ac_cv_have_dlfcn=yes
+])
+
+AC_CHECK_LIB(dld, shl_unload, [
+LIBDL="-ldld"
+ac_cv_have_shload=yes
+])
+
+AC_SUBST(LIBDL)
+])
+
+AC_DEFUN([KDE_CHECK_DLOPEN],
+[
+KDE_CHECK_LIBDL
+AC_CHECK_HEADERS(dlfcn.h dl.h)
+if test "$ac_cv_header_dlfcn_h" = "no"; then
+ ac_cv_have_dlfcn=no
+fi
+
+if test "$ac_cv_header_dl_h" = "no"; then
+ ac_cv_have_shload=no
+fi
+
+dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
+dnl (MM)
+AC_ARG_ENABLE(dlopen,
+AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]),
+enable_dlopen=$enableval,
+enable_dlopen=yes)
+
+# override the user's opinion, if we know it better ;)
+if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
+ enable_dlopen=no
+fi
+
+if test "$ac_cv_have_dlfcn" = "yes"; then
+ AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
+fi
+
+if test "$ac_cv_have_shload" = "yes"; then
+ AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
+fi
+
+if test "$enable_dlopen" = no ; then
+ test -n "$1" && eval $1
+else
+ test -n "$2" && eval $2
+fi
+
+])
+
+AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING],
+[
+KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
+KDE_PROG_LIBTOOL
+AC_MSG_CHECKING([dynamic loading])
+eval "`egrep '^build_libtool_libs=' libtool`"
+if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
+ dynamic_loading=yes
+ AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
+else
+ dynamic_loading=no
+fi
+AC_MSG_RESULT($dynamic_loading)
+if test "$dynamic_loading" = "yes"; then
+ $1
+else
+ $2
+fi
+])
+
+AC_DEFUN([KDE_ADD_INCLUDES],
+[
+if test -z "$1"; then
+ test_include="Pix.h"
+else
+ test_include="$1"
+fi
+
+AC_MSG_CHECKING([for libg++ ($test_include)])
+
+AC_CACHE_VAL(kde_cv_libgpp_includes,
+[
+kde_cv_libgpp_includes=no
+
+ for ac_dir in \
+ \
+ /usr/include/g++ \
+ /usr/include \
+ /usr/unsupported/include \
+ /opt/include \
+ $extra_include \
+ ; \
+ do
+ if test -r "$ac_dir/$test_include"; then
+ kde_cv_libgpp_includes=$ac_dir
+ break
+ fi
+ done
+])
+
+AC_MSG_RESULT($kde_cv_libgpp_includes)
+if test "$kde_cv_libgpp_includes" != "no"; then
+ all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
+fi
+])
+])
+
+AC_DEFUN([KDE_CHECK_LIBPTHREAD],
+[
+ dnl This code is here specifically to handle the
+ dnl various flavors of threading library on FreeBSD
+ dnl 4-, 5-, and 6-, and the (weird) rules around it.
+ dnl There may be an environment PTHREAD_LIBS that
+ dnl specifies what to use; otherwise, search for it.
+ dnl -pthread is special cased and unsets LIBPTHREAD
+ dnl below if found.
+ LIBPTHREAD=""
+
+ if test -n "$PTHREAD_LIBS"; then
+ if test "x$PTHREAD_LIBS" = "x-pthread" ; then
+ LIBPTHREAD="PTHREAD"
+ else
+ PTHREAD_LIBS_save="$PTHREAD_LIBS"
+ PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
+ AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS])
+ KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [
+ LIBPTHREAD="$PTHREAD_LIBS_save"])
+ PTHREAD_LIBS="$PTHREAD_LIBS_save"
+ fi
+ fi
+
+ dnl Is this test really needed, in the face of the Tru64 test below?
+ if test -z "$LIBPTHREAD"; then
+ AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"])
+ fi
+
+ dnl This is a special Tru64 check, see BR 76171 issue #18.
+ if test -z "$LIBPTHREAD" ; then
+ AC_MSG_CHECKING([for pthread_create in -lpthread])
+ kde_safe_libs=$LIBS
+ LIBS="$LIBS -lpthread"
+ AC_TRY_LINK([#include <pthread.h>],[(void)pthread_create(0,0,0,0);],[
+ AC_MSG_RESULT(yes)
+ LIBPTHREAD="-lpthread"],[
+ AC_MSG_RESULT(no)])
+ LIBS=$kde_safe_libs
+ fi
+
+ dnl Un-special-case for FreeBSD.
+ if test "x$LIBPTHREAD" = "xPTHREAD" ; then
+ LIBPTHREAD=""
+ fi
+
+ AC_SUBST(LIBPTHREAD)
+])
+
+AC_DEFUN([KDE_CHECK_PTHREAD_OPTION],
+[
+ USE_THREADS=""
+ if test -z "$LIBPTHREAD"; then
+ KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"])
+ fi
+
+ AH_VERBATIM(__svr_define, [
+#if defined(__SVR4) && !defined(__svr4__)
+#define __svr4__ 1
+#endif
+])
+ case $host_os in
+ solaris*)
+ KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
+ CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
+ ;;
+ freebsd*)
+ CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS"
+ ;;
+ aix*)
+ CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
+ LIBPTHREAD="$LIBPTHREAD -lc_r"
+ ;;
+ linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+ if test "$CXX" = "KCC"; then
+ CXXFLAGS="$CXXFLAGS --thread_safe"
+ NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
+ fi
+ ;;
+ *)
+ ;;
+ esac
+ AC_SUBST(USE_THREADS)
+ AC_SUBST(LIBPTHREAD)
+])
+
+AC_DEFUN([KDE_CHECK_THREADING],
+[
+ AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
+ AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
+ dnl default is yes if libpthread is found and no if no libpthread is available
+ if test -z "$LIBPTHREAD"; then
+ if test -z "$USE_THREADS"; then
+ kde_check_threading_default=no
+ else
+ kde_check_threading_default=yes
+ fi
+ else
+ kde_check_threading_default=yes
+ fi
+ AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]),
+ kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
+ if test "x$kde_use_threading" = "xyes"; then
+ AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
+ fi
+])
+
+AC_DEFUN([KDE_TRY_LINK_PYTHON],
+[
+if test "$kde_python_link_found" = no; then
+
+if test "$1" = normal; then
+ AC_MSG_CHECKING(if a Python application links)
+else
+ AC_MSG_CHECKING(if Python depends on $2)
+fi
+
+AC_CACHE_VAL(kde_cv_try_link_python_$1,
+[
+kde_save_cflags="$CFLAGS"
+CFLAGS="$CFLAGS $PYTHONINC"
+kde_save_libs="$LIBS"
+LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
+kde_save_ldflags="$LDFLAGS"
+LDFLAGS="$LDFLAGS $PYTHONLIB"
+
+AC_TRY_LINK(
+[
+#include <Python.h>
+],[
+ PySys_SetArgv(1, 0);
+],
+ [kde_cv_try_link_python_$1=yes],
+ [kde_cv_try_link_python_$1=no]
+)
+CFLAGS="$kde_save_cflags"
+LIBS="$kde_save_libs"
+LDFLAGS="$kde_save_ldflags"
+])
+
+if test "$kde_cv_try_link_python_$1" = "yes"; then
+ AC_MSG_RESULT(yes)
+ kde_python_link_found=yes
+ if test ! "$1" = normal; then
+ LIBPYTHON="$LIBPYTHON $2"
+ fi
+ $3
+else
+ AC_MSG_RESULT(no)
+ $4
+fi
+
+fi
+
+])
+
+AC_DEFUN([KDE_CHECK_PYTHON_DIR],
+[
+AC_MSG_CHECKING([for Python directory])
+
+AC_CACHE_VAL(kde_cv_pythondir,
+[
+ if test -z "$PYTHONDIR"; then
+ kde_cv_pythondir=/usr/local
+ else
+ kde_cv_pythondir="$PYTHONDIR"
+ fi
+])
+
+AC_ARG_WITH(pythondir,
+AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]),
+[
+ ac_python_dir=$withval
+], ac_python_dir=$kde_cv_pythondir
+)
+
+AC_MSG_RESULT($ac_python_dir)
+])
+
+AC_DEFUN([KDE_CHECK_PYTHON_INTERN],
+[
+AC_REQUIRE([KDE_CHECK_LIBDL])
+AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
+AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
+
+if test -z "$1"; then
+ version="1.5"
+else
+ version="$1"
+fi
+
+AC_MSG_CHECKING([for Python$version])
+
+python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
+AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
+if test ! -r $python_incdir/Python.h; then
+ AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
+ python_incdir=$python_incdir/python$version
+ if test ! -r $python_incdir/Python.h; then
+ python_incdir=no
+ fi
+fi
+
+PYTHONINC=-I$python_incdir
+
+python_libdirs="$ac_python_dir/lib$kdelibsuff /usr/lib$kdelibsuff /usr/local /usr/lib$kdelibsuff $kde_extra_libs"
+AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
+if test ! -r $python_libdir/libpython$version.so; then
+ AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
+ if test ! -r $python_libdir/libpython$version.a; then
+ AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
+ python_libdir=$python_libdir/python$version/config
+ if test ! -r $python_libdir/libpython$version.a; then
+ python_libdir=no
+ fi
+ fi
+fi
+
+PYTHONLIB=-L$python_libdir
+kde_orig_LIBPYTHON=$LIBPYTHON
+if test -z "$LIBPYTHON"; then
+ LIBPYTHON=-lpython$version
+fi
+
+AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
+python_moddir=$python_moddir/python$version
+if test ! -r $python_moddir/copy.py; then
+ python_moddir=no
+fi
+
+PYTHONMODDIR=$python_moddir
+
+AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
+
+if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
+ LIBPYTHON=$kde_orig_LIBPYTHON
+ test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
+ test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
+ $2
+else
+ dnl Note: this test is very weak
+ kde_python_link_found=no
+ KDE_TRY_LINK_PYTHON(normal)
+ KDE_TRY_LINK_PYTHON(m, -lm)
+ KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
+ KDE_TRY_LINK_PYTHON(tcl, -ltcl)
+ KDE_TRY_LINK_PYTHON(db2, -ldb2)
+ KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
+ KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
+ KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
+ KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
+ KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
+ KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
+ KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses])
+ KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
+ [AC_MSG_WARN([it seems, Python depends on another library.
+ Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
+ and contact the authors to let them know about this problem])
+ ])
+
+ LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
+ AC_SUBST(PYTHONINC)
+ AC_SUBST(PYTHONLIB)
+ AC_SUBST(LIBPYTHON)
+ AC_SUBST(PYTHONMODDIR)
+ AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
+fi
+
+])
+
+
+AC_DEFUN([KDE_CHECK_PYTHON],
+[
+ KDE_CHECK_PYTHON_INTERN("2.5",
+ [KDE_CHECK_PYTHON_INTERN("2.4",
+ [KDE_CHECK_PYTHON_INTERN("2.3",
+ [KDE_CHECK_PYTHON_INTERN("2.2",
+ [KDE_CHECK_PYTHON_INTERN("2.1",
+ [KDE_CHECK_PYTHON_INTERN("2.0",
+ [KDE_CHECK_PYTHON_INTERN($1, $2) ])
+ ])
+ ])
+ ])
+ ])
+ ])
+])
+
+AC_DEFUN([KDE_CHECK_STL],
+[
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
+
+ AC_MSG_CHECKING([if C++ programs can be compiled])
+ AC_CACHE_VAL(kde_cv_stl_works,
+ [
+ AC_TRY_COMPILE([
+#include <string>
+using namespace std;
+],[
+ string astring="Hallo Welt.";
+ astring.erase(0, 6); // now astring is "Welt"
+ return 0;
+], kde_cv_stl_works=yes,
+ kde_cv_stl_works=no)
+])
+
+ AC_MSG_RESULT($kde_cv_stl_works)
+
+ if test "$kde_cv_stl_works" = "yes"; then
+ # back compatible
+ AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
+ else
+ AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
+Check config.log for details - if you're using a Linux distribution you might miss
+a package named similar to libstdc++-dev.])
+ fi
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
+])
+
+AC_DEFUN([AC_FIND_QIMGIO],
+ [AC_REQUIRE([AC_FIND_JPEG])
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_MSG_CHECKING([for qimgio])
+AC_CACHE_VAL(ac_cv_lib_qimgio,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_save_LIBS="$LIBS"
+ac_save_CXXFLAGS="$CXXFLAGS"
+LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
+CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
+AC_TRY_RUN(dnl
+[
+#include <qimageio.h>
+#include <qstring.h>
+int main() {
+ QString t = "hallo";
+ t.fill('t');
+ qInitImageIO();
+}
+],
+ ac_cv_lib_qimgio=yes,
+ ac_cv_lib_qimgio=no,
+ ac_cv_lib_qimgio=no)
+LIBS="$ac_save_LIBS"
+CXXFLAGS="$ac_save_CXXFLAGS"
+AC_LANG_RESTORE
+])dnl
+if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
+ LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
+ AC_MSG_RESULT(yes)
+ AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
+ AC_SUBST(LIBQIMGIO)
+else
+ AC_MSG_RESULT(not found)
+fi
+])
+
+AC_DEFUN([AM_DISABLE_LIBRARIES],
+[
+ AC_PROVIDE([AM_ENABLE_STATIC])
+ AC_PROVIDE([AM_ENABLE_SHARED])
+ enable_static=no
+ enable_shared=yes
+])
+
+
+AC_DEFUN([AC_CHECK_UTMP_FILE],
+[
+ AC_MSG_CHECKING([for utmp file])
+
+ AC_CACHE_VAL(kde_cv_utmp_file,
+ [
+ kde_cv_utmp_file=no
+
+ for ac_file in \
+ \
+ /var/run/utmp \
+ /var/adm/utmp \
+ /etc/utmp \
+ ; \
+ do
+ if test -r "$ac_file"; then
+ kde_cv_utmp_file=$ac_file
+ break
+ fi
+ done
+ ])
+
+ if test "$kde_cv_utmp_file" != "no"; then
+ AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
+ $1
+ AC_MSG_RESULT($kde_cv_utmp_file)
+ else
+ $2
+ AC_MSG_RESULT([non found])
+ fi
+])
+
+
+AC_DEFUN([KDE_CREATE_SUBDIRSLIST],
+[
+
+DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
+TOPSUBDIRS=""
+
+if test ! -s $srcdir/subdirs; then
+ dnl Note: Makefile.common creates subdirs, so this is just a fallback
+ files=`cd $srcdir && ls -1`
+ dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
+ for i in $dirs; do
+ echo $i >> $srcdir/subdirs
+ done
+fi
+
+ac_topsubdirs=
+if test -s $srcdir/inst-apps; then
+ ac_topsubdirs="`cat $srcdir/inst-apps`"
+elif test -s $srcdir/subdirs; then
+ ac_topsubdirs="`cat $srcdir/subdirs`"
+fi
+
+for i in $ac_topsubdirs; do
+ AC_MSG_CHECKING([if $i should be compiled])
+ if test -d $srcdir/$i; then
+ install_it="yes"
+ for j in $DO_NOT_COMPILE; do
+ if test $i = $j; then
+ install_it="no"
+ fi
+ done
+ else
+ install_it="no"
+ fi
+ AC_MSG_RESULT($install_it)
+ vari=`echo $i | sed -e 's,[[-+.@]],_,g'`
+ if test $install_it = "yes"; then
+ TOPSUBDIRS="$TOPSUBDIRS $i"
+ eval "$vari""_SUBDIR_included=yes"
+ else
+ eval "$vari""_SUBDIR_included=no"
+ fi
+done
+
+AC_SUBST(TOPSUBDIRS)
+])
+
+AC_DEFUN([KDE_CHECK_NAMESPACES],
+[
+AC_MSG_CHECKING(whether C++ compiler supports namespaces)
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+AC_TRY_COMPILE([
+],
+[
+namespace Foo {
+ extern int i;
+ namespace Bar {
+ extern int i;
+ }
+}
+
+int Foo::i = 0;
+int Foo::Bar::i = 1;
+],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_NAMESPACES)
+], [
+AC_MSG_RESULT(no)
+])
+AC_LANG_RESTORE
+])
+
+dnl ------------------------------------------------------------------------
+dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_CHECK_S_ISSOCK],
+[
+AC_MSG_CHECKING(for S_ISSOCK)
+AC_CACHE_VAL(ac_cv_have_s_issock,
+[
+AC_TRY_LINK(
+[
+#include <sys/stat.h>
+],
+[
+struct stat buff;
+int b = S_ISSOCK( buff.st_mode );
+],
+ac_cv_have_s_issock=yes,
+ac_cv_have_s_issock=no)
+])
+AC_MSG_RESULT($ac_cv_have_s_issock)
+if test "$ac_cv_have_s_issock" = "yes"; then
+ AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
+fi
+
+AH_VERBATIM(_ISSOCK,
+[
+#ifndef HAVE_S_ISSOCK
+#define HAVE_S_ISSOCK
+#define S_ISSOCK(mode) (1==0)
+#endif
+])
+
+])
+
+dnl ------------------------------------------------------------------------
+dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_CHECK_KDEMAXPATHLEN],
+[
+AC_MSG_CHECKING(for MAXPATHLEN)
+AC_CACHE_VAL(ac_cv_maxpathlen,
+[
+cat > conftest.$ac_ext <<EOF
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+#endif
+#include <stdio.h>
+#include <sys/param.h>
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
+
+KDE_HELLO MAXPATHLEN
+
+EOF
+
+ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
+
+if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
+ ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
+else
+ ac_cv_maxpathlen=1024
+fi
+
+rm conftest.*
+
+])
+AC_MSG_RESULT($ac_cv_maxpathlen)
+AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
+])
+
+AC_DEFUN([KDE_CHECK_HEADER],
+[
+ kde_safe_cppflags=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $all_includes"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_CHECK_HEADER([$1], [$2], [$3], [$4])
+ AC_LANG_RESTORE
+ CPPFLAGS=$kde_safe_cppflags
+])
+
+AC_DEFUN([KDE_CHECK_HEADERS],
+[
+ AH_CHECK_HEADERS([$1])
+ AC_LANG_SAVE
+ kde_safe_cppflags=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $all_includes"
+ AC_LANG_CPLUSPLUS
+ AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
+ CPPFLAGS=$kde_safe_cppflags
+ AC_LANG_RESTORE
+])
+
+AC_DEFUN([KDE_FAST_CONFIGURE],
+[
+ dnl makes configure fast (needs perl)
+ AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]),
+ with_fast_perl=$enableval, with_fast_perl=yes)
+])
+
+AC_DEFUN([KDE_CONF_FILES],
+[
+ val=
+ if test -f $srcdir/configure.files ; then
+ val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
+ fi
+ CONF_FILES=
+ if test -n "$val" ; then
+ for i in $val ; do
+ CONF_FILES="$CONF_FILES $i"
+ done
+ fi
+ AC_SUBST(CONF_FILES)
+])dnl
+
+dnl This sets the prefix, for arts and kdelibs
+dnl Do NOT use in any other module.
+dnl It only looks at --prefix, KDEDIR and falls back to /usr/local/kde
+AC_DEFUN([KDE_SET_PREFIX_CORE],
+[
+ unset CDPATH
+ dnl make $KDEDIR the default for the installation
+ AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
+
+ if test "x$prefix" = "xNONE"; then
+ prefix=$ac_default_prefix
+ ac_configure_args="$ac_configure_args --prefix=$prefix"
+ fi
+ # And delete superfluous '/' to make compares easier
+ prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
+ exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
+
+ kde_libs_prefix='$(prefix)'
+ kde_libs_htmldir='$(kde_htmldir)'
+ AC_SUBST(kde_libs_prefix)
+ AC_SUBST(kde_libs_htmldir)
+ KDE_FAST_CONFIGURE
+ KDE_CONF_FILES
+])
+
+
+AC_DEFUN([KDE_SET_PREFIX],
+[
+ unset CDPATH
+ dnl We can't give real code to that macro, only a value.
+ dnl It only matters for --help, since we set the prefix in this function anyway.
+ AC_PREFIX_DEFAULT(${KDEDIR:-the kde prefix})
+
+ KDE_SET_DEFAULT_BINDIRS
+ if test "x$prefix" = "xNONE"; then
+ dnl no prefix given: look for kde-config in the PATH and deduce the prefix from it
+ KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
+ else
+ dnl prefix given: look for kde-config, preferrably in prefix, otherwise in PATH
+ kde_save_PATH="$PATH"
+ PATH="$exec_prefix/bin:$prefix/bin:$PATH"
+ KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
+ PATH="$kde_save_PATH"
+ fi
+
+ kde_libs_prefix=`$KDECONFIG --prefix`
+ if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
+ AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
+ This means it has been moved since you installed it.
+ This won't work. Please recompile kdelibs for the new prefix.
+ ])
+ fi
+ kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
+
+ AC_MSG_CHECKING([where to install])
+ if test "x$prefix" = "xNONE"; then
+ prefix=$kde_libs_prefix
+ AC_MSG_RESULT([$prefix (as returned by kde-config)])
+ else
+ dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different
+ given_prefix=$prefix
+ AC_MSG_RESULT([$prefix (as requested)])
+ fi
+
+ # And delete superfluous '/' to make compares easier
+ prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
+ exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
+ given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
+
+ AC_SUBST(KDECONFIG)
+ AC_SUBST(kde_libs_prefix)
+ AC_SUBST(kde_libs_htmldir)
+
+ KDE_FAST_CONFIGURE
+ KDE_CONF_FILES
+])
+
+pushdef([AC_PROG_INSTALL],
+[
+ dnl our own version, testing for a -p flag
+ popdef([AC_PROG_INSTALL])
+ dnl as AC_PROG_INSTALL works as it works we first have
+ dnl to save if the user didn't specify INSTALL, as the
+ dnl autoconf one overwrites INSTALL and we have no chance to find
+ dnl out afterwards
+ test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
+ test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
+ test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
+ AC_PROG_INSTALL
+
+ if test -z "$kde_save_INSTALL_given" ; then
+ # OK, user hasn't given any INSTALL, autoconf found one for us
+ # now we test, if it supports the -p flag
+ AC_MSG_CHECKING(for -p flag to install)
+ rm -f confinst.$$.* > /dev/null 2>&1
+ echo "Testtest" > confinst.$$.orig
+ ac_res=no
+ if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
+ if test -f confinst.$$.new ; then
+ # OK, -p seems to do no harm to install
+ INSTALL="${INSTALL} -p"
+ ac_res=yes
+ fi
+ fi
+ rm -f confinst.$$.*
+ AC_MSG_RESULT($ac_res)
+ fi
+ dnl the following tries to resolve some signs and wonders coming up
+ dnl with different autoconf/automake versions
+ dnl e.g.:
+ dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
+ dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
+ dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
+ dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
+ dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
+ dnl install-@DIR@PROGRAMS targets to explicitly use that flag
+ dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
+ dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
+ dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
+ dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from
+ dnl automake (due to broken Makefile.am or whatever) to install programs,
+ dnl and so does not see the -s flag in automake > 1.4
+ dnl to clean up that mess we:
+ dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
+ dnl which cleans KDE's program with automake > 1.4;
+ dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
+ dnl with automake<=1.4
+ dnl note that dues to this sometimes two '-s' flags are used (if KDE
+ dnl properly uses install-@DIR@PROGRAMS, but I don't care
+ dnl
+ dnl And to all this comes, that I even can't write in comments variable
+ dnl names used by automake, because it is so stupid to think I wanted to
+ dnl _use_ them, therefor I have written A_M_... instead of AM_
+ dnl hmm, I wanted to say something ... ahh yes: Arghhh.
+
+ if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
+ INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
+ fi
+ if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
+ INSTALL_SCRIPT='${INSTALL}'
+ fi
+])dnl
+
+AC_DEFUN([KDE_LANG_CPLUSPLUS],
+[AC_LANG_CPLUSPLUS
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
+pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
+])
+
+pushdef([AC_LANG_CPLUSPLUS],
+[popdef([AC_LANG_CPLUSPLUS])
+KDE_LANG_CPLUSPLUS
+])
+
+AC_DEFUN([KDE_CHECK_LONG_LONG],
+[
+AC_MSG_CHECKING(for long long)
+AC_CACHE_VAL(kde_cv_c_long_long,
+[
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_LINK([], [
+ long long foo = 0;
+ foo = foo+1;
+ ],
+ kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
+ AC_LANG_RESTORE
+])
+AC_MSG_RESULT($kde_cv_c_long_long)
+if test "$kde_cv_c_long_long" = yes; then
+ AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
+fi
+])
+
+AC_DEFUN([KDE_CHECK_LIB],
+[
+ kde_save_LDFLAGS="$LDFLAGS"
+ dnl AC_CHECK_LIB modifies LIBS, so save it here
+ kde_save_LIBS="$LIBS"
+ LDFLAGS="$LDFLAGS $all_libraries"
+ case $host_os in
+ aix*) LDFLAGS="-brtl $LDFLAGS"
+ test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
+ ;;
+ esac
+ AC_CHECK_LIB($1, $2, $3, $4, $5)
+ LDFLAGS="$kde_save_LDFLAGS"
+ LIBS="$kde_save_LIBS"
+])
+
+AC_DEFUN([KDE_JAVA_PREFIX],
+[
+ dir=`dirname "$1"`
+ base=`basename "$1"`
+ list=`ls -1 $dir 2> /dev/null`
+ for entry in $list; do
+ if test -d $dir/$entry/bin; then
+ case $entry in
+ $base)
+ javadirs="$javadirs $dir/$entry/bin"
+ ;;
+ esac
+ elif test -d $dir/$entry/jre/bin; then
+ case $entry in
+ $base)
+ javadirs="$javadirs $dir/$entry/jre/bin"
+ ;;
+ esac
+ fi
+ done
+])
+
+dnl KDE_CHEC_JAVA_DIR(onlyjre)
+AC_DEFUN([KDE_CHECK_JAVA_DIR],
+[
+
+AC_ARG_WITH(java,
+AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]),
+[ ac_java_dir=$withval
+], ac_java_dir=""
+)
+
+AC_MSG_CHECKING([for Java])
+
+dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
+if test "x$ac_java_dir" = "xno"; then
+ kde_java_bindir=no
+ kde_java_includedir=no
+ kde_java_libjvmdir=no
+ kde_java_libgcjdir=no
+ kde_java_libhpidir=no
+else
+ if test "x$ac_java_dir" = "x"; then
+
+
+ dnl No option set -> collect list of candidate paths
+ if test -n "$JAVA_HOME"; then
+ KDE_JAVA_PREFIX($JAVA_HOME)
+ fi
+ KDE_JAVA_PREFIX(/usr/j2se)
+ KDE_JAVA_PREFIX(/usr/lib/j2se)
+ KDE_JAVA_PREFIX(/usr/j*dk*)
+ KDE_JAVA_PREFIX(/usr/lib/j*dk*)
+ KDE_JAVA_PREFIX(/opt/j*sdk*)
+ KDE_JAVA_PREFIX(/usr/lib/java*)
+ KDE_JAVA_PREFIX(/usr/java*)
+ KDE_JAVA_PREFIX(/usr/java/j*dk*)
+ KDE_JAVA_PREFIX(/usr/java/j*re*)
+ KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
+ KDE_JAVA_PREFIX(/usr/lib/SunJava*)
+ KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
+ KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
+ KDE_JAVA_PREFIX(/opt/java*)
+
+ kde_cv_path="NONE"
+ kde_save_IFS=$IFS
+ IFS=':'
+ for dir in $PATH; do
+ if test -d "$dir"; then
+ javadirs="$javadirs $dir"
+ fi
+ done
+ IFS=$kde_save_IFS
+ jredirs=
+
+ dnl Now javadirs contains a list of paths that exist, all ending with bin/
+ for dir in $javadirs; do
+ dnl Check for the java executable
+ if test -x "$dir/java"; then
+ dnl And also check for a libjvm.so somewhere under there
+ dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
+ if test "$dir" != "/usr/bin"; then
+ libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
+ if test ! -f $libjvmdir/libjvm.so; then continue; fi
+ jredirs="$jredirs $dir"
+ fi
+ fi
+ done
+
+ dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found
+ JAVAC=
+ JAVA=
+ kde_java_bindir=no
+ for dir in $jredirs; do
+ JAVA="$dir/java"
+ kde_java_bindir=$dir
+ if test -x "$dir/javac"; then
+ JAVAC="$dir/javac"
+ break
+ fi
+ done
+
+ if test -n "$JAVAC"; then
+ dnl this substitution might not work - well, we test for jni.h below
+ kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
+ else
+ kde_java_includedir=no
+ fi
+ else
+ dnl config option set
+ kde_java_bindir=$ac_java_dir/bin
+ if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
+ kde_java_includedir=no
+ else
+ kde_java_includedir=$ac_java_dir/include
+ fi
+ fi
+fi
+
+dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
+if test "x$kde_java_bindir" != "xno"; then
+
+ dnl Look for libjvm.so
+ kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
+ dnl Look for libgcj.so
+ kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
+ dnl Look for libhpi.so and avoid green threads
+ kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
+
+ dnl Now check everything's fine under there
+ dnl the include dir is our flag for having the JDK
+ if test -d "$kde_java_includedir"; then
+ if test ! -x "$kde_java_bindir/javac"; then
+ AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
+ fi
+ if test ! -x "$kde_java_bindir/javah"; then
+ AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
+ fi
+ if test ! -x "$kde_java_bindir/jar"; then
+ AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
+ fi
+ if test ! -r "$kde_java_includedir/jni.h"; then
+ AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
+ fi
+
+ jni_includes="-I$kde_java_includedir"
+ dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
+ dnl and under linux here..
+
+ dnl not needed for gcj
+
+ if test "x$kde_java_libgcjdir" = "x"; then
+ test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
+ test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
+ test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
+ fi
+
+ else
+ JAVAC=
+ jni_includes=
+ fi
+
+ if test "x$kde_java_libgcjdir" = "x"; then
+ if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
+ AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
+ fi
+ else
+ if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
+ AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
+ fi
+ fi
+
+ if test ! -x "$kde_java_bindir/java"; then
+ AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
+ fi
+
+ dnl not needed for gcj compile
+
+ if test "x$kde_java_libgcjdir" = "x"; then
+ if test ! -r "$kde_java_libhpidir/libhpi.so"; then
+ AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
+ fi
+ fi
+
+ if test -n "$jni_includes"; then
+ dnl Check for JNI version
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_cxxflags_safe="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
+
+ AC_TRY_COMPILE([
+ #include <jni.h>
+ ],
+ [
+ #ifndef JNI_VERSION_1_2
+ Syntax Error
+ #endif
+ ],[ kde_jni_works=yes ],
+ [ kde_jni_works=no ])
+
+ if test $kde_jni_works = no; then
+ AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
+ You need to have Java Development Kit (JDK) version 1.2.
+
+ Use --with-java to specify another location.
+ Use --without-java to configure without java support.
+ Or download a newer JDK and try again.
+ See e.g. http://java.sun.com/products/jdk/1.2 ])
+ fi
+
+ CXXFLAGS="$ac_cxxflags_safe"
+ AC_LANG_RESTORE
+
+ dnl All tests ok, inform and subst the variables
+
+ JAVAC=$kde_java_bindir/javac
+ JAVAH=$kde_java_bindir/javah
+ JAR=$kde_java_bindir/jar
+ AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
+ if test "x$kde_java_libgcjdir" = "x"; then
+ JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
+ else
+ JVMLIBS="-L$kde_java_libgcjdir -lgcj"
+ fi
+ AC_MSG_RESULT([java JDK in $kde_java_bindir])
+
+ else
+ AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
+ AC_MSG_RESULT([java JRE in $kde_java_bindir])
+ fi
+elif test -d "/Library/Java/Home"; then
+ kde_java_bindir="/Library/Java/Home/bin"
+ jni_includes="-I/Library/Java/Home/include"
+
+ JAVAC=$kde_java_bindir/javac
+ JAVAH=$kde_java_bindir/javah
+ JAR=$kde_java_bindir/jar
+ JVMLIBS="-Wl,-framework,JavaVM"
+
+ AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
+ AC_MSG_RESULT([Apple Java Framework])
+else
+ AC_MSG_RESULT([none found])
+fi
+
+AC_SUBST(JAVAC)
+AC_SUBST(JAVAH)
+AC_SUBST(JAR)
+AC_SUBST(JVMLIBS)
+AC_SUBST(jni_includes)
+
+# for backward compat
+kde_cv_java_includedir=$kde_java_includedir
+kde_cv_java_bindir=$kde_java_bindir
+])
+
+dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
+dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
+dnl big packages, m4_foreach is dog-slow. So use our own version of
+dnl it. (matz@kde.org)
+m4_define([mm_foreach],
+[m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
+m4_define([mm_car], [[$1]])
+m4_define([mm_car2], [[$@]])
+m4_define([_mm_foreach],
+[m4_if(m4_quote($2), [], [],
+ [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1],
+ mm_car2(m4_shift($2)),
+ [$3])])])
+m4_define([AC_FOREACH],
+[mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
+
+AC_DEFUN([KDE_NEED_FLEX],
+[
+kde_libs_safe=$LIBS
+LIBS="$LIBS $USER_LDFLAGS"
+AM_PROG_LEX
+LIBS=$kde_libs_safe
+if test -z "$LEXLIB"; then
+ AC_MSG_ERROR([You need to have flex installed.])
+fi
+AC_SUBST(LEXLIB)
+])
+
+AC_DEFUN([AC_PATH_QTOPIA],
+[
+ dnl TODO: use AC_CACHE_VAL
+
+ if test -z "$1"; then
+ qtopia_minver_maj=1
+ qtopia_minver_min=5
+ qtopia_minver_pat=0
+ else
+ qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
+ qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
+ qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
+ fi
+
+ qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
+ qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
+
+ AC_REQUIRE([AC_PATH_QT])
+
+ AC_MSG_CHECKING([for Qtopia])
+
+ LIB_QTOPIA="-lqpe"
+ AC_SUBST(LIB_QTOPIA)
+
+ kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
+
+ ac_qtopia_incdir=NO
+
+ AC_ARG_WITH(qtopia-dir,
+ AC_HELP_STRING([--with-qtopia-dir=DIR],[where the root of Qtopia is installed]),
+ [ ac_qtopia_incdir="$withval"/include] )
+
+ qtopia_incdirs=""
+ for dir in $kde_qtopia_dirs; do
+ qtopia_incdirs="$qtopia_incdirs $dir/include"
+ done
+
+ if test ! "$ac_qtopia_incdir" = "NO"; then
+ qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
+ fi
+
+ qtopia_incdir=""
+ AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
+ ac_qtopia_incdir="$qtopia_incdir"
+
+ if test -z "$qtopia_incdir"; then
+ AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
+ fi
+
+ qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
+ qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
+ qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
+
+ qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
+ qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
+ if test "$qtopia_ver" -lt "$qtopia_minver"; then
+ AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
+is required.])
+ fi
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ ac_cxxflags_safe="$CXXFLAGS"
+ ac_ldflags_safe="$LDFLAGS"
+ ac_libs_safe="$LIBS"
+
+ CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
+ LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
+ LIBS="$LIBS $LIB_QTOPIA $LIBQT"
+
+ cat > conftest.$ac_ext <<EOF
+#include "confdefs.h"
+#include <qpe/qpeapplication.h>
+#include <qpe/version.h>
+
+int main( int argc, char **argv )
+{
+ QPEApplication app( argc, argv );
+ return 0;
+}
+EOF
+
+ if AC_TRY_EVAL(ac_link) && test -s conftest; then
+ rm -f conftest*
+ else
+ rm -f conftest*
+ AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
+the end of config.log])
+ fi
+
+ CXXFLAGS="$ac_cxxflags_safe"
+ LDFLAGS="$ac_ldflags_safe"
+ LIBS="$ac_libs_safe"
+
+ AC_LANG_RESTORE
+
+ QTOPIA_INCLUDES="-I$qtopia_incdir"
+ AC_SUBST(QTOPIA_INCLUDES)
+
+ AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
+])
+
+
+AC_DEFUN([KDE_INIT_DOXYGEN],
+[
+AC_MSG_CHECKING([for Qt docs])
+kde_qtdir=
+if test "${with_qt_dir+set}" = set; then
+ kde_qtdir="$with_qt_dir"
+fi
+
+AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
+AC_MSG_RESULT($QTDOCDIR)
+
+AC_SUBST(QTDOCDIR)
+
+KDE_FIND_PATH(dot, DOT, [], [])
+if test -n "$DOT"; then
+ KDE_HAVE_DOT="YES"
+else
+ KDE_HAVE_DOT="NO"
+fi
+AC_SUBST(KDE_HAVE_DOT)
+KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
+AC_SUBST(DOXYGEN)
+
+DOXYGEN_PROJECT_NAME="$1"
+DOXYGEN_PROJECT_NUMBER="$2"
+AC_SUBST(DOXYGEN_PROJECT_NAME)
+AC_SUBST(DOXYGEN_PROJECT_NUMBER)
+
+KDE_HAS_DOXYGEN=no
+if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
+ KDE_HAS_DOXYGEN=yes
+fi
+AC_SUBST(KDE_HAS_DOXYGEN)
+
+])
+
+
+AC_DEFUN([AC_FIND_BZIP2],
+[
+AC_MSG_CHECKING([for bzDecompress in libbz2])
+AC_CACHE_VAL(ac_cv_lib_bzip2,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+kde_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
+kde_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(dnl
+[
+#define BZ_NO_STDIO
+#include<bzlib.h>
+],
+ [ bz_stream s; (void) bzDecompress(&s); ],
+ eval "ac_cv_lib_bzip2='-lbz2'",
+ eval "ac_cv_lib_bzip2=no")
+LIBS="$kde_save_LIBS"
+CXXFLAGS="$kde_save_CXXFLAGS"
+AC_LANG_RESTORE
+])dnl
+AC_MSG_RESULT($ac_cv_lib_bzip2)
+
+if test ! "$ac_cv_lib_bzip2" = no; then
+ BZIP2DIR=bzip2
+
+ LIBBZ2="$ac_cv_lib_bzip2"
+ AC_SUBST(LIBBZ2)
+
+else
+
+ cxx_shared_flag=
+ ld_shared_flag=
+ KDE_CHECK_COMPILER_FLAG(shared, [
+ ld_shared_flag="-shared"
+ ])
+ KDE_CHECK_COMPILER_FLAG(fPIC, [
+ cxx_shared_flag="-fPIC"
+ ])
+
+ AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
+ AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
+ [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ kde_save_LIBS="$LIBS"
+ LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
+ kde_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
+
+ AC_TRY_LINK(dnl
+ [
+ #define BZ_NO_STDIO
+ #include<bzlib.h>
+ ],
+ [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
+ eval "ac_cv_lib_bzip2_prefix='-lbz2'",
+ eval "ac_cv_lib_bzip2_prefix=no")
+ LIBS="$kde_save_LIBS"
+ CXXFLAGS="$kde_save_CXXFLAGS"
+ AC_LANG_RESTORE
+ ])dnl
+
+ AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
+
+ if test ! "$ac_cv_lib_bzip2_prefix" = no; then
+ BZIP2DIR=bzip2
+
+ LIBBZ2="$ac_cv_lib_bzip2_prefix"
+ AC_SUBST(LIBBZ2)
+
+ AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
+ dnl else, we just ignore this
+ fi
+
+fi
+AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
+])
+
+dnl ------------------------------------------------------------------------
+dnl Try to find the SSL headers and libraries.
+dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
+dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([KDE_CHECK_SSL],
+[
+LIBSSL="-lssl -lcrypto"
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+ac_ssl_includes=NO ac_ssl_libraries=NO
+ssl_libraries=""
+ssl_includes=""
+AC_ARG_WITH(ssl-dir,
+ AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]),
+ [ ac_ssl_includes="$withval"/include
+ ac_ssl_libraries="$withval"/lib$kdelibsuff
+ ])
+
+want_ssl=yes
+AC_ARG_WITH(ssl,
+ AC_HELP_STRING([--without-ssl],[disable SSL checks]),
+ [want_ssl=$withval])
+
+if test $want_ssl = yes; then
+
+AC_MSG_CHECKING(for OpenSSL)
+
+AC_CACHE_VAL(ac_cv_have_ssl,
+[#try to guess OpenSSL locations
+
+ ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
+ ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
+ AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
+ ac_ssl_includes="$ssl_incdir"
+
+ ssl_libdirs="/usr/lib$kdelibsuff /usr/local/lib$kdelibsuff /usr/ssl/lib$kdelibsuff /usr/local/ssl/lib$kdelibsuff $libdir $prefix/lib$kdelibsuff $exec_prefix/lib$kdelibsuff $kde_extra_libs"
+ if test ! "$ac_ssl_libraries" = "NO"; then
+ ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
+ fi
+
+ test=NONE
+ ssl_libdir=NONE
+ for dir in $ssl_libdirs; do
+ try="ls -1 $dir/libssl*"
+ if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
+ done
+
+ ac_ssl_libraries="$ssl_libdir"
+
+ ac_ldflags_safe="$LDFLAGS"
+ ac_libs_safe="$LIBS"
+
+ LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
+ LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
+
+ AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
+ ac_ssl_rsaref="yes"
+ ,
+ ac_ssl_rsaref="no"
+ )
+
+ LDFLAGS="$ac_ldflags_safe"
+ LIBS="$ac_libs_safe"
+
+ if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
+ have_ssl=no
+ else
+ have_ssl=yes;
+ fi
+
+ ])
+
+ eval "$ac_cv_have_ssl"
+
+ AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
+
+ AC_MSG_CHECKING([whether OpenSSL uses rsaref])
+ AC_MSG_RESULT($ac_ssl_rsaref)
+
+ AC_MSG_CHECKING([for easter eggs])
+ AC_MSG_RESULT([none found])
+
+else
+ have_ssl=no
+fi
+
+if test "$have_ssl" = yes; then
+ AC_MSG_CHECKING(for OpenSSL version)
+ dnl Check for SSL version
+ AC_CACHE_VAL(ac_cv_ssl_version,
+ [
+
+ cat >conftest.$ac_ext <<EOF
+#include <openssl/opensslv.h>
+#include <stdio.h>
+ int main() {
+
+#ifndef OPENSSL_VERSION_NUMBER
+ printf("ssl_version=\\"error\\"\n");
+#else
+ if (OPENSSL_VERSION_NUMBER < 0x00906000)
+ printf("ssl_version=\\"old\\"\n");
+ else
+ printf("ssl_version=\\"ok\\"\n");
+#endif
+ return (0);
+ }
+EOF
+
+ ac_save_CPPFLAGS=$CPPFLAGS
+ if test "$ac_ssl_includes" != "/usr/include"; then
+ CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes"
+ fi
+
+ if AC_TRY_EVAL(ac_link); then
+
+ if eval `./conftest 2>&5`; then
+ if test $ssl_version = error; then
+ AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
+ else
+ if test $ssl_version = old; then
+ AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
+ have_ssl=no
+ fi
+ fi
+ ac_cv_ssl_version="ssl_version=$ssl_version"
+ else
+ AC_MSG_ERROR([Your system couldn't run a small SSL test program.
+ Check config.log, and if you can't figure it out, send a mail to
+ David Faure <faure@kde.org>, attaching your config.log])
+ fi
+
+ else
+ AC_MSG_ERROR([Your system couldn't link a small SSL test program.
+ Check config.log, and if you can't figure it out, send a mail to
+ David Faure <faure@kde.org>, attaching your config.log])
+ fi
+ CPPFLAGS=$ac_save_CPPFLAGS
+
+ ])
+
+ eval "$ac_cv_ssl_version"
+ AC_MSG_RESULT($ssl_version)
+fi
+
+if test "$have_ssl" != yes; then
+ LIBSSL="";
+else
+ AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
+ ac_cv_have_ssl="have_ssl=yes \
+ ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
+
+
+ ssl_libraries="$ac_ssl_libraries"
+ ssl_includes="$ac_ssl_includes"
+
+ if test "$ac_ssl_rsaref" = yes; then
+ LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref"
+ fi
+
+ if test $ssl_version = "old"; then
+ AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
+ fi
+fi
+
+SSL_INCLUDES=
+
+if test "$ssl_includes" = "/usr/include"; then
+ if test -f /usr/kerberos/include/krb5.h; then
+ SSL_INCLUDES="-I/usr/kerberos/include"
+ fi
+elif test "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then
+ SSL_INCLUDES="-I$ssl_includes"
+fi
+
+if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then
+ SSL_LDFLAGS=""
+else
+ SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
+fi
+
+AC_SUBST(SSL_INCLUDES)
+AC_SUBST(SSL_LDFLAGS)
+AC_SUBST(LIBSSL)
+])
+
+AC_DEFUN([KDE_CHECK_STRLCPY],
+[
+ AC_REQUIRE([AC_CHECK_STRLCAT])
+ AC_REQUIRE([AC_CHECK_STRLCPY])
+ AC_CHECK_SIZEOF(size_t)
+ AC_CHECK_SIZEOF(unsigned long)
+
+ AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long])
+ AC_TRY_COMPILE(,[
+ #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
+ choke me
+ #endif
+ ],AC_MSG_RESULT([yes]),[
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR([
+ Apparently on your system our assumption sizeof size_t == sizeof unsigned long
+ does not apply. Please mail kde-devel@kde.org with a description of your system!
+ ])
+ ])
+])
+
+AC_DEFUN([KDE_CHECK_BINUTILS],
+[
+ AC_MSG_CHECKING([if ld supports unversioned version maps])
+
+ kde_save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
+ echo "{ local: extern \"C++\" { foo }; };" > conftest.map
+ AC_TRY_LINK([int foo;],
+[
+#ifdef __INTEL_COMPILER
+icc apparently does not support libtools version-info and version-script
+at the same time. Dunno where the bug is, but until somebody figured out,
+better disable the optional version scripts.
+#endif
+
+ foo = 42;
+], kde_supports_versionmaps=yes, kde_supports_versionmaps=no)
+ LDFLAGS="$kde_save_LDFLAGS"
+ rm -f conftest.map
+ AM_CONDITIONAL(include_VERSION_SCRIPT,
+ [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"])
+
+ AC_MSG_RESULT($kde_supports_versionmaps)
+])
+
+AC_DEFUN([AM_PROG_OBJC],[
+AC_CHECK_PROGS(OBJC, gcc, gcc)
+test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH])
+if test "x${OBJCFLAGS-unset}" = xunset; then
+ OBJCFLAGS="-g -O2"
+fi
+AC_SUBST(OBJCFLAGS)
+_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)])
+])
+
+AC_DEFUN([KDE_CHECK_PERL],
+[
+ KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [
+ AC_MSG_ERROR([No Perl found in your $PATH.
+We need perl to generate some code.])
+ ])
+ AC_SUBST(PERL)
+])
+
+AC_DEFUN([KDE_CHECK_LARGEFILE],
+[
+AC_SYS_LARGEFILE
+if test "$ac_cv_sys_file_offset_bits" != no; then
+ CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
+fi
+
+if test "x$ac_cv_sys_large_files" != "xno"; then
+ CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1"
+fi
+
+])
+
+dnl A small extension to PKG_CHECK_MODULES (defined in pkg.m4.in)
+dnl which allows to search for libs that get installed into the KDE prefix.
+dnl
+dnl Syntax: KDE_PKG_CHECK_MODULES(KSTUFF, libkexif >= 0.2 glib = 1.3.4, action-if, action-not)
+dnl defines KSTUFF_LIBS, KSTUFF_CFLAGS, see pkg-config man page
+dnl also defines KSTUFF_PKG_ERRORS on error
+AC_DEFUN([KDE_PKG_CHECK_MODULES], [
+
+ PKG_CONFIG_PATH="$prefix/lib${kdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
+ if test "$prefix" != "$kde_libs_prefix"; then
+ PKG_CONFIG_PATH="$kde_libs_prefix/lib${kdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
+ fi
+ export PKG_CONFIG_PATH
+ PKG_CHECK_MODULES([$1],[$2],[$3],[$4])
+])
+
+
+dnl Check for PIE support in the compiler and linker
+AC_DEFUN([KDE_CHECK_PIE_SUPPORT],
+[
+ AC_CACHE_CHECK([for PIE support], kde_cv_val_pie_support,
+ [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ safe_CXXFLAGS=$CXXFLAGS
+ safe_LDFLAGS=$LDFLAGS
+ CXXFLAGS="$CXXFLAGS -fPIE"
+ LDFLAGS="$LDFLAGS -pie"
+
+ AC_TRY_LINK([int foo;], [], [kde_cv_val_pie_support=yes], [kde_cv_val_pie_support=no])
+
+ CXXFLAGS=$safe_CXXFLAGS
+ LDFLAGS=$safe_LDFLAGS
+ AC_LANG_RESTORE
+ ])
+
+ AC_MSG_CHECKING(if enabling -pie/fPIE support)
+
+ AC_ARG_ENABLE(pie,
+ AC_HELP_STRING([--enable-pie],[platform supports PIE linking [default=detect]]),
+ [kde_has_pie_support=$enableval],
+ [kde_has_pie_support=detect])
+
+ if test "$kde_has_pie_support" = "detect"; then
+ kde_has_pie_support=$kde_cv_val_pie_support
+ fi
+
+ AC_MSG_RESULT([$kde_has_pie_support])
+
+ KDE_USE_FPIE=""
+ KDE_USE_PIE=""
+
+ AC_SUBST([KDE_USE_FPIE])
+ AC_SUBST([KDE_USE_PIE])
+
+ if test "$kde_has_pie_support" = "yes"; then
+ KDE_USE_FPIE="-fPIE"
+ KDE_USE_PIE="-pie"
+ fi
+])
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+## Copyright 1996, 1997, 1998, 1999, 2000, 2001
+## Free Software Foundation, Inc.
+## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+##
+## 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.
+##
+## As a special exception to the GNU General Public License, if you
+## distribute this file as part of a program that contains a
+## configuration script generated by Autoconf, you may include it under
+## the same distribution terms that you use for the rest of that program.
+
+# serial 47 AC_PROG_LIBTOOL
+
+
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -----------------------------------------------------------
+# If this macro is not defined by Autoconf, define it here.
+m4_ifdef([AC_PROVIDE_IFELSE],
+ [],
+ [m4_define([AC_PROVIDE_IFELSE],
+ [m4_ifdef([AC_PROVIDE_$1],
+ [$2], [$3])])])
+
+
+# AC_PROG_LIBTOOL
+# ---------------
+AC_DEFUN([AC_PROG_LIBTOOL],
+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+ AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [AC_LIBTOOL_CXX],
+ [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+ ])])
+dnl And a similar setup for Fortran 77 support
+ AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [AC_LIBTOOL_F77],
+ [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
+])])
+
+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+ AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [ifdef([AC_PROG_GCJ],
+ [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+ ifdef([A][M_PROG_GCJ],
+ [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+ ifdef([LT_AC_PROG_GCJ],
+ [define([LT_AC_PROG_GCJ],
+ defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
+])])# AC_PROG_LIBTOOL
+
+
+# _AC_PROG_LIBTOOL
+# ----------------
+AC_DEFUN([_AC_PROG_LIBTOOL],
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent'
+AC_SUBST(LIBTOOL)dnl
+
+# Prevent multiple expansion
+define([AC_PROG_LIBTOOL], [])
+])# _AC_PROG_LIBTOOL
+
+
+# AC_LIBTOOL_SETUP
+# ----------------
+AC_DEFUN([AC_LIBTOOL_SETUP],
+[AC_PREREQ(2.50)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+
+AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+dnl
+
+AC_LIBTOOL_SYS_MAX_CMD_LEN
+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+AC_LIBTOOL_OBJDIR
+
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+_LT_AC_PROG_ECHO_BACKSLASH
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
+
+# Same as above, but do not quote variable references.
+[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+AC_CHECK_TOOL(AR, ar, false)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+ ;;
+ *)
+ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ AC_PATH_MAGIC
+ fi
+ ;;
+esac
+
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+enable_win32_dll=yes, enable_win32_dll=no)
+
+AC_ARG_ENABLE([libtool-lock],
+ [AC_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+AC_ARG_WITH([pic],
+ [AC_HELP_STRING([--with-pic],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [pic_mode="$withval"],
+ [pic_mode=default])
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+AC_LIBTOOL_LANG_C_CONFIG
+_LT_AC_TAGCONFIG
+])# AC_LIBTOOL_SETUP
+
+
+# _LT_AC_SYS_COMPILER
+# -------------------
+AC_DEFUN([_LT_AC_SYS_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_AC_SYS_COMPILER
+
+
+# _LT_AC_SYS_LIBPATH_AIX
+# ----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
+[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_AC_SYS_LIBPATH_AIX
+
+
+# _LT_AC_SHELL_INIT(ARG)
+# ----------------------
+AC_DEFUN([_LT_AC_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+ [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+ [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_AC_SHELL_INIT
+
+
+# _LT_AC_PROG_ECHO_BACKSLASH
+# --------------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
+[_LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+ ;;
+esac
+
+echo=${ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X[$]1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+[$]*
+EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if (echo_test_string="`eval $cmd`") 2>/dev/null &&
+ echo_test_string="`eval $cmd`" &&
+ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+ then
+ break
+ fi
+ done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$echo" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ echo='print -r'
+ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+ else
+ # Try using printf.
+ echo='printf %s\n'
+ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ echo="$CONFIG_SHELL [$]0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$CONFIG_SHELL [$]0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "[$]0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ echo=echo
+ fi
+ fi
+ fi
+ fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+ ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(ECHO)
+])])# _LT_AC_PROG_ECHO_BACKSLASH
+
+
+# _LT_AC_LOCK
+# -----------
+AC_DEFUN([_LT_AC_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AC_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ LINUX_64_MODE="32"
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ LINUX_64_MODE="64"
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+ ])
+esac
+
+need_locks="$enable_libtool_lock"
+
+])# _LT_AC_LOCK
+
+
+# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
+[AC_REQUIRE([LT_AC_PROG_SED])
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s conftest.err; then
+ $2=yes
+ fi
+ fi
+ $rm conftest*
+])
+
+if test x"[$]$2" = xyes; then
+ ifelse([$5], , :, [$5])
+else
+ ifelse([$6], , :, [$6])
+fi
+])# AC_LIBTOOL_COMPILER_OPTION
+
+
+# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
+[AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ else
+ $2=yes
+ fi
+ fi
+ $rm conftest*
+ LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+ ifelse([$4], , :, [$4])
+else
+ ifelse([$5], , :, [$5])
+fi
+])# AC_LIBTOOL_LINKER_OPTION
+
+
+# AC_LIBTOOL_SYS_MAX_CMD_LEN
+# --------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
+[# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ testring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ *)
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
+ = "XX$testring") >/dev/null 2>&1 &&
+ new_result=`expr "X$testring" : ".*" 2>&1` &&
+ lt_cv_sys_max_cmd_len=$new_result &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ testring=$testring$testring
+ done
+ testring=
+ # Add a significant safety factor because C++ compilers can tack on massive
+ # amounts of additional arguments before passing them to the linker.
+ # It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+])# AC_LIBTOOL_SYS_MAX_CMD_LEN
+
+
+# _LT_AC_CHECK_DLFCN
+# --------------------
+AC_DEFUN([_LT_AC_CHECK_DLFCN],
+[AC_CHECK_HEADERS(dlfcn.h)dnl
+])# _LT_AC_CHECK_DLFCN
+
+
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ------------------------------------------------------------------
+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}]
+EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_unknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_AC_TRY_DLOPEN_SELF
+
+
+# AC_LIBTOOL_DLOPEN_SELF
+# -------------------
+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_AC_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ LDFLAGS="$LDFLAGS $link_static_flag"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_AC_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+])# AC_LIBTOOL_DLOPEN_SELF
+
+
+# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
+# ---------------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler
+AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
+ # that will create temporary files in the current directory regardless of
+ # the output directory. Thus, making CWD read-only will cause this test
+ # to fail, enabling locking or at least warning the user not to do parallel
+ # builds.
+ chmod -w .
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s out/conftest.err; then
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w .
+ $rm conftest* out/*
+ rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+])
+])# AC_LIBTOOL_PROG_CC_C_O
+
+
+# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
+# -----------------------------------------
+# Check to see if we can do hard links to lock some files if needed
+AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
+[AC_REQUIRE([_LT_AC_LOCK])dnl
+
+hard_links="nottested"
+if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
+
+
+# AC_LIBTOOL_OBJDIR
+# -----------------
+AC_DEFUN([AC_LIBTOOL_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+])# AC_LIBTOOL_OBJDIR
+
+
+# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
+# ----------------------------------------------
+# Check hardcoding attributes.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_AC_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
+ test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
+ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_AC_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
+
+
+# AC_LIBTOOL_SYS_LIB_STRIP
+# ------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
+[striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+])# AC_LIBTOOL_SYS_LIB_STRIP
+
+
+# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
+[AC_MSG_CHECKING([dynamic linker characteristics])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi4*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ else
+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+kfreebsd*-gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+freebsd*)
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ *) # from 3.2 on
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case "$host_cpu" in
+ ia64*)
+ shrext='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ libsuff=
+ if test "x$LINUX_64_MODE" = x64; then
+ # Some platforms are per default 64-bit, so there's no /lib64
+ if test -d /lib64; then
+ libsuff=64
+ fi
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
+ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+
+
+# _LT_AC_TAGCONFIG
+# ----------------
+AC_DEFUN([_LT_AC_TAGCONFIG],
+[AC_ARG_WITH([tags],
+ [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
+ [include additional configurations @<:@automatic@:>@])],
+ [tagnames="$withval"])
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+ if test ! -f "${ofile}"; then
+ AC_MSG_WARN([output file `$ofile' does not exist])
+ fi
+
+ if test -z "$LTCC"; then
+ eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+ if test -z "$LTCC"; then
+ AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
+ else
+ AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
+ fi
+ fi
+
+ # Extract list of available tagged configurations in $ofile.
+ # Note that this assumes the entire list is on one line.
+ available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for tagname in $tagnames; do
+ IFS="$lt_save_ifs"
+ # Check whether tagname contains only valid characters
+ case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
+ "") ;;
+ *) AC_MSG_ERROR([invalid tag name: $tagname])
+ ;;
+ esac
+
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+ then
+ AC_MSG_ERROR([tag name \"$tagname\" already exists])
+ fi
+
+ # Update the list of available tags.
+ if test -n "$tagname"; then
+ echo appending configuration tag \"$tagname\" to $ofile
+
+ case $tagname in
+ CXX)
+ if test -n "$CXX" && test "X$CXX" != "Xno"; then
+ AC_LIBTOOL_LANG_CXX_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ F77)
+ if test -n "$F77" && test "X$F77" != "Xno"; then
+ AC_LIBTOOL_LANG_F77_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ GCJ)
+ if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+ AC_LIBTOOL_LANG_GCJ_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ RC)
+ AC_LIBTOOL_LANG_RC_CONFIG
+ ;;
+
+ *)
+ AC_MSG_ERROR([Unsupported tag name: $tagname])
+ ;;
+ esac
+
+ # Append the new tag name to the list of available tags.
+ if test -n "$tagname" ; then
+ available_tags="$available_tags $tagname"
+ fi
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ # Now substitute the updated list of available tags.
+ if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+ mv "${ofile}T" "$ofile"
+ chmod +x "$ofile"
+ else
+ rm -f "${ofile}T"
+ AC_MSG_ERROR([unable to update list of available tagged configurations.])
+ fi
+fi
+])# _LT_AC_TAGCONFIG
+
+
+# AC_LIBTOOL_DLOPEN
+# -----------------
+# enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN],
+ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_DLOPEN
+
+
+# AC_LIBTOOL_WIN32_DLL
+# --------------------
+# declare package support for building win32 dll's
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_WIN32_DLL
+
+
+# AC_ENABLE_SHARED([DEFAULT])
+# ---------------------------
+# implement the --enable-shared flag
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_SHARED],
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([shared],
+ [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
+])# AC_ENABLE_SHARED
+
+
+# AC_DISABLE_SHARED
+# -----------------
+#- set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)
+])# AC_DISABLE_SHARED
+
+
+# AC_ENABLE_STATIC([DEFAULT])
+# ---------------------------
+# implement the --enable-static flag
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_STATIC],
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([static],
+ [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]AC_ENABLE_STATIC_DEFAULT)
+])# AC_ENABLE_STATIC
+
+
+# AC_DISABLE_STATIC
+# -----------------
+# set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)
+])# AC_DISABLE_STATIC
+
+
+# AC_ENABLE_FAST_INSTALL([DEFAULT])
+# ---------------------------------
+# implement the --enable-fast-install flag
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([fast-install],
+ [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
+])# AC_ENABLE_FAST_INSTALL
+
+
+# AC_DISABLE_FAST_INSTALL
+# -----------------------
+# set the default to --disable-fast-install
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)
+])# AC_DISABLE_FAST_INSTALL
+
+
+# AC_LIBTOOL_PICMODE([MODE])
+# --------------------------
+# implement the --with-pic flag
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)
+])# AC_LIBTOOL_PICMODE
+
+
+# AC_PROG_EGREP
+# -------------
+# This is predefined starting with Autoconf 2.54, so this conditional
+# definition can be removed once we require Autoconf 2.54 or later.
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
+ [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi])
+ EGREP=$ac_cv_prog_egrep
+ AC_SUBST([EGREP])
+])])
+
+
+# AC_PATH_TOOL_PREFIX
+# -------------------
+# find a file program which can recognise shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="ifelse([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+])# AC_PATH_TOOL_PREFIX
+
+
+# AC_PATH_MAGIC
+# -------------
+# find a file program which can recognise a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# AC_PATH_MAGIC
+
+
+# AC_PROG_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH([gnu-ld],
+ [AC_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])
+AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_PROG_LD_GNU
+])# AC_PROG_LD
+
+
+# AC_PROG_LD_GNU
+# --------------
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# AC_PROG_LD_GNU
+
+
+# AC_PROG_LD_RELOAD_FLAG
+# ----------------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+])# AC_PROG_LD_RELOAD_FLAG
+
+
+# AC_DEPLIBS_CHECK_METHOD
+# -----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognise dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi4*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+mingw* | pw32*)
+ # win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='win32_libid'
+ ;;
+
+darwin* | rhapsody*)
+ # this will be overwritten by pass_all, but leave it in just in case
+ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System`
+ ;;
+ *) # Darwin 1.3 on
+ lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+ ;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | kfreebsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case "$host_cpu" in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ irix5* | nonstopux*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
+ ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ case $host_cpu in
+ alpha* | hppa* | i*86 | ia64* | m68* | mips* | powerpc* | sparc* | s390* | sh* | x86_64* )
+ lt_cv_deplibs_check_method=pass_all ;;
+ # the debian people say, arm and glibc 2.3.1 works for them with pass_all
+ arm* )
+ lt_cv_deplibs_check_method=pass_all ;;
+ *)
+ # glibc up to 2.1.1 does not perform some relocations on ARM
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+nto-qnx*)
+ lt_cv_deplibs_check_method=unknown
+ ;;
+
+openbsd*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
+ else
+ lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sco3.2v5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+])# AC_DEPLIBS_CHECK_METHOD
+
+
+# AC_PROG_NM
+# ----------
+# find the pathname to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/${ac_tool_prefix}nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+])# AC_PROG_NM
+
+
+# AC_CHECK_LIBM
+# -------------
+# check for math library
+AC_DEFUN([AC_CHECK_LIBM],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
+ ;;
+esac
+])# AC_CHECK_LIBM
+
+
+# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl convenience library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL
+# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If
+# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will
+# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
+# '${top_srcdir}/' (note the single quotes!). If your package is not
+# flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ case $enable_ltdl_convenience in
+ no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+ "") enable_ltdl_convenience=yes
+ ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+ esac
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ # For backwards non-gettext consistent compatibility...
+ INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_CONVENIENCE
+
+
+# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl installable library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-install to the configure arguments. Note that LIBLTDL
+# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If
+# DIRECTORY is not provided and an installed libltdl is not found, it is
+# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/'
+# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
+# quotes!). If your package is not flat and you're not using automake,
+# define top_builddir and top_srcdir appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ AC_CHECK_LIB(ltdl, lt_dlinit,
+ [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+ [if test x"$enable_ltdl_install" = xno; then
+ AC_MSG_WARN([libltdl not installed, but installation disabled])
+ else
+ enable_ltdl_install=yes
+ fi
+ ])
+ if test x"$enable_ltdl_install" = x"yes"; then
+ ac_configure_args="$ac_configure_args --enable-ltdl-install"
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ else
+ ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+ LIBLTDL="-lltdl"
+ LTDLINCL=
+ fi
+ # For backwards non-gettext consistent compatibility...
+ INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_INSTALLABLE
+
+
+# AC_LIBTOOL_CXX
+# --------------
+# enable support for C++ libraries
+AC_DEFUN([AC_LIBTOOL_CXX],
+[AC_REQUIRE([_LT_AC_LANG_CXX])
+])# AC_LIBTOOL_CXX
+
+
+# _LT_AC_LANG_CXX
+# ---------------
+AC_DEFUN([_LT_AC_LANG_CXX],
+[AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
+])# _LT_AC_LANG_CXX
+
+
+# AC_LIBTOOL_F77
+# --------------
+# enable support for Fortran 77 libraries
+AC_DEFUN([AC_LIBTOOL_F77],
+[AC_REQUIRE([_LT_AC_LANG_F77])
+])# AC_LIBTOOL_F77
+
+
+# _LT_AC_LANG_F77
+# ---------------
+AC_DEFUN([_LT_AC_LANG_F77],
+[AC_REQUIRE([AC_PROG_F77])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
+])# _LT_AC_LANG_F77
+
+
+# AC_LIBTOOL_GCJ
+# --------------
+# enable support for GCJ libraries
+AC_DEFUN([AC_LIBTOOL_GCJ],
+[AC_REQUIRE([_LT_AC_LANG_GCJ])
+])# AC_LIBTOOL_GCJ
+
+
+# _LT_AC_LANG_GCJ
+# ---------------
+AC_DEFUN([_LT_AC_LANG_GCJ],
+[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+ [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+ [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+ [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
+])# _LT_AC_LANG_GCJ
+
+
+# AC_LIBTOOL_RC
+# --------------
+# enable support for Windows resource files
+AC_DEFUN([AC_LIBTOOL_RC],
+[AC_REQUIRE([LT_AC_PROG_RC])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
+])# AC_LIBTOOL_RC
+
+
+# AC_LIBTOOL_LANG_C_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
+AC_DEFUN([_LT_AC_LANG_C_CONFIG],
+[lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+_LT_AC_SYS_COMPILER
+
+#
+# Check for any special shared library compilation flags.
+#
+_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
+if test "$GCC" = no; then
+ case $host_os in
+ sco3.2v5*)
+ _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
+ ;;
+ esac
+fi
+if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
+ AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
+ if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ ]]" >/dev/null; then :
+ else
+ AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
+ _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
+ fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
+ _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+ $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
+ [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+# Report which librarie types wil actually be built
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+aix4*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ darwin* | rhapsody*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+ ;;
+ 10.*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ output_verbose_link_cmd='echo'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_C_CONFIG
+
+
+# AC_LIBTOOL_LANG_CXX_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
+AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
+[AC_LANG_PUSH(C++)
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Dependencies to place before and after the object being linked:
+_LT_AC_TAGVAR(predep_objects, $1)=
+_LT_AC_TAGVAR(postdep_objects, $1)=
+_LT_AC_TAGVAR(predeps, $1)=
+_LT_AC_TAGVAR(postdeps, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+
+# Source file extension for C++ test sources.
+ac_ext=cc
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+ unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+ unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+else
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+fi
+
+if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ AC_PROG_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+ grep 'no-whole-archive' > /dev/null; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # KDE requires run time linking. Make it the default.
+ aix_use_runtimelinking=yes
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_AC_TAGVAR(archive_cmds, $1)=''
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ else
+ # We have old collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='-qmkshrobj ${wl}-G'
+ else
+ shared_flag='-qmkshrobj'
+ fi
+ fi
+ fi
+
+ # Let the compiler handle the export list.
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ darwin* | rhapsody*)
+ if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+ ;;
+ 10.*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring'
+ fi
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
+
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ freebsd[12]*)
+ # C++ shared libraries reported to be fairly broken before switch to ELF
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ freebsd-elf*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+ freebsd* | kfreebsd*-gnu)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+ gnu*)
+ ;;
+ hpux9*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case "$host_cpu" in
+ hppa*64*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC)
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case "$host_cpu" in
+ ia64*|hppa*64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC)
+ # SGI C++
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+ fi
+ fi
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc)
+ # Intel C++
+ with_gnu_ld=yes
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ cxx)
+ # Compaq C++
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ esac
+ ;;
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+ osf3*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ osf4* | osf5*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~
+ $rm $lib.exp'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ sco*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case $cc_basename in
+ CC)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The C++ compiler is used as linker so we must use $wl
+ # flag to pass the commands to the underlying system
+ # linker.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | grep -v '^2\.7' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ fi
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ fi
+ ;;
+ esac
+ ;;
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+esac
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$GXX"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+AC_LIBTOOL_POSTDEP_PREDEP($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+])# AC_LIBTOOL_LANG_CXX_CONFIG
+
+# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
+# ------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
+int a;
+void foo (void) { a = 0; }
+EOF
+],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+EOF
+],[$1],[F77],[cat > conftest.$ac_ext <<EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+EOF
+],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ # The `*' in the case matches for architectures that use `case' in
+ # $output_verbose_cmd can trigger glob expansion during the loop
+ # eval without this substitution.
+ output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+
+ for p in `eval $output_verbose_link_cmd`; do
+ case $p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" \
+ || test $p = "-R"; then
+ prev=$p
+ continue
+ else
+ prev=
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ case $p in
+ -L* | -R*)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
+ _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ ;;
+
+ *.$objext|*.$libext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
+ _LT_AC_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
+ _LT_AC_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$rm -f confest.$objext
+
+case " $_LT_AC_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+])# AC_LIBTOOL_POSTDEP_PREDEP
+
+# AC_LIBTOOL_LANG_F77_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
+AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
+[AC_REQUIRE([AC_PROG_F77])
+AC_LANG_PUSH(Fortran 77)
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code=" subroutine t\n return\n end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code=" program t\n end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+aix4*)
+ test "$enable_shared" = yes && enable_static=no
+ ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$G77"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_F77_CONFIG
+
+
+# AC_LIBTOOL_LANG_GCJ_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
+AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_GCJ_CONFIG
+
+
+# AC_LIBTOOL_LANG_RC_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the Windows resource compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
+AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_RC_CONFIG
+
+
+# AC_LIBTOOL_CONFIG([TAGNAME])
+# ----------------------------
+# If TAGNAME is not passed, then create an initial libtool script
+# with a default configuration from the untagged config vars. Otherwise
+# add code to config.status for appending the configuration named by
+# TAGNAME from the matching tagged config vars.
+AC_DEFUN([AC_LIBTOOL_CONFIG],
+[# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ _LT_AC_TAGVAR(compiler, $1) \
+ _LT_AC_TAGVAR(CC, $1) \
+ _LT_AC_TAGVAR(LD, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
+ _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
+ _LT_AC_TAGVAR(old_archive_cmds, $1) \
+ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
+ _LT_AC_TAGVAR(predep_objects, $1) \
+ _LT_AC_TAGVAR(postdep_objects, $1) \
+ _LT_AC_TAGVAR(predeps, $1) \
+ _LT_AC_TAGVAR(postdeps, $1) \
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+ _LT_AC_TAGVAR(archive_cmds, $1) \
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
+ _LT_AC_TAGVAR(postinstall_cmds, $1) \
+ _LT_AC_TAGVAR(postuninstall_cmds, $1) \
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
+ _LT_AC_TAGVAR(allow_undefined_flag, $1) \
+ _LT_AC_TAGVAR(no_undefined_flag, $1) \
+ _LT_AC_TAGVAR(export_symbols_cmds, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
+ _LT_AC_TAGVAR(hardcode_automatic, $1) \
+ _LT_AC_TAGVAR(module_cmds, $1) \
+ _LT_AC_TAGVAR(module_expsym_cmds, $1) \
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+ _LT_AC_TAGVAR(exclude_expsyms, $1) \
+ _LT_AC_TAGVAR(include_expsyms, $1); do
+
+ case $var in
+ _LT_AC_TAGVAR(old_archive_cmds, $1) | \
+ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
+ _LT_AC_TAGVAR(archive_cmds, $1) | \
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
+ _LT_AC_TAGVAR(module_cmds, $1) | \
+ _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
+ _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\[$]0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
+ ;;
+ esac
+
+ifelse([$1], [],
+ [cfgfile="${ofile}T"
+ trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+ $rm -f "$cfgfile"
+ AC_MSG_NOTICE([creating $ofile])],
+ [cfgfile="$ofile"])
+
+ cat <<__EOF__ >> "$cfgfile"
+ifelse([$1], [],
+[#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# 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.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG],
+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
+
+# Is the compiler the GNU C compiler?
+with_gcc=$_LT_AC_TAGVAR(GCC, $1)
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
+
+# Symbols that must always be exported.
+include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
+
+ifelse([$1],[],
+[# ### END LIBTOOL CONFIG],
+[# ### END LIBTOOL TAG CONFIG: $tagname])
+
+__EOF__
+
+ifelse([$1],[], [
+ case $host_os in
+ aix3*)
+ cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+EOF
+ ;;
+ esac
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" || \
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+])
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ test -f Makefile && make "$ltmain"
+fi
+])# AC_LIBTOOL_CONFIG
+
+
+# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+
+_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+ AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
+
+
+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+# ---------------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_NM])
+AC_REQUIRE([AC_OBJEXT])
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*) # Its linker distinguishes data from code symbols
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris* | sysv5*)
+ symcode='[[BDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGISTW]]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Write the raw and C identifiers.
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if grep ' nm_test_var$' "$nlist" >/dev/null; then
+ if grep ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+ cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr_t address;
+}
+lt_preloaded_symbols[[]] =
+{
+EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+ cat <<\EOF >> conftest.$ac_ext
+ {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -f conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+
+
+# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
+# ---------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
+[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+ ifelse([$1],[CXX],[
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | os2* | pw32*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix4* | aix5*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68)
+ # Green Hills C++ Compiler
+ # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | kfreebsd*-gnu)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ if test "$host_cpu" != ia64; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC)
+ # KAI C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ icpc)
+ # Intel C++
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ cxx)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx)
+ # Digital/Compaq C++
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ sco*)
+ case $cc_basename in
+ CC)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.x
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc)
+ # Lucid
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC)
+ # NonStop-UX NCC 3.20
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ unixware*)
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ newsos6)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ linux*)
+ case $CC in
+ icc* | ecc*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ ccc*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ sco3.2v5*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
+ ;;
+
+ solaris*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sunos4*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ uts4*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
+ _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+ [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+case "$host_os" in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+])
+
+
+# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
+# ------------------------------------
+# See if the linker supports building shared libraries.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
+[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ifelse([$1],[CXX],[
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ case $host_os in
+ aix4* | aix5*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw*)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ *)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+],[
+ runpath_var=
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_AC_TAGVAR(archive_cmds, $1)=
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=no
+ _LT_AC_TAGVAR(module_cmds, $1)=
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)=
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_AC_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ fi
+ ;;
+
+ amigaos*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris* | sysv5*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sunos4*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
+ runpath_var=LD_RUN_PATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$link_static_flag"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ fi
+
+ # KDE requires run time linking. Make it the default.
+ aix_use_runtimelinking=yes
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_AC_TAGVAR(archive_cmds, $1)=''
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ else
+ # We have old collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='-qmkshrobj ${wl}-G'
+ else
+ shared_flag='-qmkshrobj'
+ fi
+ fi
+ fi
+
+ # Let the compiler handle the export list.
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ # see comment about different semantics on the GNU ld section
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ bsdi4*)
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $compiler_flags $libobjs `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
+ darwin* | rhapsody*)
+ if test "$GXX" = yes ; then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+ ;;
+ 10.*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring'
+ fi
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ dgux*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ freebsd1*)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | kfreebsd*-gnu)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $compiler_flags $libobjs $deplibs'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $libobjs $deplibs~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10* | hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $libobjs $deplibs'
+ ;;
+ esac
+ else
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ openbsd*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+
+ os2*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $compiler_flags $libobjs $deplibs$output_objdir/$libname.def'
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ sco3.2v5*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ;;
+
+ solaris*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs~$rm $lib.exp'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+ esac
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $compiler_flags $libobjs $deplibs'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4.2uw2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ hardcode_runpath_var=yes
+ runpath_var=LD_RUN_PATH
+ ;;
+
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+ fi
+ runpath_var='LD_RUN_PATH'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv5*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+ # $CC -shared without GNU ld will not create a library from C++
+ # object files and a static libstdc++, better avoid it by now
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+ ;;
+
+ uts4*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_AC_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+ then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+ ;;
+ esac
+ fi
+ ;;
+esac
+])# AC_LIBTOOL_PROG_LD_SHLIBS
+
+
+# _LT_AC_FILE_LTDLL_C
+# -------------------
+# Be careful that the start marker always follows a newline.
+AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# # ifdef __CYGWIN32__
+# # define __CYGWIN__ __CYGWIN32__
+# # endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+# __hDllInstance_base = hInst;
+# return TRUE;
+# }
+# /* ltdll.c ends here */
+])# _LT_AC_FILE_LTDLL_C
+
+
+# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
+# ---------------------------------
+AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+
+
+# old names
+AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
+AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
+AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
+
+# This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])
+
+AC_DEFUN([LT_AC_PROG_GCJ],
+[AC_CHECK_TOOL(GCJ, gcj, no)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)
+])
+
+AC_DEFUN([LT_AC_PROG_RC],
+[AC_CHECK_TOOL(RC, windres, no)
+])
+
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+AC_DEFUN([LT_AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && break
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_MSG_RESULT([$SED])
+])
diff --git a/config.guess b/config.guess
new file mode 100644
index 0000000..da83314
--- /dev/null
+++ b/config.guess
@@ -0,0 +1,1561 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
+
+timestamp='2009-04-27'
+
+# This file 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.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH="x86_64"
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[456])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep __LP64__ >/dev/null
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+ case ${UNAME_MACHINE} in
+ pc98)
+ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ *:Interix*:[3456]*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ EM64T | authenticamd | genuineintel)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux-gnu
+ exit ;;
+ crisv32:Linux:*:*)
+ echo crisv32-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+ echo frv-unknown-linux-gnu
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ mips:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips
+ #undef mipsel
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mipsel
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips64
+ #undef mips64el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mips64el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips64
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ or32:Linux:*:*)
+ echo or32-unknown-linux-gnu
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-gnu
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-gnu
+ exit ;;
+ x86_64:Linux:*:*)
+ echo x86_64-unknown-linux-gnu
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ i*86:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us. cd to the root directory to prevent
+ # problems with other programs or directories called `ld' in the path.
+ # Set LC_ALL=C to ensure ld outputs messages in English.
+ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+ | sed -ne '/supported targets:/!d
+ s/[ ][ ]*/ /g
+ s/.*supported targets: *//
+ s/ .*//
+ p'`
+ case "$ld_supported_targets" in
+ elf32-i386)
+ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+ ;;
+ a.out-i386-linux)
+ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+ exit ;;
+ "")
+ # Either a pre-BFD a.out linker (linux-gnuoldld) or
+ # one that does not give us useful --help.
+ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+ exit ;;
+ esac
+ # Determine whether the default compiler is a.out or elf
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #ifdef __ELF__
+ # ifdef __GLIBC__
+ # if __GLIBC__ >= 2
+ LIBC=gnu
+ # else
+ LIBC=gnulibc1
+ # endif
+ # else
+ LIBC=gnulibc1
+ # endif
+ #else
+ #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+ LIBC=gnu
+ #else
+ LIBC=gnuaout
+ #endif
+ #endif
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^LIBC/{
+ s: ::g
+ p
+ }'`"
+ test x"${LIBC}" != x && {
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit
+ }
+ test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+ ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configury will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ c34*)
+ echo c34-convex-bsd
+ exit ;;
+ c38*)
+ echo c38-convex-bsd
+ exit ;;
+ c4*)
+ echo c4-convex-bsd
+ exit ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config.h.in b/config.h.in
new file mode 100755
index 0000000..055c089
--- /dev/null
+++ b/config.h.in
@@ -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
diff --git a/config.log b/config.log
new file mode 100644
index 0000000..67ab620
--- /dev/null
+++ b/config.log
@@ -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
diff --git a/config.sub b/config.sub
new file mode 100644
index 0000000..a39437d
--- /dev/null
+++ b/config.sub
@@ -0,0 +1,1686 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
+
+timestamp='2009-04-17'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file 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.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray)
+ os=
+ basic_machine=$1
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | bfin \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fido | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | lm32 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | mcore | mep | metag \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nios | nios2 \
+ | ns16k | ns32k \
+ | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu | strongarm \
+ | tahoe | thumb | tic4x | tic80 | tron \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | z8k | z80)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | lm32-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64octeon-* | mips64octeonel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nios-* | nios2-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+ | tron-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-* | z80-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
+ tic55x | c55x*)
+ basic_machine=tic55x-unknown
+ os=-coff
+ ;;
+ tic6x | c6x*)
+ basic_machine=tic6x-unknown
+ os=-coff
+ ;;
+ tile*)
+ basic_machine=tile-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -kopensolaris* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* | -aros* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-haiku)
+ os=-haiku
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/configure.files b/configure.files
new file mode 100644
index 0000000..030bce8
--- /dev/null
+++ b/configure.files
@@ -0,0 +1,2 @@
+./admin/configure.in.min
+configure.in.in
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000..82b365a
--- /dev/null
+++ b/configure.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
diff --git a/configure.in.in b/configure.in.in
new file mode 100755
index 0000000..0853047
--- /dev/null
+++ b/configure.in.in
@@ -0,0 +1,6 @@
+#MIN_CONFIG(3.2.0)
+
+AM_INIT_AUTOMAKE(knutclient, 0.9.5)
+AC_C_BIGENDIAN
+AC_CHECK_KDEMAXPATHLEN
+
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100755
index 0000000..6663b4e
--- /dev/null
+++ b/doc/Makefile.am
@@ -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)
diff --git a/doc/cs/Makefile.am b/doc/cs/Makefile.am
new file mode 100755
index 0000000..f097f05
--- /dev/null
+++ b/doc/cs/Makefile.am
@@ -0,0 +1,2 @@
+KDE_DOCS = knutclient
+KDE_LANG = cs
diff --git a/doc/cs/asetting-cs.png b/doc/cs/asetting-cs.png
new file mode 100755
index 0000000..8961947
--- /dev/null
+++ b/doc/cs/asetting-cs.png
Binary files differ
diff --git a/doc/cs/fsetting-cs.png b/doc/cs/fsetting-cs.png
new file mode 100755
index 0000000..28c3966
--- /dev/null
+++ b/doc/cs/fsetting-cs.png
Binary files differ
diff --git a/doc/cs/index.docbook b/doc/cs/index.docbook
new file mode 100755
index 0000000..26991f5
--- /dev/null
+++ b/doc/cs/index.docbook
@@ -0,0 +1,1332 @@
+<?xml version="1.0" encoding="UTF8" ?>
+<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.1-Based Variant V1.0//EN"
+"dtd/kdex.dtd" [
+ <!ENTITY knutclient '<application>KNutClient</application>'>
+ <!ENTITY kappname "&knutclient;"><!-- replace knutclient here -->
+ <!ENTITY % addindex "IGNORE">
+ <!ENTITY % Czech "INCLUDE"><!-- change language only here -->
+
+ <!-- Do not define any other entities; instead, use the entities
+ from kde-genent.entities and $LANG/user.entities. -->
+]>
+
+<!-- ................................................................ -->
+
+<!-- The language must NOT be changed here. -->
+
+<book lang="&language;">
+
+<!-- This header contains all of the meta-information for the document such
+as Authors, publish date, the abstract, and Keywords -->
+
+<bookinfo>
+<title>Příručka pro &knutclient; </title>
+
+<authorgroup>
+<author>
+<firstname>Daniel</firstname>
+<othername></othername>
+<surname>Prynych</surname>
+<affiliation>
+<address><email>Daniel@prynych.cz</email></address>
+</affiliation>
+</author>
+</authorgroup>
+
+
+<copyright>
+<year>2001</year>
+<year>2002</year>
+<year>2003</year>
+<year>2004</year>
+<year>2006</year>
+<year>2007</year>
+<year>2008</year>
+<year>2009</year>
+<holder>Daniel Prynych</holder>
+</copyright>
+<!-- Translators: put here the copyright notice of the translation -->
+<!-- Put here the FDL notice. Read the explanation in fdl-notice.docbook
+ and in the FDL itself on how to use it. -->
+<legalnotice>&FDLNotice;</legalnotice>
+
+<!-- Date and version information of the documentation
+Don't forget to include this last date and this last revision number, we
+need them for translation coordination !
+Please respect the format of the date (DD/MM/YYYY) and of the version
+(V.MM.LL), it could be used by automation scripts.
+Do NOT change these in the translation. -->
+
+<date>3/2/2008</date>
+<releaseinfo>0.12.01</releaseinfo>
+
+<!-- Abstract about this handbook -->
+
+<abstract>
+<para>
+&knutclient; je grafická klientská aplikace pro UPS systém NUT.
+</para>
+<para>
+Tento dokument popisuje aplikaci &knutclient; verze 0.9.5
+</para>
+</abstract>
+
+<keywordset>
+<keyword>KDE</keyword>
+<keyword>kdeutils</keyword>
+<keyword>KNutClient</keyword>
+<keyword>NUT</keyword>
+<keyword>UPS</keyword>
+</keywordset>
+
+</bookinfo>
+
+
+<chapter id="introduction">
+<title>Úvod</title>
+
+<para>
+&knutclient; je program který umožňuje sledovat stav UPS-ek systému NUT.
+</para>
+
+</chapter>
+<chapter id="using-knutclient">
+<title>Použití &knutclient;</title>
+
+
+<sect1 id="knutclient-mainwin">
+<title>Hlavní okno aplikace &knutclient;</title>
+
+<para>&knutclient; je klientská grafická aplikace pro systém NUT
+"Network UPS Tools". Umožňuje sledovat stav UPS-ek a zobrazovat
+hodnoty proměnných které vybraná UPS-ka a její ovladač podporuje.
+</para>
+
+<para>
+Od verze 0.6.0 &knutclient; podporuje spouštění okamžitých příkazů,
+a možnost změny RW proměnných.
+</para>
+<para>
+Od verze 0.9.0 nepodporuje &knutclient; protokol UDP.
+</para>
+
+<para>
+<screenshot>
+<screeninfo>Hlavní okno aplikace &knutclient;</screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="knutclient-cs.png" format="PNG"/>
+ </imageobject>
+ </mediaobject>
+</screenshot>
+</para>
+<para>
+Hlavní okno programu je rozděleno na dvě části.
+</para>
+<para>
+Levé část "Hlavní panel" obsahuje následující údaje indikující stav vybrané
+UPS-ky.
+Provoz na síť, provoz na baterie, přetížení, nutnost vyměnit
+baterii, vybití baterie, kalibraci baterie, údaj o dobu běhu
+po odpojení sítě (RUNTIME) a pod. Déle jsou zde neměnné údaje, to jsou údaje
+které se za provozu nemění a jsou proto přečteny jen jednou při výběru UPS-ky,
+například jméno UPS-ky, její sériové číslo, výrobce a pod.
+</para>
+<para>Pravá část obsahuje analogové panely (měřáky), které udávají hodnotu
+proměnných
+veličin jako je vstupní napětí, zatížení UPS-ky, kapacitu baterie, teplotu
+UPS-ky,
+napětí baterie apod.
+</para>
+<para>
+&knutclient; obsahuje nástrojovou lištu (toolbar) ze standardními tlačítky a
+tlačítko pro výběr sledované UPS-ky.
+</para>
+
+</sect1>
+
+
+<sect1 id="knutclient-kicker">
+<title>&knutclient; a panel KDE</title>
+
+<para>
+<screenshot>
+<screeninfo>&knutclient; a panel KDE</screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="tkicker-cs.png" format="PNG"/>
+ </imageobject>
+ </mediaobject>
+</screenshot>
+</para>
+<para>
+Od verze 0.8.0 &knutclient; dokuje v panelu KDE. Jeho icona je proměnná a zobrazuje
+informace o zatížení UPS, runtime a a kapacitě baterie, podle toho který typ icony je vybrán.
+Po přesunu ukazatele myši na ikonu se zobrazí informační okno "ToolTip" které obsahuje více
+informací o UPS, Nazev, Jméno, Adresu, Stav, Runtime ...
+</para>
+</sect1>
+
+
+<sect1 id="knutclient-features">
+<title>Více o vlastnostech &knutclient;</title>
+
+<para>
+Pro spojení se serverovou části NUT-u (upsd) používá &knutclient;
+protokol, TCP.Po vybraní UPS-ky v nástrojové liště se
+&knutclient; pokusí přečíst data, pokud se mu to nepodaří, pokus opakuje
+a to maximálně 2 krát. &knutclient; poté čte data v pravidelných
+intervalech. Při prvním čtení čte všechny vybrané proměnné, v dalších
+již jen proměnné které zobrazují analogové panely, RUNTIME a stav
+UPS-ky. Proměnné zobrazující jméno UPS-ky, výrobce, sériové číslo a pod
+se tedy čtou jen jednou protože se nepředpokládá jejich změna.
+</para>
+<para>
+Novější verze upsd (od verze 1.3), již nepodporují protokol UDP.
+</para>
+
+<para>
+Chyby vznikající za běhu programu se zobrazují ve stavové lište. Do stavové
+lišty
+je vnořen seznam (ComboBox), ktery obsahuje hlašení chyb, a to včetne datumu,
+času a nazvy UPS-ky. Maximální délka seznamu je 50 řádek.
+</para>
+<para>
+Chyby vznikající jako odezva na činnost uživatele jsou zobrazeny ve
+zvláštním okně.
+</para>
+</sect1>
+</chapter>
+
+<chapter id="commands">
+<title>Popis příkazů</title>
+
+
+
+<sect1 id="knutclient-mainwindow">
+<title>Hlavní okno aplikace &knutclient;</title>
+<para></para>
+
+
+<sect2>
+<title>Menu Soubor</title>
+<para>
+<variablelist>
+ <varlistentry>
+ <term><menuchoice>
+ <guimenu>Soubor</guimenu>
+ <guimenuitem>Zobrazení Ups proměnných a příkazů</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Vypíše Ups proměnné pro zvolenou
+UPS-ku</action></para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><menuchoice>
+ <guimenu>Soubor</guimenu>
+ <guimenuitem>Spuštění okamžitých příkazů</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Provede na UPS daný okamžitý
+příkaz</action></para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><menuchoice>
+ <guimenu>Soubor</guimenu>
+ <guimenuitem>Nastavení UPS RW proměnných</guimenuitem>
+ </menuchoice></term>
+ <listitem>
+ <para><action>Provede změnu UPS RW proměnné</action></para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><menuchoice>
+ <shortcut>
+ <keycombo><keycap>Ctrl</keycap><keycap>q</keycap></keycombo>
+ </shortcut>
+ <guimenu>Soubor</guimenu>
+ <guimenuitem>Ukončit</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Ukončí činnost programu</action></para></listitem>
+ </varlistentry>
+</variablelist>
+</para>
+</sect2>
+
+
+<sect2>
+<title>Menu Spojení</title>
+<para>
+<variablelist>
+ <varlistentry>
+ <term><menuchoice>
+ <shortcut>
+ <keycombo><keycap>F1</keycap></keycombo>
+ </shortcut>
+ <guimenu>Spojení</guimenu>
+ <guimenuitem>Obnovit Spojeni</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Obnoví spojení s UPS serverem (upsd).
+ </action></para></listitem>
+ </varlistentry>
+</variablelist>
+</para>
+</sect2>
+
+
+
+<sect2>
+<title>Menu Nastavení</title>
+<para>
+<variablelist>
+ <varlistentry>
+ <term><menuchoice>
+ <guimenu>Nastavení</guimenu>
+ <guimenuitem>Zobrazovat nástrojovou lištu</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Zapne/Vypne zobrazení nástrojové lišty
+(Toolbar)</action></para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenu>Nastavení</guimenu>
+ <guimenuitem>Zobrazovat stavovou lištu</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Zapne/Vypne zobrazování nástrojové
+lišty</action></para></listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenu>Nastavení</guimenu>
+ <guimenuitem>Nastavení klávesových zkratek...</guimenuitem>
+ </menuchoice></term>
+ <listitem>
+ <para><action>Otevře konfigurační dialog pro přiřazení klávesy k akci.</action></para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenu>Nastavení</guimenu>
+ <guimenuitem>Nastavit &knutclient; </guimenuitem>
+ </menuchoice></term>
+ <listitem>
+ <para><action>Otevře hlavni konfigurační dialog</action></para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenu>Nastavení</guimenu>
+ <guimenuitem>Použít popis</guimenuitem>
+ </menuchoice></term>
+ <listitem>
+ <para><action>Zapne/Vypne používání bublinové nápovědi (ToolTip) při
+ zobrazení UPS proměnných a příkazů.
+ </action></para>
+ </listitem>
+ </varlistentry>
+
+</variablelist>
+</para>
+</sect2>
+</sect1>
+
+
+<sect1 id="knutclient-kicker-comm">
+<title>Icona v panelu KDE</title>
+
+<para>
+<screenshot>
+<screeninfo>Menu icony v KDE panelu</screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="mkicker-cs.png" format="PNG"/>
+ </imageobject>
+ </mediaobject>
+</screenshot>
+</para>
+
+
+
+
+
+<sect2>
+<title>Menu</title>
+<para>
+<variablelist>
+ <varlistentry>
+ <term><menuchoice>
+ <guimenuitem>UPS</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Slouží pro výběr UPS-ky</action></para></listitem>
+ </varlistentry>
+
+
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenuitem>Zobrazení Ups proměnných a příkazů</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Vypíše Ups proměnné pro zvolenou
+UPS-ku</action></para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenuitem>Spuštění okamžitých příkazů</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Provede na UPS daný okamžitý
+příkaz</action></para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenuitem>Nastavení UPS RW proměnných</guimenuitem>
+ </menuchoice></term>
+ <listitem>
+ <para><action>Provede změnu UPS RW proměnné</action></para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenuitem>Obnovit Spojeni</guimenuitem>
+ </menuchoice></term>
+ <listitem>
+ <para><action>Obnoví spojení s UPS serverem (upsd)</action></para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenu>Nastavení</guimenu>
+ <guimenuitem>Nastavit &knutclient; </guimenuitem>
+ </menuchoice></term>
+ <listitem>
+ <para><action>Aktivuje konfigurační dialog</action></para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenuitem>O aplikaci &knutclient;</guimenuitem>
+ </menuchoice></term>
+ <listitem>
+ <para><action>Zobrazí informace o aplikaci &knutclient;</action></para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenuitem>Minimalizovat</guimenuitem>
+ </menuchoice></term>
+ <listitem>
+ <para><action>Zavře hlavní okno</action></para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenuitem>Konec</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Ukončí činnost programu</action></para></listitem>
+ </varlistentry>
+
+</variablelist>
+</para>
+</sect2>
+</sect1>
+
+
+<sect1 id="knuclient-show-variables">
+<title>Zobrazení proměnných</title>
+<para>
+Toto okno zobrazý seznam všech proměnných a okamžitých příkazů, které existují pro zvolenou UPS-ku.
+
+<screenshot>
+<screeninfo>Okno proměnných a okamžitých příkazů</screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="variables-cs.png" format="PNG"/>
+ </imageobject>
+ </mediaobject>
+</screenshot>
+</para>
+</sect1>
+
+
+ <sect1 id="knuclient-instant-command">
+ <title>Okamžité příkazy</title>
+ <para>
+ Okamžité příkazy jsou vykonávány přímo na na UPS-ce, NUT server
+ předává požadavek na příkaz příslušnému ovladači (driveru) a ten
+ pak příkaz vyvolá na UPS-ce. Okno pro ovládaní Vám nabízí ty
+ příkazy, které příslušný ovladač (driver) podporuje.
+ </para>
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><guilabel>OK</guilabel></term>
+ <listitem>
+ <para>Tlačítko <guibutton>OK</guibutton> provede vybraný příkaz.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Zrušit</guilabel></term>
+ <listitem>
+ <para>Tlačítko <guibutton>zrušit</guibutton> zavře okno.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Příkaz</guilabel></term>
+ <listitem>
+ <para>Zde je možno vybrat příkaz který je pak následně vykonán</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </sect1>
+
+ <sect1 id="knutclient-RW-values">
+ <title>Uživatelsky měnitelné (RW) proměnné</title>
+ <para> Uživatelsky měnitelné (RW) proměnné jsou skupinou
+ proměnných které muže měnit přímo uživatel, většina z nich je
+ přímo ekvivalentní nastavení příslušné UPS-ky. Uživatelsky
+ měnitelné proměnné jsou dvojího typu znakové (CHAR) a výčtové (ENUM).
+ Znakové proměnné jsou prostý řetězec znaků o definované maximální
+ délce. Výčtové proměnné je seznam povolených hodnot na které muže
+ být proměnná nastavená.
+ </para>
+ <para>
+ Uživatelsky měnitelné proměnná není změněna na serveru NUT-u
+ (upsd) ale sever pouze dá příslušnému ovladači (driveru) příkaz ke změně,
+ ten ihned provede změnu nastavení UPS-ky. Tato činnost není okamžitá a
+ může trvat i několik sekund.
+ </para>
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><guilabel>OK</guilabel></term>
+ <listitem>
+ <para>Tlačítkem <guibutton>OK</guibutton> je změna proměnné provedena.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Zrušit</guilabel></term>
+ <listitem>
+ <para>Tlačítkem <guibutton>Zrušit</guibutton> je okno zavřeno.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Implicitní</guilabel></term>
+ <listitem>
+ <para>Tlačítkem <guibutton>Implicitní</guibutton> mužeme obnovit současnou hodnotu proměnné.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Proměnná</guilabel></term>
+ <listitem>
+ <para>Zde je možno vybrat proměnnou která bude změněna</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Hodnota</guilabel></term>
+ <listitem>
+ <para>Zde je možno u znakové proměnné zadat, nebo u
+ výčtové proměnné vybrat její hodnotu. Nabídkové pole se automaticky mění
+ podle typu proměnné.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </sect1>
+
+
+<sect1 id="knutclient-configuration">
+<title>Nastavení aplikace &knutclient;</title>
+<para>
+Okno pro nastavení má pět částí Nastavení, UPS, Panel Písma a Analog.
+</para>
+ <sect2>
+ <title>Nastavení</title>
+ <para>
+ Část NASTAVENÍ slouží pro nastavení počtu sloupců analogových panelů, barvy
+pozadí hlavního okna,
+ vstupního napětí (120/230)V, frekvence vstupního napětí (50/60)Hz a povolení
+použití hodnot
+ Xfer (LowXfer a HighXfer)
+ </para>
+ <para>
+ <screenshot>
+ <screeninfo>&knutclient; </screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="msetting-cs.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </screenshot>
+ </para>
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><guilabel>Počet sloupců</guilabel></term>
+ <listitem>
+ <para>Určuje maximální počet sloupců pro analogové panely</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Použít vlastní barvu pozadí</guilabel></term>
+ <listitem>
+ <para>Dovoluje zvolit vlastní barvu pozadí pro základní okno.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Barva pozadí</guilabel></term>
+ <listitem>
+ <para>Umožňuje zvolit barvu pozadí</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Použít dialog "Jste si jistý"</guilabel></term>
+ <listitem>
+ <para>Při aktivaci, se při ukončení programu objeví
+ dialog "Jste si jistý" který vyžaduje potvrzení, jinak
+ se program neukončí.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Použít hlavní okno když program startuje</guilabel></term>
+ <listitem>
+ <para> Nastaví zobrazení hlavního okna při startu programu.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Zobrazit okno zpráv, když program hlásí chybu.</guilabel></term>
+ <listitem>
+ <para> Povoli zobrazení okna zpráv, kde je zobrazen popis chyby. Má význam jen, když není zakázáno dokování programu.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><guilabel>Vstupní napětí</guilabel></term>
+ <listitem>
+ <para>Umožňuje vybrat vstupní napětí 230/120V. Položka
+ nemá význam pokud je zároveň zvolena
+ položka <guilabel>Použít High-Low XFER</guilabel>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Vstupní frekvence</guilabel></term>
+ <listitem>
+ <para>Umožňuje vybrat vstupní frekvenci
+ 50/60Hz. Položka nemá význam pokud je zároveň zvolena
+ položka <guilabel>Použít High-Low
+ XFER</guilabel>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Použít High-Low XFER</guilabel></term>
+ <listitem>
+ <para>Nastaví vstupní napětí a vstupní frekvenci na
+ základě hodnot v proměnných NUT-u LOWXFER a
+ HIGHXFER. Tyto proměnné udávají rozpětí hodnot vstupního
+ napětí, které muže UPS-ka ještě bezpečně zpracovat. Na
+ základě těchto hodnot &knutclient; nastaví vstupní
+ napětí a vstupní frekvenci pro panely které je
+ používají. Například vstupní napětí, vstupní frekvence
+ apod.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>UPS</title>
+ <para>
+ Část UPS slouží pro nastavení seznamu UPS-ek a jejich
+ parametrů. Levá část obsahuje seznam UPS-ek. Pravá část tlačítka pro
+ přidávání, změnu parametrů a smazání záznamu o UPS-kách.
+ </para>
+ <para>
+ <screenshot>
+ <screeninfo>&knutclient; </screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="usetting-cs.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </screenshot>
+ </para>
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><guibutton>Přidat</guibutton></term>
+ <listitem>
+ <para>Přidá do seznamu další UPS-ku a nastaví její parametry.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guibutton>Úpravy</guibutton></term>
+ <listitem>
+ <para>Změní parametry vybrané UPS-ky </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guibutton>Smazat</guibutton></term>
+ <listitem><para>Smaže UPS-ku v seznamu</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ <sect3>
+ <title>Nastavení parametrů</title>
+ <para>
+ Toto okno slouží k nastavení parametrů UPS-ky.
+ </para>
+ <para>
+ <screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="new-cs.png" format="PNG"/>
+ </imageobject>
+ </mediaobject>
+ </screenshot>
+ </para>
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><guilabel>Název</guilabel></term>
+ <listitem>
+ <para>Určuje jméno UPS-ky pro program &knutclient;</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Adresa UPS</guilabel></term>
+ <listitem>
+ <para>Určuje adresu počítače ke kterému je UPS připojena.
+ Tedy adresu UPS v síti.
+ Příklad : ns.alo.cz, localhost, 192.168.1.12.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Jméno UPS</guilabel></term>
+ <listitem>
+ <para>Určuje jméno UPS tak jak je definuje NUT.
+ Pokud není ups definováno, je automaticky použita první ups v seznamu
+ systému NUT daného pc. To platí jen za předpokladu že minimalní
+ verze upsd je 1.3. Blíže v dokumentaci k systému NUT.
+ Příklad : victron, myups, apc700</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Zpoždění (ms)</guilabel></term>
+ <listitem>
+ <para>Určuje interval mezi dvěma přenosy dat (čteni dat) ze
+ systému NUT.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Port</guilabel></term>
+ <listitem>
+ <para>
+ Nastaví port na který se &knutclient; připojí.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Uživatelské jméno</guilabel></term>
+ <listitem>
+ <para>Určuje uživatelské jméno (USERNAME) které
+ &knutclient; použije při prokázaní totožnosti uživatele
+ serveru to jest, programu upsd</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Heslo</guilabel></term>
+ <listitem>
+ <para>Určuje heslo (PASSWORD) pro pro prokázaní
+ totožnosti uživatele. </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Store NUT password in configuration file.
+ </guilabel></term>
+ <listitem>
+ <para>Při zvolení této volby bude heslo uloženo do
+ konfiguračního souboru. V konfiguračním souboru je
+ heslo uloženo nezašifrovaně. Pokud nebude tato volba
+ zvolena bude heslo po ukončení programu zapomenuto.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>UPS Proměnné</guilabel></term>
+ <listitem>
+ <para>Umožňuje vybrat proměnné které budou zobrazeny
+ na analogových panelech v pravé části hlavního
+ okna.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ <para>Parametry Uživatelské jméno a Heslo mají význam jen
+ pri použití okamžitých příkazů a změnách RW proměnných, při
+ sledování stavu UPS-ky není uživatelské jméno a heslo
+ potřebné. Heslo (PASSWORD) a uživatelské jméno (USERNAME)
+ mají své ekvivalenty v systému NUT v souboru upsd.users.
+ </para>
+ </sect3>
+ </sect2>
+
+
+
+ <sect2>
+ <title>Panel</title>
+ <para>
+ Část PANEL slouží pro určení které informační části hlavního panelu budou
+zobrazené
+ </para>
+
+ <para>
+ <screenshot>
+ <screeninfo>&knutclient; </screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="psetting-cs.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </screenshot>
+ </para>
+
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><guilabel>Přetížení</guilabel></term>
+ <listitem>
+ <para>
+ Povoluje/zakazuje zobrazení přetížení.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Baterie je vybitá</guilabel></term>
+ <listitem>
+ <para>
+ Povoluje/zakazuje zobrazení vybití baterie.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><guilabel>Vyměnit baterie </guilabel></term>
+ <listitem>
+ <para>
+ Povoluje/zakazuje zobrazení nutnosti výměny baterie.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Kalibrace UPS</guilabel></term>
+ <listitem>
+ <para>
+ Povoluje/zakazuje zobrazení kalibrace UPS.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Výrobce + Model</guilabel></term>
+ <listitem>
+ <para>
+ Povoluje/zakazuje zobrazení výrobce a modelu UPS-ky.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Výrobce</guilabel></term>
+ <listitem>
+ <para>
+ Povoluje/zakazuje zobrazení výrobce UPS-ky.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Model</guilabel></term>
+ <listitem>
+ <para>
+ Povoluje/zakazuje zobrazení modelu UPS-ky.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Sériové č.</guilabel></term>
+ <listitem>
+ <para>
+ Povoluje/zakazuje zobrazení sériového čísla UPS-ky.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Verze Firmvare</guilabel></term>
+ <listitem>
+ <para>
+ Povoluje/zakazuje zobrazení verze firmware UPS-ky.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Runtime</guilabel></term>
+ <listitem>
+ <para>
+ Povoluje/zakazuje zobrazení doby po kterou je UPS-ka schopna po výpadku
+ napájení dodávat el. proud.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Použít vlastní barvu pozadí</guilabel></term>
+ <listitem>
+ <para>Dovoluje zvolit vlastní barvu pozadí pro hlavní panel.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Barva pozadí</guilabel></term>
+ <listitem>
+ <para>Umožňuje zvolit barvu pozadí pro hlavní panel.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </sect2>
+
+
+
+ <sect2>
+ <title>Písma</title>
+ <para>
+ Část PÍSMA slouží pro výběr používaných písmen.
+ </para>
+ <para>
+ <screenshot>
+ <screeninfo>&knutclient; </screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="fsetting-cs.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </screenshot>
+ </para>
+
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><guilabel>Použít vlastní písma</guilabel></term>
+ <listitem>
+ <para>
+ Povoluje/zakazuje možnost vybrat vlastní písma pro Hlavni panel a Analogové
+panely.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Hlavní panel / Analogové panely</guilabel></term>
+ <listitem>
+ <para>Určuje pro který panel se bude vybírat písmo.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Požadované písmo</guilabel></term>
+ <listitem>
+ <para>Vybírá písma pro zadaný typ panelu. Má význam
+ jen tehdy pokud je vybrána položka <guilabel>Použít
+ vlastní písmo</guilabel>.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </sect2>
+
+
+ <sect2>
+ <title>Analog</title>
+ <para>
+ Část Analog slouží pro nastavení barev na analogových panelech.
+ </para>
+ <para>
+ <screenshot>
+ <screeninfo>&knutclient; </screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="asetting-cs.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </screenshot>
+ </para>
+
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><guilabel>Použít vlastní barvu pozadí</guilabel></term>
+ <listitem>
+ <para>Dovoluje zvolit vlastní barvu pozadí pro analogový panel.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Barva pozadí</guilabel></term>
+ <listitem>
+ <para>Umožňuje zvolit barvu pozadí pro analogový panel.</para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><guilabel>Použít vlastní barvy</guilabel></term>
+ <listitem>
+ <para>Dovoluje zvolit vlastní barvy pro následující části analogového panelu.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Barva ručičky</guilabel></term>
+ <listitem>
+ <para>
+ Umožňuje zvolit barvu ručičky pro analogový panel. Standardní barva
+ je černá.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><guilabel>Barva OK rozsahu</guilabel></term>
+ <listitem>
+ <para>
+ Umožňuje zvolit barvu podbarvení stupnice pro rozsah správných (OK)
+ hodnot. Standardní barva je zelená.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Barva rozsahu varování</guilabel></term>
+ <listitem>
+ <para>
+ Umožňuje zvolit barvu podbarvení stupnice pro rozsah varovaní.
+ Standardní barva je žlutá.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><guilabel>Barva rozsahu chyby</guilabel></term>
+ <listitem>
+ <para>
+ Umožňuje zvolit barvu podbarvení stupnice pro rozsah chyby.
+ Standardní barva je červená.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Barva stupnice</guilabel></term>
+ <listitem>
+ <para>
+ Umožňuje zvolit barvu stupnice pro analogový panel.
+ Standardní barva je černá.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Barva písma</guilabel></term>
+ <listitem>
+ <para>
+ Umožňuje zvolit barvu písma pro analogový panel.
+ Standardní barva je černá.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><guilabel>Vylepšení zpracování ručičky</guilabel></term>
+ <listitem>
+ <para>
+ Umožňuje vybrat grafický způsob zpracování ručičky.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ </variablelist>
+ </para>
+ </sect2>
+
+
+ <sect2>
+ <title>Dokovaní</title>
+ <para>
+ Část DOCK slouží pro nastavení parametrů "dokovaní" programu.
+ </para>
+ <para>
+ <screenshot>
+ <screeninfo>&knutclient; </screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="ksetting-cs.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </screenshot>
+ </para>
+
+ <para>
+ Typ zobrazení v doku. (Dokem je míněn panel KDE.)
+ </para>
+
+
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><guilabel>Obrázkové</guilabel></term>
+ <listitem>
+ <para>
+ Nastavuje obrazkový typ icony.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><guilabel>Obrázkové</guilabel></term>
+ <listitem>
+ <para>
+ Nastavuje souhrny typ icony, pouze pro specialisty.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+
+ <para>
+ Prvky ToolTipu. (ToolTipem je míněna "bublinova" napověda.)
+ </para>
+
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><guilabel>Výrobce</guilabel></term>
+ <listitem>
+ <para>
+ Povoluje/zakazuje zobrazení výrobce UPS-ky.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Model</guilabel></term>
+ <listitem>
+ <para>
+ Povoluje/zakazuje zobrazení modelu UPS-ky.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Sériové č.</guilabel></term>
+ <listitem>
+ <para>
+ Povoluje/zakazuje zobrazení sériového čísla UPS-ky.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Verze Firmvare</guilabel></term>
+ <listitem>
+ <para>
+ Povoluje/zakazuje zobrazení verze firmware UPS-ky.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Runtime</guilabel></term>
+ <listitem>
+ <para>
+ Povoluje/zakazuje zobrazení doby po kterou je UPS-ka schopna po výpadku
+ napájení dodávat el. proud.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Kapacita baterie</guilabel></term>
+ <listitem>
+ <para>
+ Povoluje/zakazuje zobrazení kapacity baterie.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><guilabel>Zatížení UPS</guilabel></term>
+ <listitem>
+ <para>
+ Povoluje/zakazuje zobrazení zatížení UPS.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><guilabel>Použít vlastní barvu pozadí</guilabel></term>
+ <listitem>
+ <para>Dovoluje zvolit vlastní barvu pozadí pro iconu v KDE panelu, když typ zobrazení icony v panelu je obrázkový.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Barva pozadí</guilabel></term>
+ <listitem>
+ <para>Umožnuje zvolit barvu pozadí.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </sect2>
+
+
+
+</sect1>
+</chapter>
+
+
+<chapter id="faq">
+<title>Otázky a odpovědi</title>
+
+&reporting.bugs;
+&updating.documentation;
+
+<qandaset id="faqlist">
+<qandaentry>
+<question>
+<para>&knutclient; nepracuje ale program upsc ano. Co mam dělat ?</para>
+</question>
+<answer>
+<para> Zkontrolujte nastaveni čísla portu. Od ver. 0.5 (NUT) je změněno číslo
+portu 3493.
+Klikněte na <link linkend="knutclient-configuration"> odkaz </link> pro další
+údaje.</para>
+</answer>
+</qandaentry>
+</qandaset>
+</chapter>
+
+<chapter id="credits">
+
+
+<title>Credits and License</title>
+<para>
+&knutclient;
+</para>
+<para>
+Program copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 Daniel Prynych <email>Daniel@prynych.cz</email>
+</para>
+<para>
+Documentation copyright 2003, 2004, 2005, 2006, 2007, 2008 Daniel Prynych
+<email>Daniel@prynych.cz</email>
+</para>
+<para>
+Translations done by:
+<itemizedlist>
+<listitem>
+<para>Daniel Prynych <email>Daniel@prynych.cz</email> Čeština</para>
+</listitem>
+</itemizedlist>
+</para>
+
+&underFDL; <!-- FDL: do not remove -->
+&underGPL; <!-- GPL License -->
+
+</chapter>
+
+<appendix id="installation">
+<title>Instalace</title>
+<sect1 id="getting-knutclient">
+<title>Jak získat &knutclient; </title>
+<para>
+&knutclient; není částí KDE projektu
+<ulink url="http://www.kde.org">http://www.kde.org</ulink>.
+&knutclient; může být nalezen na
+<ulink url="ftp://ftp.buzuluk.cz/pub/alo/knutclient">ftp://ftp.buzuluk.cz/pub/alo/knutclient/</ulink>
+</para>
+</sect1>
+
+<sect1 id="requirements">
+<title>Požadavky</title>
+
+<para>
+Pro úspěšné použití &knutclient; potřebujete KDE 3.x.x
+</para>
+
+<para>
+Seznam změn můžete najít na
+<ulink
+url="http://www.knut.noveradsl.cz/knutclient/">http://www.knut.noveradsl.cz/knutclient/</ulink>.
+</para>
+</sect1>
+
+<sect1 id="compilation">
+<title>Překlad a instalace</title>
+
+<para>
+Pro překlad a instalaci &knutclient; napište následující příkazy v základním adresáři
+Vaší &knutclient; aplikace.
+
+<screen width="40">
+<prompt>%</prompt> <userinput>./configure</userinput>
+<prompt>%</prompt> <userinput>make</userinput>
+<prompt>%</prompt> <userinput>make install</userinput>
+</screen>
+</para>
+
+<para>
+Od doby kdy KDE aplikace používají autoconf a automake,
+nemůžete mít žádné problémy při překladu. Jestliže přesto vzniknou
+nějaké problémy hlaste je prosím do KDE konference.
+</para>
+</sect1>
+</appendix>
+&documentation.index;
+</book>
+<!--
+Local Variables:
+mode: sgml
+sgml-minimize-attributes: nil
+sgml-general-insert-case: lower
+End:
+-->
diff --git a/doc/cs/knutclient-cs.png b/doc/cs/knutclient-cs.png
new file mode 100755
index 0000000..cb36d29
--- /dev/null
+++ b/doc/cs/knutclient-cs.png
Binary files differ
diff --git a/doc/cs/ksetting-cs.png b/doc/cs/ksetting-cs.png
new file mode 100644
index 0000000..ae4e047
--- /dev/null
+++ b/doc/cs/ksetting-cs.png
Binary files differ
diff --git a/doc/cs/mkicker-cs.png b/doc/cs/mkicker-cs.png
new file mode 100644
index 0000000..8c7f0c1
--- /dev/null
+++ b/doc/cs/mkicker-cs.png
Binary files differ
diff --git a/doc/cs/msetting-cs.png b/doc/cs/msetting-cs.png
new file mode 100755
index 0000000..6d41e04
--- /dev/null
+++ b/doc/cs/msetting-cs.png
Binary files differ
diff --git a/doc/cs/new-cs.png b/doc/cs/new-cs.png
new file mode 100755
index 0000000..3324d17
--- /dev/null
+++ b/doc/cs/new-cs.png
Binary files differ
diff --git a/doc/cs/psetting-cs.png b/doc/cs/psetting-cs.png
new file mode 100755
index 0000000..55ff9ce
--- /dev/null
+++ b/doc/cs/psetting-cs.png
Binary files differ
diff --git a/doc/cs/tkicker-cs.png b/doc/cs/tkicker-cs.png
new file mode 100644
index 0000000..e662839
--- /dev/null
+++ b/doc/cs/tkicker-cs.png
Binary files differ
diff --git a/doc/cs/usetting-cs.png b/doc/cs/usetting-cs.png
new file mode 100755
index 0000000..c53b8dc
--- /dev/null
+++ b/doc/cs/usetting-cs.png
Binary files differ
diff --git a/doc/cs/variables-cs.png b/doc/cs/variables-cs.png
new file mode 100644
index 0000000..da3a274
--- /dev/null
+++ b/doc/cs/variables-cs.png
Binary files differ
diff --git a/doc/en/Makefile.am b/doc/en/Makefile.am
new file mode 100755
index 0000000..4f808eb
--- /dev/null
+++ b/doc/en/Makefile.am
@@ -0,0 +1,2 @@
+KDE_DOCS = knutclient
+KDE_LANG = en
diff --git a/doc/en/asetting-en.png b/doc/en/asetting-en.png
new file mode 100755
index 0000000..444c11e
--- /dev/null
+++ b/doc/en/asetting-en.png
Binary files differ
diff --git a/doc/en/fsetting-en.png b/doc/en/fsetting-en.png
new file mode 100755
index 0000000..e90e339
--- /dev/null
+++ b/doc/en/fsetting-en.png
Binary files differ
diff --git a/doc/en/index.docbook b/doc/en/index.docbook
new file mode 100755
index 0000000..2b8ac9d
--- /dev/null
+++ b/doc/en/index.docbook
@@ -0,0 +1,1288 @@
+<?xml version="1.0" ?>
+<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.1-Based Variant V1.0//EN"
+"dtd/kdex.dtd" [
+ <!ENTITY knutclient '<application>KNutClient</application>'>
+ <!ENTITY kappname "&knutclient;"><!-- replace knutclient here -->
+ <!ENTITY % addindex "IGNORE">
+ <!ENTITY % English "INCLUDE"><!-- change language only here -->
+
+ <!-- Do not define any other entities; instead, use the entities
+ from kde-genent.entities and $LANG/user.entities. -->
+]>
+<!-- kdoctemplate v0.8 October 1 1999
+ Minor update to "Credits and Licenses" section on August 24, 2000
+ Removed "Revision history" section on 22 January 2001 -->
+
+<!-- ................................................................ -->
+
+<!-- The language must NOT be changed here. -->
+
+<book lang="&language;">
+
+<!-- This header contains all of the meta-information for the document such
+as Authors, publish date, the abstract, and Keywords -->
+
+<bookinfo>
+<title>The KNutClient Handbook</title>
+
+<authorgroup>
+<author>
+<firstname>Daniel</firstname>
+<othername></othername>
+<surname>Prynych</surname>
+<affiliation>
+<address><email>Daniel@prynych.cz</email></address>
+</affiliation>
+</author>
+</authorgroup>
+
+
+<copyright>
+<year>2001</year>
+<year>2002</year>
+<year>2003</year>
+<year>2004</year>
+<year>2006</year>
+<year>2007</year>
+<year>2008</year>
+<year>2009</year>
+<holder>Daniel Prynych</holder>
+</copyright>
+
+<!-- Translators: put here the copyright notice of the translation -->
+<!-- Put here the FDL notice. Read the explanation in fdl-notice.docbook
+ and in the FDL itself on how to use it. -->
+<legalnotice>&FDLNotice;</legalnotice>
+
+<!-- Date and version information of the documentation
+Don't forget to include this last date and this last revision number, we
+need them for translation coordination !
+Please respect the format of the date (DD/MM/YYYY) and of the version
+(V.MM.LL), it could be used by automation scripts.
+Do NOT change these in the translation. -->
+
+<date>15/01/2008</date>
+<releaseinfo>0.12.01</releaseinfo>
+
+<!-- Abstract about this handbook -->
+
+<abstract>
+<para>
+&knutclient; is GUI client for UPS system NUT.
+</para>
+<para>
+This document describes &knutclient; version 0.9.5
+</para>
+</abstract>
+
+
+<keywordset>
+<keyword>KDE</keyword>
+<keyword>kdeutils</keyword>
+<keyword>KNutClient</keyword>
+<keyword>NUT</keyword>
+<keyword>UPS</keyword>
+</keywordset>
+
+</bookinfo>
+
+
+<chapter id="introduction">
+<title>Introduction</title>
+
+<para>
+The &knutclient; is the application that watches state of UPS for system NUT.
+</para>
+</chapter>
+
+<chapter id="using-knutclient">
+<title>Using KNutClient</title>
+
+<sect1 id="knutclient-mainwin">
+<title>Main window &knutclient;</title>
+
+
+
+<para>
+Main window applications &knutclient;
+</para>
+<para>
+The &knutclient; is the client graphics application for system NUT
+"Network Ups Tools". It enables to watch the state of UPS and to show
+values of variables which the choice UPS a its driver are supporting.
+</para>
+
+<para>
+From version 0.6.0 &knutclient; supports the running of instant command and
+enables the change of RW variables.
+</para>
+<para>
+From version 0.9.0 &knutclient; doesn't support protocol UDP.
+</para>
+
+<para>
+<screenshot>
+<screeninfo>Main window &knutclient;</screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="knutclient-en.png" format="PNG"/>
+ </imageobject>
+ </mediaobject>
+</screenshot>
+</para>
+<para>
+
+Main window is divided in two parts.
+</para>
+<para>
+The left part "Main panel" includes next dates which show the state of the UPS choice.
+On line, on battery, overload,replace battery,battery low, calibration,runtime.
+There are unchangeable dates in this panel, name of UPS, serial number,
+manufactured. This dates are reading only once, when you UPS choose.
+</para>
+<para>
+The right part includes analog panels. These panels show values of variables like
+input voltage, load UPS, battery charge, UPS temperature, battery voltage.
+</para>
+<para>
+&knutclient; includes toolbar, with standard buttons and button for the UPS choice.
+</para>
+</sect1>
+
+<sect1 id="knutclient-kicker">
+<title>&knutclient; and KDE panel</title>
+
+<para>
+<screenshot>
+<screeninfo>&knutclient; and KDE panel</screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="tkicker-en.png" format="PNG"/>
+ </imageobject>
+ </mediaobject>
+</screenshot>
+</para>
+
+<para>
+From 0.8.0 version &knutclient; docks in KDE panel. His icon is variable and shows
+information about UPS load, runtime and the charge of battery, depending on type of icons is selected.
+
+After moving the pointer of the mouse on the icon, information window "ToolTip" is showes up,
+which includes more information about UPS, Name, UPS name ,Address, State, Runtime ..
+</para>
+</sect1>
+
+
+<sect1 id="knutclient-features">
+<title>More KNutClient features</title>
+<para>
+For connecting with server side of NUT (upsd), &knutclient; uses protocol TCP.
+When UPS is selected in toolbar, &knutclient; tries to read the data. When
+reading fails, reading is repeated. The maximum count of repetitions is five.
+Afterwards &knutclient; reads data in periodical sequences. The first reading
+reads all variables, next reading reads variables that analog panels,
+RUNTIME a state of UPS show only. Variables show UPS name, manufacturer, serial
+number ... are read only once, because their changes aren't probable.
+</para>
+
+<para>
+Errors which arise like answer from user actions are show in their own window.
+</para>
+
+</sect1>
+
+</chapter>
+
+<chapter id="commands">
+<title>Command Reference</title>
+
+
+<sect1 id="knutclient-mainwindow">
+<title>The main KNutClient window</title>
+<para></para>
+
+<sect2>
+<title>The File Menu</title>
+<para>
+<variablelist>
+ <varlistentry>
+ <term><menuchoice>
+ <guimenu>File</guimenu>
+ <guimenuitem>Showing Ups variables and commands</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Shows Ups variables for selected Ups
+ </action></para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenu>File</guimenu>
+ <guimenuitem>Running instant command</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Runs selected instant command for selected UPS</action></para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenu>File</guimenu>
+ <guimenuitem>Setting RW variables</guimenuitem>
+ </menuchoice></term>
+ <listitem>
+ <para><action> Changes selected UPS RW variable</action></para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><menuchoice>
+ <shortcut>
+ <keycombo><keycap>Ctrl</keycap><keycap>q</keycap></keycombo>
+ </shortcut>
+ <guimenu>File</guimenu>
+ <guimenuitem>Quit</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Quits program</action></para></listitem>
+ </varlistentry>
+</variablelist>
+</para>
+</sect2>
+
+
+<sect2>
+<title>Menu Connection</title>
+<para>
+<variablelist>
+ <varlistentry>
+ <term><menuchoice>
+ <shortcut>
+ <keycombo><keycap>F1</keycap></keycombo>
+ </shortcut>
+ <guimenu>Connection</guimenu>
+ <guimenuitem>Reconnect</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Restore connection (reconnect) to UPS server(upsd).
+ </action></para></listitem>
+ </varlistentry>
+</variablelist>
+</para>
+</sect2>
+
+
+
+<sect2>
+<title>Menu Settings</title>
+<para>
+<variablelist>
+ <varlistentry>
+ <term><menuchoice>
+ <guimenu>Settings</guimenu>
+ <guimenuitem>Show Toolbar</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Shows/Hides toolbar.</action></para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenu>Settings</guimenu>
+ <guimenuitem>Show Statusbar</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Shows/Hides statusbar.</action></para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenu>Settings</guimenu>
+ <guimenuitem>Configure Shortcuts... </guimenuitem>
+ </menuchoice></term>
+ <listitem>
+ <para><action>Opens dialog panels for configuration key/action associations.
+ </action></para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenu>Settings</guimenu>
+ <guimenuitem>Configure &knutclient; </guimenuitem>
+ </menuchoice></term>
+ <listitem>
+ <para><action>Opens main configuration dialog panels.
+ </action></para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenu>Settings</guimenu>
+ <guimenuitem>Using description</guimenuitem>
+ </menuchoice></term>
+ <listitem>
+ <para><action>Shows/Hides tooltip for showing UPS variables and commands.
+ </action></para>
+ </listitem>
+ </varlistentry>
+
+</variablelist>
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="knutclient-kicker-comm">
+<title>Icon in KDE panel</title>
+
+<para>
+<screenshot>
+<screeninfo>Menu of KDE panel's icon</screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="mkicker-cs.png" format="PNG"/>
+ </imageobject>
+ </mediaobject>
+</screenshot>
+</para>
+
+
+<sect2>
+<title>Menu</title>
+<para>
+<variablelist>
+ <varlistentry>
+ <term><menuchoice>
+ <guimenuitem>UPS</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Using for select Ups.</action></para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenuitem>Showing Ups variables and commands</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Shows Ups variables for selected Ups.
+ </action></para></listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenuitem>Running instant command</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Runs selected instant command for selected UPS.</action></para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenuitem>Setting RW variables</guimenuitem>
+ </menuchoice></term>
+ <listitem>
+ <para><action> Changes selected UPS RW variable.</action></para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenuitem>Reconnect</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Restore connection (reconnect) to UPS server(upsd).
+ </action></para></listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenuitem>Setting &knutclient; </guimenuitem>
+ </menuchoice></term>
+ <listitem>
+ <para><action>Opens configuration dialog panels.
+ </action></para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenuitem>About &knutclient;</guimenuitem>
+ </menuchoice></term>
+ <listitem>
+ <para><action>Shows information about aplication &knutclient;.</action></para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenuitem>Minimalize</guimenuitem>
+ </menuchoice></term>
+ <listitem>
+ <para><action>Closes main window.</action></para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><menuchoice>
+ <guimenuitem>Quit</guimenuitem>
+ </menuchoice></term>
+ <listitem><para><action>Quits program.</action></para></listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+ </sect2>
+ </sect1>
+
+
+<sect1 id="knuclient-show-variables">
+<title>Showing variables</title>
+<para>
+This window shows list of all variables and instant commands, when exist for selected UPS.
+<screenshot>
+<screeninfo>Window of variables and instant commands</screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="variables-cs.png" format="PNG"/>
+ </imageobject>
+ </mediaobject>
+</screenshot>
+</para>
+</sect1>
+
+
+
+ <sect1 id="knuclient-instant-command">
+ <title>Instant commands</title>
+ <para>
+ Instant commands run in UPS, the NUT server puts the command selected driver and
+ driver will run the command in UPS. The control window offers commands, which
+ the driver supports.
+ </para>
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><guilabel>OK</guilabel></term>
+ <listitem>
+ <para>The button <guibutton>OK</guibutton> runs the selected commands.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Cancel</guilabel></term>
+ <listitem>
+ <para>The Button <guibutton>Cancel</guibutton> closes the window.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Command</guilabel></term>
+ <listitem>
+ <para>The command for running is selected here.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </sect1>
+
+ <sect1 id="knutclient-RW-values">
+ <title>User changed (RW) variables</title>
+ <para>
+ User changed variables are group of variables which can be changed by the user.
+ Majority of them are equal to setting of UPS. There are two types of user
+ changed variables, char or enumerated variables. Char variables are a string of
+ chars with maximal length. Enumerated variables are a list of right values
+ for setting these variables.
+ </para>
+ <para>
+ User changed variable is not changed on server NUT (upsd) but the server
+ puts command for change to driver, it changes the setting immediately. This
+ activity is not instant and it can wait a few seconds.
+ </para>
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><guilabel>OK</guilabel></term>
+ <listitem>
+ <para>Button<guibutton>OK</guibutton> changes variable.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Cancel</guilabel></term>
+ <listitem>
+ <para>Button <guibutton>Cancel</guibutton> close window.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Default</guilabel></term>
+ <listitem>
+ <para>Button <guibutton>Default</guibutton> sets default values
+this variable.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Variable</guilabel></term>
+ <listitem>
+ <para>Variable for changed is selected here.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Value</guilabel></term>
+ <listitem>
+ <para> Values for selected variable are selected here.
+ Array for changed of value is changes on base type of variable.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </sect1>
+
+
+<sect1 id="knutclient-configuration">
+<title>Setting &knutclient;</title>
+
+<para>
+The window for setting has got five parts Setting, UPS, Panel, Fonts and Analog.
+</para>
+ <sect2>
+ <title>Setting</title>
+ <para>
+ Part Setting is used for setting number of rows, analog panels, background color of the main window,
+ input voltage (120/230)V, frequency of input voltage (50/60)Hz and allowing of Xfer's values (LowXfer and HighXfer)
+ </para>
+ <para>
+ <screenshot>
+ <screeninfo>&knutclient; </screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="msetting-en.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </screenshot>
+ </para>
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><guilabel>Number of columns</guilabel></term>
+ <listitem>
+ <para>This sets the maximum number of columns for analog panels</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Use custom background color</guilabel></term>
+ <listitem>
+ <para>This allows to use the custom background color of the main window.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Color of Background</guilabel></term>
+ <listitem>
+ <para>This selects the background color.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Use dialog "Are you sure"</guilabel></term>
+ <listitem>
+ <para>
+ This switches on dialog "Are you sure" when you want to end the program.
+ When you don't acknowledge dialog "Are you sure", program doesn't stop.</para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><guilabel>Use Main window when program started</guilabel></term>
+ <listitem>
+ <para>Sets showing main window, when program started.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Show message window, when program reports error</guilabel></term>
+ <listitem>
+ <para>Permits showing message window, what shows description of error. It's useful when docking of program isn't forbided.</para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><guilabel>Nominal Input Voltage</guilabel></term>
+ <listitem>
+ <para> This selects nominal input voltage from 230V or 120V. The selection isn't
+ useless of <guilabel>"Use High-Low XFER"</guilabel> is switched on.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Nominal Input Frequency</guilabel></term>
+ <listitem>
+ <para> This selects nominal input frequency from 50Hz or 60Hz. The selection isn't
+ useless of<guilabel>"Use High-Low XFER"</guilabel> is switched on.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Use High-Low XFER</guilabel></term>
+ <listitem>
+ <para>This sets nominal input voltage and nominal input frequency on based values in variables of NUT LOWXFER and HIGHXFER.
+ These variables determine the range of value input voltage, which UPS can work with.
+ On the basis of thise values &knutclient; sets input voltage and input frequency for analog panels which use them.
+ These panels are input voltage, input frequency and etc.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+</sect2>
+
+<sect2>
+ <title>UPS</title>
+ <para>
+ The part UPS is used for setting the list of UPS and their parameters
+ The left part includes list of UPS. The right part includes buttons for
+ adding, changed parameters and deleting the record of UPS.
+ </para>
+ <para>
+ <screenshot>
+ <screeninfo>&knutclient; </screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="usetting-en.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </screenshot>
+ </para>
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><guibutton>Add</guibutton></term>
+ <listitem>
+ <para>This adds into the list another UPS and sets its parameters.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guibutton>Change</guibutton></term>
+ <listitem>
+ <para>This changes parametric selected UPS.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guibutton>Delete</guibutton></term>
+ <listitem><para>This deletes UPS from list.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ <sect3>
+ <title>Setting of parameters</title>
+ <para>
+ This windows is used for setting parameters of UPS.
+ </para>
+ <para>
+ <screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="new-en.png" format="PNG"/>
+ </imageobject>
+ </mediaobject>
+ </screenshot>
+ </para>
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><guilabel>Name</guilabel></term>
+ <listitem>
+ <para>This sets the name of UPS for the &knutclient; program.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>UPS address</guilabel></term>
+ <listitem>
+ <para>
+ This sets name of PC. UPS is connected with this PC.
+ This name is UPS address on net.
+ Examples: ns.alo.cz, localhost, 192.168.1.12.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><guilabel>UPS name</guilabel></term>
+ <listitem>
+ <para>
+ This sets name of UPS as it is defined in NUT. When name is not defined
+ program uses the first name of NUT system list on this PC.
+ This is true when minimal version of upsd is 1.3. Look into NUT documentacion.
+ Examples: victron, myups, apc700.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Delay (ms)</guilabel></term>
+ <listitem>
+ <para>
+ This sets the interval between two transmitions of data (reading data) from the NUT system.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Password</guilabel></term>
+ <listitem>
+ <para>This sets the password for the authorization of the user.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Store NUT password in configuration file</guilabel></term>
+ <listitem>
+ <para>
+ When you select this selection, the password will be saved into the configuration file.
+ Password saved in configuration file not crypt. When you don't select this selection,
+ the password will be forgotten, when the program is ended.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>UPS Variables</guilabel></term>
+ <listitem>
+ <para>This selects variables which will show in analog panels
+ in the right part main window.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ <para>
+ Parameters User Name and Password are used for instant command or change of RW variables only.
+ For watching the state of UPS the User name and the Password aren't needed.
+ The Password and The User name have got their equivalents in file upsd.users of the NUT system.
+ </para>
+ </sect3>
+ </sect2>
+
+<sect2>
+ <title>Panel</title>
+ <para>
+ The part Panel is used for selecting which information's parts of the main panel will show.
+ </para>
+ <para>
+ <screenshot>
+ <screeninfo>&knutclient; </screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="psetting-en.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </screenshot>
+ </para>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><guilabel>Overloading</guilabel></term>
+ <listitem>
+ <para>
+ Shows/Hides showing overloading
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>UPS Battery low</guilabel></term>
+ <listitem>
+ <para>
+ Shows/Hides showing battery low.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Replace battery</guilabel></term>
+ <listitem>
+ <para>
+ Shows/Hides showing that battery needs to be replaced
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Ups calibration</guilabel></term>
+ <listitem>
+ <para>
+ Shows/Hides showing UPS calibration.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Manufac. + Model</guilabel></term>
+ <listitem>
+ <para>
+ Shows/Hides showing Manufacturer and Model of UPS
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Manufacturer</guilabel></term>
+ <listitem>
+ <para>
+ Shows/Hides showing Manufacturer of UPS.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Model</guilabel></term>
+ <listitem>
+ <para>
+ Shows/Hides showing Model of UPS.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Serial</guilabel></term>
+ <listitem>
+ <para>
+ Shows/Hides showing serial number.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Firm. rev.</guilabel></term>
+ <listitem>
+ <para>
+ Shows/Hides showing firmware's revision.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Runtime</guilabel></term>
+ <listitem>
+ <para>
+ Shows/Hides show the time of the runtime on battery without power.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Use custom background color</guilabel></term>
+ <listitem>
+ <para>This allows to use the custom background color of the main panel.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Color of background</guilabel></term>
+ <listitem>
+ <para>This selects the background color.</para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+</sect2>
+
+ <sect2>
+ <title>Fonts</title>
+ <para>
+ The part Fonts is used for selecting used fonts.
+ </para>
+ <para>
+ <screenshot>
+ <screeninfo>&knutclient; </screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="fsetting-en.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </screenshot>
+ </para>
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><guilabel>Use custom font</guilabel></term>
+ <listitem>
+ <para>
+ Shows/Hides allows to select custom fonts for the main panel and the analog panels.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Main panel / Analog panels</guilabel></term>
+ <listitem>
+ <para>This selects the panel for which the font is selected.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Font</guilabel></term>
+ <listitem>
+ <para>This selects the font for the selection panel.
+ This is used when select <guilabel>Use custom font</guilabel> is selected.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </sect2>
+
+
+
+
+<sect2>
+ <title>Analog</title>
+ <para>
+ The part Analog is used for setting color for the analog panels.
+ </para>
+
+ <para>
+ <screenshot>
+ <screeninfo>&knutclient; </screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="asetting-en.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </screenshot>
+ </para>
+
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><guilabel>Use custom background color</guilabel></term>
+ <listitem>
+ <para>This allows to use custom background color for the analog panel.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Color of background</guilabel></term>
+ <listitem>
+ <para>This selects the background color of analog panel.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Use custom other colors</guilabel></term>
+ <listitem>
+ <para>This allows to select custom color of the analog panel's other parts.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Color of pointer</guilabel></term>
+ <listitem>
+ <para>
+ This is used for selecting the color of analog panel's pointer (finger). Default color is black.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Color of OK range</guilabel></term>
+ <listitem>
+ <para>
+ This is used for selecting color of range OK for analog panel. Default color is green.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Color of warning range</guilabel></term>
+ <listitem>
+ <para>
+ This is used for selecting color of range warning for analog panel. Default color is yellow.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Color of error range</guilabel></term>
+ <listitem>
+ <para>
+ This is used for selecting color of range error for analog panel. Default color is red.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Color of scale</guilabel></term>
+ <listitem>
+ <para>
+ This is used for selecting color of scale for analog panel. Default color is black.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Color of font</guilabel></term>
+ <listitem>
+ <para>
+ This is used for selecting color of font for analog panel. Default color is black.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+
+ <varlistentry>
+ <term><guilabel>Digital processing of pointers</guilabel></term>
+ <listitem>
+ <para>
+ This is used for selecting type of graphics proccessing of pointers.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ </variablelist>
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>Docking</title>
+ <para>
+ The part DOCK is used for setting parameters of docking program.
+ </para>
+ <para>
+ <screenshot>
+ <screeninfo>&knutclient; </screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="ksetting-cs.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </screenshot>
+ </para>
+
+ <para>
+ Type of dock's showing (Dock is KDE panel).
+ </para>
+
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><guilabel>Picture</guilabel></term>
+ <listitem>
+ <para>
+ Sets picture type of icon.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>General</guilabel></term>
+ <listitem>
+ <para>
+ Sets general type of icon, for specialist only.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+
+ <para>
+ Items of ToolTip. (ToolTip is bubble help.)
+ </para>
+
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><guilabel>Manufacturer</guilabel></term>
+ <listitem>
+ <para>
+ Shows/Hides showing Manufacturer of UPS.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Model</guilabel></term>
+ <listitem>
+ <para>
+ Shows/Hides showing Model of UPS.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><guilabel>Serial</guilabel></term>
+ <listitem>
+ <para>
+ Shows/Hides showing serial number.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Firm. rev.</guilabel></term>
+ <listitem>
+ <para>
+ Shows/Hides showing firmware's revision.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Runtime</guilabel></term>
+ <listitem>
+ <para>
+ Shows/Hides showing the time of the runtime on battery without power.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><guilabel>Battery Charge</guilabel></term>
+ <listitem>
+ <para>
+ Shows/Hides showing the Battery Charge.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Load UPS</guilabel></term>
+ <listitem>
+ <para>
+ Shows/Hides showing the Load of UPS.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+
+ <varlistentry>
+ <term><guilabel>Use custom background color</guilabel></term>
+ <listitem>
+ <para>This allows to use the custom background color of KDE panel's icon, when type of icon in KDE panel is picture.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Color of background</guilabel></term>
+ <listitem>
+ <para>This selects the background color.</para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+ </sect2>
+
+
+</sect1>
+</chapter>
+
+<chapter id="faq">
+<title>Questions and Answers</title>
+
+&reporting.bugs;
+&updating.documentation;
+
+<qandaset id="faqlist">
+<qandaentry>
+<question>
+<para>
+The &knutclient; isn't working, but the upsc is. What shall I do ?
+</para>
+</question>
+<answer>
+<para>
+See the setting number of port. From version 0.5 (NUT) the number of port is changed.
+</para>
+</answer>
+</qandaentry>
+</qandaset>
+</chapter>
+
+<chapter id="credits">
+
+<title>Credits and License</title>
+
+<para>
+&knutclient;
+</para>
+<para>
+Program copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 Daniel Prynych <email>Daniel@prynych.cz</email>
+</para>
+<para>
+Documentation copyright 2003, 2004, 2005, 2006, 2007, 2008 Daniel Prynych <email>Daniel@prynych.cz</email>
+</para>
+<para>
+Translations done by:
+<itemizedlist>
+<listitem>
+<para>Daniel Prynych <email>Daniel@prynych.cz</email> Eng</para>
+</listitem>
+</itemizedlist>
+</para>
+
+&underFDL; <!-- FDL: do not remove -->
+&underGPL; <!-- GPL License -->
+
+</chapter>
+
+<appendix id="installation">
+<title>Installation</title>
+
+<sect1 id="getting-knutclient">
+<title>How to obtain KNutClient</title>
+
+<para>
+&knutclient; is not part of the KDE project
+<ulink url="http://www.kde.org">http://www.kde.org</ulink>.
+&knutclient; can be found on
+<ulink
+url="ftp://ftp.buzuluk.cz/pub/alo/knutclient/">ftp://ftp.buzuluk.cz/pub/alo/knutclient/</ulink>, the
+main ftp site of the A.L.O. </para>
+</sect1>
+
+<sect1 id="requirements">
+<title>Requirements</title>
+
+<para>
+In order to successfully use &knutclient;, you need KDE 3.x
+</para>
+
+<para>
+You can find a list of changes at <ulink
+url="http://www.knut.noveradsl.cz/knutclient/">http://www.knut.noveradsl.cz/knutclient/</ulink>.
+</para>
+</sect1>
+
+<sect1 id="compilation">
+<title>Compilation and installation</title>
+
+<para>
+In order to compile and install &knutclient; on your system, type the following
+in the base
+directory of.
+<screen width="40">
+<prompt>%</prompt> <userinput>./configure</userinput>
+<prompt>%</prompt> <userinput>make</userinput>
+<prompt>%</prompt> <userinput>make install</userinput>
+</screen>
+</para>
+
+<para>Since KApp uses autoconf and automake you should have not trouble
+compiling it.
+Should you run into problems please report them to the KDE mailing lists.</para>
+</sect1>
+</appendix>
+
+&documentation.index;
+</book>
+<!--
+Local Variables:
+mode: sgml
+sgml-minimize-attributes: nil
+sgml-general-insert-case: lower
+End:
+-->
diff --git a/doc/en/knutclient-en.png b/doc/en/knutclient-en.png
new file mode 100755
index 0000000..44c2e26
--- /dev/null
+++ b/doc/en/knutclient-en.png
Binary files differ
diff --git a/doc/en/ksetting-en.png b/doc/en/ksetting-en.png
new file mode 100644
index 0000000..751d49c
--- /dev/null
+++ b/doc/en/ksetting-en.png
Binary files differ
diff --git a/doc/en/mkicker-en.png b/doc/en/mkicker-en.png
new file mode 100644
index 0000000..8a5328f
--- /dev/null
+++ b/doc/en/mkicker-en.png
Binary files differ
diff --git a/doc/en/msetting-en.png b/doc/en/msetting-en.png
new file mode 100755
index 0000000..0031423
--- /dev/null
+++ b/doc/en/msetting-en.png
Binary files differ
diff --git a/doc/en/new-en.png b/doc/en/new-en.png
new file mode 100755
index 0000000..3814a63
--- /dev/null
+++ b/doc/en/new-en.png
Binary files differ
diff --git a/doc/en/psetting-en.png b/doc/en/psetting-en.png
new file mode 100755
index 0000000..79fdae2
--- /dev/null
+++ b/doc/en/psetting-en.png
Binary files differ
diff --git a/doc/en/tkicker-en.png b/doc/en/tkicker-en.png
new file mode 100644
index 0000000..6bafb51
--- /dev/null
+++ b/doc/en/tkicker-en.png
Binary files differ
diff --git a/doc/en/usetting-en.png b/doc/en/usetting-en.png
new file mode 100755
index 0000000..e9d308d
--- /dev/null
+++ b/doc/en/usetting-en.png
Binary files differ
diff --git a/doc/en/variables-en.png b/doc/en/variables-en.png
new file mode 100644
index 0000000..c54950d
--- /dev/null
+++ b/doc/en/variables-en.png
Binary files differ
diff --git a/installDeb.sh b/installDeb.sh
new file mode 100755
index 0000000..a4e70f3
--- /dev/null
+++ b/installDeb.sh
@@ -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
diff --git a/installFedora.sh b/installFedora.sh
new file mode 100755
index 0000000..8412d92
--- /dev/null
+++ b/installFedora.sh
@@ -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
diff --git a/installMandriva.sh b/installMandriva.sh
new file mode 100755
index 0000000..8412d92
--- /dev/null
+++ b/installMandriva.sh
@@ -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
diff --git a/installMandriva4.sh b/installMandriva4.sh
new file mode 100755
index 0000000..7ac078b
--- /dev/null
+++ b/installMandriva4.sh
@@ -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/
+
diff --git a/pics/Makefile.am b/pics/Makefile.am
new file mode 100644
index 0000000..973f792
--- /dev/null
+++ b/pics/Makefile.am
@@ -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
diff --git a/pics/knc_analog.png b/pics/knc_analog.png
new file mode 100644
index 0000000..259a5f6
--- /dev/null
+++ b/pics/knc_analog.png
Binary files differ
diff --git a/pics/knc_batt.png b/pics/knc_batt.png
new file mode 100644
index 0000000..e8ff202
--- /dev/null
+++ b/pics/knc_batt.png
Binary files differ
diff --git a/pics/knc_conn.png b/pics/knc_conn.png
new file mode 100644
index 0000000..e298e09
--- /dev/null
+++ b/pics/knc_conn.png
Binary files differ
diff --git a/pics/knc_dock.png b/pics/knc_dock.png
new file mode 100644
index 0000000..fe3f95c
--- /dev/null
+++ b/pics/knc_dock.png
Binary files differ
diff --git a/pics/knc_error.png b/pics/knc_error.png
new file mode 100644
index 0000000..61c9b28
--- /dev/null
+++ b/pics/knc_error.png
Binary files differ
diff --git a/pics/knc_main.png b/pics/knc_main.png
new file mode 100644
index 0000000..d4af4ac
--- /dev/null
+++ b/pics/knc_main.png
Binary files differ
diff --git a/pics/knc_mpref.png b/pics/knc_mpref.png
new file mode 100644
index 0000000..a9e2bc1
--- /dev/null
+++ b/pics/knc_mpref.png
Binary files differ
diff --git a/pics/knc_mset.png b/pics/knc_mset.png
new file mode 100644
index 0000000..45f3e63
--- /dev/null
+++ b/pics/knc_mset.png
Binary files differ
diff --git a/pics/knc_panel.png b/pics/knc_panel.png
new file mode 100644
index 0000000..8b23efc
--- /dev/null
+++ b/pics/knc_panel.png
Binary files differ
diff --git a/pics/knc_ups.png b/pics/knc_ups.png
new file mode 100644
index 0000000..0d7d32d
--- /dev/null
+++ b/pics/knc_ups.png
Binary files differ
diff --git a/pics/knc_upses.png b/pics/knc_upses.png
new file mode 100644
index 0000000..69eebba
--- /dev/null
+++ b/pics/knc_upses.png
Binary files differ
diff --git a/po/Makefile.am b/po/Makefile.am
new file mode 100644
index 0000000..5ab765c
--- /dev/null
+++ b/po/Makefile.am
@@ -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
diff --git a/po/cs.po b/po/cs.po
new file mode 100644
index 0000000..0bbef63
--- /dev/null
+++ b/po/cs.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í"
diff --git a/po/de.po b/po/de.po
new file mode 100644
index 0000000..24300a2
--- /dev/null
+++ b/po/de.po
@@ -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"
diff --git a/po/es.po b/po/es.po
new file mode 100644
index 0000000..b1505c9
--- /dev/null
+++ b/po/es.po
@@ -0,0 +1,1029 @@
+# translation of es.po to Spanish
+# tradução de knutclient.po para Brazilian Portuguese
+# Copyright (C) 2004, 2008 Free Software Foundation, Inc.
+#
+# Wellington Terumi Uemura <wellingtonuemura@gmail.com>, 2006.
+# Lisiane Sztoltz Teixeira <lisiane@kdemail.net>, 2004.
+# Daniel Prynych <Daniel.Prynych@alo.cz>, 2004.
+# Mad-Soft <mad.soft@gmail.com>, 2008.
+msgid ""
+msgstr ""
+"Project-Id-Version: es\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-02-21 12:13+0100\n"
+"PO-Revision-Date: 2009-02-22 23:12+0100\n"
+"Last-Translator: Mad-Soft <mad.soft@gmail.com>\n"
+"Language-Team: Spanish <mad.soft@gmail.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+# _translatorinfo.cpp:1
+#: _translatorinfo.cpp:1
+msgid ""
+"_: NAME OF TRANSLATORS\n"
+"Your names"
+msgstr "Mad-Soft"
+
+# _translatorinfo.cpp:3
+#: _translatorinfo.cpp:3
+msgid ""
+"_: EMAIL OF TRANSLATORS\n"
+"Your emails"
+msgstr "mad.soft@gmail.com"
+
+# knutclient.cpp:74
+#: knutclient.cpp:86
+msgid "Ready."
+msgstr "Listo."
+
+#: knutclient.cpp:218 knutclient.cpp:219
+msgid "The connection was renewed."
+msgstr "La conexión se renovó."
+
+#: knutclient.cpp:285
+msgid "The connection failed. The next connection will make after %1 sec."
+msgstr "La conexión ha fallado. La reconexión se hará despues de %1 segundos."
+
+# knutclient.cpp:328
+#: knutclient.cpp:546
+msgid "upsd > 1.2 doesn't support UDP. Connection is switched to TCP"
+msgstr "upsd > 1.2 no soporta UDP. La conexión se ha cambiado a TCP"
+
+# knutclient.cpp:462 knutclient.cpp:463
+#: knutclient.cpp:688 knutclient.cpp:689
+msgid "Data OK"
+msgstr "Datos OK"
+
+#: knutclient.cpp:781 knutclient.cpp:782
+msgid "The connection was closed by the second side (upsd)."
+msgstr "La conexión fué cerrado por otra instancia (upsd)."
+
+# knutclient.cpp:526 knutclient.cpp:527
+#: knutclient.cpp:798 knutclient.cpp:799
+msgid "UPS is off."
+msgstr "SAI está apagado."
+
+# knutclient.cpp:530 knutclient.cpp:531
+#: knutclient.cpp:802 knutclient.cpp:803
+msgid "UPS is back on."
+msgstr "SAI ha vuelto."
+
+# knutclient.cpp:536 knutclient.cpp:537
+#: knutclient.cpp:808 knutclient.cpp:809
+msgid "Power is back online."
+msgstr "Ha vuelto la corriente."
+
+# knutclient.cpp:542 knutclient.cpp:543
+#: knutclient.cpp:814 knutclient.cpp:815
+msgid "UPS is on battery."
+msgstr "SAI funciona con batería."
+
+# knutclient.cpp:548 knutclient.cpp:549
+#: knutclient.cpp:820 knutclient.cpp:821
+msgid "UPS battery is low."
+msgstr "Batería baja del SAI"
+
+# knutclient.cpp:552 knutclient.cpp:553
+#: knutclient.cpp:824 knutclient.cpp:825
+msgid "UPS battery is OK."
+msgstr "La batería del SAI esta OK."
+
+# knutclient.cpp:558 knutclient.cpp:559
+#: knutclient.cpp:830 knutclient.cpp:831
+msgid "UPS battery is bad and needs be replaced."
+msgstr "La batería del SAI está mal y necesita ser reemplazada."
+
+# knutclient.cpp:564 knutclient.cpp:565
+#: knutclient.cpp:836 knutclient.cpp:837
+msgid "UPS is overloaded."
+msgstr "SAI está sobrecargado."
+
+# knutclient.cpp:568 knutclient.cpp:569
+#: knutclient.cpp:840 knutclient.cpp:841
+msgid "UPS isn't overloaded."
+msgstr "SAI no está sobrecargado."
+
+# knutclient.cpp:574 knutclient.cpp:575 knutdock.cpp:322
+#: knutclient.cpp:846 knutclient.cpp:847 knutdock.cpp:449
+msgid "UPS is performing calibration"
+msgstr "SAI está siendo calibrado."
+
+# knutclient.cpp:578 knutclient.cpp:579
+#: knutclient.cpp:850 knutclient.cpp:851
+msgid "Calibration of UPS is ended."
+msgstr "La calibración del SAI ha finalizado."
+
+# knutclient.cpp:584 knutclient.cpp:585
+#: knutclient.cpp:856 knutclient.cpp:857
+msgid "UPS is boosting incoming voltage."
+msgstr "SAI está aumentando el voltaje de entrada."
+
+# knutclient.cpp:588 knutclient.cpp:589
+#: knutclient.cpp:860 knutclient.cpp:861
+msgid "Boosting of UPS is ended."
+msgstr "Finalizó el aumento de voltaje del SAI."
+
+# knutclient.cpp:594 knutclient.cpp:595
+#: knutclient.cpp:866 knutclient.cpp:867
+msgid "UPS is trimming incoming voltage."
+msgstr "SAI está ajustando el voltaje de entrada."
+
+# knutclient.cpp:598 knutclient.cpp:599
+#: knutclient.cpp:870 knutclient.cpp:871
+msgid "Trimming of UPS is ended."
+msgstr "Finalizó el ajuste de voltaje del SAI."
+
+# knutclient.cpp:615 knutclient.cpp:672 knutclient.cpp:679
+#: knutclient.cpp:887 knutclient.cpp:954 knutclient.cpp:963
+msgid "Switched"
+msgstr "Cambiado."
+
+#: knutclient.cpp:1103 knutdock.cpp:640 knutmainwindow.cpp:781
+msgid "Reconnect"
+msgstr "Reconectar"
+
+# knutdock.cpp:292 knutdock.cpp:342 knutfrontpanel.cpp:164
+# knutnewupsdlg.cpp:64 knutprintupsvar.cpp:75
+#: knutdock.cpp:419 knutdock.cpp:469 knutfrontpanel.cpp:192
+#: knutnewupsdlg.cpp:69 knutprintupsvar.cpp:78
+msgid "Name"
+msgstr "Nombre"
+
+# knutdock.cpp:293 knutnewupsdlg.cpp:76
+#: knutdock.cpp:420 knutnewupsdlg.cpp:83
+msgid "UPS name"
+msgstr "Nombre del SAI"
+
+# knutdock.cpp:294 knutnewupsdlg.cpp:70
+#: knutdock.cpp:421 knutnewupsdlg.cpp:77
+msgid "UPS address"
+msgstr "Dirección del SAI"
+
+# knutdock.cpp:295 knutdock.cpp:316 knutdock.cpp:319 knutdock.cpp:322
+# knutdock.cpp:325 knutdock.cpp:328 knutdock.cpp:331
+#: knutdock.cpp:422 knutdock.cpp:443 knutdock.cpp:446 knutdock.cpp:449
+#: knutdock.cpp:452 knutdock.cpp:455 knutdock.cpp:458
+msgid "Status : "
+msgstr "Estado :"
+
+# knutdock.cpp:298 knutvardata.cpp:192
+#: knutdock.cpp:425 knutvardata.cpp:209
+msgid "Connection doesn't exist."
+msgstr "La conexión no existe."
+
+# knutdock.cpp:302 knutfrontpanel.cpp:70
+#: knutdock.cpp:429 knutfrontpanel.cpp:80
+msgid "UPS On line"
+msgstr "SAI activo."
+
+# knutdock.cpp:306 knutfrontpanel.cpp:83
+#: knutdock.cpp:433 knutfrontpanel.cpp:95
+msgid "UPS On battery"
+msgstr "SAI en batería"
+
+# knutdock.cpp:310
+#: knutdock.cpp:437
+msgid "UPS Of line"
+msgstr "SAI inactivo"
+
+# knutdock.cpp:316
+#: knutdock.cpp:443
+msgid "UPS Battery is low"
+msgstr "SAI batería baja"
+
+# knutdock.cpp:319 knutfrontpanel.cpp:122
+#: knutdock.cpp:446 knutfrontpanel.cpp:138
+msgid "Replace battery"
+msgstr "Cambia la batería"
+
+# knutdock.cpp:325
+#: knutdock.cpp:452
+msgid "UPS is Overload"
+msgstr "SAI está sobrecargado"
+
+# knutdock.cpp:328
+#: knutdock.cpp:455
+msgid "UPS is trimming voltage"
+msgstr "SAI está ajustando el voltaje"
+
+# knutdock.cpp:331
+#: knutdock.cpp:458
+msgid "UPS is boosting voltage"
+msgstr "SAI está aumentando el voltaje"
+
+# knutdock.cpp:337
+#: knutdock.cpp:464
+msgid "Error : "
+msgstr "Error :"
+
+# knutdock.cpp:340 knutfrontpanel.cpp:154
+#: knutdock.cpp:467 knutfrontpanel.cpp:182
+msgid "Manufac. : "
+msgstr "Fabricante :"
+
+# knutdock.cpp:344
+#: knutdock.cpp:471
+msgid "Serial"
+msgstr "Nº Serie"
+
+# knutdock.cpp:346
+#: knutdock.cpp:473
+msgid "Firmware"
+msgstr "Firmware"
+
+# knutdock.cpp:350 knutfrontpanel.cpp:194
+#: knutdock.cpp:477 knutfrontpanel.cpp:233
+msgid "Runtime"
+msgstr "En Ejecución"
+
+# knutdock.cpp:350
+#: knutdock.cpp:477
+msgid " : %1:%2 min"
+msgstr " : %1:%2 min"
+
+# knutdock.cpp:357 knutvardata.cpp:43
+#: knutdock.cpp:482 knutvardata.cpp:45
+msgid "Battery Charge"
+msgstr "Carga batería"
+
+# knutdock.cpp:364 knutvardata.cpp:46
+#: knutdock.cpp:487 knutvardata.cpp:48
+msgid "UPS Load"
+msgstr "Carga del SAI"
+
+# knutdock.cpp:427 knutmainwindow.cpp:377
+#: knutdock.cpp:513 knutmainwindow.cpp:663
+msgid "Are you sure ?"
+msgstr "¿Estás seguro?"
+
+# knutdock.cpp:402 knutmainwindow.cpp:639
+#: knutdock.cpp:636 knutmainwindow.cpp:748
+msgid "&Showing UPS variables and commands"
+msgstr "&Mostrar comandos y variables del SAI"
+
+# knutdock.cpp:403 knutmainwindow.cpp:640
+#: knutdock.cpp:637 knutmainwindow.cpp:749
+msgid "&Running instant commands"
+msgstr "&Ejecutar comandos instantaneos"
+
+# knutdock.cpp:404 knutmainwindow.cpp:641
+#: knutdock.cpp:638 knutmainwindow.cpp:750
+msgid "Setting R&W variables"
+msgstr "Definir variables de &Lect/Esc."
+
+# knutdock.cpp:406
+#: knutdock.cpp:642
+msgid "&Preferences"
+msgstr "&Opciones"
+
+# knutdock.cpp:408
+#: knutdock.cpp:644
+msgid "&About KNutClient"
+msgstr "&Acerca de KNutClient"
+
+# knutdock.cpp:410
+#: knutdock.cpp:646
+msgid "&Minimize"
+msgstr "&Minimizar"
+
+# knutdock.cpp:412
+#: knutdock.cpp:648
+msgid "&Exit"
+msgstr "&Salir"
+
+# knutfrontpanel.cpp:96
+#: knutfrontpanel.cpp:110
+msgid "UPS Overload"
+msgstr "SAI Sobrecarga"
+
+# knutfrontpanel.cpp:109
+#: knutfrontpanel.cpp:124
+msgid "UPS Battery low"
+msgstr "SAI Batería baja"
+
+# knutfrontpanel.cpp:135
+#: knutfrontpanel.cpp:152
+msgid "UPS calibration"
+msgstr "SAI calibración"
+
+# knutfrontpanel.cpp:174
+#: knutfrontpanel.cpp:202
+msgid "Serial : "
+msgstr "Nº Serie : "
+
+# knutfrontpanel.cpp:184
+#: knutfrontpanel.cpp:212
+msgid "Firm. rev. : "
+msgstr "Firm. rev. : "
+
+# knutinstcomms.cpp:33
+#: knutinstcomms.cpp:33
+msgid "Instant commands"
+msgstr "Comandos instantaneos"
+
+# knutinstcomms.cpp:48
+#: knutinstcomms.cpp:45
+msgid "RUN INSTANT COMMAND"
+msgstr "EJECUTAR COMANDO INSTANTANEO"
+
+# knutinstcomms.cpp:52
+#: knutinstcomms.cpp:49
+msgid "Command:"
+msgstr "Comando:"
+
+# knutinstcomms.cpp:56 knutnewupsdlg.cpp:95 knutrwvar.cpp:70
+#: knutinstcomms.cpp:53 knutnewupsdlg.cpp:102 knutrwvar.cpp:70
+msgid "User name:"
+msgstr "Nombre de usuario:"
+
+# knutinstcomms.cpp:57 knutnewupsdlg.cpp:102 knutrwvar.cpp:71
+#: knutinstcomms.cpp:54 knutnewupsdlg.cpp:109 knutrwvar.cpp:71
+msgid "Password:"
+msgstr "Contraseña:"
+
+#: knutmainwindow.cpp:59
+msgid "test of conection from 5"
+msgstr "test de conexión desde 5"
+
+# knutmainwindow.cpp:636
+#: knutmainwindow.cpp:745
+msgid "Quits the application"
+msgstr "Salir de la aplicación"
+
+# knutmainwindow.cpp:644
+#: knutmainwindow.cpp:778
+msgid "&Using descriptions"
+msgstr "&Usar descripciones"
+
+# knutnewupsdlg.cpp:35
+#: knutnewupsdlg.cpp:39
+msgid "New Ups"
+msgstr "Nuevo SAI"
+
+# knutnewupsdlg.cpp:82
+#: knutnewupsdlg.cpp:89
+msgid "Delay (ms):"
+msgstr "Retraso (ms):"
+
+# knutnewupsdlg.cpp:89
+#: knutnewupsdlg.cpp:96
+msgid "Port:"
+msgstr "Puerto:"
+
+# knutnewupsdlg.cpp:109
+#: knutnewupsdlg.cpp:116
+msgid "Store NUT password in configuration file"
+msgstr "Guardar contraseña de NUT en el archivo de configuración"
+
+#: knutnewupsdlg.cpp:123
+msgid "Availabled UPS values"
+msgstr "Valores UPS Disponibles"
+
+#: knutnewupsdlg.cpp:124
+msgid "Selected UPS values"
+msgstr "Valores UPS Seleccionados"
+
+# knutnewupsdlg.cpp:123
+#: knutnewupsdlg.cpp:134
+msgid "UPS Variables"
+msgstr "Variables del SAI"
+
+# knutnewupsdlg.cpp:227
+#: knutnewupsdlg.cpp:255
+msgid "No Name or UPS address"
+msgstr "Sin nombre o direccion del SAI"
+
+# knutnewupsdlg.cpp:234
+#: knutnewupsdlg.cpp:263
+msgid "This Name exist"
+msgstr "El nombre ya existe"
+
+# knutnewupsdlg.cpp:241
+#: knutnewupsdlg.cpp:270
+msgid "Delay must be number"
+msgstr "Retraso debe ser numérico"
+
+# knutnewupsdlg.cpp:247
+#: knutnewupsdlg.cpp:276
+msgid "Port must be number"
+msgstr "Puerto debe ser numérico"
+
+# knutnewupsdlg.cpp:252
+#: knutnewupsdlg.cpp:281
+msgid "Port must be from 1025 until 65535"
+msgstr "Puerto debe estar entre 1025 y 65535"
+
+# knutnewupsdlg.cpp:257
+#: knutnewupsdlg.cpp:286
+msgid "Delay is too small"
+msgstr "Retraso demasiado pequeño"
+
+# knutprefdlg.cpp:464
+#: knutprefdlg.cpp:45
+msgid "Preferences"
+msgstr "Opciones"
+
+# knutprefdlg.cpp:42
+#: knutprefdlg.cpp:508
+msgid "Setting"
+msgstr "Configuración"
+
+# knutprefdlg.cpp:42
+#: knutprefdlg.cpp:508
+msgid "Main Setting"
+msgstr "Configuración Principal"
+
+# knutprefdlg.cpp:50
+#: knutprefdlg.cpp:516
+msgid "Voltage/Frequency"
+msgstr "Voltaje/Frecuencia"
+
+# knutprefdlg.cpp:53
+#: knutprefdlg.cpp:519
+msgid "&Use High-Low XFER"
+msgstr "&Usar Alto-Bajo XFER"
+
+# knutprefdlg.cpp:55
+#: knutprefdlg.cpp:521
+msgid "Number of columns :"
+msgstr "Número de columnas:"
+
+# knutprefdlg.cpp:58 knutprefdlg.cpp:317 knutprefdlg.cpp:394
+#: knutprefdlg.cpp:524 knutprefdlg.cpp:815 knutprefdlg.cpp:894
+msgid "Use custom background color"
+msgstr "Usar color de fondo personalizado"
+
+# knutprefdlg.cpp:62 knutprefdlg.cpp:320 knutprefdlg.cpp:396
+#: knutprefdlg.cpp:528 knutprefdlg.cpp:818 knutprefdlg.cpp:896
+msgid "Color of background :"
+msgstr "Color de fondo :"
+
+# knutprefdlg.cpp:66
+#: knutprefdlg.cpp:532
+msgid "Use dialog \"Are you sure\""
+msgstr "Usar diálogo \"¿Estás seguro?\""
+
+# knutprefdlg.cpp:70
+#: knutprefdlg.cpp:535
+msgid "Use Main window when program is started"
+msgstr "Mostrar ventana principal cuando el programa se inicie"
+
+# knutprefdlg.cpp:70
+#: knutprefdlg.cpp:538
+msgid "Show message window, when program reports error"
+msgstr "Mostrar ventana de mensaje, cuando el programa de un error"
+
+#: knutprefdlg.cpp:543
+msgid "Auto"
+msgstr "Auto"
+
+# knutprefdlg.cpp:75
+#: knutprefdlg.cpp:547
+msgid "Nominal Input Voltage"
+msgstr "Voltaje de entrada Nominal"
+
+# knutprefdlg.cpp:78
+#: knutprefdlg.cpp:550
+msgid "&230 V"
+msgstr "&220 V"
+
+# knutprefdlg.cpp:79
+#: knutprefdlg.cpp:551
+msgid "&120 V"
+msgstr "&120 V"
+
+# knutprefdlg.cpp:81
+#: knutprefdlg.cpp:553
+msgid "Nominal Input Frequency"
+msgstr "Frecuencia de entrada nominal"
+
+# knutprefdlg.cpp:84
+#: knutprefdlg.cpp:556
+msgid "&50 Hz"
+msgstr "&50 Hz"
+
+# knutprefdlg.cpp:85
+#: knutprefdlg.cpp:557
+msgid "&60 Hz"
+msgstr "&60 Hz"
+
+# knutprefdlg.cpp:153
+#: knutprefdlg.cpp:628
+msgid "UPS"
+msgstr "SAI"
+
+# knutprefdlg.cpp:153
+#: knutprefdlg.cpp:628
+msgid "UPS Setting"
+msgstr "Configuración SAI"
+
+# knutprefdlg.cpp:171
+#: knutprefdlg.cpp:646
+msgid "&Add"
+msgstr "&Añadir"
+
+# knutprefdlg.cpp:189
+#: knutprefdlg.cpp:667
+msgid "Dock bar"
+msgstr "Barra de anclaje"
+
+# knutprefdlg.cpp:189
+#: knutprefdlg.cpp:667
+msgid "Docking Setting"
+msgstr "Configuración del icono de sistema"
+
+# knutprefdlg.cpp:192
+#: knutprefdlg.cpp:671
+msgid "Type of dock's showing"
+msgstr "Tipo de icono de sistema"
+
+# knutprefdlg.cpp:197
+#: knutprefdlg.cpp:676
+msgid "Items of tooltip"
+msgstr "Objetos del mensaje emergente"
+
+# knutprefdlg.cpp:205
+#: knutprefdlg.cpp:684
+msgid "&Picture"
+msgstr "&Figura"
+
+# knutprefdlg.cpp:206
+#: knutprefdlg.cpp:685
+msgid "&General"
+msgstr "&General"
+
+# knutprefdlg.cpp:209 knutprefdlg.cpp:301
+#: knutprefdlg.cpp:688 knutprefdlg.cpp:799
+msgid "M&anufacturer"
+msgstr "F&abricante"
+
+# knutprefdlg.cpp:212 knutprefdlg.cpp:304
+#: knutprefdlg.cpp:691 knutprefdlg.cpp:802
+msgid "M&odel"
+msgstr "M&odelo"
+
+# knutprefdlg.cpp:215 knutprefdlg.cpp:307
+#: knutprefdlg.cpp:694 knutprefdlg.cpp:805
+msgid "&Serial"
+msgstr "Nº de &Serie"
+
+# knutprefdlg.cpp:218 knutprefdlg.cpp:310
+#: knutprefdlg.cpp:697 knutprefdlg.cpp:808
+msgid "&Firm. rev."
+msgstr "&Firm. rev."
+
+# knutprefdlg.cpp:221 knutprefdlg.cpp:313
+#: knutprefdlg.cpp:700 knutprefdlg.cpp:811
+msgid "&Runtime"
+msgstr "En E&jecución"
+
+# knutprefdlg.cpp:224
+#: knutprefdlg.cpp:703
+msgid "&Battery Charge"
+msgstr "Carga de &Batería"
+
+# knutprefdlg.cpp:227
+#: knutprefdlg.cpp:706
+msgid "&UPS Load"
+msgstr "&SAI Carga"
+
+# knutprefdlg.cpp:231
+#: knutprefdlg.cpp:710
+msgid "Use custom icon's background color"
+msgstr "Usar color personalizado de fondo de los iconos"
+
+# knutprefdlg.cpp:234
+#: knutprefdlg.cpp:713
+msgid "Color of icon's background :"
+msgstr "Color de fondo de los iconos :"
+
+# knutprefdlg.cpp:273
+#: knutprefdlg.cpp:769
+msgid "Panel"
+msgstr "Panel"
+
+# knutprefdlg.cpp:273
+#: knutprefdlg.cpp:769
+msgid "Panel Setting"
+msgstr "Configuración del panel"
+
+# knutprefdlg.cpp:286
+#: knutprefdlg.cpp:784
+msgid "UPS &Overload"
+msgstr "SAI &Sobrecarga"
+
+# knutprefdlg.cpp:289
+#: knutprefdlg.cpp:787
+msgid "UPS &Battery low"
+msgstr "SAI &Batería baja"
+
+# knutprefdlg.cpp:292
+#: knutprefdlg.cpp:790
+msgid "R&eplace battery"
+msgstr "R&emplaza batería"
+
+# knutprefdlg.cpp:295
+#: knutprefdlg.cpp:793
+msgid "Ups &calibration"
+msgstr "&Calibración del SAI"
+
+# knutprefdlg.cpp:298
+#: knutprefdlg.cpp:796
+msgid "&Manufac. + Model"
+msgstr "Fabricante + &Modelo"
+
+# knutprefdlg.cpp:353
+#: knutprefdlg.cpp:851
+msgid "Setting Fonts"
+msgstr "Configuración de Fuentes"
+
+# knutprefdlg.cpp:360
+#: knutprefdlg.cpp:858
+msgid "&Use custom font"
+msgstr "&Utilizar fuente personalizada"
+
+# knutprefdlg.cpp:365
+#: knutprefdlg.cpp:863
+msgid "Main panel"
+msgstr "Panel principal"
+
+# knutprefdlg.cpp:366
+#: knutprefdlg.cpp:864
+msgid "Analog panels"
+msgstr "Panel analógico"
+
+# knutprefdlg.cpp:388
+#: knutprefdlg.cpp:887
+msgid "Analog"
+msgstr "Analógico"
+
+# knutprefdlg.cpp:388
+#: knutprefdlg.cpp:887
+msgid "Setting Analog panel"
+msgstr "Configuración del panel analógico"
+
+# knutprefdlg.cpp:398
+#: knutprefdlg.cpp:898
+msgid "Use custom other colors"
+msgstr "Usar otros colores personalizados"
+
+# knutprefdlg.cpp:400
+#: knutprefdlg.cpp:900
+msgid "Color of pointer :"
+msgstr "Color del puntero:"
+
+# knutprefdlg.cpp:402
+#: knutprefdlg.cpp:902
+msgid "Color of OK range :"
+msgstr "Color del limite OK:"
+
+# knutprefdlg.cpp:404
+#: knutprefdlg.cpp:904
+msgid "Color of warning range :"
+msgstr "Color del limite de aviso:"
+
+# knutprefdlg.cpp:406
+#: knutprefdlg.cpp:906
+msgid "Color of error range :"
+msgstr "Color del limite de error:"
+
+# knutprefdlg.cpp:408
+#: knutprefdlg.cpp:908
+msgid "Color of scale :"
+msgstr "Color de la escala:"
+
+# knutprefdlg.cpp:410
+#: knutprefdlg.cpp:910
+msgid "Color of font :"
+msgstr "Color de la fuente :"
+
+# knutprefdlg.cpp:400
+#: knutprefdlg.cpp:913
+msgid "Digital processing of pointers :"
+msgstr "Procesamiento digital de los punteros:"
+
+#: knutprefdlg.cpp:964
+msgid "Nothing processing"
+msgstr "Nada se esta procesando"
+
+#: knutprefdlg.cpp:965
+msgid "Fast antialiasing"
+msgstr "Antialiasing rápido"
+
+#: knutprefdlg.cpp:966
+msgid "Fine antialiasing"
+msgstr "Antialiasing bueno"
+
+#: knutprefdlg.cpp:967
+msgid "Fast antialiasing and blur motion"
+msgstr "Antialiasing rápido y blur motion"
+
+#: knutprefdlg.cpp:968
+msgid "Fine antialiasing and blur motion"
+msgstr "Antialiasing bueno y blur motion"
+
+# knutprintupsvar.cpp:41
+#: knutprintupsvar.cpp:41
+msgid "Variables"
+msgstr "Variables"
+
+# knutprintupsvar.cpp:48
+#: knutprintupsvar.cpp:50
+msgid "Reload Vars"
+msgstr "Recargar Variables"
+
+# knutprintupsvar.cpp:50
+#: knutprintupsvar.cpp:52
+msgid "UPS variables"
+msgstr "Variables del SAI"
+
+# knutprintupsvar.cpp:76
+#: knutprintupsvar.cpp:79
+msgid "Value"
+msgstr "Valor"
+
+# knutprintupsvar.cpp:78
+#: knutprintupsvar.cpp:81
+msgid "Description"
+msgstr "Descripción"
+
+# knutprintupsvar.cpp:97 knutprintupsvar.cpp:99 knutprintupsvar.cpp:102
+#: knutprintupsvar.cpp:90
+msgid "Instant Commands"
+msgstr "Comandos Instantáneos"
+
+# knutprintupsvar.cpp:118 knutprintupsvar.cpp:120 knutprintupsvar.cpp:123
+#: knutprintupsvar.cpp:103
+msgid "Read/Write Variables"
+msgstr "Variables de Lectura/Escritura"
+
+# knutprintupsvar.cpp:152 knutprintupsvar.cpp:154 knutprintupsvar.cpp:157
+#: knutprintupsvar.cpp:121
+msgid "Read Only Variables"
+msgstr "Variables de Solo Lectura"
+
+# knutrwvar.cpp:40
+#: knutrwvar.cpp:40
+msgid "RW variables"
+msgstr "Variables de Lect/Escr."
+
+# knutrwvar.cpp:56
+#: knutrwvar.cpp:56
+msgid "SET RW VARIABLE"
+msgstr "DEFINIR VARIABLE DE LECT/ESCR."
+
+# knutrwvar.cpp:61
+#: knutrwvar.cpp:61
+msgid "Variable:"
+msgstr "Variable:"
+
+# knutrwvar.cpp:64
+#: knutrwvar.cpp:64
+msgid "Value:"
+msgstr "Valor:"
+
+# knutvardata.cpp:41
+#: knutvardata.cpp:43
+msgid "None"
+msgstr "Nada"
+
+# knutvardata.cpp:42
+#: knutvardata.cpp:44
+msgid "Input Voltage"
+msgstr "Voltaje de Entrada"
+
+# knutvardata.cpp:44
+#: knutvardata.cpp:46
+msgid "UPS Temperature"
+msgstr "Temperatura del SAI"
+
+# knutvardata.cpp:45
+#: knutvardata.cpp:47
+msgid "Input Frequency"
+msgstr "Frecuencia de Entrada"
+
+# knutvardata.cpp:47
+#: knutvardata.cpp:49
+msgid "Outside Temperature"
+msgstr "Temperatura Exterior"
+
+# knutvardata.cpp:48
+#: knutvardata.cpp:50
+msgid "Outside Humidity"
+msgstr "Humedad Exterior"
+
+# knutvardata.cpp:49
+#: knutvardata.cpp:51
+msgid "Battery Voltage"
+msgstr "Voltaje de la Batería"
+
+# knutvardata.cpp:50
+#: knutvardata.cpp:52
+msgid "Output Voltage"
+msgstr "Voltaje de Salida"
+
+# knutvardata.cpp:51
+#: knutvardata.cpp:53
+msgid "Output Current"
+msgstr "Salida Actual"
+
+# knutvardata.cpp:45
+#: knutvardata.cpp:54
+msgid "Output Frequency"
+msgstr "Frecuencia de Salida"
+
+# knutvardata.cpp:52
+#: knutvardata.cpp:55
+msgid "Battery Temperature"
+msgstr "Temperatura de la Batería"
+
+# knutvardata.cpp:53
+#: knutvardata.cpp:56
+msgid "Battery Current"
+msgstr "Batería Actual"
+
+# knutvardata.cpp:170
+#: knutvardata.cpp:186
+msgid "No memory."
+msgstr "Sin memoria."
+
+# knutvardata.cpp:171
+#: knutvardata.cpp:187
+msgid "No address."
+msgstr "Sin dirección."
+
+# knutvardata.cpp:172
+#: knutvardata.cpp:188
+msgid "Unknown address."
+msgstr "Dirección desconocida."
+
+#: knutvardata.cpp:191
+msgid "Error of connection."
+msgstr "Error de conexión."
+
+# knutvardata.cpp:177
+#: knutvardata.cpp:194
+msgid "No connection with server."
+msgstr "Sin conectar al servidor."
+
+# knutvardata.cpp:179
+#: knutvardata.cpp:196
+msgid "Server-client protocol or variables of NUT are unknown."
+msgstr "Protocolo cliente-servidor o las variables del NUT son desconocidas."
+
+# knutvardata.cpp:180
+#: knutvardata.cpp:197
+msgid "No UPS on this address."
+msgstr "No hay SAI en esa dirección."
+
+# knutvardata.cpp:177
+#: knutvardata.cpp:198
+msgid "Connection was refused by server."
+msgstr "La conexión fue rechazada por el servidor."
+
+# knutvardata.cpp:181
+#: knutvardata.cpp:200
+msgid "Server doesn't receive data."
+msgstr "El Servidor no recibe datos."
+
+# knutvardata.cpp:182
+#: knutvardata.cpp:201
+msgid "Server doesn't send data."
+msgstr "El Servidor no envía datos."
+
+# knutvardata.cpp:183
+#: knutvardata.cpp:202
+msgid "Server doesn't answer."
+msgstr "El Servidor no responde."
+
+# knutvardata.cpp:185
+#: knutvardata.cpp:204
+msgid "Server returns data with unknown format."
+msgstr "El Servidor devuelve datos con un formato desconocido."
+
+# knutvardata.cpp:186
+#: knutvardata.cpp:205
+msgid "Server returns unknown data."
+msgstr "El Servidor devuelve datos desconocidos."
+
+# knutvardata.cpp:187
+#: knutvardata.cpp:206
+msgid "Command VER returns data with unknown format."
+msgstr "El comando VER devuelve datos con un formato desconocido."
+
+# knutvardata.cpp:190
+#: knutvardata.cpp:208
+msgid "No data."
+msgstr "Sin datos."
+
+# knutvardata.cpp:196
+#: knutvardata.cpp:212
+msgid "Access denied. Failed password ?"
+msgstr "Acceso denegado. Contraseña erronea ?"
+
+# knutvardata.cpp:197
+#: knutvardata.cpp:213
+msgid "UPS doesn't sent data to server (Data Stale)."
+msgstr "SAI no envía datos al servidor (Datos perdidos)."
+
+# knutvardata.cpp:198
+#: knutvardata.cpp:214
+msgid "Server doesn't know this command."
+msgstr "El servidor no conoce este comando."
+
+# knutvardata.cpp:201
+#: knutvardata.cpp:217
+msgid "UPS's driver isn't connected."
+msgstr "El driver del SAI no está conectado."
+
+# knutvardata.cpp:203
+#: knutvardata.cpp:219
+msgid "Server required password."
+msgstr "Servidor requiere contraseña."
+
+# knutvardata.cpp:204
+#: knutvardata.cpp:220
+msgid "Incorrect password."
+msgstr "Contraseña incorrecta."
+
+# knutvardata.cpp:205
+#: knutvardata.cpp:221
+msgid "UPS doesn't response."
+msgstr "SAI no responde."
+
+# knutvardata.cpp:206
+#: knutvardata.cpp:222
+msgid "Command failed."
+msgstr "Comando fallido."
+
+# knutvardata.cpp:207
+#: knutvardata.cpp:223
+msgid "UPS doesn't know this instant command."
+msgstr "SAI no conoce este comando instantáneo."
+
+# knutvardata.cpp:208
+#: knutvardata.cpp:224
+msgid "UPS doesn't support this instant command."
+msgstr "SAI no soporta este comando instantáneo."
+
+# knutvardata.cpp:209
+#: knutvardata.cpp:225
+msgid "UPS doesn't known this variable."
+msgstr "SAI no conoce esta variable."
+
+# knutvardata.cpp:210
+#: knutvardata.cpp:226
+msgid "UPS doesn't support this variable."
+msgstr "SAI no soporta esta variable."
+
+# knutvardata.cpp:211
+#: knutvardata.cpp:227
+msgid "UPS doesn't support this value in this variable."
+msgstr "SAI no soporta este valor en esta variable."
+
+# knutvardata.cpp:212
+#: knutvardata.cpp:228
+msgid "Name of UPS is unknown."
+msgstr "Nombre desconocido del SAI."
+
+#: knutvardata.cpp:230
+msgid "Username has been already entered."
+msgstr "El nombre de usuario ya ha sido introducido."
+
+#: knutvardata.cpp:231
+msgid "Password has been already entered."
+msgstr "La contraseña ya ha sido introducida."
+
+# knutvardata.cpp:182
+#: knutvardata.cpp:233
+msgid "Server doesn't send list of variables."
+msgstr "El Servidor no envía la lista de variables."
+
+# knutvardata.cpp:215
+#: knutvardata.cpp:236
+msgid "Unknown error."
+msgstr "Erro dessconocido."
+
+# main.cpp:31
+#: main.cpp:31
+msgid "Client for Network UPS Tool"
+msgstr "Cliente para Network UPS Tool"
+
+# main.cpp:37
+#: main.cpp:37
+msgid "Don't dock in Kicker"
+msgstr "Sin icono en Kicker"
+
+# main.cpp:47
+#: main.cpp:47
+msgid "KNutClient"
+msgstr "KNutClient"
+
+#. i18n: file ./knutclientui.rc line 13
+#: rc.cpp:9
+#, no-c-format
+msgid "&Connection"
+msgstr "&Conexión"
diff --git a/po/fr.po b/po/fr.po
new file mode 100644
index 0000000..4f1ca34
--- /dev/null
+++ b/po/fr.po
@@ -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"
diff --git a/po/it.po b/po/it.po
new file mode 100644
index 0000000..dbba5c4
--- /dev/null
+++ b/po/it.po
@@ -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"
diff --git a/po/knutclient.pot b/po/knutclient.pot
new file mode 100644
index 0000000..3c9886e
--- /dev/null
+++ b/po/knutclient.pot
@@ -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 ""
diff --git a/po/pl.po b/po/pl.po
new file mode 100644
index 0000000..23b88a1
--- /dev/null
+++ b/po/pl.po
@@ -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"
diff --git a/po/pt_BR.po b/po/pt_BR.po
new file mode 100644
index 0000000..4b06303
--- /dev/null
+++ b/po/pt_BR.po
@@ -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"
diff --git a/po/ru.po b/po/ru.po
new file mode 100644
index 0000000..111d20a
--- /dev/null
+++ b/po/ru.po
@@ -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 "Имя:"
diff --git a/po/uk.po b/po/uk.po
new file mode 100644
index 0000000..474c57d
--- /dev/null
+++ b/po/uk.po
@@ -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 "Ім'я:"
diff --git a/specs/Makefile.am b/specs/Makefile.am
new file mode 100644
index 0000000..ec594c1
--- /dev/null
+++ b/specs/Makefile.am
@@ -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
diff --git a/specs/knutclient.spec.fedora.10 b/specs/knutclient.spec.fedora.10
new file mode 100644
index 0000000..f5b8f47
--- /dev/null
+++ b/specs/knutclient.spec.fedora.10
@@ -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)
+
diff --git a/specs/knutclient.spec.fedora.5 b/specs/knutclient.spec.fedora.5
new file mode 100644
index 0000000..35a89e9
--- /dev/null
+++ b/specs/knutclient.spec.fedora.5
@@ -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)
+
diff --git a/specs/knutclient.spec.fedora.8 b/specs/knutclient.spec.fedora.8
new file mode 100644
index 0000000..9603e05
--- /dev/null
+++ b/specs/knutclient.spec.fedora.8
@@ -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)
+
diff --git a/specs/knutclient.spec.fedora.9 b/specs/knutclient.spec.fedora.9
new file mode 100644
index 0000000..9603e05
--- /dev/null
+++ b/specs/knutclient.spec.fedora.9
@@ -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)
+
diff --git a/specs/knutclient.spec.mandrake.10.1 b/specs/knutclient.spec.mandrake.10.1
new file mode 100644
index 0000000..804dd3d
--- /dev/null
+++ b/specs/knutclient.spec.mandrake.10.1
@@ -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
diff --git a/specs/knutclient.spec.mandriva.2006 b/specs/knutclient.spec.mandriva.2006
new file mode 100644
index 0000000..50a922b
--- /dev/null
+++ b/specs/knutclient.spec.mandriva.2006
@@ -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
diff --git a/specs/knutclient.spec.mandriva.2009 b/specs/knutclient.spec.mandriva.2009
new file mode 100755
index 0000000..ef26a1e
--- /dev/null
+++ b/specs/knutclient.spec.mandriva.2009
@@ -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
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..5c68efa
--- /dev/null
+++ b/src/Makefile.am
@@ -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
+
diff --git a/src/hi16-app-knutclient.png b/src/hi16-app-knutclient.png
new file mode 100644
index 0000000..2583d9a
--- /dev/null
+++ b/src/hi16-app-knutclient.png
Binary files differ
diff --git a/src/hi16-app-knutclientconn.png b/src/hi16-app-knutclientconn.png
new file mode 100755
index 0000000..e298e09
--- /dev/null
+++ b/src/hi16-app-knutclientconn.png
Binary files differ
diff --git a/src/hi16-app-knutclienterr.png b/src/hi16-app-knutclienterr.png
new file mode 100644
index 0000000..61c9b28
--- /dev/null
+++ b/src/hi16-app-knutclienterr.png
Binary files differ
diff --git a/src/hi32-app-knutclient.png b/src/hi32-app-knutclient.png
new file mode 100644
index 0000000..f5c9beb
--- /dev/null
+++ b/src/hi32-app-knutclient.png
Binary files differ
diff --git a/src/hi48-app-knutclient.png b/src/hi48-app-knutclient.png
new file mode 100644
index 0000000..b26d5c9
--- /dev/null
+++ b/src/hi48-app-knutclient.png
Binary files differ
diff --git a/src/knutanalog.cpp b/src/knutanalog.cpp
new file mode 100644
index 0000000..c240523
--- /dev/null
+++ b/src/knutanalog.cpp
@@ -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"
+
+
+
diff --git a/src/knutanalog.h b/src/knutanalog.h
new file mode 100644
index 0000000..b0b64f5
--- /dev/null
+++ b/src/knutanalog.h
@@ -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
diff --git a/src/knutclient.cpp b/src/knutclient.cpp
new file mode 100755
index 0000000..f7d7157
--- /dev/null
+++ b/src/knutclient.cpp
@@ -0,0 +1,1237 @@
+/***************************************************************************
+ knutclient.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 "knutupsdata.h"
+#include "knutvardata.h"
+#include "knutprefdlg.h"
+#include "knutprintupsvar.h"
+#include "knutinstcomms.h"
+#include "knutrwvar.h"
+#include "knutclient.h"
+
+#include <qdatetime.h>
+#include <qmutex.h>
+
+#include <kconfig.h>
+#include <ksimpleconfig.h>
+
+#include <kwin.h>
+
+#include <unistd.h> // for function sleep and other ...
+
+//#include <iostream>
+
+
+
+
+// const char *nameUpsVars1[] = {
+// "NONE", "UTILITY", "BATTPCT", "UPSTEMP", "ACFREQ", "LOADPCT", "AMBTEMP", "AMBHUMID","BATTVOLT","OUTVOLT",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"};
+
+ extern const char *nameUpsVars1[];
+ extern const char *nameUpsVars2[];
+
+KNutClient::KNutClient(bool noDock, QObject* parent, const char *name) : QObject(parent, name) {
+
+ upsRecords = new KNutUpsData();
+ analogRecords = new KNutVarData();
+
+ m_upsTimer = new QTimer (this);
+ connect( m_upsTimer, SIGNAL(timeout()), SLOT(slotTimeout()) );
+
+ m_reconnectTimer = new QTimer(this);
+ connect( m_reconnectTimer, SIGNAL(timeout()), SLOT(slotReconnectTimeout()) );
+
+
+ // data for combo
+ m_listKNutEvent = new QStringList();
+
+ // init and load of configuration
+ initVars();
+
+ loadConfiguration();
+
+ if (!noDock) {
+ m_myDock = new KNutDock(&m_mainUpsInfo,&settingData,upsRecords);
+
+ m_myDock->show();
+ connect(m_myDock, SIGNAL(endApplication()), this, SLOT(slotExitApplication()));
+ connect(m_myDock, SIGNAL(activeMainWindow()), this, SLOT(slotActiveMainWindow()));
+ connect(m_myDock, SIGNAL(minimize()), this, SLOT(closeMainWindow()));
+ connect(m_myDock, SIGNAL(UPSChanged(QString)), this, SLOT(slotSetNewUPS (QString)));
+
+ connect(m_myDock, SIGNAL(preferences()),this, SLOT(slotPreferenceUps()));
+ connect(m_myDock, SIGNAL(printUPSVars()),this, SLOT(slotPrintUPSVars()));
+ connect(m_myDock, SIGNAL(instComms()),this, SLOT(slotInstComms()));
+ connect(m_myDock, SIGNAL(RWVars()),this, SLOT(slotRWVars()));
+ connect(m_myDock, SIGNAL(makeRefreshConnection()),this, SLOT(slotRefreshConnection()));
+ }
+
+ addEventString(i18n("Ready."));
+
+
+ // nastavime data pro vybranou polozku
+ // sets data for selected item
+ setActiveUpsInfo(m_mainUpsInfo.record.name);
+
+ // sets mainUpsInfo.oldState to const value KNutNet::initStatus
+ m_mainUpsInfo.oldState=KNutNet::initState;
+
+
+ //makes connect to UPS, connection is non blocking operation
+ //we have to use signal firstConnection and connectionError from KNutNet class
+ m_mainUpsInfo.upsNet = new KNutNet( m_mainUpsInfo.record.upsAddress, m_mainUpsInfo.record.upsName, m_mainUpsInfo.record.port,5,200);
+
+
+ connect(m_mainUpsInfo.upsNet, SIGNAL(firstConnection(void)),this, SLOT(slotFirstConnection(void)));
+ connect(m_mainUpsInfo.upsNet, SIGNAL(connectionError(int)),this, SLOT(slotErrorConnection(int)));
+ connect(m_mainUpsInfo.upsNet, SIGNAL(connectionClosed(void )),this, SLOT(slotConnectionClosed(void)));
+ connect(m_mainUpsInfo.upsNet, SIGNAL(tryFirstConnection(int )),this, SLOT(slotTryFirstConnection(int)));
+ connect(m_mainUpsInfo.upsNet, SIGNAL(tryRepeatFirstConnection(int )),this, SLOT(slotTryReepatFirstConnection( int )));
+
+
+// state of connection to usbd, this isn't state of knutnet
+// if (mainUpsInfo.record.upsName !="") {
+// mainUpsInfo.upsDriverState=knc::connecting;
+ // }
+ // else mainUpsInfo.upsDriverState=knc::notConnected;
+
+ // repaints the dock
+ if (m_myDock) m_myDock->clearDockValues();
+
+ if (settingData.useMainWindow == KNutVarData::mw_yes || noDock ||
+ (settingData.useMainWindow == KNutVarData::mw_auto && settingData.activatedMainWindow )) makeMainWindow ();
+
+ if (m_myDock) m_myMessMan = new KNutMessageManager(this);
+
+ //tries connecting to server
+ m_mainUpsInfo.upsDriverState=knc::connecting;
+ m_mainUpsInfo.upsNet->open();
+ }
+
+
+KNutClient::~KNutClient(void) {
+
+ if (m_myMessMan) delete m_myMessMan;
+
+ // melo by uz byt zruseno - jistota
+ if (m_myDock) { m_myDock->close(); m_myDock=0l;}
+
+ if (m_mainUpsInfo.upsNet) {
+ // melo by uz byt zruseno - jistota
+ delete m_mainUpsInfo.upsNet;
+ m_mainUpsInfo.upsNet = 0;
+ }
+ m_listKNutEvent->clear();
+ delete m_listKNutEvent;
+
+ // melo by uz byt zruseno - jistota
+ if (mainWindow) delete mainWindow;
+
+ delete upsRecords;
+ delete analogRecords;
+ }
+
+
+
+void KNutClient::slotTryFirstConnection (int maxCount) {
+//qDebug ("KNutClient::slotTryFirstConnection");
+
+//knutNet begin the first test of connection (connectToHost will be made after emiting signal tryFirstConnection )
+// repaints icon
+ if (m_myDock) m_myDock->repaintDock(true);
+ if (mainWindow) mainWindow->startConnectPB(maxCount);
+ }
+
+
+void KNutClient::slotTryReepatFirstConnection (int number ) {
+//qDebug ("KNutClient::slotTryFirstConnection");
+//knutNet begin nexts test of connection
+
+ if (mainWindow) mainWindow->setProgressConnectPB (number);
+ }
+
+
+
+void KNutClient::slotFirstConnection (void) {
+//qDebug ("sKNutClient::slotFirstConnection");
+//TCP - UDP connection to server was made
+
+ bool reconnecting = m_mainUpsInfo.reconnecting;
+
+
+ m_mainUpsInfo.reconnecting =false;
+ m_reconnectTimer->stop();
+
+ m_mainUpsInfo.nutVariables = m_mainUpsInfo.upsNet->getNutVariables();
+ m_mainUpsInfo.nutProtocol = m_mainUpsInfo.upsNet->getNutProtocol();
+
+ if (mainWindow) mainWindow->hideConnectPB();
+
+
+ // reads UPS's variables
+
+ int countRevision = 2; // pocet max opakovani po kterych muzeme zjistovat hodnoty
+ do {
+ if (!(m_mainUpsInfo.netError = m_mainUpsInfo.upsNet->getUpsVars())) break;
+ if (!(m_mainUpsInfo.netError)) break; // no error
+ if (m_mainUpsInfo.netError == KNutNet::UnknownUps) break;
+ if (m_mainUpsInfo.netError == KNutNet::DriverNotConnected) break;
+ countRevision--;
+ if (countRevision) sleep (2);
+ }
+ while (countRevision);
+
+ if (m_mainUpsInfo.netError) {
+ m_mainUpsInfo.errorUpsData=true;
+ // mainUpsInfo.upsDriverState is state of connection to usbd, this isn't state of knutnet
+ if (m_mainUpsInfo.netError == KNutNet::DriverNotConnected)
+ m_mainUpsInfo.upsDriverState=knc::notConnected;
+ else
+ m_mainUpsInfo.upsDriverState=knc::error;
+
+ if (m_myDock) m_myDock->repaintDock(true);
+ addEventString (KNutVarData::errorToText(m_mainUpsInfo.netError),m_mainUpsInfo.record.name);
+// KNutVarData::showError (mainUpsInfo.netError);
+ if ((m_myMessMan)) m_myMessMan->addMessage(KNutVarData::errorToText(m_mainUpsInfo.netError),knc::errorLevel,true);
+ }
+ else {
+
+ if (reconnecting) {
+ addEventString(i18n("The connection was renewed."),m_mainUpsInfo.record.name);
+ if ((m_myMessMan) and (settingData.useMessageWindow)) m_myMessMan->addMessage(i18n("The connection was renewed."),knc::errorLevel,true,true);
+ }
+
+
+ m_mainUpsInfo.upsDriverState=knc::connected;
+ m_mainUpsInfo.errorUpsData=false;
+
+ switch (m_mainUpsInfo.nutVariables) { // type of variables, old or new (with dot)
+ case 1:
+//qDebug ("sKNutClient::slotFirstConnection - var 1");
+ if (!(m_mainUpsInfo.upsNet->existName("BATT_RUNTIME"))) m_mainUpsInfo.runtimeVar="BATT_RUNTIME";
+ else m_mainUpsInfo.runtimeVar="RUNTIME";
+ m_mainUpsInfo.upsLoadVar="LOADPCT";
+ m_mainUpsInfo.lowxferVar="LOWXFER";
+ m_mainUpsInfo.highxferVar="HIGHXFER";
+ m_mainUpsInfo.statusVar="STATUS";
+ break;
+ case 2:
+//qDebug ("sKNutClient::slotFirstConnection - var 2");
+ m_mainUpsInfo.runtimeVar="battery.runtime";
+ m_mainUpsInfo.upsLoadVar="ups.load";
+ m_mainUpsInfo.lowxferVar="input.transfer.low";
+ m_mainUpsInfo.highxferVar="input.transfer.high";
+ m_mainUpsInfo.statusVar="ups.status";
+ }
+
+
+ if ((settingData.useDescription) && (!m_mainUpsInfo.upsNet->isDescription())) m_mainUpsInfo.upsNet->getDescription();
+ // test presunut do setActiveUpsVars
+ if (mainWindow) setActiveUpsVars(true);
+ else setActiveUpsVars(false);
+
+ // repaints main window and dock immediately
+ if (mainWindow) mainWindow->showUpsData();
+// if (myDock) myDock->repaintDock(mainUpsInfo.netError,true); // dock is repainting always
+ if (m_myDock) m_myDock->repaintDock(true); // dock is repainting always
+
+ m_panelsAreZeroing=false; // analog panels isn't setting to zero
+ }
+ if ((m_mainUpsInfo.upsNet->getState() == KNutNet::Connected) && (!m_mainUpsInfo.errorUpsData)) {
+ showStatusEvent();
+ // getUpsVars loads informations about variables, but their values too
+ m_upsTimer->start( m_mainUpsInfo.record.delay, TRUE ); // nastartujeme casovac - starts timer
+ }
+ }
+
+
+void KNutClient::slotErrorConnection (int error) {
+
+//qDebug ("KNutClient::slotErrorConnection (1)");
+
+ if (mainWindow) mainWindow->hideConnectPB();
+
+ m_mainUpsInfo.netError = error;
+ m_mainUpsInfo.errorUpsData=true;
+ if (m_mainUpsInfo.netError == KNutNet::DriverNotConnected)
+ m_mainUpsInfo.upsDriverState=knc::notConnected;
+ else
+ m_mainUpsInfo.upsDriverState=knc::error;
+ if (m_myDock) m_myDock->repaintDock(true);
+
+ if (m_mainUpsInfo.reconnecting) {
+//qDebug ("KNutClient::slotErrorConnection (2)");
+ m_mainUpsInfo.reconnectCount++;
+ if (m_mainUpsInfo.reconnectCount > countNextConnDelay) m_mainUpsInfo.reconnectCount = countNextConnDelay;
+
+ addEventString(i18n("The connection failed. The next connection will make after %1 sec.").arg(nextConnDelay[m_mainUpsInfo.reconnectCount-1]),m_mainUpsInfo.record.name);
+ m_reconnectTimer->start( nextConnDelay[m_mainUpsInfo.reconnectCount-1]*1000, TRUE ); // starts reconnect timer again
+ }
+ else {
+//qDebug ("KNutClient::slotErrorConnection (3)");
+ addEventString (KNutVarData::errorToText(m_mainUpsInfo.netError),m_mainUpsInfo.record.name);
+// KNutVarData::showError (mainUpsInfo.netError);
+ if ((m_myMessMan)) m_myMessMan->addMessage(KNutVarData::errorToText(m_mainUpsInfo.netError),knc::errorLevel,true);
+
+
+ }
+ }
+
+
+
+void KNutClient::initVars (void) {
+// Nasledujici data jsou nastavena pri natazeni konfigurace
+//Next data is setted when konfiguration is loaded
+ settingData.panelFlags = KNutFrontPanel::DefaultPanelFlags; // informace v hlavnim panelu // information in main panel
+ settingData.toolTipFlags = KNutDock::DefaultToolTipFlags; // informace v hlavnim panelu // information in main panel
+
+ m_mainUpsInfo.record.name="";
+ m_mainUpsInfo.upsNet=0L;
+ m_mainUpsInfo.netError=0; // no error zadna chyba
+ m_mainUpsInfo.name="";
+ m_mainUpsInfo.password="";
+ m_mainUpsInfo.errorUpsData=false;
+ m_mainUpsInfo.nutVariables=0;
+ m_mainUpsInfo.runtimeVar="";
+ m_mainUpsInfo.lowxferVar="";
+ m_mainUpsInfo.highxferVar="";
+ m_mainUpsInfo.statusVar="";
+ m_mainUpsInfo.upsLoadVar="";
+ m_mainUpsInfo.upsDriverState=knc::notConnected;
+ m_mainUpsInfo.reconnectCount = 1;
+ m_mainUpsInfo.reconnecting = false;
+
+ m_panelsAreZeroing=false;
+ m_lastError=0; // no error
+
+
+ mainWindow=0;
+ m_myDock=0;
+ m_myMessMan=0;
+ settingData.activatedMainWindow=false;
+ }
+
+
+ void KNutClient::loadConfiguration ( void ) {
+
+ QString groupName;
+ KNutUpsData::upsRecordDef upsData; // structure includes informations about UPS // struktura obsahuje udaje o UPS
+ QFont appFont = kapp->font(); // systemovy font pri startu
+ kapp->config()->setGroup ("");
+ settingData.areYouSure=kapp->config()->readBoolEntry("AreYouSure",FALSE);
+
+ int helpInt=kapp->config()->readNumEntry("UseMainWindow",TRUE);
+
+//std::cout << "readNumEntry " << helpInt << "--" << std::endl;
+ switch (helpInt) {
+ case 0 : settingData.useMainWindow=KNutVarData::mw_yes;break;
+ case 1 : settingData.useMainWindow=KNutVarData::mw_no;break;
+ default : settingData.useMainWindow=KNutVarData::mw_auto;break;
+ }
+
+
+ settingData.useMessageWindow=kapp->config()->readBoolEntry("UseMessageWindow",FALSE);
+ settingData.activatedMainWindow=kapp->config()->readBoolEntry("PreviousMainWindow",FALSE);
+ settingData.x=kapp->config()->readNumEntry("PosX",0);
+ settingData.y=kapp->config()->readNumEntry("PosY",0);
+ settingData.width=kapp->config()->readNumEntry("Width",300);
+ settingData.height=kapp->config()->readNumEntry("Height",200);
+ settingData.useDescription=kapp->config()->readBoolEntry("UseDescription",FALSE);
+ settingData.countCols=kapp->config()->readNumEntry("NumberOfCols",knc::DefaultCountCols);
+ settingData.panelFlags=kapp->config()->readUnsignedNumEntry("PanelFlags",KNutFrontPanel::DefaultPanelFlags);
+ settingData.inputFrequency=kapp->config()->readNumEntry("InputFrequency",knc::DefaultInputFrequency);
+ settingData.inputVoltage=kapp->config()->readNumEntry("InputVoltage",knc::DefaultInputVoltage);
+ settingData.lowHighXfer=kapp->config()->readBoolEntry("LowHighXfer",FALSE);
+ settingData.customFont=kapp->config()->readBoolEntry("CustomFont",FALSE);
+ settingData.aPanelFont=kapp->config()->readFontEntry("AnalogPanelFont",&appFont);
+ settingData.mPanelFont=kapp->config()->readFontEntry("MainPanelFont",&appFont);
+ int upsCount=kapp->config()->readNumEntry("NumberOfUpsRecords",0);
+ settingData.customBColor=kapp->config()->readBoolEntry("CustomBColor",FALSE);
+ settingData.mainBackgroundColor=kapp->config()->readColorEntry ("MainBackGroundColor",& DEFAULT_BG_COLOR);
+ settingData.customBPanelColor=kapp->config()->readBoolEntry("CustomBPanelColor",FALSE);
+ settingData.customBAnalogColor=kapp->config()->readBoolEntry("CustomBAnalogColor",FALSE);
+ settingData.customOAnalogColor=kapp->config()->readBoolEntry("CustomOAnalogColor",FALSE);
+ settingData.mPanelBackgroundColor=kapp->config()->readColorEntry ("MPanelBackGroundColor",& DEFAULT_BG_COLOR);
+ settingData.aPanelBackgroundColor=kapp->config()->readColorEntry ("APanelBackGroundColor",& DEFAULT_BG_COLOR);
+ settingData.analogFingerColor=kapp->config()->readColorEntry ("AnalogFingerColor",& DEFAULT_FINGER_COLOR);
+ settingData.analogOKColor=kapp->config()->readColorEntry ("AnalogOKColor",& DEFAULT_OK_COLOR);
+ settingData.analogWarnningColor=kapp->config()->readColorEntry ("AnalogWarnningColor",& DEFAULT_WARNNING_COLOR);
+ settingData.analogErrorColor=kapp->config()->readColorEntry ("AnalogErrorColor",& DEFAULT_ERROR_COLOR);
+ settingData.analogScaleColor=kapp->config()->readColorEntry ("AnalogScaleColor",& DEFAULT_SCALE_COLOR);
+ settingData.analogFontColor=kapp->config()->readColorEntry ("AnalogFontColor",& DEFAULT_FONT_COLOR);
+ settingData.toolTipFlags=kapp->config()->readUnsignedNumEntry("ToolTipFlags",KNutDock::DefaultToolTipFlags);
+ settingData.customKIconColor=kapp->config()->readBoolEntry("CustomKIconColor",FALSE);
+ settingData.kIconBackgroundColor=kapp->config()->readColorEntry ("KIconBackGroundColor",& DEFAULT_KICON_COLOR);
+ settingData.typeOfKIcon=kapp->config()->readBoolEntry("TypeOfKIcon", KNutDock::pictureKI);
+ settingData.typeDigitalProcessing=kapp->config()->readNumEntry("DigitalProcessingOfPointers", 2);
+
+
+ m_mainUpsInfo.record.name=kapp->config()->readEntry("ActiveUps","");
+
+
+ for (int i = 0; i < upsCount; i++) {
+ groupName.sprintf ("UPS %d",i);
+ kapp->config()->setGroup (groupName);
+ if ((upsData.name = kapp->config()->readEntry ("Name")) != QChar::null) {
+ // record exist, we will go next part
+ //if ActiveUps is empty, we use name of first ups from ups list
+ if ((m_mainUpsInfo.record.name.isEmpty()) && (!(upsData.name.isEmpty())))
+ m_mainUpsInfo.record.name = upsData.name;
+ upsData.upsName = kapp->config()->readEntry ("UpsName","");
+ if (((upsData.upsAddress = kapp->config()->readEntry ("UpsAddress")) != QChar::null)
+ || (( upsData.upsAddress == QChar::null) && (upsData.upsName != QChar::null ))) {
+
+ // only for backwards compatibility with older release then 0.7
+ if (upsData.upsAddress.isEmpty()) {
+ int charPos;
+ if ((charPos=upsData.upsName.find('@')) == -1) {
+ upsData.upsAddress=upsData.upsName;
+ upsData.upsName="";
+ }
+ else {
+ upsData.upsAddress=upsData.upsName.mid(charPos+1);
+ upsData.upsName=upsData.upsName.left(charPos);
+ }
+ }
+ // zaznam existuje pokracujeme dale a nacteme zbytek hodnotet
+ // record exists, we go next and will read rest of values
+ upsData.delay = kapp->config()->readNumEntry("Delay",knc::DefaultDelay);
+ upsData.port = (unsigned short)kapp->config()->readNumEntry("Port",knc::DefaultPort);
+ upsData.userName=kapp->config()->readEntry("UserName","");
+ upsData.password=kapp->config()->readEntry("Password","");
+ upsData.savePassword=kapp->config()->readBoolEntry("SavePassword",false);
+ for (int j=0; j < knc::NumberOfVars; j++) {
+ groupName.sprintf ("Var %d",j);
+ upsData.upsVarCode[j]=kapp->config()->readNumEntry (groupName,0);
+ if ((upsData.upsVarCode[j] < 0) || (upsData.upsVarCode[j] > knc::NumberOfTypes))
+ upsData.upsVarCode[j] = 0;
+ }
+ upsRecords->add (upsData);
+ }
+ }
+ }
+ }
+
+void KNutClient::saveConfiguration ( bool all ) {
+ QString groupName;
+ QString codeName;
+ KNutUpsData::upsRecordDef upsData; // struktura obsahuje udaje o UPS // structure includes information about UPS
+ int upsCount = upsRecords->getCount();
+
+ kapp->config()->setGroup ("");
+
+ if (all) {
+ kapp->config()->writeEntry ("DigitalProcessingOfPointers",settingData.typeDigitalProcessing);
+ kapp->config()->writeEntry ("TypeOfKIcon",settingData.typeOfKIcon);
+ kapp->config()->writeEntry ("KIconBackGroundColor",settingData.kIconBackgroundColor);
+ kapp->config()->writeEntry ("CustomKIconColor",(settingData.customKIconColor));
+ kapp->config()->writeEntry ("ToolTipFlags",(settingData.toolTipFlags));
+ }
+
+ //if name of active ups isn't knowly, will use name of the firt ups from ups list
+ if ((m_mainUpsInfo.record.name.isEmpty()) && (upsCount > 0)) {
+ upsRecords->get(0,upsData);
+ kapp->config()->writeEntry ("ActiveUps",upsData.name);
+ }
+ else kapp->config()->writeEntry ("ActiveUps",(QString)m_mainUpsInfo.record.name); //
+
+ if (all) {
+ kapp->config()->writeEntry ("AnalogFontColor",settingData.analogFontColor);
+ kapp->config()->writeEntry ("AnalogScaleColor",settingData.analogScaleColor);
+ kapp->config()->writeEntry ("AnalogErrorColor",settingData.analogErrorColor);
+ kapp->config()->writeEntry ("AnalogWarnningColor",settingData.analogWarnningColor);
+ kapp->config()->writeEntry ("AnalogOKColor",settingData.analogOKColor);
+ kapp->config()->writeEntry ("AnalogFingerColor",settingData.analogFingerColor);
+ kapp->config()->writeEntry ("APanelBackGroundColor",settingData.aPanelBackgroundColor);
+ kapp->config()->writeEntry ("MPanelBackGroundColor",settingData.mPanelBackgroundColor);
+ kapp->config()->writeEntry ("MainBackGroundColor",settingData.mainBackgroundColor);
+ kapp->config()->writeEntry ("NumberOfUpsRecords",upsCount);
+ kapp->config()->writeEntry ("CustomFont",settingData.customFont);
+ kapp->config()->writeEntry ("AnalogPanelFont",settingData.aPanelFont);
+ kapp->config()->writeEntry ("MainPanelFont",settingData.mPanelFont);
+ kapp->config()->writeEntry ("CustomBColor",(settingData.customBColor));
+ kapp->config()->writeEntry ("CustomBPanelColor",(settingData.customBPanelColor));
+ kapp->config()->writeEntry ("CustomBAnalogColor",(settingData.customBAnalogColor));
+ kapp->config()->writeEntry ("CustomOAnalogColor",(settingData.customOAnalogColor));
+ kapp->config()->writeEntry ("LowHighXfer",(settingData.lowHighXfer));
+ kapp->config()->writeEntry ("InputVoltage",(settingData.inputVoltage));
+ kapp->config()->writeEntry ("InputFrequency",(settingData.inputFrequency));
+ kapp->config()->writeEntry ("PanelFlags",(settingData.panelFlags | 3));
+ kapp->config()->writeEntry ("NumberOfCols",settingData.countCols);
+ kapp->config()->writeEntry ("UseDescription",settingData.useDescription);
+ kapp->config()->writeEntry ("AreYouSure",settingData.areYouSure);
+ kapp->config()->writeEntry ("UseMainWindow",settingData.useMainWindow);
+ kapp->config()->writeEntry ("UseMessageWindow",settingData.useMessageWindow);
+ }
+
+ kapp->config()->writeEntry ("Height",settingData.height); //
+ kapp->config()->writeEntry ("Width",settingData.width); //
+ kapp->config()->writeEntry ("PosY",settingData.y); //
+ kapp->config()->writeEntry ("PosX",settingData.x); //
+ kapp->config()->writeEntry ("PreviousMainWindow",settingData.activatedMainWindow);
+
+ if (all) {
+ for (int i=0; i<upsCount; i++) {
+ groupName.sprintf ("UPS %d",i);
+ kapp->config()->setGroup (groupName);
+ upsRecords->get(i,upsData);
+ kapp->config()->writeEntry ("Port",upsData.port);
+ kapp->config()->writeEntry ("Delay",upsData.delay);
+ kapp->config()->writeEntry ("UpsAddress",upsData.upsAddress);
+ kapp->config()->writeEntry ("UpsName",upsData.upsName);
+ kapp->config()->writeEntry ("Name",upsData.name);
+ if (upsData.savePassword) {
+ kapp->config()->writeEntry ("UserName",upsData.userName);
+ kapp->config()->writeEntry ("Password",upsData.password);
+ }
+ kapp->config()->writeEntry ("SavePassword",upsData.savePassword);
+ for (int j=0; j < knc::NumberOfVars; j++) {
+ groupName.sprintf ("Var %d",j);
+ kapp->config()->writeEntry (groupName,upsData.upsVarCode[j]);
+ }
+ kapp->config()->setGroup ("");
+ }
+ }
+ kapp->config()->sync();
+ }
+
+
+bool KNutClient::commitData (QSessionManager&) {
+
+ saveConfiguration(false);
+ return true;
+ }
+
+ bool KNutClient::saveState (QSessionManager&) {
+
+ saveConfiguration(false);
+ return true;
+ }
+
+
+
+void KNutClient::upsActivate (void) {
+
+//qDebug ("KNutClient::upsActivate");
+
+ m_mainUpsInfo.upsNet = new KNutNet( m_mainUpsInfo.record.upsAddress,m_mainUpsInfo.record.upsName,m_mainUpsInfo.record.port,0,1);
+ if (m_mainUpsInfo.upsNet->getState() != KNutNet::Connected) {
+ m_mainUpsInfo.netError=m_mainUpsInfo.upsNet->getError(); // aktivace ups skoncila s chybou
+// KNutVarData::showError(mainUpsInfo.netError);
+
+ if ((m_myMessMan)) m_myMessMan->addMessage(KNutVarData::errorToText(m_mainUpsInfo.netError),knc::errorLevel,true);
+
+
+ m_mainUpsInfo.errorUpsData=true;
+ m_mainUpsInfo.upsDriverState=knc::notConnected;
+ }
+ else {
+ if (m_mainUpsInfo.upsNet->switchedToTCP())
+ addEventString (i18n("upsd > 1.2 doesn't support UDP. Connection is switched to TCP"),m_mainUpsInfo.record.name);
+ m_mainUpsInfo.nutVariables = m_mainUpsInfo.upsNet->getNutVariables();
+ m_mainUpsInfo.nutProtocol = m_mainUpsInfo.upsNet->getNutProtocol();
+
+ int countRevision = 2; // pocet max opakovani po kterych muzeme zjistovat hodnoty
+ do {
+ if (!(m_mainUpsInfo.netError = m_mainUpsInfo.upsNet->getUpsVars())) break;
+ if (m_mainUpsInfo.netError == KNutNet::UnknownUps) break;
+ if (m_mainUpsInfo.netError == KNutNet::DriverNotConnected) break;
+ countRevision--;
+ if (countRevision) sleep (2);
+ }
+ while (countRevision);
+
+ if (m_mainUpsInfo.netError) {
+ addEventString (KNutVarData::errorToText(m_mainUpsInfo.netError),m_mainUpsInfo.record.name);
+// KNutVarData::showError (mainUpsInfo.netError);
+
+ if ((m_myMessMan)) m_myMessMan->addMessage(KNutVarData::errorToText(m_mainUpsInfo.netError),knc::errorLevel,true);
+
+ m_mainUpsInfo.errorUpsData=true;
+ if (m_mainUpsInfo.netError == KNutNet::DriverNotConnected)
+ m_mainUpsInfo.upsDriverState=knc::notConnected;
+ else
+ m_mainUpsInfo.upsDriverState=knc::error;
+ }
+ else {
+ m_mainUpsInfo.upsDriverState=knc::connected;
+
+ switch (m_mainUpsInfo.nutVariables) {
+ case 1:
+ if (!(m_mainUpsInfo.upsNet->existName("BATT_RUNTIME"))) m_mainUpsInfo.runtimeVar="BATT_RUNTIME";
+ else m_mainUpsInfo.runtimeVar="RUNTIME";
+ m_mainUpsInfo.upsLoadVar="LOADPCT";
+ m_mainUpsInfo.lowxferVar="LOWXFER";
+ m_mainUpsInfo.highxferVar="HIGHXFER";
+ m_mainUpsInfo.statusVar="STATUS";
+ break;
+ case 2:
+ m_mainUpsInfo.runtimeVar="battery.runtime";
+ m_mainUpsInfo.upsLoadVar="ups.load";
+ m_mainUpsInfo.lowxferVar="input.transfer.low";
+ m_mainUpsInfo.highxferVar="input.transfer.high";
+ m_mainUpsInfo.statusVar="ups.status";
+ }
+
+ if ((settingData.useDescription) && (!m_mainUpsInfo.upsNet->isDescription())) m_mainUpsInfo.upsNet->getDescription();
+ // test presunut do setActiveUpsVars
+ if (mainWindow) setActiveUpsVars(true);
+ else setActiveUpsVars(false);
+ }
+ }
+ }
+
+void KNutClient::upsDeactivate (void) {
+
+ // this function isn't interuptable function
+// upsDeactivateMutex.lock();
+ QMutexLocker upsDeactivateLocker( &m_upsDeactivateMutex );
+ m_mainUpsInfo.upsNet->close(); // close connection
+ // state of connection to usbd, this isn't state of knutnet
+ m_mainUpsInfo.upsDriverState=knc::notConnected;
+ m_mainUpsInfo.netError=0; // no error
+ m_mainUpsInfo.nutVariables=0;
+// upsDeactivateMutex.unlock();
+ }
+
+void KNutClient::setActiveUpsVars (bool mWindow) {
+ // nastavujeme jen pokud existuji nejake promene
+ if ( m_mainUpsInfo.upsNet->readNumberVars() > 0) {
+ // deaktivujeme veskere promene
+ m_mainUpsInfo.upsNet->unSetActivateAll();
+
+ if (mWindow) {
+ for (int j=0; j < knc::NumberOfVars; j++) {
+ switch (m_mainUpsInfo.nutVariables) {
+ case 1:
+ if (m_mainUpsInfo.record.upsVarCode[j] != 0 ) m_mainUpsInfo.upsNet->setActivate(nameUpsVars1[m_mainUpsInfo.record.upsVarCode[j]]);
+ break;
+ case 2:
+ if (m_mainUpsInfo.record.upsVarCode[j] != 0 ) m_mainUpsInfo.upsNet->setActivate(nameUpsVars2[m_mainUpsInfo.record.upsVarCode[j]]);
+ break;
+ }
+ }
+ }
+ m_mainUpsInfo.upsNet->setActivate(m_mainUpsInfo.runtimeVar); //runtime je vzdy pridano v merenym polozkam
+ if (m_myDock) m_mainUpsInfo.upsNet->setActivate(m_mainUpsInfo.upsLoadVar);
+ // status se nastavi vzdy
+ m_mainUpsInfo.upsNet->setActivate(m_mainUpsInfo.statusVar);
+ // xfer se nastavi vzdy pokud existuje
+ // podrebujeme ho znat jeste pred startem a pak behen behu programu
+ setActiveXFerVars(true);
+ }
+ }
+
+
+void KNutClient::setActiveXFerVars (bool activate) {
+ if (activate) {
+ // podkud neexistuje jedna z promenych neaktivujeme ani jednu
+ if (!(m_mainUpsInfo.upsNet->setActivate(m_mainUpsInfo.lowxferVar)))
+ if (m_mainUpsInfo.upsNet->setActivate(m_mainUpsInfo.highxferVar))
+ m_mainUpsInfo.upsNet->unSetActivate(m_mainUpsInfo.lowxferVar);
+ }
+ else {
+ m_mainUpsInfo.upsNet->unSetActivate(m_mainUpsInfo.lowxferVar);
+ m_mainUpsInfo.upsNet->unSetActivate(m_mainUpsInfo.highxferVar);
+ }
+ }
+
+void KNutClient::setActiveUpsInfo (QString name) {
+ //presuneme jmena z databaze ups-ek - je nahrana z config. souboru
+ KNutUpsData::upsRecordDef* upsRecordPointer;
+
+ if ((!name.isNull()) && (!name.isEmpty()) && ((upsRecordPointer = upsRecords->findName(name)) != 0L)) {
+
+ m_mainUpsInfo.record.upsName = upsRecordPointer->upsName;
+ m_mainUpsInfo.record.upsAddress = upsRecordPointer->upsAddress;
+ m_mainUpsInfo.record.delay = upsRecordPointer->delay;
+ m_mainUpsInfo.record.port = upsRecordPointer->port;
+// mainUpsInfo.record.tcp = upsRecordPointer->tcp;
+ m_mainUpsInfo.record.userName = upsRecordPointer->userName;
+ m_mainUpsInfo.record.password = upsRecordPointer->password;
+ for (int i =0; i < knc::NumberOfVars; i++) m_mainUpsInfo.record.upsVarCode[i] = 0; // vynulujeme polozky
+ int ii = 0;
+ for (int i =0; i < knc::NumberOfVars; i++)
+ if (upsRecordPointer->upsVarCode[i]>0) m_mainUpsInfo.record.upsVarCode[ii++] = upsRecordPointer->upsVarCode[i];
+ }
+ }
+
+
+void KNutClient::getUpsData (void) {
+ int runNetError;
+
+//qDebug("KNutClient::getUpsData");
+
+ //loads values for selected variables <getUpsValues(false)> / activate values
+ if (!(runNetError=m_mainUpsInfo.upsNet->getUpsValues(false))) { // data from upsNet is ok
+ // we read all values of UPS
+ // nacetli jsme vsechny hodnoty pro ups
+ m_mainUpsInfo.netError=runNetError;
+ if (m_mainUpsInfo.errorUpsData) { // changes status from error to ok
+ m_mainUpsInfo.errorUpsData=false;
+ addEventString (i18n("Data OK"),m_mainUpsInfo.record.name);
+ if ((m_myMessMan) and (settingData.useMessageWindow)) m_myMessMan->addMessage(i18n("Data OK"),knc::errorLevel,true,true);
+ }
+ }
+ else { // data from upsNet isn't ok
+ m_mainUpsInfo.netError=runNetError;
+ if (!m_mainUpsInfo.errorUpsData) { //change status from ok to error
+ addEventString (KNutVarData::errorToText(runNetError), m_mainUpsInfo.record.name);
+ if ((m_myMessMan) and (settingData.useMessageWindow)) m_myMessMan->addMessage(KNutVarData::errorToText(runNetError),knc::errorLevel);
+ m_lastError=runNetError;
+ m_mainUpsInfo.errorUpsData=true;
+ }
+ else {
+ if (m_lastError != runNetError) { // change status from error to other error
+ addEventString (KNutVarData::errorToText(runNetError),m_mainUpsInfo.record.name);
+ if ((m_myMessMan) and (settingData.useMessageWindow)) m_myMessMan->addMessage(KNutVarData::errorToText(runNetError),knc::errorLevel);
+ m_lastError=runNetError;
+ }
+ }
+ }
+ }
+
+
+void KNutClient::addEventString (const QString text, const QString UPSAddress) {
+
+ if (mainWindow)
+ mainWindow->addComboStatusItem (text,UPSAddress);
+ else
+ {
+ QString dateTime(QDate::currentDate().toString());
+ dateTime +=" " + QTime::currentTime().toString();
+ if (UPSAddress.isEmpty()) m_listKNutEvent->append(dateTime+" "+text);
+ else m_listKNutEvent->append(dateTime+" "+UPSAddress+" : "+text);
+ if (m_listKNutEvent->count() > knc::maxCountKNutEvent) m_listKNutEvent->remove(m_listKNutEvent->begin());
+ }
+ }
+
+/*********************************************************************************************/
+/* */
+/* PRIVATE SLOTS */
+/* */
+/*********************************************************************************************/
+
+
+void KNutClient::slotReconnectTimeout (void) {
+
+ m_mainUpsInfo.netError=0; //clears netError
+ m_mainUpsInfo.upsDriverState=knc::connecting;
+ m_mainUpsInfo.upsNet->open();
+ }
+
+
+
+void KNutClient::slotTimeout (void) {
+
+ getUpsData();
+ if (!m_mainUpsInfo.errorUpsData) { // no error
+ if (mainWindow) {
+ mainWindow->repaintPanel();
+ mainWindow->repaintAnalogs();
+ }
+ m_panelsAreZeroing=false;
+ showStatusEvent();
+ }
+ else { // error
+ if ((mainWindow) && (!m_panelsAreZeroing)) mainWindow->zeroingPanels();
+ m_panelsAreZeroing=true;
+ if (m_myDock) m_myDock->clearDockValues();
+ }
+ if (m_myDock) m_myDock->repaintDock();
+ m_upsTimer->start( m_mainUpsInfo.record.delay, TRUE ); // nastartujem znovu
+ }
+
+
+void KNutClient::slotConnectionClosed(void) {
+//qDebug("KNutClient::slotConnectionClosed");
+
+ m_mainUpsInfo.netError = KNutNet::ConnetionClosedByServer;
+
+ m_upsTimer->stop();
+ upsDeactivate();
+ //sets netError this, because procedure upsDeactivate sets netError to zero
+ m_mainUpsInfo.netError = KNutNet::ConnetionClosedByServer;
+
+ if (mainWindow) {
+ mainWindow->hideConnectPB();
+ mainWindow->cleanPanels();
+ }
+ if (m_myDock) {
+ // clears values of dock and set standard icon of dock
+ m_myDock->clearDockValues();
+ }
+
+ addEventString(i18n("The connection was closed by the second side (upsd)."),m_mainUpsInfo.record.name);
+ if ((m_myMessMan) and (settingData.useMessageWindow)) m_myMessMan->addMessage(i18n("The connection was closed by the second side (upsd)."),knc::errorLevel,true);
+
+ m_mainUpsInfo.reconnecting = true;
+ m_mainUpsInfo.reconnectCount = 1;
+ m_reconnectTimer->start( nextConnDelay[0]*1000, TRUE ); // start timer for reconnect delay
+ }
+
+void KNutClient::showStatusEvent(void) {
+
+
+//qDebug ("KNutClient::showStatusEvent");
+ int myState = m_mainUpsInfo.upsNet->readStatus();
+ if (myState != m_mainUpsInfo.oldState) {
+
+ if ((myState & KNutNet::OFF) != (m_mainUpsInfo.oldState & KNutNet::OFF)) {
+ if (myState & KNutNet::OFF) {
+ addEventString(i18n("UPS is off."),m_mainUpsInfo.record.name);
+ if ((m_myMessMan) and (settingData.useMessageWindow)) m_myMessMan->addMessage(i18n("UPS is off."),knc::criticalLevel);
+ }
+ else {
+ addEventString(i18n("UPS is back on."),m_mainUpsInfo.record.name);
+ if ((m_myMessMan) and (settingData.useMessageWindow)) m_myMessMan->addMessage(i18n("UPS is back on."),knc::criticalLevel,true);
+ }
+ }
+ if ((myState & KNutNet::OL) != (m_mainUpsInfo.oldState & KNutNet::OL)){
+ if (myState & KNutNet::OL) {
+ addEventString(i18n("Power is back online."),m_mainUpsInfo.record.name);
+ if ((m_myMessMan) and (settingData.useMessageWindow)) m_myMessMan->addMessage(i18n("Power is back online."),knc::warningLevel,true);
+ }
+ }
+ if ((myState & KNutNet::OB) != (m_mainUpsInfo.oldState & KNutNet::OB)) {
+ if (myState & KNutNet::OB) {
+ addEventString(i18n("UPS is on battery."),m_mainUpsInfo.record.name);
+ if ((m_myMessMan) and (settingData.useMessageWindow)) m_myMessMan->addMessage(i18n("UPS is on battery."),knc::warningLevel);
+ }
+ }
+ if ((myState & KNutNet::LB) != (m_mainUpsInfo.oldState & KNutNet::LB)) {
+ if (myState & KNutNet::LB) {
+ addEventString(i18n("UPS battery is low."),m_mainUpsInfo.record.name);
+ if ((m_myMessMan) and (settingData.useMessageWindow)) m_myMessMan->addMessage(i18n("UPS battery is low."),knc::criticalLevel);
+ }
+ else {
+ addEventString(i18n("UPS battery is OK."),m_mainUpsInfo.record.name);
+ if ((m_myMessMan) and (settingData.useMessageWindow)) m_myMessMan->addMessage(i18n("UPS battery is OK."),knc::criticalLevel,true);
+ }
+ }
+ if ((myState & KNutNet::RB) != (m_mainUpsInfo.oldState & KNutNet::RB)) {
+ if (myState & KNutNet::RB) {
+ addEventString(i18n("UPS battery is bad and needs be replaced."),m_mainUpsInfo.record.name);
+ if ((m_myMessMan) and (settingData.useMessageWindow)) m_myMessMan->addMessage(i18n("UPS battery is bad and needs be replaced."),knc::infoLevel);
+ }
+ }
+ if ((myState & KNutNet::OVER) != (m_mainUpsInfo.oldState & KNutNet::OVER)) {
+ if (myState & KNutNet::OVER) {
+ addEventString(i18n("UPS is overloaded."),m_mainUpsInfo.record.name);
+ if ((m_myMessMan) and (settingData.useMessageWindow)) m_myMessMan->addMessage(i18n("UPS is overloaded."),knc::lowWarningLevel);
+ }
+ else {
+ addEventString(i18n("UPS isn't overloaded."),m_mainUpsInfo.record.name);
+ if ((m_myMessMan) and (settingData.useMessageWindow)) m_myMessMan->addMessage(i18n("UPS isn't overloaded."),knc::lowWarningLevel,true);
+ }
+ }
+ if ((myState & KNutNet::CAL) != (m_mainUpsInfo.oldState & KNutNet::CAL)) {
+ if (myState & KNutNet::CAL) {
+ addEventString(i18n("UPS is performing calibration")+".",m_mainUpsInfo.record.name);
+ if ((m_myMessMan) and (settingData.useMessageWindow)) m_myMessMan->addMessage(i18n("UPS is performing calibration")+".",knc::infoLevel);
+ }
+ else {
+ addEventString(i18n("Calibration of UPS is ended."),m_mainUpsInfo.record.name);
+ if ((m_myMessMan) and (settingData.useMessageWindow)) m_myMessMan->addMessage(i18n("Calibration of UPS is ended."),knc::infoLevel,true);
+ }
+ }
+ if ((myState & KNutNet::BOOST) != (m_mainUpsInfo.oldState & KNutNet::BOOST)) {
+ if (myState & KNutNet::BOOST) {
+ addEventString(i18n("UPS is boosting incoming voltage."),m_mainUpsInfo.record.name);
+ if ((m_myMessMan) and (settingData.useMessageWindow)) m_myMessMan->addMessage(i18n("UPS is boosting incoming voltage."),knc::infoLevel);
+ }
+ else {
+ addEventString(i18n("Boosting of UPS is ended."),m_mainUpsInfo.record.name);
+ if ((m_myMessMan) and (settingData.useMessageWindow)) m_myMessMan->addMessage(i18n("Boosting of UPS is ended."),knc::infoLevel,true);
+ }
+ }
+ if ((myState & KNutNet::TRIM) != (m_mainUpsInfo.oldState & KNutNet::TRIM)) {
+ if (myState & KNutNet::TRIM) {
+ addEventString(i18n("UPS is trimming incoming voltage."),m_mainUpsInfo.record.name);
+ if ((m_myMessMan) and (settingData.useMessageWindow)) m_myMessMan->addMessage(i18n("UPS is trimming incoming voltage."),knc::infoLevel);
+ }
+ else {
+ addEventString(i18n("Trimming of UPS is ended."),m_mainUpsInfo.record.name);
+ if ((m_myMessMan) and (settingData.useMessageWindow)) m_myMessMan->addMessage(i18n("Trimming of UPS is ended."),knc::infoLevel,true);
+ }
+ }
+ m_mainUpsInfo.oldState=myState;
+ }
+ }
+
+void KNutClient::slotSetNewUPS (QString name) {
+
+ m_mainUpsInfo.reconnecting =false;
+ m_reconnectTimer->stop();
+
+ if (name != m_mainUpsInfo.record.name) {
+ m_upsTimer->stop();
+ upsDeactivate();
+
+ addEventString(i18n("Switched"),name);
+ if (m_myMessMan) m_myMessMan->deleteMessage();
+
+ m_mainUpsInfo.record.name=name;
+ m_mainUpsInfo.errorUpsData=false;
+ setActiveUpsInfo(m_mainUpsInfo.record.name);
+
+ //new connection name and password are cleaned
+ m_mainUpsInfo.name = "";
+ m_mainUpsInfo.password = "";
+
+ if (mainWindow) {
+ mainWindow->setCombo(name);
+// mainWindow->showUpsData();
+ mainWindow->cleanPanels();
+ }
+
+ if (m_myDock) {
+ // clears values of dock and set standard icon of dock
+ m_myDock->clearDockValues();
+ m_myDock->setNewUPS(); // sets miniIcon in list of UPSes for selected UPS
+ }
+
+ m_panelsAreZeroing=false;
+ m_lastError=0; // zadna chyba
+ m_mainUpsInfo.oldState=KNutNet::initState; // init variable of last UPS state
+
+ // nova cast
+
+ m_mainUpsInfo.upsNet->newUPS(m_mainUpsInfo.record.upsAddress,m_mainUpsInfo.record.upsName, m_mainUpsInfo.record.port);
+ // state of connection to usbd, this isn't state of knutnet
+ m_mainUpsInfo.upsDriverState=knc::connecting;
+ m_mainUpsInfo.upsNet->open();
+ }
+ }
+
+
+void KNutClient::slotPreferenceUps (void) {
+
+ KNutPrefDlg* prefDlg = new KNutPrefDlg ( upsRecords, analogRecords, &settingData, m_mainUpsInfo.record.name ); // aktivujeme dialog pro preference
+ connect (prefDlg,SIGNAL(signalChangeConfig(unsigned int)),this,SLOT(slotSetConfig(unsigned int)));
+ prefDlg->exec();
+ delete prefDlg;
+ }
+
+
+void KNutClient::slotSetConfig (unsigned int changeSetting) {
+
+ if (changeSetting) {
+ // cely blok konfiguraci ukladame jen zde // all block of configurations is saved only here
+ saveConfiguration(true);
+ if (changeSetting & KNutPrefDlg::ChangeXFer) {
+ if (settingData.lowHighXfer)
+ setActiveXFerVars(false);
+ else
+ setActiveXFerVars(true);
+ }
+
+ if (changeSetting & KNutPrefDlg::ChangeUpsSetting) {
+ //we have changed active UPS
+//********** same code like code into slotSetNewUPS -- stejny kod jako v slotSetNewUPS
+ m_upsTimer->stop();
+ upsDeactivate();
+
+ if (m_mainUpsInfo.record.name == "") {
+ // the first record was added, because the first UPS is active UPS always
+ QString name = upsRecords->getName(0);
+ addEventString(i18n("Switched"),name);
+ m_mainUpsInfo.record.name=name;
+ m_mainUpsInfo.errorUpsData=false;
+ m_myMessMan->deleteMessage();
+ saveConfiguration(false); // saves information of new/first active UPS
+ }
+ else {
+ if (upsRecords->getCount() == 0) {
+ // the last record was deleted, because the last UPS is active UPS
+ addEventString(i18n("Switched"),"");
+ m_mainUpsInfo.record.name="";
+ m_mainUpsInfo.errorUpsData=false;
+ m_mainUpsInfo.record.upsName = "";
+ m_mainUpsInfo.record.upsAddress = "";
+ m_myMessMan->deleteMessage();
+ saveConfiguration(false); // saves information of no UPS, list of UPS is empty
+ }
+ }
+ setActiveUpsInfo(m_mainUpsInfo.record.name);
+// upsActivate();
+// getUpsData(); // provedeme hned natazeni zbytku promenych oby se nastavili meraky
+ // protoze UPS byla odpojena a znovu pripojena
+ // zde je nutno hned provest prekresleni
+ // showUpsData je nutno udelat take proto ze se mohl zmenit vyber meraku
+// if (mainWindow) mainWindow->showUpsData();
+ if (mainWindow) mainWindow->cleanPanels();
+// if (myDock) myDock->repaintDock(mainUpsInfo.netError);
+ if (m_myDock) m_myDock->clearDockValues();
+
+ m_mainUpsInfo.upsNet->newUPS(m_mainUpsInfo.record.upsAddress,m_mainUpsInfo.record.upsName, m_mainUpsInfo.record.port);
+ // state of connection to usbd, this isn't state of knutnet
+ m_mainUpsInfo.upsDriverState=knc::connecting;
+ m_mainUpsInfo.upsNet->open();
+// if ((mainUpsInfo.upsNet->getState() == KNutNet::Connected) && (!mainUpsInfo.errorUpsData)) {
+// showStatusEvent();
+// upsTimer->start( mainUpsInfo.record.delay, TRUE ); // nastartujeme casovac
+// }
+ }
+
+ if (changeSetting & KNutPrefDlg::ChangeUpsCount) {
+ if (m_myDock) m_myDock->changeUps();
+ }
+
+ if (changeSetting & KNutPrefDlg::ChangeTypeOfKIcon) {
+ if (m_myDock) m_myDock->changeKIcon();
+ }
+
+ if (changeSetting & KNutPrefDlg::ChangeCustomKIconColor) {
+ if (m_myDock) m_myDock->changeKIBColor();
+ }
+
+ if (changeSetting & KNutPrefDlg::ChangeKIconBColor) {
+ if (m_myDock) m_myDock->changeKIBColor();
+ }
+
+ if (changeSetting & KNutPrefDlg::ChangeToolTip) {
+ if (m_myDock) m_myDock->changeToolTip();
+ }
+
+ //for other settings will call functions from mainWindow class
+ if (mainWindow) mainWindow->setConfig (changeSetting);
+ }
+ }
+
+
+void KNutClient::slotPrintUPSVars(void) {
+
+ if (m_mainUpsInfo.upsDriverState == knc::connected) {
+ if (!m_mainUpsInfo.errorUpsData) {
+ if ((m_mainUpsInfo.upsNet->readNumberVars (KNutNet::AllVars)) || (m_mainUpsInfo.upsNet->readNumberComms ())) {
+ KNutPrintUpsVar *windowUpsVars = new KNutPrintUpsVar(m_mainUpsInfo.upsNet,settingData.useDescription);
+ if (windowUpsVars->upsOk()) windowUpsVars->exec();
+ delete windowUpsVars;
+ }
+ } else {
+ // KNutVarData::showError (mainUpsInfo.netError);
+ if ((m_myMessMan)) m_myMessMan->addMessage(KNutVarData::errorToText(m_mainUpsInfo.netError),knc::errorLevel,true);
+ }
+ } else {
+ // KNutVarData::showError (KNutNet::NotConnection);
+ if ((m_myMessMan)) m_myMessMan->addMessage(KNutVarData::errorToText(KNutNet::NotConnection),knc::errorLevel,true);
+
+ }
+ }
+
+
+void KNutClient::slotInstComms(void) {
+
+ if (m_mainUpsInfo.upsDriverState == knc::connected) {
+ if (!m_mainUpsInfo.errorUpsData) {
+ if (m_mainUpsInfo.upsNet->readNumberComms ()) {
+ KNutInstComms *windowInstComms = new KNutInstComms(&m_mainUpsInfo.name,&m_mainUpsInfo.password,m_mainUpsInfo.record.userName,m_mainUpsInfo.record.password,m_mainUpsInfo.upsNet);
+ if (windowInstComms->upsOk()) windowInstComms->exec();
+ delete windowInstComms;
+ }
+ }
+ else {
+// KNutVarData::showError (mainUpsInfo.netError);
+ if ((m_myMessMan)) m_myMessMan->addMessage(KNutVarData::errorToText(m_mainUpsInfo.netError),knc::errorLevel,true);
+ }
+ }
+ else {
+// KNutVarData::showError (KNutNet::NotConnection);
+ if ((m_myMessMan)) m_myMessMan->addMessage(KNutVarData::errorToText(KNutNet::NotConnection),knc::errorLevel,true);
+ }
+ }
+
+void KNutClient::slotRWVars(void) {
+
+ if (m_mainUpsInfo.upsDriverState == knc::connected) {
+ if (!m_mainUpsInfo.errorUpsData) {
+ if (m_mainUpsInfo.upsNet->readNumberVars (KNutNet::RWVars)) {
+ KNutRWVar *windowRWVars = new KNutRWVar(&m_mainUpsInfo.name,&m_mainUpsInfo.password,m_mainUpsInfo.record.userName,m_mainUpsInfo.record.password,m_mainUpsInfo.upsNet);
+ connect (windowRWVars,SIGNAL(signalChangeRWVars(QString)),this,SLOT(slotChangeRWVars(QString)));
+ if (windowRWVars->upsOk()) windowRWVars->exec();
+ delete windowRWVars;
+ }
+ }
+ else {
+ // KNutVarData::showError (mainUpsInfo.netError);
+ if ((m_myMessMan)) m_myMessMan->addMessage(KNutVarData::errorToText(m_mainUpsInfo.netError),knc::errorLevel,true);
+ }
+ }
+ else {
+ // KNutVarData::showError (mainUpsInfo.netError);
+ if ((m_myMessMan)) m_myMessMan->addMessage(KNutVarData::errorToText(KNutNet::NotConnection),knc::errorLevel,true);
+ }
+ }
+
+
+void KNutClient::slotRefreshConnection(void) {
+
+ m_reconnectMutex.lock();
+
+ m_mainUpsInfo.reconnecting =false;
+ m_reconnectTimer->stop();
+ m_upsTimer->stop();
+ upsDeactivate(); // closes connections
+
+ // nastavime na docku iconu
+ // sets icon for dock
+ if (m_myDock) {
+ m_myDock->clearDockValues();
+ // myDock->initImage();
+ // myDock->repaint();
+ }
+ if (mainWindow) {
+ mainWindow->cleanPanels();
+ }
+ addEventString(i18n("Reconnect"),m_mainUpsInfo.record.name);
+ if (m_myMessMan) m_myMessMan->deleteMessage();
+
+// mainUpsInfo.record.name=name;
+ m_mainUpsInfo.errorUpsData=false;
+ setActiveUpsInfo(m_mainUpsInfo.record.name);
+
+ //new connection name and password are cleaned
+ m_mainUpsInfo.name = "";
+ m_mainUpsInfo.password = "";
+
+
+ m_panelsAreZeroing=false;
+ m_lastError=0; // zadna chyba
+ m_mainUpsInfo.oldState=KNutNet::initState;
+
+ m_mainUpsInfo.upsNet->newUPS(m_mainUpsInfo.record.upsAddress,m_mainUpsInfo.record.upsName, m_mainUpsInfo.record.port);
+ // state of connection to usbd, this isn't state of knutnet
+ m_mainUpsInfo.upsDriverState=knc::connecting;
+ m_mainUpsInfo.upsNet->open();
+ m_reconnectMutex.unlock();
+ }
+
+
+void KNutClient::slotChangeRWVars( QString ) {
+ // informace ze doslo k uspesne zmene promene
+ // vzhledem k asynchronimu zpracovani muze upsd vratit tuto hodnotu az za nejakou dobu
+ // nevim zda bude potreba
+ }
+
+
+void KNutClient::exitMainWindow (void) {
+
+ mainWindow=0;
+ if (m_mainUpsInfo.upsNet) setActiveUpsVars(false);
+ // Pokud neni aktivovan dock musime ukoncit aplikaci..
+ // When dock isn't activated we must close application.
+ if (m_myDock == 0) {
+ saveConfiguration(false);
+ if (m_mainUpsInfo.upsNet) {
+ delete m_mainUpsInfo.upsNet;
+ m_mainUpsInfo.upsNet = 0;
+ }
+ kapp->quit();
+ }
+ }
+
+
+void KNutClient::makeMainWindow (void) {
+
+ mainWindow = new KNutMainWindow(m_listKNutEvent ,&m_mainUpsInfo, &settingData, upsRecords, analogRecords);
+ connect(mainWindow, SIGNAL(UPSChanged (QString)), this, SLOT(slotSetNewUPS (QString)));
+ connect(mainWindow, SIGNAL(preferenceUps()),this, SLOT(slotPreferenceUps()));
+ connect(mainWindow, SIGNAL(showUPSVars()),this, SLOT(slotPrintUPSVars()));
+ connect(mainWindow, SIGNAL(makeInstComms()),this, SLOT(slotInstComms()));
+ connect(mainWindow, SIGNAL(makeRWVars()),this, SLOT(slotRWVars()));
+ connect(mainWindow, SIGNAL(makeRefreshConnection()),this, SLOT(slotRefreshConnection()));
+ connect(mainWindow, SIGNAL(saveConf()),this, SLOT(slotSaveConf()));
+
+
+
+
+ connect(mainWindow, SIGNAL(endApplication()), this, SLOT(slotExitApplication()));
+ connect(mainWindow, SIGNAL(destroyed()), this, SLOT(exitMainWindow()));
+ }
+
+
+
+void KNutClient::slotActiveMainWindow (void) {
+
+ if (!mainWindow) {
+ // pred activaci nastaveme promenne znovu precteme data
+ // state of connection to usbd, this isn't state of knutnet
+ if (m_mainUpsInfo.upsDriverState==knc::connected) {
+ m_upsTimer->stop();
+ setActiveUpsVars(true);
+ getUpsData();
+ makeMainWindow();
+ if (m_myDock) m_myDock->repaintDock(m_mainUpsInfo.netError);
+ m_upsTimer->start( 1, TRUE ); // nastartujem znovu
+ // 1 proto aby se zpracovali pripadne udalosti o zruseni spojeni
+ }
+ else {
+ setActiveUpsVars(true);
+ //getUpsData(); zrusene protoze kdyz nebylo spojeni navazeno vratil by prikaz
+ // getValues error=0 a doslo by vypsani data ok.
+ makeMainWindow();
+ if (!m_mainUpsInfo.errorUpsData) {
+ if (m_myDock) m_myDock->repaintDock(m_mainUpsInfo.netError);
+ }
+ }
+ }
+ else { // end if mainWindow
+ //activates main window
+ mainWindow->raise();
+ KWin::activateWindow(mainWindow->winId());
+ }
+ }
+
+void KNutClient::slotSaveConf (void) {
+ saveConfiguration(true); // saves all configuration
+}
+
+void KNutClient::closeMainWindow (void) {
+ if (mainWindow) {
+ if (m_myDock) m_myDock->repaintDock(m_mainUpsInfo.netError);
+ m_upsTimer->stop();
+ mainWindow->close();
+ mainWindow=0;
+ m_upsTimer->start( 1, TRUE ); // starts timer // nastartujeme casovac
+ }
+ }
+
+
+void KNutClient::slotExitApplication(void) {
+
+ m_upsTimer->stop();
+ if (mainWindow) {
+ // odpojime protoze exitMainWindow by byl vykonan az po zkonceni procedury;
+ disconnect(mainWindow, SIGNAL(destroyed()), this, SLOT(exitMainWindow()));
+ delete mainWindow;
+ mainWindow = 0;
+ }
+ saveConfiguration(false);
+ if (m_mainUpsInfo.upsNet) {
+ delete m_mainUpsInfo.upsNet;
+ m_mainUpsInfo.upsNet = 0;
+ }
+ if (m_myDock) { m_myDock->close(); m_myDock = 0;}
+ kapp->quit();
+ }
+
+#include "knutclient.moc"
+
diff --git a/src/knutclient.desktop b/src/knutclient.desktop
new file mode 100644
index 0000000..8a2568e
--- /dev/null
+++ b/src/knutclient.desktop
@@ -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� NUT
+Comment[es]=Cliente KDE para NUT
+Terminal=0
+X-KDE-StartupNotify=true
+OnlyShowIn=KDE;
+Categories=Qt;KDE;System;Monitor;
diff --git a/src/knutclient.h b/src/knutclient.h
new file mode 100755
index 0000000..fab2295
--- /dev/null
+++ b/src/knutclient.h
@@ -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
diff --git a/src/knutclientui.rc b/src/knutclientui.rc
new file mode 100644
index 0000000..8854298
--- /dev/null
+++ b/src/knutclientui.rc
@@ -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>
diff --git a/src/knutconst.h b/src/knutconst.h
new file mode 100755
index 0000000..866fe5d
--- /dev/null
+++ b/src/knutconst.h
@@ -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
diff --git a/src/knutdock.cpp b/src/knutdock.cpp
new file mode 100755
index 0000000..13d0d87
--- /dev/null
+++ b/src/knutdock.cpp
@@ -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"
diff --git a/src/knutdock.h b/src/knutdock.h
new file mode 100755
index 0000000..15fa69c
--- /dev/null
+++ b/src/knutdock.h
@@ -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
diff --git a/src/knutfrontpanel.cpp b/src/knutfrontpanel.cpp
new file mode 100755
index 0000000..caa5b6e
--- /dev/null
+++ b/src/knutfrontpanel.cpp
@@ -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"
diff --git a/src/knutfrontpanel.h b/src/knutfrontpanel.h
new file mode 100755
index 0000000..42242ed
--- /dev/null
+++ b/src/knutfrontpanel.h
@@ -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
+
diff --git a/src/knutinstcomms.cpp b/src/knutinstcomms.cpp
new file mode 100755
index 0000000..e21ebfc
--- /dev/null
+++ b/src/knutinstcomms.cpp
@@ -0,0 +1,137 @@
+/***************************************************************************
+ knutinstcomms.cpp - description
+ -------------------
+ begin : ct rj 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; }
+
+
diff --git a/src/knutinstcomms.h b/src/knutinstcomms.h
new file mode 100755
index 0000000..55e02b1
--- /dev/null
+++ b/src/knutinstcomms.h
@@ -0,0 +1,97 @@
+/***************************************************************************
+ knutinstcomms.h - description
+ -------------------
+ begin : ct rj 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
diff --git a/src/knutmainwindow.cpp b/src/knutmainwindow.cpp
new file mode 100644
index 0000000..c5aaf16
--- /dev/null
+++ b/src/knutmainwindow.cpp
@@ -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"
diff --git a/src/knutmainwindow.h b/src/knutmainwindow.h
new file mode 100644
index 0000000..01b9815
--- /dev/null
+++ b/src/knutmainwindow.h
@@ -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
+
diff --git a/src/knutmessage.cpp b/src/knutmessage.cpp
new file mode 100644
index 0000000..f13b9e7
--- /dev/null
+++ b/src/knutmessage.cpp
@@ -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"
diff --git a/src/knutmessage.h b/src/knutmessage.h
new file mode 100644
index 0000000..6be9f5d
--- /dev/null
+++ b/src/knutmessage.h
@@ -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
diff --git a/src/knutmessagemanager.cpp b/src/knutmessagemanager.cpp
new file mode 100644
index 0000000..4a5aa8a
--- /dev/null
+++ b/src/knutmessagemanager.cpp
@@ -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"
diff --git a/src/knutmessagemanager.h b/src/knutmessagemanager.h
new file mode 100644
index 0000000..3267c6e
--- /dev/null
+++ b/src/knutmessagemanager.h
@@ -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
diff --git a/src/knutnet.cpp b/src/knutnet.cpp
new file mode 100755
index 0000000..71bc315
--- /dev/null
+++ b/src/knutnet.cpp
@@ -0,0 +1,1941 @@
+/***************************************************************************
+ knutnet.cpp - description
+ -------------------
+ begin : Ne led 12 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 "knutnet.h"
+
+#include <qtextstream.h>
+#include <qstring.h>
+#include <qcstring.h>
+#include <qtimer.h>
+
+
+#include <unistd.h> // for function sleep
+
+//#include <iostream>
+
+
+
+/****** CONSTS ***********/
+
+//const Q_ULONG rBufferLen = 1024;
+
+
+
+KNutNet::KNutNet (const QString upsAddress, const QString upsName, const unsigned short port, unsigned int countRepeat, const unsigned int delay)
+ : QObject(), m_upsAddress(upsAddress), m_upsName(upsName), m_countRepeat(countRepeat), m_port(port), m_delay(delay) {
+
+
+//qDebug ("KNutNet::KNutNet");
+
+ m_state = Idle; //idle is value
+ m_numberVars = 0;
+ m_numberRWVars = 0;
+ m_numberIComms = 0;
+ m_upsStatusVar = 0;
+ m_nutProtocol = 0;
+ m_nutVariables = 0;
+ m_switchToTCP = false;
+
+ m_description = false; // popis neni natazen - description is not loaded
+
+ m_unConnectTimer = new QTimer( this );
+ connect( m_unConnectTimer, SIGNAL(timeout()), this, SLOT(slotTimerReconnect()) );
+
+ m_error = NoError;
+
+ m_commandSocket = new QSocket( this );
+ connect( m_commandSocket, SIGNAL( hostFound()),this, SLOT( slotHostFound()));
+ connect( m_commandSocket, SIGNAL( connected()),this,SLOT( slotConnected()));
+ connect( m_commandSocket, SIGNAL( connectionClosed()),this, SLOT( slotConnectionClosed()));
+ connect( m_commandSocket, SIGNAL( error(int)),this, SLOT( slotConnectionError(int)));
+ }
+
+
+KNutNet::~KNutNet(){
+ QCString inBuffer;
+ QString outBuffer;
+
+ close(); // close connetion when is existed
+ while (m_state == Closing ) {
+ sleep (100);
+ }
+// deleteVars() is made in close();
+ }
+
+
+void KNutNet::close (void) {
+// std::cout << "--KNutNet::close" << std::endl;
+ QCString inBuffer;
+ QString outBuffer;
+
+ m_unConnectTimer->stop();
+ deleteVars();
+ if ((m_state == Connected) || (m_state == Connecting)) {
+ m_state = Closing;
+ if (m_state == Connected) {
+ inBuffer="LOGOUT\n";
+ getUpsData (inBuffer,outBuffer);
+ // getUpsDate makes "commandSocket->flush()"
+ }
+
+ if (m_commandSocket->bytesToWrite () > 0) sleep (1000);
+ m_commandSocket->clearPendingData (); // data in output buffer will be errased
+ m_commandSocket->close(); // closes the socket
+
+ if ( m_commandSocket->state() == QSocket::Closing ) {
+ connect( m_commandSocket, SIGNAL(delayedCloseFinished()),this,SLOT(slotClosed()) );
+ }
+ else {
+ slotClosed();
+ }
+ }
+ }
+
+void KNutNet::slotClosed (void) {
+
+ disconnect( m_commandSocket,SIGNAL(delayedCloseFinished()),this, SLOT(slotClosed()) );
+ m_state = Idle;
+ }
+
+
+void KNutNet::open (void) {
+
+ QCString inBuffer;
+ QString outBuffer;
+
+ if ((m_state == Connected) || (m_state == Connecting)) close(); // close connetion when is existed
+ else {
+ while (m_state == Closing ) {
+ sleep (100);
+ }
+ }
+ if (m_upsAddress != "") {
+ if ( m_commandSocket->state() != QSocket::Connecting ) {
+ m_firstConnect=true;
+ m_numberConnection=0;
+ m_state = HostLookup;
+ emit tryFirstConnection(m_countRepeat); // how many times we can try to connect with ups server /upsd/
+// std::cout << "--KNutNet :: Open emit - tryFirstConnection" << std::endl;
+ m_commandSocket->connectToHost(m_upsAddress,m_port);
+ }
+ }
+ }
+
+
+void KNutNet::newUPS (const QString upsAddress, const QString upsName, const unsigned short port) {
+
+ if ((m_state == Connected) || (m_state == Connecting)) {
+ close();
+ while (m_state == Closing ) {
+ sleep (100);
+ }
+ }
+
+ m_upsAddress = upsAddress;
+ m_upsName = upsName;
+ m_port = port;
+
+ m_state = Idle;
+ m_numberVars = 0;
+ m_numberRWVars = 0;
+ m_numberIComms = 0;
+ m_upsStatusVar = 0;
+ m_nutProtocol = 0;
+ m_nutVariables = 0;
+ m_switchToTCP = false;
+
+ m_error = NoError;
+ //firstConnect=true;
+ //numberConnection=0;
+ }
+
+
+
+int KNutNet::getError ( void ) { return m_error; }
+
+int KNutNet::getState ( void ){ return m_state; }
+
+bool KNutNet::isDescription ( void ){ return m_description; }
+
+int KNutNet::getNutProtocol ( void ) { return m_nutProtocol; }
+
+int KNutNet::getNutVariables ( void ) { return m_nutVariables; }
+
+bool KNutNet::switchedToTCP ( void ) { return m_switchToTCP; }
+
+
+int KNutNet::getUpsVars ( void) {
+ int returnValue;
+
+ m_error=0;
+ if (m_state == Connected) {
+
+ // init vars and lists
+ m_numberVars = 0;
+ m_numberRWVars = 0;
+ m_numberIComms = 0;
+ deleteVars();
+ int countWaitRevision = 5;
+ do {
+ switch (m_nutProtocol) {
+ case 1:
+ returnValue = getUpsVars1();
+ break;
+ case 2:
+ returnValue = getUpsVars2();
+ break;
+ default:
+ return 0;
+ }
+ if ( readStatus() != KNutNet::WAIT) return returnValue;
+ countWaitRevision--;
+ if (countWaitRevision) sleep (2);
+ }
+ while (countWaitRevision);
+ return NoListVars; //getUpsVars can't read list variables
+ }
+ else {
+ return NotConnection;
+ }
+ }
+
+
+int KNutNet::getUpsValues (const bool allVars ) {// allVars = true vse; allVars = false jen activate
+
+ m_error=0; // vynulujeme chyby
+ if (m_state == Connected) {
+ // init vars and lists
+ switch (m_nutProtocol) {
+ case 1:
+ return getUpsValues1(allVars);
+ break;
+ case 2:
+ return getUpsValues2(allVars);
+ break;
+ default:
+ return 0;
+ }
+ }
+ else {
+ return NotConnection;
+ }
+ }
+
+
+
+int KNutNet::getDescription (bool always) {
+
+ m_error=0; // vynulujeme chyby
+ if (m_state == Connected) {
+ switch (m_nutProtocol) {
+ case 1:
+ return getDescription1 (always);
+ break;
+ case 2:
+ return getDescription2 (always);
+ break;
+ default:
+ return 0;
+ }
+ }
+ else return NotConnection;
+ }
+
+
+int KNutNet::instantCommand (const QString command, const QString userName, const QString password, const bool onlyCommand) {
+ m_error=0; // vynulujeme chyby
+
+ if (m_state == Connected) {
+ QString outBuffer;
+
+ // funkce sendComm sama mastavi promenou error
+ if (onlyCommand) {
+ if (!(m_error = sendComm("INSTCMD", command, "",true))) {
+// netMutex=false;
+ return 0;
+ }
+ else {
+// netMutex=false;
+ return m_error;
+ }
+ }
+ else {
+
+
+
+
+ if (!(m_error = sendComm ("USERNAME", userName, ""))) {
+ if (!(m_error = sendComm("PASSWORD", password, ""))) {
+ if (!(m_error = sendComm("INSTCMD", command, "",true))) {
+// netMutex=false;
+ return 0;
+ }
+ else {
+ return m_error; // spatny prikaz
+ }
+ } //username
+ else {
+ return m_error; //spatne helso
+ }
+ }
+ else {
+ return m_error; // spatne jmeno
+ }
+ }
+ }
+ else return NotConnection;
+ }
+
+
+int KNutNet::setVariable (const QString variable, const QString value, const QString userName, const QString password, const bool onlyVariable) {
+ m_error=0; // vynulujeme chyby
+ if (m_state == Connected) {
+ QString outBuffer;
+ QString setCommand;
+
+ switch (m_nutProtocol) {
+ case 1: setCommand = "SET";
+ break;
+ case 2: setCommand = "SET VAR";
+ }
+ if (onlyVariable) {
+ if (!(m_error = sendComm(setCommand, variable, value, true))) {
+ return 0;
+ }
+ else {
+ return m_error;
+ }
+ }
+ else {
+ if (!(m_error = sendComm ("USERNAME", userName, ""))) {
+ if (!(m_error = sendComm("PASSWORD", password, ""))) {
+ if (!(m_error = sendComm(setCommand, variable, value, true))) {
+ //netMutex=false;
+ return 0;
+ }
+ else {
+ return m_error;
+ }
+ } //username
+ else {
+ return m_error;
+ }
+ }
+ else {
+ return m_error;
+ }
+ }
+ }
+ else return NotConnection;
+ }
+
+
+int KNutNet::readNumberVars (typeOfVar typVar) {
+// Vraci pocet promenych
+ m_error=0;
+ if (m_state == Connected) {
+ switch (typVar) {
+ case AllVars:
+ return m_numberVars;
+ break;
+ case ROVars:
+ return m_numberVars - m_numberRWVars;
+ break;
+ case RWVars:
+ return m_numberRWVars;
+ break;
+ default:
+ return -1;
+ }
+ }
+ else return -1;
+ }
+
+int KNutNet::readNumberComms (void) {
+// Vraci pocet prikazu
+ m_error=0;
+ if (m_state == Connected) return m_numberIComms;
+ else return -1;
+ }
+
+
+int KNutNet::readIComm (const int seqNumber, upsICommDef& upsIComm) {
+ m_error =0;
+ if (m_state == Connected) {
+ if ((seqNumber < 1) || ((unsigned int)seqNumber > m_listIComms.size())) {
+ m_error=CommNotFind;
+ return m_error;
+ }
+ upsIComm = m_listIComms[seqNumber-1];
+ return 0;
+ }
+ else return NotConnection;
+ }
+
+
+int KNutNet::readVars (const QString name, struct upsVarDef& allVar) {
+ m_error =0;
+ if (m_state == Connected) {
+ QValueVector<upsVarDef>::const_iterator it;
+ for (it = m_listVars.begin(); it != m_listVars.end(); it++) {
+ if ((*it).upsVarName == name) {
+ allVar = (*it);
+ return 0;
+ }
+ }
+ m_error=VarNotFind;
+ return m_error;
+ }
+ else return NotConnection;
+ }
+
+ int KNutNet::readVars (const int seqNumber, struct upsVarDef& allVar, const typeOfVar typVar) {
+
+ m_error =0;
+ if (m_state == Connected) {
+ int n = 1;
+ QValueVector<upsVarDef>::const_iterator it;
+
+ for (it = m_listVars.begin(); it != m_listVars.end(); it++) {
+ if ((typVar== AllVars) || ((typVar==ROVars) && ((*it).upsVarType)) ||
+ ((typVar==RWVars) && (!(*it).upsVarType))) {
+ if (n == seqNumber) {
+ allVar = (*it);
+ return 0;
+ }
+ n++;
+ }
+ }
+ m_error=VarNotFind;
+ return m_error;
+ }
+ else return NotConnection;
+ }
+
+
+QString KNutNet::readStringVar (const QString name) {
+
+ m_error =0;
+ if (m_state == Connected) {
+ QValueVector<upsVarDef>::const_iterator it;
+ for (it = m_listVars.begin(); it != m_listVars.end(); it++) {
+ if ((*it).upsVarName == name) return (*it).upsValue;
+ }
+ m_error = VarNotFind;
+ return 0l;
+ }
+ else return 0l;
+}
+
+
+QString KNutNet::readEnumValueVar (const QString name, const int valueNumber) {
+
+ m_error =0;
+ if (m_state == Connected) {
+// #if defined (KDE_VERSION_MAJOR)
+// #if KDE_VERSION_MAJOR >= 3
+ QValueVector<upsVarDef>::const_iterator it;
+// #else
+// QValueList<upsVar>::ConstIterator it;
+// #endif
+// #else
+// QValueList<upsVar>::ConstIterator it;
+// #endif
+
+
+ for (it = m_listVars.begin(); it != m_listVars.end(); it++) {
+ if ((*it).upsVarName == name) {
+ if ((valueNumber < 1) || (valueNumber > (*it).upsVarMax)) {
+ m_error=EnumValueNotFind;
+ return 0l;
+ }
+ // vratime hodnotu
+ return (*(*it).upsEnumValues)[valueNumber-1];
+ }
+ }
+ m_error = VarNotFind;
+ return 0;
+ }
+ else return 0;
+ }
+
+
+int KNutNet::readStatus(void) {
+
+ m_error=0;
+ return m_upsStatusVar;
+ }
+
+
+int KNutNet::setActivate ( const QString name ) {
+ return activate (name,true);
+ }
+
+
+int KNutNet::unSetActivate ( const QString name ) {
+ return activate (name,false);
+ }
+
+
+int KNutNet::unSetActivateAll ( void ) {
+ return activateAll (false);
+ }
+
+
+int KNutNet::existName ( const QString name ) {
+
+ m_error =0;
+ if (m_state == Connected) {
+ QValueVector<upsVarDef>::const_iterator it;
+ for (it = m_listVars.begin(); it != m_listVars.end(); it++) {
+ if ((*it).upsVarName == name) return 0;
+ }
+ m_error = VarNotFind;
+ return m_error;
+ }
+ else return NotConnection;
+ }
+
+/*************************************************************************/
+/* */
+/* PRIVATE FUNCTIONS */
+/* */
+/*************************************************************************/
+
+
+int KNutNet::version (int countRepeat, const int delay) {
+ QCString inBuffer;
+ QString outBuffer;
+
+ m_error =0;
+ do {
+ inBuffer="VER\n";
+ if (!(m_error=getUpsData (inBuffer,outBuffer))) {
+ outBuffer=outBuffer.stripWhiteSpace ();
+
+ if (outBuffer.length() > 0) {
+ outBuffer = outBuffer.mid(outBuffer.find("upsd")+4);
+ int n = outBuffer.find(".");
+ if (n > 0) {
+ QString firstNumber= outBuffer.left(n);
+ QString secondNumber= outBuffer.mid(n+1);
+ int n = secondNumber.find(".");
+ if (n > 0) {
+ bool ok;
+ secondNumber = secondNumber.left(n);
+ int secondInt = secondNumber.toInt(&ok);
+ if (!ok) {m_error = UnknownFormatVer; return m_error;}
+ int firstInt = firstNumber.toInt(&ok);
+ if (!ok) {m_error = UnknownFormatVer; return m_error;}
+ if ((firstInt == 0) || ((firstInt == 1) && (secondInt < 3))) {
+ m_nutProtocol =1;
+ m_nutVariables =1;
+ }
+ else {
+ m_nutProtocol =2;
+ m_nutVariables =2;
+ }
+ return 0;
+ }
+ else m_error = UnknownFormatVer; // n is <= 0 the second dot
+ }
+ else m_error = UnknownFormatVer; // n is <= 0 the first dot
+ }
+ m_error = UnknownAnswer; // i cannot specify number of protocol and number of variables
+ return m_error;
+ }
+ countRepeat--;
+ if (countRepeat) sleep (delay);
+ }
+ while ((countRepeat));
+ return m_error;
+ }
+
+
+
+int KNutNet::getFirstUpsName (QString& firstUpsName) {
+ QCString inBuffer;
+ QString outBuffer;
+ QString varOutBuffer;
+ int lenString;
+
+ m_error=0;
+ inBuffer = "LIST UPS\n";
+ if (!(m_error=getUpsData (inBuffer,outBuffer,"END LIST UPS"))) {
+
+ QString inLine, upsNameRet, varName, value;
+ int key, typeValue;
+ bool beginList = false;
+ QTextIStream varInputStream(&outBuffer);
+ while (!(inLine = varInputStream.readLine()).isNull()) {
+ key = parseLine (inLine, upsNameRet, varName, value, typeValue, lenString);
+ switch (key) {
+ case BEGIN_LIST_UPS: {
+ beginList = true;;
+ break;
+ }
+ case UPS:
+ if (beginList ) {
+ firstUpsName = upsNameRet;
+ return 0;
+ }
+ case END_LIST_UPS:
+ firstUpsName = "";
+ m_error=NoUpsHere;
+ return m_error;
+ case ERR:
+ m_error = upsTranslateError(value);
+ return m_error;
+ default:
+ m_error=UnknownAnswer;
+ return m_error;
+ }
+ }// end while
+ }
+ else {m_error=NoData; return m_error; }
+ return 0;
+ }
+
+
+
+int KNutNet::setKey (const QString line) {
+
+ QString myLine=line.stripWhiteSpace();
+ if (myLine == "OK") return OK;
+ if (myLine == "ERR") return ERR;
+ if (myLine == "BEGIN") return BEGIN;
+ if (myLine == "END") return END;
+ if (myLine == "VAR") return VAR;
+ if (myLine == "TYPE") return TYPE;
+ if (myLine == "DESC") return DESC;
+ if (myLine == "CMDDESC") return CMDDESC;
+ if (myLine == "UPSDESC") return CMDDESC;
+ if (myLine == "UPS") return UPS;
+ if (myLine == "LIST") return LIST;
+ if (myLine == "RW") return RW;
+ if (myLine == "CMD") return CMD;
+ if (myLine == "ENUM") return ENUM;
+ if (myLine == "STARTTLS") return STARTTLS;
+ return NONE;
+ }
+
+QString KNutNet::parseValue (const QString line) {
+
+ if (line.isEmpty()) return "";
+ if (line[0] != "\"") {
+ if ((m_posChar=line.find(' ')) == -1) return line;
+ else return line.left(m_posChar+1);
+ }
+ else {
+ int len = line.length();
+ QString outString = "";
+ for (int i=1; i < len; i++) {
+ if ( line[i] == "\\") {
+ if ((i+1) <len) {
+ if ((line[i+1] == "\"") || (line[i+1] == "\"")) {
+ outString +=line[i+1];
+ i++;
+ }
+ else i +=2;
+ }
+ outString +=line[i];
+ continue;
+ }
+ if (line [i] == "\"") {
+ return outString;
+ }
+ outString += line[i];
+ }
+ return outString;
+ }
+ return "";
+ }
+
+int KNutNet::parseTypeValue (QString line, int& lenString ) {
+ int ret=0;
+ QString word;
+
+ lenString = 0;
+ if (line.isEmpty()) return 0;
+ QTextIStream inputStream(&line);
+ while (!inputStream.atEnd()) {
+ inputStream >> word;
+ if (word == "RW") ret += RW_FLAG;
+ if (word == "ENUM") ret += ENUM_FLAG;
+ if (word.find("STRING:") != -1) {
+ word = word.mid(7);
+ ret += STRING_FLAG;
+ lenString = word.toInt();
+ }
+ }
+ return ret;
+ }
+
+
+int KNutNet::parseLine(QString& line, QString& upsName ,QString& varName, QString& value, int& typeValue, int& lenString) {
+ int posChar;
+ QString word1, word2, word3;
+ int key1, key2, key3;
+
+ line = line.stripWhiteSpace();
+
+ upsName = "";
+ varName = "";
+ value = "";
+ typeValue =0;
+
+ if (line.isEmpty()) return NONE;
+
+ if ((posChar=line.find(' ')) == -1) {
+ if (setKey(line) == OK) return OK;
+ else return NONE;
+ }
+ else {
+ key1 = setKey( line.left(posChar));
+ line = line.mid(posChar+1);
+
+ switch (key1) {
+
+ case NONE:
+ return key1;
+ case OK:
+ return key1;
+ case ERR:
+ value = parseValue(line);
+ return key1;
+ default:
+ if ((posChar=line.find(' ')) == -1) return NONE;
+ word2 = line.left(posChar);
+ key2 = setKey( word2);
+ line = line.mid(posChar+1);
+
+ switch (key1) {
+ case BEGIN:
+ if ((key2 == LIST) && (setKey(line) == UPS)) return BEGIN_LIST_UPS;
+ break;
+ case END:
+ if ((key2 == LIST) && (setKey(line) == UPS)) return END_LIST_UPS;
+ break;
+ case UPS:
+ upsName = word2;
+ value = parseValue(line);
+ return key1;
+ case CMD:
+ upsName = word2;
+ varName = parseValue(line);
+ return key1;
+ }
+
+ if ((posChar=line.find(' ')) == -1) return NONE;
+
+ word3 = line.left(posChar);
+ key3 = setKey( word3);
+ line = line.mid(posChar+1);
+
+ switch (key1) {
+ case VAR:
+ upsName = word2;
+ varName = word3;
+ value = parseValue(line);
+ return VAR;
+ case TYPE:
+ upsName = word2;
+ varName = word3;
+ typeValue = parseTypeValue(line,lenString);
+ return TYPE;
+ case ENUM:
+ upsName = word2;
+ varName = word3;
+ value = parseValue(line);
+ return ENUM;
+ case DESC:
+ upsName = word2;
+ varName = word3;
+ value = parseValue(line);
+ return DESC;
+ case CMDDESC:
+ upsName = word2;
+ varName = word3;
+ value = parseValue(line);
+ return CMDDESC;
+ case BEGIN:
+ if (key2 != LIST) return NONE;
+ if (key3 == VAR) {
+ upsName=line.stripWhiteSpace();
+ return BEGIN_LIST_VAR;
+ }
+ if (key3 == RW) {
+ upsName=line.stripWhiteSpace();
+ return BEGIN_LIST_RW;
+ }
+ if (key3 == CMD) {
+ upsName=line.stripWhiteSpace();
+ return BEGIN_LIST_CMD;
+ }
+ if (key3 == ENUM) {
+ if ((posChar=line.find(' ')) == -1) return NONE;
+ upsName = line.left(posChar);
+ line=line.mid(posChar+1);
+ varName = line.stripWhiteSpace();
+ return BEGIN_LIST_ENUM;
+ }
+ return NONE;
+ case END:
+ if (key2 != LIST) return NONE;
+ if (key3 == VAR) {
+ upsName=line.stripWhiteSpace();
+ return END_LIST_VAR;
+ }
+ if (key3 == RW) {
+ upsName=line.stripWhiteSpace();
+ return END_LIST_RW;
+ }
+ if (key3 == CMD) {
+ upsName=line.stripWhiteSpace();
+ return END_LIST_CMD;
+ }
+ if (key3 == ENUM) {
+ if ((posChar=line.find(' ')) == -1) return NONE;
+ upsName = line.left(posChar);
+ line=line.mid(posChar+1);
+ varName = line.stripWhiteSpace();
+ return END_LIST_ENUM;
+ }
+ return NONE;
+ default:
+ return NONE;
+ }
+ }
+ }
+ }
+
+
+int KNutNet::newDescription (const QCString inBuffer, QString& upsDescription) {
+ QString outBuffer;
+
+ if (!(m_error=getUpsData (inBuffer,outBuffer))) {
+ outBuffer=outBuffer.stripWhiteSpace ();
+ QString word1, word2, word3;
+
+ if ((m_posChar = outBuffer.find(' ')) == -1)
+ word1 = outBuffer;
+ else {
+ word1 = outBuffer.left(m_posChar);
+ word2 = outBuffer.mid(m_posChar+1);
+ }
+ if (word1 == "DESC") {
+ if ((m_posChar = word2.find('\"')) == -1) word3="";
+ else
+ {
+ word3 = word2.mid(m_posChar+1);
+ if ((m_posChar = word3.find('\"')) != -1) word3=word3.left(m_posChar);
+ }
+ if (!word3.isEmpty()) upsDescription=word3;
+ }
+ else {
+ if (word1 == "ERR" ) return upsTranslateError(word2);
+ else return UnknownAnswer;
+ }
+ }
+ else return m_error;
+ return 0;
+ }
+
+
+void KNutNet::cleanConnecting (void) {
+ Q_ULONG rMaxLen;
+ QCString recvBuffer(rBufferLen);
+ Q_LONG lengthInputData;
+
+ int n = 0;
+ while (m_commandSocket->bytesAvailable() > 0) {
+
+ if ( (m_commandSocket->bytesAvailable()+1) > rBufferLen) rMaxLen = rBufferLen;
+ else rMaxLen=m_commandSocket->bytesAvailable()+1;
+
+ recvBuffer.resize(rMaxLen);
+ if ((lengthInputData = m_commandSocket->readBlock(recvBuffer.data(),rMaxLen)) == -1) {
+ }
+ if (lengthInputData == 0) break;
+ if (n > 20) break; else n++;
+ }
+ }
+
+
+int KNutNet::getUpsData (const QCString sBuffer, QString& rBuffer, const QCString endString) {
+
+ //rbufferLen a sbufferLen are maximal value of buffers
+ QCString recvBuffer(rBufferLen);
+ Q_LONG lengthInputData;
+ Q_ULONG dataAvailable;
+
+
+ QMutexLocker getUpsDataLocker( &m_getUpsDataMutex );
+
+ cleanConnecting();
+ // first we clean input TCP buffer
+
+ //cleans buffer
+ rBuffer=""; // clean main input buffer;
+
+
+ // after write block, runs command flush for sending data to server inmediately
+ if (m_commandSocket->writeBlock(sBuffer.data(),sBuffer.length()) < 0 ) return SendErr;
+ m_commandSocket->flush();
+
+ if (m_commandSocket->waitForMore(1000) == 0) {
+ m_commandSocket->waitForMore(500); // workaround
+ }
+ bool endRecv = false;
+ do {
+ dataAvailable=m_commandSocket->bytesAvailable();
+ if (recvBuffer.size() < (dataAvailable+1) ) recvBuffer.resize(dataAvailable+1);
+ if ((lengthInputData = m_commandSocket->readBlock(recvBuffer.data(),dataAvailable)) == -1) return RecvErr;
+
+//correct for X86_64 by Alexey Sidorov
+ recvBuffer[(int)lengthInputData]='\0';
+ // recvBuffer[lengthInputData]='\0';
+
+ //Problem is that
+ //for 64bit environment is Q_LONG defined like _int64 and
+ //for other environments is Q_LONG defined like long
+
+
+
+
+ rBuffer.append(recvBuffer.data()); // adds reading data to main input buffer
+ if (endString.isEmpty()) endRecv = false;
+ else {
+ if (recvBuffer.findRev(endString) == -1) {
+//doesn't find right end of input data
+ if (m_commandSocket->bytesAvailable() == 0) m_commandSocket->waitForMore(1000);
+ if (m_commandSocket->bytesAvailable() > 0) endRecv=true; // makes other cyckle og while
+ else endRecv=false;
+ }
+//finds right end of input data
+ else endRecv = false; // we have found what we want to find
+ }
+ } while (endRecv);
+ return 0; // all is OK
+ }
+
+
+
+ void KNutNet::setRWVars (const QString varName, const bool valueType, const int varMax, QValueVector<QString>* enumValues) {
+ QValueVector<upsVarDef>::iterator it;
+
+ for (it = m_listVars.begin(); it != m_listVars.end(); it++) {
+ if ((*it).upsVarName == varName) {
+ (*it).upsVarMax = varMax;
+ (*it).upsValueType=valueType;
+ (*it).upsEnumValues=enumValues;
+ (*it).upsVarType=false;
+ break;
+ }
+ }
+ }
+
+void KNutNet::upsSetType (struct upsVarDef& upsVar, const QString name, const QString value) {
+
+ if (((m_nutVariables = 2) && (name == "STATUS")) || ((m_nutVariables = 2) && (name == "ups.status")))
+ upsVar.upsVarActivate=true;
+ else upsVar.upsVarActivate=false;
+
+ upsVar.upsVarName = name;
+ upsVar.upsVarType=true;
+ upsVar.upsValueType=true;
+ upsVar.upsVarMax=0;
+ upsVar.upsValue=value;
+ upsVar.upsDescription="";
+ upsVar.upsEnumValues=0L;
+}
+
+
+void KNutNet::deleteVars (void) {
+// #if defined (KDE_VERSION_MAJOR)
+// #if KDE_VERSION_MAJOR >= 3
+ QValueVector<upsVarDef>::iterator it;
+// #else
+// QValueList<upsVar>::Iterator it;
+// #endif
+// #else
+// QValueList<upsVar>::Iterator it;
+// #endif
+ for (it = m_listVars.begin(); it != m_listVars.end(); it++) {
+ if ((*it).upsEnumValues != 0) {
+ (*it).upsEnumValues->clear();
+ delete (*it).upsEnumValues;
+ }
+ }
+ m_listVars.clear();
+ m_listIComms.clear();
+ }
+
+void KNutNet::genStatusFlags (QString value) {
+ m_upsStatusVar = 0;
+ QTextIStream inputStream(&value);
+ QString word;
+ while (!inputStream.atEnd()) {
+ inputStream >> word;
+ if (word == "OFF") m_upsStatusVar +=OFF;
+ if (word == "OL") m_upsStatusVar +=OL;
+ if (word == "OB") m_upsStatusVar +=OB;
+ if (word == "LB") m_upsStatusVar +=LB;
+ if (word == "CAL") m_upsStatusVar +=CAL;
+ if (word == "TRIM") m_upsStatusVar +=TRIM;
+ if (word == "BOOST") m_upsStatusVar +=BOOST;
+ if (word == "OVER") m_upsStatusVar +=OVER;
+ if (word == "RB") m_upsStatusVar +=RB;
+ if (word == "WAIT") m_upsStatusVar = WAIT;
+ //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 kalibrace
+ //OVER - 128 ups je pretizena
+ //RB - 256 ups pozaduje vymenu baterie
+ //WAIT - 512 ups zada o strpeni // UPS asks for waiting
+ }
+ }
+
+
+int KNutNet::getDescription1 (bool always) {
+
+ if (always || (! m_description)) {
+ QCString inBuffer;
+ QString outBuffer;
+
+ QValueVector<upsVarDef>::iterator itv;
+ QValueVector<upsICommDef>::iterator itc;
+ for (itv = m_listVars.begin(); itv != m_listVars.end(); itv++) {
+ //nacteme promenou
+ inBuffer = "VARDESC " + (*itv).upsVarName + "\n";
+ if ((m_error = newDescription (inBuffer, (*itv).upsDescription))) {
+ //netMutex.unlock();
+// netMutex=false;
+ return m_error;
+ }
+ }
+ for (itc = m_listIComms.begin(); itc != m_listIComms.end(); itc++) {
+ //nacteme promenou
+ inBuffer = "INSTCMDDESC "+(*itc).upsCommName+"\n";
+ if ((m_error = newDescription (inBuffer, (*itc).upsDescription))) {
+ //netMutex.unlock();
+ //netMutex=false;
+ return m_error;
+ }
+ }
+ //netMutex=false;
+ m_description = true;
+ }
+ return 0;
+ }
+
+
+
+int KNutNet::getDescription2 (bool always) {
+
+ if (always || (! m_description)) {
+ QCString inBuffer;
+ QString outBuffer;
+ QString upsNameRet;
+ QString varName;
+ QString value;
+ int typeValue;
+ int lenString;
+
+ QValueVector<upsVarDef>::iterator itv;
+ QValueVector<upsICommDef>::iterator itc;
+ for (itv = m_listVars.begin(); itv != m_listVars.end(); itv++) {
+ //nacteme promenou
+ inBuffer = "GET DESC " + m_upsName + " " + (*itv).upsVarName+"\n";
+
+ if (!(m_error=getUpsData (inBuffer,outBuffer))) {
+ outBuffer=outBuffer.stripWhiteSpace ();
+ if ( !outBuffer.isEmpty() ) {
+ int key = parseLine(outBuffer, upsNameRet, varName, value, typeValue, lenString);
+ switch (key) {
+ case DESC:
+ (*itv).upsDescription = value;
+ break;
+ case ERR:
+ m_error=upsTranslateError(value);
+ return m_error;
+ default:
+ m_error=UnknownAnswer;
+ return m_error;
+ }
+ }
+ else {
+ m_error = NoData;
+ return m_error;
+ }
+ }
+ else {
+ return m_error;
+ }
+ }
+ for (itc = m_listIComms.begin(); itc != m_listIComms.end(); itc++) {
+ //nacteme promenou
+ inBuffer = "GET CMDDESC " + m_upsName + " " + (*itc).upsCommName+"\n";
+ if (!(m_error=getUpsData (inBuffer,outBuffer))) {
+ outBuffer=outBuffer.stripWhiteSpace ();
+ if ( !outBuffer.isEmpty() ) {
+ int key = parseLine(outBuffer, upsNameRet, varName, value, typeValue, lenString);
+ switch (key) {
+ case CMDDESC:
+ (*itc).upsDescription = value;
+ break;
+ case ERR:
+ m_error=upsTranslateError(value);
+ return m_error;
+ default:
+ m_error=UnknownAnswer;
+ return m_error;
+ }
+ }
+ else {
+ m_error = NoData;
+ return m_error;
+ }
+ }
+ else {
+ return m_error;
+ }
+ }
+ m_description = true;
+ }
+ return 0;
+ }
+
+
+
+int KNutNet::getUpsVars1 ( void) {
+// getUpsVars nacte promene a jejich typ
+// vraci kod chyby nebo 0 pokud je vse v poradku
+ QCString inBuffer;
+ QString outBuffer;
+ QString varOutBuffer;
+ upsVarDef upsVar;
+ upsICommDef upsIComm;
+
+ // init vars and lists
+ if (!m_upsName.isEmpty()) { // pokud upsName neni je vzdy nastaveno na null
+ inBuffer="LISTVARS ";
+ inBuffer.append(m_upsName);
+ inBuffer.append("\n");
+ }
+ else inBuffer ="LISTVARS\n";
+
+ if (!(m_error=getUpsData (inBuffer,outBuffer))) {
+ outBuffer=outBuffer.stripWhiteSpace ();
+ if (outBuffer.length() > 0) {
+ // precteme data
+ QTextIStream inputStream(&outBuffer);
+ QString word;
+ int count =1 ;
+ while (!inputStream.atEnd()) {
+ inputStream >> word;
+ switch (count) {
+ case 1:
+ // vyndame prvni polozku
+ if (word == "VARS") count++;
+ else {
+ if (word == "ERR") {
+ inputStream >> word;
+ m_error = upsTranslateError(word);
+ }
+ else m_error=UnknownAnswer;
+ return m_error;
+ }
+ break;
+ case 2:
+ count++;
+ if ((word.length() > 0) && word.startsWith("@")) break;
+ default:
+ // pridame polozku do tabulky
+ upsSetType(upsVar, word);
+ m_listVars.push_back(upsVar);
+ m_numberVars++;
+ break;
+ }
+ }
+ }
+ else { m_error=NoData; return m_error; }
+ }
+ else return m_error;
+
+ if ((m_error = getUpsValues1(true))) return m_error;
+
+ // *********** RW VARIABLES
+ if (!m_upsName.isEmpty()) { // pokud upsName neni je vzdy nastaveno na null
+ inBuffer="LISTRW ";
+ inBuffer.append(m_upsName);
+ inBuffer.append("\n");
+ }
+ else inBuffer ="LISTRW\n";
+
+ if (!(m_error=getUpsData (inBuffer,outBuffer))) {
+ outBuffer=outBuffer.stripWhiteSpace();
+ if (!outBuffer.isEmpty()) {
+ // precteme data
+ QTextIStream inputStream(&outBuffer);
+ QString word;
+ int count =1 ;
+ bool valueType;
+ int varMax;
+ while (!inputStream.atEnd()) {
+ inputStream >> word;
+ switch (count) {
+ case 1:
+ // vyndame prvni polozku
+ if (word == "RW") count++;
+ else {
+ if (word == "ERR") {
+ inputStream >> word;
+ m_error = upsTranslateError(word);
+ }
+ else m_error=UnknownAnswer;
+ return m_error;
+ }
+ break;
+ case 2:
+ count++;
+ if ((word.length() > 0) && word.startsWith("@")) break;
+ default:
+ // Zpracujeme polozku v tabulce
+ // zjistime informaci o promene
+ inBuffer="VARTYPE ";
+ inBuffer.append(word);
+ if (!m_upsName.isEmpty()) {
+ inBuffer.append("@"); // pokud upsName neni je vzdy nastaveno na null
+ inBuffer.append(m_upsName);
+ }
+ inBuffer.append("\n");
+ if (!(m_error=getUpsData (inBuffer,varOutBuffer))) {
+ varOutBuffer=varOutBuffer.stripWhiteSpace();
+ if ( !outBuffer.isEmpty() ) {
+ QTextIStream varInputStream(&varOutBuffer);
+ QString word1, word2, word3;
+ varInputStream >> word1;
+ varInputStream >> word2;
+ varInputStream >> word3;
+ if (word1 == "TYPE") {
+ if ((word2.isEmpty()) || (word3.isEmpty())) {
+ m_error=UnknownFormat;
+ return m_error;
+ }
+ if (word2 == "ENUM") valueType=false;
+ else {
+ if (word2 =="STRING") valueType=true;
+ else {
+ m_error=UnknownFormat;
+ return m_error;
+ }
+ }
+ bool ok = true;
+ varMax=word3.toInt(&ok);
+ if (!ok) {m_error=UnknownFormat; return m_error;};
+ } // word1 = Type
+ else {
+ if (word1=="ERR") {
+ m_error = upsTranslateError(word2);
+ return m_error;
+ }
+ else {
+ m_error = UnknownAnswer;
+ return m_error;
+ }
+ }
+ }
+ else { m_error=NoData; return m_error; }
+ }
+ else return m_error;
+ // ********** ENUM / STRING ******************
+
+ QValueVector<QString>* enumString=0;
+ if (!valueType) {
+ // nacteme enum hodnoty
+ inBuffer="ENUM ";
+ inBuffer.append(word);
+ // pokud existuje pridame jmeno UPS-ky
+ if (!m_upsName.isEmpty()) {
+ inBuffer.append("@");
+ inBuffer.append(m_upsName);
+ }
+ inBuffer.append("\n");
+ if (!(m_error=getUpsData (inBuffer,varOutBuffer,"END\n"))) {
+// varOutBuffer.stripWhiteSpace(); nemuze provest protoze bychom si odstranili konce radek
+ if (!varOutBuffer.isEmpty()) {
+ QString inLine, word1, word2;
+ QTextIStream varInputStream(&varOutBuffer);
+ int inCountLine=1;
+ while (!(inLine = varInputStream.readLine()).isNull()) {
+ inLine=inLine.stripWhiteSpace();
+
+ if ((m_posChar=inLine.find(' ')) == -1) word1=inLine;
+ else {
+ word1=inLine.left(m_posChar);
+ inLine = inLine.mid(m_posChar+1);
+ }
+ if (word1.isEmpty()) { m_error = UnknownFormat; return m_error; }
+ if (inCountLine == 1) {
+ if ((m_posChar=inLine.find(' ')) == -1) word2=inLine;
+ else word2=inLine.left(m_posChar);
+ if (word1 =="ENUM") {
+ if (word2 != word) { m_error = UnknownFormat; return m_error; }
+ varMax=0;
+ inCountLine++;
+ enumString = new QValueVector<QString>;
+ enumString->clear();
+ }
+ else {
+ if (word1=="ERR")
+ m_error=upsTranslateError(word2); // prevede chybu na jeji kod
+ else m_error=UnknownAnswer;
+ return m_error;
+ }
+ }
+ else {
+ if (word1 == "END") break;
+ if (word1 != "OPTION") { m_error = UnknownFormat; return m_error; }
+ if ((m_posChar = inLine.find('\"')) == -1) word2 = "";
+ else {
+ word2 = inLine.mid(m_posChar+1);
+ if ((m_posChar=word2.find('\"')) != -1) word2 = word2.left(m_posChar);
+ }
+ enumString->push_back(word2);
+ varMax++;
+ }
+ } // end while
+ } // buffer is not empty
+ else { m_error = NoData ; return m_error; }
+ } // getUpsData
+ else return m_error;
+ } // type of var
+ else enumString = 0l;
+ // nacteme stringovou promenou
+ // ulozime promene
+ setRWVars (word,valueType,varMax,enumString);
+ m_numberRWVars++;
+ break;
+ }
+ } // end while (!inputStream.atEnd())
+ }
+ else { m_error = NoData ; return m_error; }
+ }
+ else return m_error;
+
+ // *************** INSTANT COMMAND
+ if (!m_upsName.isEmpty()) { // pokud upsName neni je vzdy nastaveno na null
+ inBuffer="LISTINSTCMD ";
+ inBuffer.append(m_upsName);
+ inBuffer.append("\n");
+ }
+ else inBuffer ="LISTINSTCMD\n";
+
+ if (!(m_error=getUpsData (inBuffer,outBuffer))) {
+ outBuffer=outBuffer.stripWhiteSpace ();
+ if ( !outBuffer.isEmpty() ) {
+ // precteme data
+ QTextIStream inputStream(&outBuffer);
+ QString word;
+ int count =1 ;
+ while (!inputStream.atEnd()) {
+ inputStream >> word;
+ switch (count) {
+ case 1:
+ // vyndame prvni polozku
+ if (word == "INSTCMDS") count++;
+ else {
+ if (word == "ERR") {
+ inputStream >> word;
+ m_error = upsTranslateError(word);
+ }
+ else m_error=UnknownAnswer;
+ return m_error;
+ }
+ break;
+ case 2:
+ count++;
+ if ((word.length() > 0) && word.startsWith("@")) break;
+ default:
+ // Zpracujeme polozku v tabulky
+ upsIComm.upsCommName=word;
+ upsIComm.upsDescription="";
+ m_listIComms.push_back(upsIComm);
+ m_numberIComms++;
+ break;
+ }
+ }
+ }
+ else { m_error=NoData; return m_error; }
+ }
+ else return m_error;
+ return 0;
+ }
+
+
+
+int KNutNet::getUpsVars2 ( void) {
+ QCString inBuffer;
+ QString outBuffer;
+ QString varOutBuffer;
+ upsVarDef upsVar;
+ upsICommDef upsIComm;
+ int key;
+ int typeValue;
+ int lenString;
+ int varMax=0;
+
+ QValueVector<QString>* enumString=0;
+ inBuffer = "LIST VAR " + m_upsName + "\n";
+ if (!(m_error=getUpsData (inBuffer,outBuffer,"END LIST VAR"))) {
+ QString inLine, upsNameRet, varName, varNameRet, value;
+ bool beginList = false;
+ QTextIStream varInputStream(&outBuffer);
+ while (!(inLine = varInputStream.readLine()).isNull()) {
+
+ key = parseLine (inLine, upsNameRet, varName, value, typeValue, lenString);
+ switch (key) {
+ case BEGIN_LIST_VAR:
+ if (upsNameRet == m_upsName) beginList = true;
+ break;
+ case VAR:
+ if (beginList ) {
+ upsSetType(upsVar, varName, value);
+
+ if (varName == "ups.status") genStatusFlags(value);
+ inBuffer = "GET TYPE " + m_upsName + " " + varName +"\n";
+ if (!(m_error=getUpsData (inBuffer,varOutBuffer))) {
+ key = parseLine (varOutBuffer, upsNameRet, varNameRet, value, typeValue, lenString);
+ switch (key) {
+ case TYPE:
+ if (typeValue & RW_FLAG) {
+ upsVar.upsVarMax = 0;
+ upsVar.upsEnumValues=0L;
+ if (typeValue & ENUM_FLAG) {
+ upsVar.upsValueType=false;
+ // nacteme enumValues
+ inBuffer = "LIST ENUM " + m_upsName + " " + varName +"\n";
+ if (!(m_error=getUpsData (inBuffer,varOutBuffer,"END LIST ENUM"))) {
+ bool beginEnumList = false;
+ QTextIStream varInputStream(&varOutBuffer);
+ while (!(inLine = varInputStream.readLine()).isNull()) {
+ key = parseLine (inLine, upsNameRet, varName, value, typeValue, lenString);
+ switch (key) {
+ case BEGIN_LIST_ENUM:
+ beginEnumList = true;
+ varMax=0;
+ enumString = new QValueVector<QString>;
+ enumString->clear();
+ upsVar.upsEnumValues=enumString;
+ break;
+ case ENUM:
+ if (beginList ) {
+ enumString->push_back(value);
+ varMax++;
+ }
+ break;
+ case ERR:
+ m_error = upsTranslateError(value);
+ return m_error;
+ default:
+ m_error=UnknownAnswer;
+ return m_error;
+ case END_LIST_ENUM:
+ upsVar.upsVarMax=varMax;
+ break;
+ }
+ }
+ }
+ }
+ else {
+ // Vse co nenini ENUM je STRING
+ upsVar.upsValueType=true;
+ upsVar.upsVarMax=lenString;
+ }
+ upsVar.upsVarType=false;
+ m_numberRWVars++;
+ }
+ break;
+ case ERR:
+ m_error = upsTranslateError(value);
+ return m_error;
+ default:
+ m_error=UnknownAnswer;
+ return m_error;
+ }
+ }
+ else { return m_error; }
+ m_listVars.push_back(upsVar);
+ m_numberVars++;
+ }
+ break;
+ case END_LIST_VAR:
+ break;
+ case ERR:
+ m_error = upsTranslateError(value);
+ return m_error;
+ default:
+ m_error=UnknownAnswer;
+ return m_error;
+ } // end switch
+ } // end while
+ }
+ else { return m_error; }
+ // INSTANT COMMANDS
+
+ inBuffer = "LIST CMD " + m_upsName + "\n";
+ if (!(m_error=getUpsData (inBuffer,outBuffer,"END LIST CMD"))) {
+
+ QString inLine, upsNameRet, varName, value;
+ int key, typeValue;
+ bool beginList = false;
+//std::cout << "CMD Buffer " << outBuffer << std::endl;
+
+ QTextIStream varInputStream(&outBuffer);
+ while (!(inLine = varInputStream.readLine()).isNull()) {
+ key = parseLine (inLine, upsNameRet, varName, value, typeValue, lenString);
+//std::cout << "CMD Line " << inLine << std::endl;
+
+ switch (key) {
+ case BEGIN_LIST_CMD: {
+ if (upsNameRet == m_upsName) beginList = true;
+ break;
+ }
+ case CMD:
+ if (beginList ) {
+ // Zpracujeme polozku v tabulky
+ upsIComm.upsCommName=varName;
+ upsIComm.upsDescription="";
+ m_listIComms.push_back(upsIComm);
+ m_numberIComms++;
+ }
+ break;
+ case END_LIST_CMD:
+ break;
+ case ERR:
+ m_error = upsTranslateError(value);
+ return m_error;
+ default:
+ m_error=UnknownAnswer;
+ return m_error;
+ } // end switch
+ } // end while
+ }
+ else { return m_error; }
+ return 0;
+ }
+
+
+
+int KNutNet::getUpsValues1 (const bool allVars ) {// allVars = true vse; allVars = false jen activate
+ QString endChar;
+ QCString inBuffer;
+ QString outBuffer;
+ QValueVector<upsVarDef>::iterator it;
+
+ // Nacte hodnotu promenych
+ // reads value of variables
+
+
+ emit getVarDesc (m_numberVars, 0);
+
+ int numberVar = 0;
+ for (it = m_listVars.begin(); it != m_listVars.end(); it++) {
+ numberVar++;
+ if ((allVars) || ((*it).upsVarActivate)) {
+ //nacteme promenou
+ inBuffer = "REQ ";
+ inBuffer.append((*it).upsVarName);
+ if (!m_upsName.isEmpty()) { // pokud upsName neni je vzdy nastaveno na null
+ inBuffer.append("@");
+ inBuffer.append(m_upsName);
+ }
+ inBuffer.append("\n");
+// if (!(error=getUpsData (inBuffer,outBuffer))) {
+ m_error=getUpsData (inBuffer,outBuffer);
+ // when outBuffer is empty sends and reads date again, but only the only time
+ if ((!(m_error)) && (outBuffer.isEmpty())) m_error=getUpsData (inBuffer,outBuffer);
+ if (!(m_error)) {
+
+ endChar = "";
+ if ((outBuffer.length()>0) && (outBuffer.at(outBuffer.length()-2)==' ')) endChar=' ';
+
+ outBuffer=outBuffer.stripWhiteSpace ();
+ outBuffer += endChar;
+ emit getVarDesc (m_numberVars, numberVar);
+
+ if ( !outBuffer.isEmpty() ) {
+ QTextIStream inputStream(&outBuffer);
+ QString word1, word2, word3 ;
+ inputStream >> word1;
+ inputStream >> word2;
+ if (inputStream.atEnd()) { // neexistuje treti cast VALUE
+ if (word1 == "ERR") {
+ // vracena chyba
+ m_error=upsTranslateError(word2);
+ return m_error;
+ }
+ else {
+// if ((word2 != "MODEL") && (word2 != "MFR")) {
+ if (endChar != " ") { // if values of variable is empty, string is ended on char space
+ m_error=UnknownFormat;
+ return m_error;
+ }
+ }
+ }
+ inputStream >> word3;
+ if (word1 == "ANS") {
+ // answer - odpoved
+ // odstranime pripadne jmeno upsky
+ if ((m_posChar = word2.find('@')) != -1) word2 = word2.left(m_posChar);
+ if ( word2 != (*it).upsVarName ) {
+ m_error=UnknownAnswer;
+ return m_error;// neni to odpoved na spravnou promennou
+ }
+ // test pro starsi format modulu, vraceli chybu v hodnote promene
+ if ((m_error=upsOldTranslateError(word3))) {
+ return m_error;
+ }
+ // zalozime hodnotu do vectoru;
+ (*it).upsValue=word3;
+ if ((*it).upsVarName == "STATUS") {
+ // dogenerujeme dalsi slova pro status
+ word3 += inputStream.readLine();
+ genStatusFlags(word3);
+ }
+ }
+ else {
+ // neznama odpoved - neni ANS ani ERR
+ m_error=UnknownAnswer;
+ return m_error;
+ }
+ }
+ else {
+ m_error=NoData;
+ return m_error;
+ }
+ }
+ else {
+ return m_error;
+ }
+ }
+ }
+ return 0;
+ }
+
+
+
+int KNutNet::getUpsValues2 (const bool allVars ) {// allVars = true vse; allVars = false jen activate
+ QString varName;
+ QString upsNameRet;
+ QString value;
+ int typeValue;
+ int lenString;
+
+ // reads value of variables
+ QCString inBuffer;
+ QString outBuffer;
+ QValueVector<upsVarDef>::iterator it;
+
+ emit getVarDesc (m_numberVars, 0);
+ int numberVar = 0;
+ for (it = m_listVars.begin(); it != m_listVars.end(); it++) {
+ numberVar++;
+ if ((allVars) || ((*it).upsVarActivate)) {
+ //reads variable
+ inBuffer = "GET VAR "+m_upsName+" "+(*it).upsVarName+"\n";
+// if (!(error=getUpsData (inBuffer,outBuffer))) {
+ m_error=getUpsData (inBuffer,outBuffer);
+ // when outBuffer is empty sends and reads date again, but only the only time
+ if ((!(m_error)) && (outBuffer.isEmpty())) m_error=getUpsData (inBuffer,outBuffer);
+ if (!(m_error)) {
+ outBuffer=outBuffer.stripWhiteSpace ();
+ emit getVarDesc (m_numberVars, numberVar);
+ if ( !outBuffer.isEmpty() ) {
+ int key = parseLine(outBuffer, upsNameRet, varName, value, typeValue, lenString);
+ switch (key) {
+ case VAR:
+ if ( varName != (*it).upsVarName ) {
+ m_error=UnknownAnswer;
+ return m_error;// it isn't answer for right variable - neni to odpoved na spravnou promennou
+ }
+ (*it).upsValue=value;
+ if ((((*it).upsVarName == "STATUS") && (m_nutVariables == 1)) || (((*it).upsVarName == "ups.status") && (m_nutVariables == 2))) {
+ // dogenerujeme dalsi slova pro status
+ genStatusFlags(value);
+ }
+ break;
+ case ERR:
+ m_error=upsTranslateError(value);
+ return m_error;
+ default:
+ m_error=UnknownAnswer;
+ return m_error;
+ }
+ }
+ else {
+ m_error= NoData;
+ return m_error;
+ }
+ }
+ else {
+ return m_error;
+ }
+ }
+ }
+ return 0;
+ }
+
+
+int KNutNet::sendComm (const QString command, const QString arg1, const QString arg2, const bool useUpsName) {
+ int localError;
+// nenastavi promenou error ale nenuluje ji
+ QCString inBuffer;
+ QString outBuffer;
+
+ switch (m_nutProtocol) {
+ case 1:
+ inBuffer=command + " " + arg1;
+ if (useUpsName && (!m_upsName.isEmpty())) // pokud upsName neni je vzdy prazdne
+ inBuffer += "@"+m_upsName;
+ if (!arg2.isEmpty()) inBuffer += " " + arg2;
+ break;
+ case 2:
+ inBuffer = command + " ";
+ if (useUpsName) inBuffer += m_upsName + " ";
+ inBuffer.append(arg1);
+ if (!arg2.isEmpty()) inBuffer += " \"" + arg2 +"\"";
+ break;
+ }
+ inBuffer.append("\n");
+
+ if (!(localError=getUpsData (inBuffer,outBuffer))) {
+ outBuffer=outBuffer.stripWhiteSpace();
+ QTextIStream inputStream(&outBuffer);
+ QString word1, word2;
+ inputStream >> word1;
+ inputStream >> word2;
+ if (word1.isEmpty()) return UnknownAnswer; // zadna odpoved
+ if (word1 != "OK") {
+ // neni rovno OK
+ if (word1 == "ERR") return upsTranslateError (word2);
+ else return UnknownAnswer;
+ }
+ else return 0;
+ }
+ else return localError;
+ }
+
+
+int KNutNet::activate ( const QString name, const bool setActivate ) {
+ m_error =0;
+ if (m_state == Connected) {
+ QValueVector<upsVarDef>::iterator it;
+ for (it = m_listVars.begin(); it != m_listVars.end(); it++) {
+ if ((*it).upsVarName == name) {
+ (*it).upsVarActivate = setActivate;
+ return 0;
+ }
+ }
+ m_error = VarNotFind;
+ return m_error;
+ }
+ else return NotConnection;
+ }
+
+int KNutNet::activateAll ( const bool setActivate ) {
+ m_error =0;
+ if (m_state == Connected) {
+ QValueVector<upsVarDef>::iterator it;
+ for (it = m_listVars.begin(); it != m_listVars.end(); it++) {
+ (*it).upsVarActivate = setActivate;
+ }
+ return 0;
+ }
+ else return NotConnection;
+ }
+
+
+int KNutNet::upsTranslateError (const QString string) {
+ if (string == "VAR-NOT-SUPPORTED") return VarNotSupported;
+ if (string == "VAR-UNKNOWN") return VarUnknown;
+
+ if (string == "ACCESS-DENIED") return AccessDenied;
+ if (string == "PASSWORD-REQUIRED") return PasswordRequired;
+ if (string == "PASSWORD-INCORRECT") return PasswordIncorrect;
+ if (string == "UNKNOWN-UPS") return UnknownUps;
+ if (string == "ALREADY-LOGGED_IN") return AlreadyLoggedIn;
+ if (string == "ALREADY-SET-PASSWORD") return AlreadySetPassword;
+ if (string == "ALREADY-SET-USERNAME") return AlreadySetUsername;
+ if (string == "UNKNOWN-COMMAND") return UnknownCommand;
+
+ if (string == "UNKNOWN-INSTCMD") return UnknownInstCmd;
+ if (string == "CMD-NOT-SUPPORTED") return CmdNotSupported;
+
+ if (string == "INVALID-VALUE") return InvalidValue;
+
+ if (string == "NO-RESPONSE") return NoResponse;
+ if (string == "UNKNOWN-REPLY") return UnknownReply;
+ if (string == "NOT-IMPLEMENTED") return NotImplemented;
+ if (string == "COMMAND-FAILED") return CommandFailed;
+
+ if (string == "MISSING-ARGUMENT") return MissingArgument;
+ if (string == "DATA-STALE") return DataStale;
+ if (string == "UNKNOWN-TYPE") return UnknownType;
+
+ if (string == "DRIVER-NOT-CONNECTED") return DriverNotConnected;
+
+ if (string == "") return UnknownFormat;
+
+ return UnknownErr;
+ }
+
+int KNutNet::upsOldTranslateError (const QString string) {
+ if (string == "NOT-SUPPORTED") return VarNotSupported;
+ if (string == "UNKNOWN") return VarUnknown;
+ if (string == "DATA-STALE") return DataStale;
+ return 0; // nebylo nalezeno
+ }
+
+//--------------------Socket----------------
+
+
+void KNutNet::slotConnectionError(int error) {
+//std::cout << "--KNutNet::slotConnectionError" << std::endl;
+//qDebug ("--KNutNet::slotConnectionError");
+
+ m_state = ConnectError;
+ m_unConnectTimer->stop();
+ if (error == QSocket::ErrHostNotFound) {
+ error = NoSuchHost;
+ emit connectionError(error);
+ return;
+ }
+ //connection was refused // no connection
+ if ((error == QSocket::ErrConnectionRefused) && (m_commandSocket->state()==QSocket::Idle)) {
+ if (m_firstConnect) {
+ if (m_numberConnection < m_countRepeat) {
+ m_numberConnection++;
+// qDebug ("--KNutNet:: connect error - try connect on next time");
+ m_unConnectTimer->start( m_delay, TRUE );
+ }
+ else {
+ // i don't connect server
+ error=CantConnect;
+// qDebug("--KNutNet::emit - connection error ");
+ emit connectionError(error);
+ return;
+ }
+ } // end of if (firstConnection)
+ else {
+ // connecting is down, try repeated connection
+
+// qDebug ("--KNutNet::no first connect connection error ");
+ m_unConnectTimer->start( m_delay, TRUE );
+ }
+ return;
+ }
+ if (error == QSocket::ErrConnectionRefused) {
+ error = ConnectionRefused;
+// std::cout << "--KNutNet::connection error ErrConnectionRefused " << QSocket::Idle << " - " << error << std::endl;
+ emit connectionError(error);
+ return;
+ }
+ if (error == QSocket::ErrSocketRead) {
+ error = SocketReadErr;
+// std::cout << "--KNutNet::connection error QSocket::ErrSocketRead " << error << std::endl;
+ emit connectionError(error);
+ return;
+ }
+ }
+
+
+void KNutNet::slotConnected(void) {
+ int n;
+
+ if ((n = version (m_countRepeat, m_delay)) == 0) { // 0 OK, 0> error
+ if ((m_nutProtocol == 0) || (m_nutVariables == 0)) { // answer from upsd (VER) is unknown
+ m_error=NutProtocolVarErr;
+ m_state = Closing;
+ m_commandSocket->close();
+ while (m_commandSocket->state() == QSocket::Closing) {
+ sleep (100);
+ }
+ m_state = ConnectError;
+
+ return;
+ }
+ if ((m_nutProtocol == 2) && m_upsName.isEmpty()) {
+ // if upsName is empty reads first ups name from upsd server
+ if ((m_error =KNutNet::getFirstUpsName (m_upsName))) { // reading first upsName
+ // upsd server doesn't support any ups
+ m_state = Closing;
+ m_commandSocket->close();
+ while (m_commandSocket->state() == QSocket::Closing) {
+ sleep (100);
+ }
+ m_state = ConnectError;
+
+ }
+ }
+ m_state=Connected;
+ }
+ else {
+ m_commandSocket->close();
+ }
+ emit firstConnection();
+// std::cout << "KNutNet::emit - firstConnection" << std::endl;
+ }
+
+void KNutNet::slotHostFound(void) {
+
+// std::cout << "--KNutNet::slotHostFound" << std::endl;
+ m_state = Connecting;
+ emit hostFound();
+ }
+
+
+void KNutNet::slotConnectionClosed(void) {
+
+// std::cout << "--KNutNet::slotConnectionClosed" << std::endl;
+ m_unConnectTimer->stop();
+ deleteVars();
+ m_state = Idle;
+ emit connectionClosed();
+ }
+
+
+
+void KNutNet::slotTimerReconnect(void) {
+// std::cout << "--KNutNet::slotTimerReconnect" << std::endl;
+
+ m_unConnectTimer->stop();
+ if (m_commandSocket->state()==QSocket::Idle) {
+ //std::cout << "--KNutNet::slotTimerReconnect QSOcket::Idle" << std::endl;
+ emit tryRepeatFirstConnection(m_numberConnection);
+ // std::cout << "KNutNet::emit-tryRepeatFirstConnection" << std::endl;
+ m_state=Connecting;
+ if ( m_commandSocket->state() != QSocket::Connecting )
+ m_commandSocket->connectToHost(m_upsAddress,m_port);
+ }
+ }
+
+
+#include "knutnet.moc"
diff --git a/src/knutnet.h b/src/knutnet.h
new file mode 100755
index 0000000..00b8e9a
--- /dev/null
+++ b/src/knutnet.h
@@ -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
+
diff --git a/src/knutnewupsdlg.cpp b/src/knutnewupsdlg.cpp
new file mode 100644
index 0000000..6cdd2b9
--- /dev/null
+++ b/src/knutnewupsdlg.cpp
@@ -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"
diff --git a/src/knutnewupsdlg.h b/src/knutnewupsdlg.h
new file mode 100644
index 0000000..447c089
--- /dev/null
+++ b/src/knutnewupsdlg.h
@@ -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
diff --git a/src/knutpanelmeter.cpp b/src/knutpanelmeter.cpp
new file mode 100644
index 0000000..e27a246
--- /dev/null
+++ b/src/knutpanelmeter.cpp
@@ -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"
diff --git a/src/knutpanelmeter.h b/src/knutpanelmeter.h
new file mode 100644
index 0000000..3bc8d47
--- /dev/null
+++ b/src/knutpanelmeter.h
@@ -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
diff --git a/src/knutprefdlg.cpp b/src/knutprefdlg.cpp
new file mode 100644
index 0000000..68ce4ce
--- /dev/null
+++ b/src/knutprefdlg.cpp
@@ -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"
diff --git a/src/knutprefdlg.h b/src/knutprefdlg.h
new file mode 100644
index 0000000..0628abd
--- /dev/null
+++ b/src/knutprefdlg.h
@@ -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
diff --git a/src/knutprintupsvar.cpp b/src/knutprintupsvar.cpp
new file mode 100644
index 0000000..bfd09e4
--- /dev/null
+++ b/src/knutprintupsvar.cpp
@@ -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"
+
diff --git a/src/knutprintupsvar.h b/src/knutprintupsvar.h
new file mode 100755
index 0000000..bded7ac
--- /dev/null
+++ b/src/knutprintupsvar.h
@@ -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
diff --git a/src/knutrwvar.cpp b/src/knutrwvar.cpp
new file mode 100755
index 0000000..20e45bc
--- /dev/null
+++ b/src/knutrwvar.cpp
@@ -0,0 +1,217 @@
+/***************************************************************************
+ knutrwvar.cpp - description
+ -------------------
+ begin : So rj 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"
diff --git a/src/knutrwvar.h b/src/knutrwvar.h
new file mode 100755
index 0000000..4cef64c
--- /dev/null
+++ b/src/knutrwvar.h
@@ -0,0 +1,140 @@
+/***************************************************************************
+ knutrwvar.h - description
+ -------------------
+ begin : So rj 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
diff --git a/src/knutupsdata.cpp b/src/knutupsdata.cpp
new file mode 100644
index 0000000..9a4a0b5
--- /dev/null
+++ b/src/knutupsdata.cpp
@@ -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;
+ }
+
diff --git a/src/knutupsdata.h b/src/knutupsdata.h
new file mode 100644
index 0000000..e258227
--- /dev/null
+++ b/src/knutupsdata.h
@@ -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
diff --git a/src/knutvardata.cpp b/src/knutvardata.cpp
new file mode 100755
index 0000000..86650bd
--- /dev/null
+++ b/src/knutvardata.cpp
@@ -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));
+ }
diff --git a/src/knutvardata.h b/src/knutvardata.h
new file mode 100755
index 0000000..6f112d5
--- /dev/null
+++ b/src/knutvardata.h
@@ -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
diff --git a/src/lo16-app-knutclient.png b/src/lo16-app-knutclient.png
new file mode 100644
index 0000000..8b8d655
--- /dev/null
+++ b/src/lo16-app-knutclient.png
Binary files differ
diff --git a/src/lo16-app-knutclientconn.png b/src/lo16-app-knutclientconn.png
new file mode 100644
index 0000000..a9901e1
--- /dev/null
+++ b/src/lo16-app-knutclientconn.png
Binary files differ
diff --git a/src/lo16-app-knutclienterr.png b/src/lo16-app-knutclienterr.png
new file mode 100644
index 0000000..114fc95
--- /dev/null
+++ b/src/lo16-app-knutclienterr.png
Binary files differ
diff --git a/src/lo32-app-knutclient.png b/src/lo32-app-knutclient.png
new file mode 100644
index 0000000..2c6d538
--- /dev/null
+++ b/src/lo32-app-knutclient.png
Binary files differ
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644
index 0000000..d3dabec
--- /dev/null
+++ b/src/main.cpp
@@ -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;
+}
diff --git a/stamp-h.in b/stamp-h.in
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/stamp-h.in