From 49059c82f49d86dfdaed8dfc2d8ee3c6f137f897 Mon Sep 17 00:00:00 2001 From: tariq Date: Fri, 17 Mar 2006 10:38:15 +0000 Subject: [PATCH] some work on AboutDlg, fixed problem with new databases git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@57 b624d157-de02-0410-bad0-e51aec6abb33 --- share/keepass/license.html | 678 +++++++++++++++--------------- src/Database.cpp | 6 + src/Database.h | 9 +- src/PwManager.cpp | 75 ++-- src/PwManager.h | 5 +- src/dialogs/AboutDlg.cpp | 18 + src/dialogs/SettingsDlg.cpp | 15 +- src/dialogs/SettingsDlg.h | 1 + src/forms/AboutDlg.ui | 34 +- src/forms/MainWindow.ui | 37 +- src/import/Import_KWalletXml.cpp | 2 +- src/main.cpp | 22 +- src/main.h | 1 + src/mainwindow.cpp | 40 +- src/mainwindow.h | 3 + src/translations/keepass-de_DE.ts | 266 +++++++----- src/translations/keepass-xx_XX.ts | 250 ++++++----- 17 files changed, 804 insertions(+), 658 deletions(-) diff --git a/share/keepass/license.html b/share/keepass/license.html index 804a20b..1dd7b51 100644 --- a/share/keepass/license.html +++ b/share/keepass/license.html @@ -1,339 +1,339 @@ -
                         GNU GENERAL PUBLIC LICENSE
-                           Version 2, June 1991
-
-     Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                           51 Franklin St, 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
-
-            Appendix: 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) 19yy  <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 St, 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) 19yy 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.
\ No newline at end of file +
                     GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       51 Franklin St, 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
+
+        Appendix: 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) 19yy  <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 St, 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) 19yy 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.
\ No newline at end of file diff --git a/src/Database.cpp b/src/Database.cpp index 3c500d1..2e43435 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -60,3 +60,9 @@ CGroup::~CGroup(){ CEntry::~CEntry(){ } + +Database::Database(){ +file=NULL; +KeyEncRounds=6000; +CryptoAlgorithmus=ALGO_AES; +} diff --git a/src/Database.h b/src/Database.h index a1d0a6d..7566289 100644 --- a/src/Database.h +++ b/src/Database.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005 by Tarek Saidi * + * Copyright (C) 2005-2006 by Tarek Saidi * * mail@tarek-saidi.de * * * * This program is free software; you can redistribute it and/or modify * @@ -22,6 +22,7 @@ #include #include +#include #include "lib/SecString.h" using namespace std; @@ -72,13 +73,15 @@ static bool UI_ExpandByDefault; }; - +#define ALGO_AES 0 +#define ALGO_TWOFISH 1 class Database{ public: + Database(); Q_UINT32 CryptoAlgorithmus; Q_UINT32 KeyEncRounds; - QString filename; + QFile* file; bool modflag; int SearchGroupID; QListGroups; diff --git a/src/PwManager.cpp b/src/PwManager.cpp index d203ebf..a1b2115 100755 --- a/src/PwManager.cpp +++ b/src/PwManager.cpp @@ -33,6 +33,8 @@ using namespace std; #include "PwManager.h" +#define _ERROR Errors << QString("Unexpected error in: %1, Line:%2").arg(__FILE__).arg(__LINE__); + QString PwDatabase::getError(){ if(Errors.size()){ QString r=Errors.front(); @@ -64,7 +66,7 @@ for(i=GroupIndex+1; iopen(QIODevice::ReadWrite)){ + if(!file->open(QIODevice::ReadOnly)){ + Errors << tr("Could not open file."); + delete file; + file=NULL; + return false; + } +} +total_size=file->size(); char* buffer = new char[total_size]; -file.readBlock(buffer,total_size); -file.close(); +file->readBlock(buffer,total_size); if(total_size < DB_HEADER_SIZE){ err=tr("Unexpected file size (DB_TOTAL_SIZE < DB_HEADER_SIZE)"); @@ -383,8 +390,7 @@ else if(FileSize == 64){ file.close(); return false;} file.close(); - if(!convHexToBinaryKey(hex,(char*)FileKey)) return false; - + if(!convHexToBinaryKey(hex,(char*)FileKey)){return false;} } else{ sha256_starts(&sha32); @@ -519,6 +525,9 @@ PwDatabase::~PwDatabase(){ } +void PwDatabase::newDatabase(){ + file=new QFile(); +} bool CEntry::ReadEntryField(Q_UINT16 FieldType, Q_UINT32 FieldSize, Q_UINT8 *pData){ @@ -586,9 +595,13 @@ switch(FieldType) bool PwDatabase::closeDatabase(){ Groups.clear(); Entries.clear(); +file->close(); +delete file; +file=NULL; return true; } + bool PwDatabase::saveDatabase(){ CGroup SearchGroup; Q_UINT32 NumGroups,NumEntries,Signature1,Signature2,Flags,Version; @@ -597,10 +610,18 @@ Q_UINT8 FinalRandomSeed[16]; Q_UINT8 ContentsHash[32]; Q_UINT8 EncryptionIV[16]; -if(filename==QString::null)return false; -QFile file(filename); -unsigned int FileSize; +Q_ASSERT(file); +if(!(file->openMode() & QIODevice::WriteOnly)){ + file->close(); +} +if(!file->isOpen()){ + if(!file->open(QIODevice::ReadWrite)){ + Errors << tr("Could not open file for writing."); + return false; + } +} +unsigned int FileSize; Entries+=UnkownMetaStreams; ///@FIXME ID conflicts??? FileSize=DB_HEADER_SIZE; @@ -806,7 +827,7 @@ if(CryptoAlgorithmus == ALGO_AES){ Rijndael aes; // Initialize Rijndael/AES if(aes.init(Rijndael::CBC, Rijndael::Encrypt, FinalKey,Rijndael::Key32Bytes, EncryptionIV) != RIJNDAEL_SUCCESS){ - //TODO:ERR_MSG + _ERROR delete [] buffer; return false;} EncryptedPartSize = (unsigned long)aes.padEncrypt((Q_UINT8*)buffer+DB_HEADER_SIZE, @@ -815,7 +836,7 @@ EncryptedPartSize = (unsigned long)aes.padEncrypt((Q_UINT8*)buffer+DB_HEADER_SIZ }else if(CryptoAlgorithmus == ALGO_TWOFISH){ CTwofish twofish; if(twofish.init(FinalKey, 32, EncryptionIV) == false){ -//TODO:ERR_MSG +_ERROR delete [] buffer; return false;} EncryptedPartSize = (unsigned long)twofish.padEncrypt((Q_UINT8*)buffer+DB_HEADER_SIZE, @@ -823,27 +844,20 @@ EncryptedPartSize = (unsigned long)twofish.padEncrypt((Q_UINT8*)buffer+DB_HEADER (Q_UINT8*)buffer+DB_HEADER_SIZE); } if((EncryptedPartSize > 2147483446) || (EncryptedPartSize == 0)){ -//TODO:ERR_MSG -delete [] buffer; -return false; -} - -if(file.open(QIODevice::ReadWrite | QIODevice::Truncate)==false){ -//TODO:ERR_MSG +_ERROR delete [] buffer; return false; } -if(file.writeBlock(buffer,EncryptedPartSize+DB_HEADER_SIZE)!=EncryptedPartSize+DB_HEADER_SIZE){ -//TODO:ERR_MSG -file.close(); +file->resize(0); //truncate +if(file->writeBlock(buffer,EncryptedPartSize+DB_HEADER_SIZE)!=EncryptedPartSize+DB_HEADER_SIZE){ delete [] buffer; return false; } +file->flush(); -file.close(); delete [] buffer; -if(SearchGroupID!=-1)Groups.push_back(SearchGroup); +//if(SearchGroupID!=-1)Groups.push_back(SearchGroup); return true; } @@ -990,6 +1004,7 @@ for(int i=0; i<64; i+=2){ return false;} memcpy(dst+(i/2),&bin,1); } +return true; } void PwDatabase::moveGroup(CGroup* group, CGroup* DstGroup, int pos){ @@ -1026,7 +1041,7 @@ else{ NumParentSubGroups=Groups.size();} if(pos==-1)DstIndex+=(NumParentSubGroups+1); -else{ int n=0; //Counter for direct (first-level) childs +else{ int n=0; //counter for direct (first-level) childs for(i=0; iLevel+1)n++; @@ -1311,8 +1326,8 @@ bool testDatabase(){ /* create a test database */ PwDatabase database; kp_assert(results, database.CalcMasterKeyByPassword(dbPassword)); - database.filename = dbPath; - database.CryptoAlgorithmus = ALGO_TWOFISH; + database.file = new QFile(dbPath); + database.CryptoAlgorithmus = ALGO_TWOFISH; CGroup* main = database.addGroup(NULL); CGroup* child = database.addGroup(main); @@ -1345,7 +1360,7 @@ bool testDatabase(){ PwDatabase cloneDatabase; kp_assert(results, cloneDatabase.CalcMasterKeyByPassword(dbPassword)); QString err; - bool loadedDB = cloneDatabase.loadDatabase(dbPath, err); + bool loadedDB = cloneDatabase.openDatabase(dbPath, err); if (!loadedDB){ kp_assert(results, loadedDB); cout << err.ascii() << endl; diff --git a/src/PwManager.h b/src/PwManager.h index 498141a..a1dcbf7 100755 --- a/src/PwManager.h +++ b/src/PwManager.h @@ -29,8 +29,6 @@ #define PWM_FLAG_ARCFOUR 4 #define PWM_FLAG_TWOFISH 8 #define PWM_STD_KEYENCROUNDS 6000 - #define ALGO_AES 0 - #define ALGO_TWOFISH 1 #include #include @@ -47,9 +45,10 @@ class PwDatabase:QObject,public Database{ public: PwDatabase(); ~ PwDatabase(); - bool loadDatabase(QString filename, QString& err); + bool openDatabase(QString filename, QString& err); bool saveDatabase(); bool closeDatabase(); + void newDatabase(); bool CalcMasterKeyByPassword(QString& password); bool CalcMasterKeyByFile(QString filename); bool CalcMasterKeyByFileAndPw(QString filename, QString& password); diff --git a/src/dialogs/AboutDlg.cpp b/src/dialogs/AboutDlg.cpp index 8263c75..ed0151d 100755 --- a/src/dialogs/AboutDlg.cpp +++ b/src/dialogs/AboutDlg.cpp @@ -32,6 +32,24 @@ CAboutDialog::CAboutDialog(QWidget* parent, const char* name, bool modal, Qt::WF setupUi(this); createBanner(Banner,Icon_Key32x32,tr("KeePassX %1").arg(KEEPASS_VERSION)); loadLicFromFile(); + +QString AboutTr=tr("Current Translation: None

","Please replace 'None' with the language of your translation"); +if(TrActive){ + AboutTr+=tr("Author: %1
").arg(tr("$TRANSALTION_AUTHOR")); + QString mail=tr("$TRANSLATION_AUTHOR_EMAIL","Here you can enter your email or homepage if you want."); + if(mail!=QString()){ + AboutTr+=mail+"
"; + } + AboutTr+="
"; +} +Edit_Translation->setText(AboutTr+tr("\ +Information on how to translate KeePassX can be found under:\n\ +http://keepass.berlios.de/translation-howto.html")); + +QString ThanksTemplate=QString("
%1
%2


"); + +Edit_Thanks->setText(ThanksTemplate.arg(tr("Matthias Miller")).arg(tr("http://www.outofhanwell.com/
Mac OS X Support"))); +//Edit_Thanks->setText(Edit_Thanks->text()+ThanksTemplate.arg(tr(" ")).arg(tr(" "))); } CAboutDialog::~CAboutDialog() diff --git a/src/dialogs/SettingsDlg.cpp b/src/dialogs/SettingsDlg.cpp index be7b2ae..25a9b88 100755 --- a/src/dialogs/SettingsDlg.cpp +++ b/src/dialogs/SettingsDlg.cpp @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include "SettingsDlg.h" @@ -37,6 +39,7 @@ connect(ButtonColor1, SIGNAL( clicked() ), this, SLOT( OnColor1() ) ); connect(ButtonColor2, SIGNAL( clicked() ), this, SLOT( OnColor2() ) ); connect(ButtonTextColor, SIGNAL( clicked() ), this, SLOT( OnTextColor() ) ); connect(CheckBox_OpenLast,SIGNAL(stateChanged(int)),this,SLOT(OnCeckBoxOpenLastChanged(int))); +connect(Button_MountDirBrowse,SIGNAL(clicked()),this,SLOT(OnMountDirBrowse())); createBanner(Banner,Icon_Settings32x32,tr("Settings")); CheckBox_OpenLast->setChecked(config.OpenLast); SpinBox_ClipboardTime->setValue(config.ClipboardTimeOut); @@ -142,9 +145,9 @@ if(state==Qt::Checked){ } } - -/*$SPECIALIZATION$*/ - - -//#include "settingsdlg.moc" - +void CSettingsDlg::OnMountDirBrowse(){ +QString dir=QFileDialog::getExistingDirectory(this,tr("Select a directory..."),"/"); +if(dir!=QString()){ + Edit_MountDir->setText(dir); +} +} diff --git a/src/dialogs/SettingsDlg.h b/src/dialogs/SettingsDlg.h index afcb7d4..99496c4 100755 --- a/src/dialogs/SettingsDlg.h +++ b/src/dialogs/SettingsDlg.h @@ -38,6 +38,7 @@ public slots: virtual void OnColor2(); virtual void OnColor1(); void OnCeckBoxOpenLastChanged(int state); + void OnMountDirBrowse(); private: QColor color1,color2,textcolor; diff --git a/src/forms/AboutDlg.ui b/src/forms/AboutDlg.ui index 0512a6f..6e94725 100644 --- a/src/forms/AboutDlg.ui +++ b/src/forms/AboutDlg.ui @@ -124,14 +124,14 @@ - 0 - 0 - 401 - 171 + 3 + 3 + 390 + 166 - - <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> + + true @@ -142,12 +142,15 @@ - 0 - 0 - 401 - 171 + 3 + 3 + 390 + 167 + + true + @@ -157,12 +160,15 @@ - 0 - 0 - 401 - 171 + 3 + 3 + 391 + 167 + + true + diff --git a/src/forms/MainWindow.ui b/src/forms/MainWindow.ui index ff59d63..10f2f1f 100644 --- a/src/forms/MainWindow.ui +++ b/src/forms/MainWindow.ui @@ -104,6 +104,9 @@ 60 + + true + @@ -219,40 +222,6 @@ - - - - 1 - 7 - 0 - 0 - - - - - 15 - 6 - - - - - 16777215 - 22 - - - - Qt::Horizontal - - - - 16 - 16 - - - - 4 - - New Database... diff --git a/src/import/Import_KWalletXml.cpp b/src/import/Import_KWalletXml.cpp index c4875dd..e10412a 100755 --- a/src/import/Import_KWalletXml.cpp +++ b/src/import/Import_KWalletXml.cpp @@ -72,7 +72,7 @@ for(int i=0;iPassword.setString(pw,true); } } -pwm->filename=""; +pwm->file=NULL; pwm->SearchGroupID=-1; pwm->CryptoAlgorithmus=ALGO_AES; pwm->KeyEncRounds=6000; diff --git a/src/main.cpp b/src/main.cpp index edcd655..c68b772 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -38,6 +38,7 @@ using namespace std; CConfig config; QString AppDir; +bool TrActive; QPixmap *Icon_Key32x32; QPixmap *Icon_Settings32x32; QPixmap *Icon_Search32x32; @@ -62,6 +63,7 @@ QIcon *Icon_EditSearch; QIcon *Icon_Configure; QIcon *Icon_Help; + inline void loadImages(); inline void parseCmdLineArgs(int argc, char** argv,QString &ArgFile,QString& ArgCfg); @@ -107,6 +109,7 @@ if(TrFound) else delete translator; +TrActive=TrFound; loadImages(); SecString::generateSessionKey(); int r=0; @@ -196,21 +199,10 @@ if(Img.load(AppDir+"/../share/keepass/icons/"+name)==false){ } -#ifndef Q_WS_X11 -#define _loadIcon(Icon,PATH)\ - {QImage img(ThemeDir+PATH);\ - Icon=new QIcon();\ - /*Icon->addPixmap(QPixmap::fromImage(img));*/\ - Icon->addPixmap(QPixmap::fromImage(img.scaled(16,16,Qt::IgnoreAspectRatio,Qt::SmoothTransformation)));\ - } -#else + #define _loadIcon(Icon,PATH)\ - {QImage img(ThemeDir+PATH);\ - Icon=new QIcon();\ - Icon->addPixmap(QPixmap::fromImage(img));\ - Icon->addPixmap(QPixmap::fromImage(img.scaled(16,16,Qt::IgnoreAspectRatio,Qt::SmoothTransformation)));\ - } -#endif + Icon=new QIcon(ThemeDir+PATH); + void loadImages(){ @@ -246,6 +238,7 @@ Icon_Search32x32=new QPixmap; *Icon_Search32x32=tmpImg; //-------------------------- + _loadIcon(Icon_FileNew,"/actions/filenew.png"); _loadIcon(Icon_FileOpen,"/actions/fileopen.png"); _loadIcon(Icon_FileSave,"/actions/filesave.png"); @@ -262,6 +255,7 @@ _loadIcon(Icon_EditOpenUrl,"/actions/run.png"); _loadIcon(Icon_EditSearch,"/actions/find.png"); _loadIcon(Icon_Configure,"/actions/configure.png"); _loadIcon(Icon_Help,"/actions/help.png"); + } diff --git a/src/main.h b/src/main.h index 8ebc64b..5a48eda 100644 --- a/src/main.h +++ b/src/main.h @@ -39,6 +39,7 @@ void showErrMsg(const QString& msg,QWidget* parent=NULL); extern CConfig config; extern QString AppDir; +extern bool TrActive; extern QPixmap *EntryIcons; extern QPixmap *Icon_Key32x32; extern QPixmap *Icon_Settings32x32; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 9d0ec01..c6ea876 100755 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -63,8 +63,6 @@ KeepassMainWindow::KeepassMainWindow(QWidget *parent, Qt::WFlags flags):QMainWin setupUi(this); setGeometry(geometry().x(),geometry().y(),config.MainWinWidth,config.MainWinHeight); splitter->setSizes(QList() << config.MainWinSplit1 << config.MainWinSplit2); - QuickSearchEdit=new QLineEdit(toolBar); - QuickSearchEdit->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); setupIcons(); setupToolbar(); setStateFileOpen(false); @@ -75,6 +73,7 @@ KeepassMainWindow::KeepassMainWindow(QWidget *parent, Qt::WFlags flags):QMainWin statusBar()->addWidget(StatusBarGeneral,15); statusBar()->addWidget(StatusBarSelection,85); statusBar()->setVisible(config.ShowStatusbar); + CGroup::UI_ExpandByDefault=config.ExpandGroupTree; setupConnections(); FileOpen=false; Clipboard=QApplication::clipboard(); @@ -138,6 +137,8 @@ void KeepassMainWindow::setupConnections(){ connect(&ClipboardTimer, SIGNAL(timeout()), this, SLOT(OnClipboardTimeOut())); connect(GroupView,SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),this, SLOT(OnCurrentGroupChanged(QTreeWidgetItem*,QTreeWidgetItem*))); + connect(GroupView,SIGNAL(itemExpanded(QTreeWidgetItem*)),this,SLOT(OnItemExpanded(QTreeWidgetItem*))); + connect(GroupView,SIGNAL(itemCollapsed(QTreeWidgetItem*)),this,SLOT(OnItemCollaped(QTreeWidgetItem*))); connect(EntryView,SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),this, SLOT(OnEntryItemDoubleClicked(QTreeWidgetItem*,int))); connect(EntryView,SIGNAL(itemSelectionChanged()), this, SLOT(OnEntrySelectionChanged())); @@ -148,6 +149,9 @@ void KeepassMainWindow::setupConnections(){ } void KeepassMainWindow::setupToolbar(){ + toolBar=new QToolBar(this); + addToolBar(toolBar); + toolBar->setIconSize(QSize(16,16)); toolBar->addAction(FileNewAction); toolBar->addAction(FileOpenAction); toolBar->addAction(FileSaveAction); @@ -159,6 +163,8 @@ void KeepassMainWindow::setupToolbar(){ toolBar->addAction(EditPasswordToClipboardAction); toolBar->addAction(EditUsernameToClipboardAction); toolBar->addSeparator(); + QuickSearchEdit=new QLineEdit(toolBar); + QuickSearchEdit->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); toolBar->addWidget(QuickSearchEdit); } @@ -261,7 +267,7 @@ if(PasswordDlg.password!="" && PasswordDlg.keyfile!="") db->CalcMasterKeyByFileAndPw(PasswordDlg.keyfile,PasswordDlg.password); QString err; StatusBarGeneral->setText(tr("Loading Database...")); -if(db->loadDatabase(filename,err)==true){ +if(db->openDatabase(filename,err)==true){ //SUCCESS if(config.OpenLast)config.LastFile=filename; setCaption(tr("Keepass - %1").arg(filename)); @@ -274,7 +280,7 @@ else{ //ERROR delete db; StatusBarGeneral->setText(tr("Loading Failed")); -if(err=="")err=tr("Unknown error in PwDatabase::loadDatabase()"); +if(err=="")err=tr("Unknown error in PwDatabase::openDatabase()"); QMessageBox::critical(this,tr("Error") ,tr("The following error occured while opening the database:\n%1") .arg(err),tr("OK")); @@ -315,6 +321,7 @@ CPasswordDialog dlg(this,"PasswordDlg",true,false,true); dlg.setCaption("New Database"); db=new PwDatabase(); if(dlg.exec()==1){ + db->newDatabase(); if(dlg.KeyType==BOTH || dlg.KeyType==KEYFILE){ if(!db->createKeyFile(dlg.keyfile)){ QMessageBox::warning(this,tr("Error"),tr("Could not create key file. The following error occured:\n%1").arg(db->getError()),tr("OK"),"","",0,0); @@ -344,7 +351,7 @@ void KeepassMainWindow::OnFileOpen(){ if(FileOpen) if(!closeDatabase())return; QString filename=QFileDialog::getOpenFileName(this,tr("Open Database..."),QDir::homePath(),"*.kdb"); -if(filename!=QString::null){ +if(filename!=QString()){ openDatabase(filename); } } @@ -540,7 +547,7 @@ else Q_ASSERT(false); } bool KeepassMainWindow::OnFileSave(){ -if(db->filename==QString()) +if(db->file->fileName()==QString()) return OnFileSaveAs(); if(db->saveDatabase()) setStateFileModified(false); @@ -554,8 +561,11 @@ return true; bool KeepassMainWindow::OnFileSaveAs(){ QString filename=QFileDialog::getSaveFileName(this,tr("Save Database As..."),QDir::homePath(),"*.kdb"); if(filename==QString()) return false; -db->filename=filename; -setCaption(tr("KeePassX - %1").arg(db->filename)); +Q_ASSERT(db->file); +if(db->file->isOpen()) db->file->close(); + +db->file->setFileName(filename); +setCaption(tr("KeePassX - %1").arg(filename)); return OnFileSave(); } @@ -566,7 +576,7 @@ if(dlg.exec())setStateFileModified(true); void KeepassMainWindow::OnFileChangeKey(){ CPasswordDialog dlg(this,"PasswordDlg",true,false,true); -dlg.setCaption(db->filename); +dlg.setCaption(db->file->fileName()); if(dlg.exec()==1){ if(dlg.KeyType==BOTH || dlg.KeyType==KEYFILE){ if(!db->createKeyFile(dlg.keyfile)){ @@ -810,10 +820,8 @@ for(int i=0; isetText(currentEntry()->UserName, QClipboard::Clipboard); ClipboardTimer.start(config.ClipboardTimeOut*1000,true); @@ -932,6 +940,7 @@ void KeepassMainWindow::OnExtrasSettings(){ CSettingsDlg dlg(this,"SettingsDlg"); dlg.exec(); EntryView->setAlternatingRowColors(config.AlternatingRowColors); +CGroup::UI_ExpandByDefault=config.ExpandGroupTree; } void KeepassMainWindow::OnHelpAbout(){ @@ -948,3 +957,12 @@ void KeepassMainWindow::OnViewShowEntryDetails(bool show){ config.EntryDetails=show; DetailView->setVisible(config.EntryDetails); } + +void KeepassMainWindow::OnItemExpanded(QTreeWidgetItem* item){ +((GroupViewItem*)item)->pGroup->UI_ItemIsExpanded=true; +} + +void KeepassMainWindow::OnItemCollaped(QTreeWidgetItem* item){ +((GroupViewItem*)item)->pGroup->UI_ItemIsExpanded=false; +} + diff --git a/src/mainwindow.h b/src/mainwindow.h index e7f61d1..4e1c786 100755 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -90,6 +90,8 @@ private slots: void OnFileModified(); void OnExtrasSettings(); void OnHelpAbout(); + void OnItemExpanded(QTreeWidgetItem*); + void OnItemCollaped(QTreeWidgetItem*); private: enum SelectionState{NONE,SINGLE,MULTIPLE,SEARCHGROUP}; @@ -118,6 +120,7 @@ private: QLineEdit* QuickSearchEdit; QLabel* StatusBarGeneral; QLabel* StatusBarSelection; + QToolBar* toolBar; protected: void closeEvent(QCloseEvent* event); diff --git a/src/translations/keepass-de_DE.ts b/src/translations/keepass-de_DE.ts index 2460769..c1cfedb 100644 --- a/src/translations/keepass-de_DE.ts +++ b/src/translations/keepass-de_DE.ts @@ -1,4 +1,11 @@ + + + + Could not open file (FileError=%1) + + + AboutDlg @@ -31,7 +38,7 @@ <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> - <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> + <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> Translation @@ -74,62 +81,40 @@ http://keepass.berlios.de/index.php http://keepass.berlios.de/index.php - - - CChangeKeyDlg - - Change Master Key - - - - Error - Fehler - - - Please enter a password. - - - - OK - OK - - - Please choose a key file. - - - - Please select a key file or enter a password. - - - Overwrite? - + <b>Current Translation: None</b><br><br> + Please replace 'None' with the language of your translation + <b>Aktuelle Übersetzung: Deutsch</b><br><br> - A file with this name already exists. -Do you want to replace it? - + <b>Author:</b> %1<br> + <b>Autor:</b> %1<br> - Could not open key file for writing. - + $TRANSALTION_AUTHOR + Tarek Saidi - Key file could not be written. - + $TRANSLATION_AUTHOR_EMAIL + Here you can enter your email or homepage if you want. + tarek.saidi@arcor.de - Password and password repetition are not equal. -Please check your input. - + Information on how to translate KeePassX can be found under: +http://keepass.berlios.de/translation-howto.html + Informationen wie Sie eine Übersetztung für KeePassX machen können finden Sie unter: +http://keepass.berlios.de/translation-howto.html + + + CChangeKeyDlg - Open key file - + Error + Fehler - Choose Directory - + OK + OK @@ -266,28 +251,10 @@ Are you sure? CPasswordDialog - - No key file found - - - - No key file could be found in the chosen directory. -Make sure that the volume is mounted correctly. -Please use the manual file selection for key files with a filename other than 'pwsafe.key'. - - OK OK - - Browse... - - - - Open Key File - - Error Fehler @@ -305,100 +272,116 @@ Please use the manual file selection for key files with a filename other than &a - Open Database + Database Key - Select File Manually... + Select a Key File - < none > + *.key - - - CSearchDlg - Notice + Unexpected Error: File does not exist. - Please enter a search string. + The selected key file or directory does not exist. - OK - OK + The selected key file or directory is not readable +.Please check your permissions. + - Search + The given directory does not contain any key files. - - - CSettingsDlg - Settings + The given directory contains more then one key file. +Please specify the key file directly. - - - ChangeKeyDialog - Change Master Key + The key file found in the given directory is not readable. +Please check your permissions. - Key + Key file could not be found. - Use password AND key file + Key file is not readable. +Please check your permissions. - Key file or directory: + Warning - Password Repetition: + Password an password repetition are not equal. +Please check your input. - Password: + Please enter a password or select a key file. - ... + A file with the name 'pwsafe.key' already exisits in the given directory. +Do you want to replace it? - &Browse... + Yes - Alt+B + No - Enter a Password and/or choose a key file. + The exisiting file is not writable. - &Cancel + A file with the this name already exisits. +Do you want to replace it? + + + CSearchDlg - Alt+C + Notice - O&K + Please enter a search string. - Alt+K + OK + OK + + + Search + + + + + CSettingsDlg + + Settings + + + + Select a directory... @@ -673,6 +656,10 @@ Please use the manual file selection for key files with a filename other than &a Attachment + + %1 items + + KeepassGroupView @@ -834,6 +821,35 @@ to save the changes? Open Database... + + Loading Database... + + + + Loading Failed + + + + Could not create key file. The following error occured: +%1 + + + + Export To... + + + + KeePassX [new] + + + + Unknown error in Import_PwManager::importFile()() + + + + Unknown error in Import_KWalletXml::importFile() + + MainWindow @@ -1029,6 +1045,18 @@ to save the changes? Show Statusbar + + Export to... + + + + KeePassX Handbook... + + + + Plain Text (*.txt) + + PasswordDlg @@ -1076,6 +1104,14 @@ to save the changes? Use Password AND Key File + + Exit + + + + Password Repet.: + + PwDatabase @@ -1105,11 +1141,6 @@ to save the changes? Decryption failed. -The key is wrong or the file is damaged - - - - Hash test failed. The key is wrong or the file is damaged @@ -1133,6 +1164,19 @@ The key is wrong or the file is damaged Unexpected error: Offset is out of range. [E3] + + Hash test failed. +The key is wrong or the file is damaged. + + + + Could not open key file. + + + + Key file could not be written. + + QObject @@ -1348,10 +1392,6 @@ Make sure you have write access to '~/.keepass'. &Cancel - - Securi&try - - Clear clipboard after: @@ -1416,6 +1456,26 @@ Make sure you have write access to '~/.keepass'. Browser Command: + + Securi&ty + + + + Alternating Row Colors + + + + Browse... + + + + Media Directory: + + + + Remember last key type and location + + SimplePasswordDialog diff --git a/src/translations/keepass-xx_XX.ts b/src/translations/keepass-xx_XX.ts index 80929a3..4b3115f 100644 --- a/src/translations/keepass-xx_XX.ts +++ b/src/translations/keepass-xx_XX.ts @@ -1,4 +1,11 @@ + + + + Could not open file (FileError=%1) + + + AboutDlg @@ -29,10 +36,6 @@ License - - <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> - - Translation @@ -73,64 +76,33 @@ http://keepass.berlios.de/index.php - - - CChangeKeyDlg - - Change Master Key - - - - Error - - - - Please enter a password. - - - - OK - - - - Please choose a key file. - - - Please select a key file or enter a password. + <b>Current Translation: None</b><br><br> + Please replace 'None' with the language of your translation - Overwrite? + <b>Author:</b> %1<br> - A file with this name already exists. -Do you want to replace it? + $TRANSALTION_AUTHOR - Could not open key file for writing. + $TRANSLATION_AUTHOR_EMAIL + Here you can enter your email or homepage if you want. - Key file could not be written. - - - - Password and password repetition are not equal. -Please check your input. - - - - Open key file - - - - Choose Directory + Information on how to translate KeePassX can be found under: +http://keepass.berlios.de/translation-howto.html + + CChangeKeyDlg + CDbSettingsDlg @@ -266,141 +238,142 @@ Are you sure? CPasswordDialog - No key file found + OK - No key file could be found in the chosen directory. -Make sure that the volume is mounted correctly. -Please use the manual file selection for key files with a filename other than 'pwsafe.key'. + Error - OK + Please enter a Password. - Browse... + Please choose a key file. - Open Key File + Please enter a Password or select a key file. - Error + Database Key - Please enter a Password. + Select a Key File - Please choose a key file. + *.key - Please enter a Password or select a key file. + Unexpected Error: File does not exist. - Open Database + The selected key file or directory does not exist. - Select File Manually... + The selected key file or directory is not readable +.Please check your permissions. - < none > + The given directory does not contain any key files. - - - CSearchDlg - Notice + The given directory contains more then one key file. +Please specify the key file directly. - Please enter a search string. + The key file found in the given directory is not readable. +Please check your permissions. - OK + Key file could not be found. - Search - - - - - CSettingsDlg - - Settings + Key file is not readable. +Please check your permissions. - - - ChangeKeyDialog - Change Master Key + Warning - Key + Password an password repetition are not equal. +Please check your input. - Use password AND key file + Please enter a password or select a key file. - Key file or directory: + A file with the name 'pwsafe.key' already exisits in the given directory. +Do you want to replace it? - Password Repetition: + Yes - Password: + No - ... + The exisiting file is not writable. - &Browse... + A file with the this name already exisits. +Do you want to replace it? + + + CSearchDlg - Alt+B + Notice - Enter a Password and/or choose a key file. + Please enter a search string. - &Cancel + OK - Alt+C + Search + + + CSettingsDlg - O&K + Settings - Alt+K + Select a directory... + + ChangeKeyDialog + EditEntryDialog @@ -672,6 +645,10 @@ Please use the manual file selection for key files with a filename other than &a Attachment + + %1 items + + KeepassGroupView @@ -833,6 +810,35 @@ to save the changes? Open Database... + + Loading Database... + + + + Loading Failed + + + + Could not create key file. The following error occured: +%1 + + + + Export To... + + + + KeePassX [new] + + + + Unknown error in Import_PwManager::importFile()() + + + + Unknown error in Import_KWalletXml::importFile() + + MainWindow @@ -1028,6 +1034,18 @@ to save the changes? Show Statusbar + + Export to... + + + + KeePassX Handbook... + + + + Plain Text (*.txt) + + PasswordDlg @@ -1075,6 +1093,14 @@ to save the changes? Use Password AND Key File + + Exit + + + + Password Repet.: + + PwDatabase @@ -1104,11 +1130,6 @@ to save the changes? Decryption failed. -The key is wrong or the file is damaged - - - - Hash test failed. The key is wrong or the file is damaged @@ -1132,6 +1153,19 @@ The key is wrong or the file is damaged Unexpected error: Offset is out of range. [E3] + + Hash test failed. +The key is wrong or the file is damaged. + + + + Could not open key file. + + + + Key file could not be written. + + QObject @@ -1347,10 +1381,6 @@ Make sure you have write access to '~/.keepass'. &Cancel - - Securi&try - - Clear clipboard after: @@ -1415,6 +1445,26 @@ Make sure you have write access to '~/.keepass'. Browser Command: + + Securi&ty + + + + Alternating Row Colors + + + + Browse... + + + + Media Directory: + + + + Remember last key type and location + + SimplePasswordDialog