Implemented backup feature
Disabled desktop integration plugins Disabled "Features" tab in SettingsDlg Removed useless files git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@231 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
parent
a8fafee769
commit
ef92de215c
|
@ -1,19 +0,0 @@
|
||||||
#wrapheader {
|
|
||||||
min-height: 120px;
|
|
||||||
height: auto !important;
|
|
||||||
height: 120px;
|
|
||||||
background-image: url('./images/headerbackground.png');
|
|
||||||
background-repeat: repeat-x;
|
|
||||||
padding: 0 25px 15px 25px;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#logo {
|
|
||||||
min-height: 120px;
|
|
||||||
height: auto !important;
|
|
||||||
height: 120px;
|
|
||||||
background-image: url('./images/logo.png');
|
|
||||||
padding: 0 25px 15px 25px;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 271 B |
Binary file not shown.
Before Width: | Height: | Size: 8.2 KiB |
|
@ -1,110 +0,0 @@
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
||||||
<HTML
|
|
||||||
><HEAD
|
|
||||||
><TITLE
|
|
||||||
>KeePassX User Guide</TITLE
|
|
||||||
><META
|
|
||||||
NAME="GENERATOR"
|
|
||||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
|
||||||
REL="NEXT"
|
|
||||||
TITLE="Introduction"
|
|
||||||
HREF="f3.html"></HEAD
|
|
||||||
><BODY
|
|
||||||
CLASS="book"
|
|
||||||
BGCOLOR="#FFFFFF"
|
|
||||||
TEXT="#000000"
|
|
||||||
LINK="#0000FF"
|
|
||||||
VLINK="#840084"
|
|
||||||
ALINK="#0000FF"
|
|
||||||
><DIV
|
|
||||||
CLASS="BOOK"
|
|
||||||
><A
|
|
||||||
NAME="basic_usage"
|
|
||||||
></A
|
|
||||||
><DIV
|
|
||||||
CLASS="TITLEPAGE"
|
|
||||||
><H1
|
|
||||||
CLASS="title"
|
|
||||||
><A
|
|
||||||
NAME="basic_usage"
|
|
||||||
>KeePassX User Guide</A
|
|
||||||
></H1
|
|
||||||
><HR></DIV
|
|
||||||
><DIV
|
|
||||||
CLASS="TOC"
|
|
||||||
><DL
|
|
||||||
><DT
|
|
||||||
><B
|
|
||||||
>Table of Contents</B
|
|
||||||
></DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="f3.html"
|
|
||||||
>Introduction</A
|
|
||||||
></DT
|
|
||||||
><DT
|
|
||||||
>1. <A
|
|
||||||
HREF="c15.html"
|
|
||||||
>First Steps</A
|
|
||||||
></DT
|
|
||||||
><DT
|
|
||||||
>2. <A
|
|
||||||
HREF="c18.html"
|
|
||||||
></A
|
|
||||||
></DT
|
|
||||||
></DL
|
|
||||||
></DIV
|
|
||||||
></DIV
|
|
||||||
><DIV
|
|
||||||
CLASS="NAVFOOTER"
|
|
||||||
><HR
|
|
||||||
ALIGN="LEFT"
|
|
||||||
WIDTH="100%"><TABLE
|
|
||||||
SUMMARY="Footer navigation table"
|
|
||||||
WIDTH="100%"
|
|
||||||
BORDER="0"
|
|
||||||
CELLPADDING="0"
|
|
||||||
CELLSPACING="0"
|
|
||||||
><TR
|
|
||||||
><TD
|
|
||||||
WIDTH="33%"
|
|
||||||
ALIGN="left"
|
|
||||||
VALIGN="top"
|
|
||||||
> </TD
|
|
||||||
><TD
|
|
||||||
WIDTH="34%"
|
|
||||||
ALIGN="center"
|
|
||||||
VALIGN="top"
|
|
||||||
> </TD
|
|
||||||
><TD
|
|
||||||
WIDTH="33%"
|
|
||||||
ALIGN="right"
|
|
||||||
VALIGN="top"
|
|
||||||
><A
|
|
||||||
HREF="f3.html"
|
|
||||||
ACCESSKEY="N"
|
|
||||||
>Next</A
|
|
||||||
></TD
|
|
||||||
></TR
|
|
||||||
><TR
|
|
||||||
><TD
|
|
||||||
WIDTH="33%"
|
|
||||||
ALIGN="left"
|
|
||||||
VALIGN="top"
|
|
||||||
> </TD
|
|
||||||
><TD
|
|
||||||
WIDTH="34%"
|
|
||||||
ALIGN="center"
|
|
||||||
VALIGN="top"
|
|
||||||
> </TD
|
|
||||||
><TD
|
|
||||||
WIDTH="33%"
|
|
||||||
ALIGN="right"
|
|
||||||
VALIGN="top"
|
|
||||||
>Introduction</TD
|
|
||||||
></TR
|
|
||||||
></TABLE
|
|
||||||
></DIV
|
|
||||||
></BODY
|
|
||||||
></HTML
|
|
||||||
>
|
|
|
@ -1,33 +0,0 @@
|
||||||
<!DOCTYPE DCF>
|
|
||||||
|
|
||||||
<assistantconfig version="3.2.0">
|
|
||||||
|
|
||||||
<profile>
|
|
||||||
<property name="name">KeePassX</property>
|
|
||||||
<property name="title">KeePassX Documentation</property>
|
|
||||||
<property name="applicationicon">images/logo.png</property>
|
|
||||||
<property name="startpage">index.html</property>
|
|
||||||
<property name="aboutmenutext">About KeePassX</property>
|
|
||||||
<property name="abouturl">about.txt</property>
|
|
||||||
<property name="assistantdocs">.</property>
|
|
||||||
</profile>
|
|
||||||
|
|
||||||
<DCF ref="index.html" icon="images/handbook.png" title="Basic Usage">
|
|
||||||
<section ref="./findfile.html" title="First Steps"/>
|
|
||||||
<section ref="./findfile.html" title="Database Settings"/>
|
|
||||||
<section ref="./findfile.html" title="Program Settings"/>
|
|
||||||
</DCF>
|
|
||||||
|
|
||||||
<DCF ref="index.html" icon="images/handbook.png" title="Advanced Features">
|
|
||||||
<section ref="./findfile.html" title="Auto-Type"/>
|
|
||||||
</DCF>
|
|
||||||
|
|
||||||
<DCF ref="index.html" icon="images/handbook.png" title="HowTos">
|
|
||||||
<section ref="./findfile.html" title="General Usage"/>
|
|
||||||
</DCF>
|
|
||||||
|
|
||||||
<DCF ref="index.html" icon="images/handbook.png" title="Technical Documentation">
|
|
||||||
<section ref="./findfile.html" title="File Format"/>
|
|
||||||
</DCF>
|
|
||||||
|
|
||||||
</assistantconfig>
|
|
|
@ -1,339 +0,0 @@
|
||||||
<pre> 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.</pre>
|
|
|
@ -157,7 +157,7 @@ public:
|
||||||
\return TRUE if the handle is valid and FALSE if the handle is invalid e.g. because the associated entry was deleted.*/
|
\return TRUE if the handle is valid and FALSE if the handle is invalid e.g. because the associated entry was deleted.*/
|
||||||
virtual bool isValid()const=0;
|
virtual bool isValid()const=0;
|
||||||
|
|
||||||
|
virtual CEntry data()const=0;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Custom Icon Interface
|
//! Custom Icon Interface
|
||||||
|
@ -206,13 +206,13 @@ public:
|
||||||
//! \return a pointer to the handle of the parent group or NULL if the group has no parent.
|
//! \return a pointer to the handle of the parent group or NULL if the group has no parent.
|
||||||
virtual IGroupHandle* parent()=0;
|
virtual IGroupHandle* parent()=0;
|
||||||
|
|
||||||
//! \return a List of pointers to the handles of all childs of the group and an empty list if the group has no childs. The list is sorted and starts with the first child.
|
//! \return a List of pointers to the handles of all children of the group and an empty list if the group has no children. The list is sorted.
|
||||||
virtual QList<IGroupHandle*> childs()=0;
|
virtual QList<IGroupHandle*> children()=0;
|
||||||
|
|
||||||
//! \return the index of the group amongst the childs of its parent. The index of the first child is 0.
|
//! \return the index of the group amongst the children of its parent. The index of the first child is 0.
|
||||||
virtual int index()=0;
|
virtual int index()=0;
|
||||||
|
|
||||||
/*! Sets the index of a group amongst the childs of its parent.
|
/*! Sets the index of a group amongst the children of its parent.
|
||||||
This function can be used to sort the groups of the database in a specific order.
|
This function can be used to sort the groups of the database in a specific order.
|
||||||
\param index The new index of the group. The indices of the other groups which are affected by this operation will be automatically adjusted.*/
|
\param index The new index of the group. The indices of the other groups which are affected by this operation will be automatically adjusted.*/
|
||||||
virtual void setIndex(int index)=0;
|
virtual void setIndex(int index)=0;
|
||||||
|
@ -291,6 +291,10 @@ public:
|
||||||
\return a list with the pointers to the handles of all entries of the database. The list ist sorted and contains only valid handles.*/
|
\return a list with the pointers to the handles of all entries of the database. The list ist sorted and contains only valid handles.*/
|
||||||
virtual QList<IGroupHandle*> sortedGroups()=0;
|
virtual QList<IGroupHandle*> sortedGroups()=0;
|
||||||
|
|
||||||
|
/*! \return handle of the backup group or NULL if it doesn't exist
|
||||||
|
\param create Create the backup group if it doesn't exist
|
||||||
|
*/
|
||||||
|
virtual IGroupHandle* backupGroup(bool create=false)=0;
|
||||||
|
|
||||||
/*! \return the last error message or an empty QString() object if no error occured.*/
|
/*! \return the last error message or an empty QString() object if no error occured.*/
|
||||||
virtual QString getError()=0;
|
virtual QString getError()=0;
|
||||||
|
|
|
@ -407,8 +407,8 @@ bool Kdb3Database::createGroupTree(QList<quint32>& Levels){
|
||||||
for(int i=0;i<Groups.size();i++){
|
for(int i=0;i<Groups.size();i++){
|
||||||
if(Levels[i]==0){
|
if(Levels[i]==0){
|
||||||
Groups[i].Parent=&RootGroup;
|
Groups[i].Parent=&RootGroup;
|
||||||
Groups[i].Index=RootGroup.Childs.size();
|
Groups[i].Index=RootGroup.Children.size();
|
||||||
RootGroup.Childs.append(&Groups[i]);
|
RootGroup.Children.append(&Groups[i]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int j;
|
int j;
|
||||||
|
@ -421,8 +421,8 @@ bool Kdb3Database::createGroupTree(QList<quint32>& Levels){
|
||||||
if(j==0)return false; //No parent found
|
if(j==0)return false; //No parent found
|
||||||
}
|
}
|
||||||
Groups[i].Parent=&Groups[j];
|
Groups[i].Parent=&Groups[j];
|
||||||
Groups[i].Index=Groups[j].Childs.size();
|
Groups[i].Index=Groups[j].Children.size();
|
||||||
Groups[i].Parent->Childs.append(&Groups[i]);
|
Groups[i].Parent->Children.append(&Groups[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<int> EntryIndexCounter;
|
QList<int> EntryIndexCounter;
|
||||||
|
@ -468,6 +468,9 @@ void Kdb3Database::restoreGroupTreeState(){
|
||||||
for(int i=0;i<Groups.size();i++)
|
for(int i=0;i<Groups.size();i++)
|
||||||
Groups[i].IsExpanded=true;
|
Groups[i].IsExpanded=true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case KpxConfig::DoNothing:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -744,17 +747,17 @@ int Kdb3Database::numEntries(){
|
||||||
|
|
||||||
void Kdb3Database::deleteGroup(StdGroup* group){
|
void Kdb3Database::deleteGroup(StdGroup* group){
|
||||||
|
|
||||||
while(group->Childs.size())
|
while(group->Children.size())
|
||||||
deleteGroup(group->Childs.front());
|
deleteGroup(group->Children.front());
|
||||||
|
|
||||||
QList<IEntryHandle*> GroupEntries;
|
QList<IEntryHandle*> GroupEntries;
|
||||||
GroupEntries=entries(group->Handle);
|
GroupEntries=entries(group->Handle);
|
||||||
deleteEntries(GroupEntries);
|
deleteEntries(GroupEntries);
|
||||||
|
|
||||||
Q_ASSERT(group==group->Parent->Childs[group->Index]);
|
Q_ASSERT(group==group->Parent->Children[group->Index]);
|
||||||
group->Parent->Childs.removeAt(group->Index);
|
group->Parent->Children.removeAt(group->Index);
|
||||||
for(int i=group->Index;i<group->Parent->Childs.size();i++){
|
for(int i=group->Index;i<group->Parent->Children.size();i++){
|
||||||
group->Parent->Childs[i]->Index--;
|
group->Parent->Children[i]->Index--;
|
||||||
}
|
}
|
||||||
group->Handle->invalidate();
|
group->Handle->invalidate();
|
||||||
|
|
||||||
|
@ -791,7 +794,7 @@ void Kdb3Database::GroupHandle::setIndex(int index){
|
||||||
if(pDB->Groups[NewPos].ParentId==ParentId && pDB->Groups[NewPos].Index+1==index)
|
if(pDB->Groups[NewPos].ParentId==ParentId && pDB->Groups[NewPos].Index+1==index)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//skip the childs of the found sibling
|
//skip the children of the found sibling
|
||||||
for(NewPos;NewPos<Groups.size();NewPos++){
|
for(NewPos;NewPos<Groups.size();NewPos++){
|
||||||
if(Groups[NewPos]
|
if(Groups[NewPos]
|
||||||
pDB->Groups.move(Pos,NewPos);
|
pDB->Groups.move(Pos,NewPos);
|
||||||
|
@ -978,13 +981,13 @@ void Kdb3Database::deleteEntries(QList<IEntryHandle*> entries){
|
||||||
if(&Entries[j]==((EntryHandle*)entries[i])->Entry)
|
if(&Entries[j]==((EntryHandle*)entries[i])->Entry)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Group->Childs.removeAt(Entries[j].Index);
|
Group->Children.removeAt(Entries[j].Index);
|
||||||
Entries[j].Handle->invalidate();
|
Entries[j].Handle->invalidate();
|
||||||
Entries.removeAt(j);
|
Entries.removeAt(j);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i=0;i<Group->Childs.size();i++){
|
for(int i=0;i<Group->Children.size();i++){
|
||||||
Group->Childs[i]->Index=i;
|
Group->Children[i]->Index=i;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1018,17 +1021,37 @@ IGroupHandle* Kdb3Database::addGroup(const CGroup* group,IGroupHandle* ParentHan
|
||||||
GroupHandles.back().Group=&Groups.back();
|
GroupHandles.back().Group=&Groups.back();
|
||||||
if(ParentHandle){
|
if(ParentHandle){
|
||||||
Groups.back().Parent=((GroupHandle*)ParentHandle)->Group;
|
Groups.back().Parent=((GroupHandle*)ParentHandle)->Group;
|
||||||
Groups.back().Index=Groups.back().Parent->Childs.size();
|
Groups.back().Index=Groups.back().Parent->Children.size();
|
||||||
Groups.back().Parent->Childs.append(&Groups.back());
|
Groups.back().Parent->Children.append(&Groups.back());
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
Groups.back().Parent=&RootGroup;
|
Groups.back().Parent=&RootGroup;
|
||||||
Groups.back().Index=RootGroup.Childs.size();
|
Groups.back().Index=RootGroup.Children.size();
|
||||||
Groups.back().Parent->Childs.append(&Groups.back());
|
Groups.back().Parent->Children.append(&Groups.back());
|
||||||
}
|
}
|
||||||
return &GroupHandles.back();
|
return &GroupHandles.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IGroupHandle* Kdb3Database::backupGroup(bool create){
|
||||||
|
IGroupHandle* group = NULL;
|
||||||
|
QList<IGroupHandle*> allGroups = groups();
|
||||||
|
for (int i=0; i<allGroups.size(); i++){
|
||||||
|
if (allGroups[i]->parent()==NULL && allGroups[i]->title()=="Backup"){
|
||||||
|
group = allGroups[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (group==NULL && create){
|
||||||
|
CGroup newGroup;
|
||||||
|
newGroup.Title = "Backup";
|
||||||
|
newGroup.Image = 4;
|
||||||
|
group = addGroup(&newGroup, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
return group;
|
||||||
|
}
|
||||||
|
|
||||||
Kdb3Database::StdGroup::StdGroup(const CGroup& other){
|
Kdb3Database::StdGroup::StdGroup(const CGroup& other){
|
||||||
Index=0;
|
Index=0;
|
||||||
Id=other.Id;
|
Id=other.Id;
|
||||||
|
@ -1104,6 +1127,10 @@ int Kdb3Database::EntryHandle::visualIndex()const{return Entry->Index;}
|
||||||
void Kdb3Database::EntryHandle::setVisualIndexDirectly(int i){Entry->Index=i;}
|
void Kdb3Database::EntryHandle::setVisualIndexDirectly(int i){Entry->Index=i;}
|
||||||
bool Kdb3Database::EntryHandle::isValid()const{return valid;}
|
bool Kdb3Database::EntryHandle::isValid()const{return valid;}
|
||||||
|
|
||||||
|
CEntry Kdb3Database::EntryHandle::data()const{
|
||||||
|
return *this->Entry;
|
||||||
|
}
|
||||||
|
|
||||||
void Kdb3Database::EntryHandle::setVisualIndex(int index){
|
void Kdb3Database::EntryHandle::setVisualIndex(int index){
|
||||||
QList<IEntryHandle*>Entries=pDB->entries(Entry->Group->Handle);
|
QList<IEntryHandle*>Entries=pDB->entries(Entry->Group->Handle);
|
||||||
Entries.move(visualIndex(),index);
|
Entries.move(visualIndex(),index);
|
||||||
|
@ -1150,35 +1177,35 @@ int Kdb3Database::GroupHandle::level(){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QList<IGroupHandle*> Kdb3Database::GroupHandle::childs(){
|
QList<IGroupHandle*> Kdb3Database::GroupHandle::children(){
|
||||||
QList<IGroupHandle*> childs;
|
QList<IGroupHandle*> children;
|
||||||
for(int i=0;i<Group->Childs.size();i++){
|
for(int i=0; i < Group->Children.size(); i++){
|
||||||
childs.append(Group->Childs[i]->Handle);
|
children.append(Group->Children[i]->Handle);
|
||||||
}
|
}
|
||||||
return childs;
|
return children;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void memcpyFromLEnd32(quint32* dst,const char* src){
|
void memcpyFromLEnd32(quint32* dst,const char* src){
|
||||||
|
if (QSysInfo::ByteOrder==QSysInfo::BigEndian){
|
||||||
if(QSysInfo::ByteOrder==QSysInfo::BigEndian){
|
|
||||||
memcpy(((char*)dst)+3,src+0,1);
|
memcpy(((char*)dst)+3,src+0,1);
|
||||||
memcpy(((char*)dst)+2,src+1,1);
|
memcpy(((char*)dst)+2,src+1,1);
|
||||||
memcpy(((char*)dst)+1,src+2,1);
|
memcpy(((char*)dst)+1,src+2,1);
|
||||||
memcpy(((char*)dst)+0,src+3,1);
|
memcpy(((char*)dst)+0,src+3,1);
|
||||||
}
|
}
|
||||||
else
|
else{
|
||||||
memcpy(dst,src,4);
|
memcpy(dst,src,4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void memcpyFromLEnd16(quint16* dst,const char* src){
|
void memcpyFromLEnd16(quint16* dst,const char* src){
|
||||||
|
if (QSysInfo::ByteOrder==QSysInfo::BigEndian){
|
||||||
if(QSysInfo::ByteOrder==QSysInfo::BigEndian){
|
|
||||||
memcpy(((char*)dst)+1,src+0,1);
|
memcpy(((char*)dst)+1,src+0,1);
|
||||||
memcpy(((char*)dst)+0,src+1,1);
|
memcpy(((char*)dst)+0,src+1,1);
|
||||||
}
|
}
|
||||||
else
|
else{
|
||||||
memcpy(dst,src,2);
|
memcpy(dst,src,2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void memcpyToLEnd32(char* dst,const quint32* src){
|
void memcpyToLEnd32(char* dst,const quint32* src){
|
||||||
|
@ -1188,8 +1215,9 @@ void memcpyToLEnd32(char* dst,const quint32* src){
|
||||||
memcpy(dst+2,((char*)src)+1,1);
|
memcpy(dst+2,((char*)src)+1,1);
|
||||||
memcpy(dst+3,((char*)src)+0,1);
|
memcpy(dst+3,((char*)src)+0,1);
|
||||||
}
|
}
|
||||||
else
|
else{
|
||||||
memcpy(dst,src,4);
|
memcpy(dst,src,4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void memcpyToLEnd16(char* dst,const quint16* src){
|
void memcpyToLEnd16(char* dst,const quint16* src){
|
||||||
|
@ -1197,8 +1225,9 @@ void memcpyToLEnd16(char* dst,const quint16* src){
|
||||||
memcpy(dst+0,((char*)src)+1,1);
|
memcpy(dst+0,((char*)src)+1,1);
|
||||||
memcpy(dst+1,((char*)src)+0,1);
|
memcpy(dst+1,((char*)src)+0,1);
|
||||||
}
|
}
|
||||||
else
|
else{
|
||||||
memcpy(dst,src,2);
|
memcpy(dst,src,2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Kdb3Database::save(){
|
bool Kdb3Database::save(){
|
||||||
|
@ -1206,6 +1235,17 @@ bool Kdb3Database::save(){
|
||||||
error=tr("The database must contain at least one group.");
|
error=tr("The database must contain at least one group.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Delete old backup entries
|
||||||
|
if (config->backup() && config->backupDelete() && config->backupDeleteAfter()>0 && backupGroup()){
|
||||||
|
QDateTime time = QDateTime::currentDateTime().addDays(-config->backupDeleteAfter());
|
||||||
|
QList<IEntryHandle*> backupEntries = entries(backupGroup());
|
||||||
|
for (int i=0; i<backupEntries.size(); i++){
|
||||||
|
if (backupEntries[i]->lastMod()<time)
|
||||||
|
deleteEntry(backupEntries[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
quint32 NumGroups,NumEntries,Signature1,Signature2,Flags,Version;
|
quint32 NumGroups,NumEntries,Signature1,Signature2,Flags,Version;
|
||||||
quint8 FinalRandomSeed[16];
|
quint8 FinalRandomSeed[16];
|
||||||
quint8 ContentsHash[32];
|
quint8 ContentsHash[32];
|
||||||
|
@ -1418,23 +1458,23 @@ void Kdb3Database::createCustomIconsMetaStream(StdEntry* e){
|
||||||
|
|
||||||
QList<IGroupHandle*> Kdb3Database::sortedGroups(){
|
QList<IGroupHandle*> Kdb3Database::sortedGroups(){
|
||||||
QList<IGroupHandle*> SortedGroups;
|
QList<IGroupHandle*> SortedGroups;
|
||||||
appendChildsToGroupList(SortedGroups,RootGroup);
|
appendChildrenToGroupList(SortedGroups,RootGroup);
|
||||||
return SortedGroups;
|
return SortedGroups;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Kdb3Database::appendChildsToGroupList(QList<IGroupHandle*>& list,StdGroup& group){
|
void Kdb3Database::appendChildrenToGroupList(QList<IGroupHandle*>& list,StdGroup& group){
|
||||||
for(int i=0;i<group.Childs.size();i++){
|
for(int i=0;i<group.Children.size();i++){
|
||||||
list << group.Childs[i]->Handle;
|
list << group.Children[i]->Handle;
|
||||||
appendChildsToGroupList(list,*group.Childs[i]);
|
appendChildrenToGroupList(list,*group.Children[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Kdb3Database::appendChildsToGroupList(QList<StdGroup*>& list,StdGroup& group){
|
void Kdb3Database::appendChildrenToGroupList(QList<StdGroup*>& list,StdGroup& group){
|
||||||
for(int i=0;i<group.Childs.size();i++){
|
for(int i=0;i<group.Children.size();i++){
|
||||||
list << group.Childs[i];
|
list << group.Children[i];
|
||||||
appendChildsToGroupList(list,*group.Childs[i]);
|
appendChildrenToGroupList(list,*group.Children[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1444,7 +1484,7 @@ void Kdb3Database::serializeGroups(QList<StdGroup>& GroupList,char* buffer,unsig
|
||||||
quint32 FieldSize;
|
quint32 FieldSize;
|
||||||
quint32 Flags=0; //unused
|
quint32 Flags=0; //unused
|
||||||
QList<StdGroup*>SortedGroups;
|
QList<StdGroup*>SortedGroups;
|
||||||
appendChildsToGroupList(SortedGroups,RootGroup);
|
appendChildrenToGroupList(SortedGroups,RootGroup);
|
||||||
|
|
||||||
for(int i=0; i < SortedGroups.size(); i++){
|
for(int i=0; i < SortedGroups.size(); i++){
|
||||||
unsigned char Date[5];
|
unsigned char Date[5];
|
||||||
|
@ -1692,8 +1732,8 @@ bool Kdb3Database::searchStringContains(const QString& search, const QString& st
|
||||||
|
|
||||||
void Kdb3Database::getEntriesRecursive(IGroupHandle* Group, QList<IEntryHandle*>& EntryList){
|
void Kdb3Database::getEntriesRecursive(IGroupHandle* Group, QList<IEntryHandle*>& EntryList){
|
||||||
EntryList<<entries(Group);
|
EntryList<<entries(Group);
|
||||||
for(int i=0;i<((GroupHandle*)Group)->Group->Childs.size(); i++){
|
for(int i=0;i<((GroupHandle*)Group)->Group->Children.size(); i++){
|
||||||
getEntriesRecursive(((GroupHandle*)Group)->Group->Childs[i]->Handle,EntryList);
|
getEntriesRecursive(((GroupHandle*)Group)->Group->Children[i]->Handle,EntryList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1712,23 +1752,14 @@ QList<IEntryHandle*> Kdb3Database::search(IGroupHandle* Group,const QString& sea
|
||||||
else
|
else
|
||||||
SearchEntries=entries();
|
SearchEntries=entries();
|
||||||
|
|
||||||
IGroupHandle* backupGroup = NULL;
|
IGroupHandle* bGroup = backupGroup();
|
||||||
if (!Group){
|
|
||||||
QList<IGroupHandle*> allGroups = groups();
|
|
||||||
for (int i=0; i<allGroups.size(); i++){
|
|
||||||
if (allGroups[i]->parent()==NULL && allGroups[i]->title()=="Backup"){
|
|
||||||
backupGroup = allGroups[i];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<IEntryHandle*> ResultEntries;
|
QList<IEntryHandle*> ResultEntries;
|
||||||
for(int i=0; i<SearchEntries.size(); i++){
|
for(int i=0; i<SearchEntries.size(); i++){
|
||||||
IGroupHandle* entryGroup = SearchEntries[i]->group();
|
IGroupHandle* entryGroup = SearchEntries[i]->group();
|
||||||
while (entryGroup->parent())
|
while (entryGroup->parent())
|
||||||
entryGroup = entryGroup->parent();
|
entryGroup = entryGroup->parent();
|
||||||
if (entryGroup == backupGroup)
|
if (entryGroup == bGroup)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
bool match=false;
|
bool match=false;
|
||||||
|
@ -1762,18 +1793,18 @@ void Kdb3Database::moveGroup(IGroupHandle* groupHandle,IGroupHandle* NewParent,i
|
||||||
Parent=((GroupHandle*)NewParent)->Group;
|
Parent=((GroupHandle*)NewParent)->Group;
|
||||||
else
|
else
|
||||||
Parent=&RootGroup;
|
Parent=&RootGroup;
|
||||||
Group->Parent->Childs.removeAt(Group->Index);
|
Group->Parent->Children.removeAt(Group->Index);
|
||||||
rebuildIndices(Group->Parent->Childs);
|
rebuildIndices(Group->Parent->Children);
|
||||||
Group->Parent=Parent;
|
Group->Parent=Parent;
|
||||||
if(Pos==-1){
|
if(Pos==-1){
|
||||||
Parent->Childs.append(Group);
|
Parent->Children.append(Group);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Q_ASSERT(Parent->Childs.size()>=Pos);
|
Q_ASSERT(Parent->Children.size()>=Pos);
|
||||||
Parent->Childs.insert(Pos,Group);
|
Parent->Children.insert(Pos,Group);
|
||||||
}
|
}
|
||||||
rebuildIndices(Parent->Childs);
|
rebuildIndices(Parent->Children);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Kdb3Database::changeFile(const QString& filename){
|
bool Kdb3Database::changeFile(const QString& filename){
|
||||||
|
|
|
@ -80,6 +80,7 @@ public:
|
||||||
virtual quint32 binarySize();
|
virtual quint32 binarySize();
|
||||||
virtual QString friendlySize();
|
virtual QString friendlySize();
|
||||||
virtual bool isValid() const;
|
virtual bool isValid() const;
|
||||||
|
virtual CEntry data()const;
|
||||||
private:
|
private:
|
||||||
void invalidate(){valid=false;}
|
void invalidate(){valid=false;}
|
||||||
bool valid;
|
bool valid;
|
||||||
|
@ -98,7 +99,7 @@ public:
|
||||||
virtual quint32 image();
|
virtual quint32 image();
|
||||||
virtual bool isValid();
|
virtual bool isValid();
|
||||||
virtual IGroupHandle* parent();
|
virtual IGroupHandle* parent();
|
||||||
virtual QList<IGroupHandle*> childs();
|
virtual QList<IGroupHandle*> children();
|
||||||
virtual int index();
|
virtual int index();
|
||||||
virtual void setIndex(int index);
|
virtual void setIndex(int index);
|
||||||
virtual int level();
|
virtual int level();
|
||||||
|
@ -128,7 +129,7 @@ public:
|
||||||
quint16 Index;
|
quint16 Index;
|
||||||
StdGroup* Parent;
|
StdGroup* Parent;
|
||||||
GroupHandle* Handle;
|
GroupHandle* Handle;
|
||||||
QList<StdGroup*> Childs;
|
QList<StdGroup*> Children;
|
||||||
QList<StdEntry*> Entries;
|
QList<StdEntry*> Entries;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -187,6 +188,7 @@ public:
|
||||||
virtual void deleteGroup(IGroupHandle* group);
|
virtual void deleteGroup(IGroupHandle* group);
|
||||||
virtual void moveGroup(IGroupHandle* Group,IGroupHandle* NewParent,int Position);
|
virtual void moveGroup(IGroupHandle* Group,IGroupHandle* NewParent,int Position);
|
||||||
virtual IGroupHandle* addGroup(const CGroup* Group,IGroupHandle* Parent);
|
virtual IGroupHandle* addGroup(const CGroup* Group,IGroupHandle* Parent);
|
||||||
|
virtual IGroupHandle* backupGroup(bool create=false);
|
||||||
virtual bool isParent(IGroupHandle* parent, IGroupHandle* child);
|
virtual bool isParent(IGroupHandle* parent, IGroupHandle* child);
|
||||||
|
|
||||||
virtual void generateMasterKey();
|
virtual void generateMasterKey();
|
||||||
|
@ -212,8 +214,8 @@ private:
|
||||||
quint32 getNewGroupId();
|
quint32 getNewGroupId();
|
||||||
void serializeEntries(QList<StdEntry>& EntryList,char* buffer,unsigned int& pos);
|
void serializeEntries(QList<StdEntry>& EntryList,char* buffer,unsigned int& pos);
|
||||||
void serializeGroups(QList<StdGroup>& GroupList,char* buffer,unsigned int& pos);
|
void serializeGroups(QList<StdGroup>& GroupList,char* buffer,unsigned int& pos);
|
||||||
void appendChildsToGroupList(QList<StdGroup*>& list,StdGroup& group);
|
void appendChildrenToGroupList(QList<StdGroup*>& list,StdGroup& group);
|
||||||
void appendChildsToGroupList(QList<IGroupHandle*>& list,StdGroup& group);
|
void appendChildrenToGroupList(QList<IGroupHandle*>& list,StdGroup& group);
|
||||||
bool searchStringContains(const QString& search, const QString& string,bool Cs, bool RegExp);
|
bool searchStringContains(const QString& search, const QString& string,bool Cs, bool RegExp);
|
||||||
void getEntriesRecursive(IGroupHandle* Group, QList<IEntryHandle*>& EntryList);
|
void getEntriesRecursive(IGroupHandle* Group, QList<IEntryHandle*>& EntryList);
|
||||||
void rebuildIndices(QList<StdGroup*>& list);
|
void rebuildIndices(QList<StdGroup*>& list);
|
||||||
|
|
|
@ -73,6 +73,9 @@ public:
|
||||||
bool openLastFile(){return settings.value("Options/OpenLastFile",true).toBool();}
|
bool openLastFile(){return settings.value("Options/OpenLastFile",true).toBool();}
|
||||||
bool autoSave(){return settings.value("Options/AutoSave",false).toBool();}
|
bool autoSave(){return settings.value("Options/AutoSave",false).toBool();}
|
||||||
bool autoSaveChange(){return settings.value("Options/AutoSaveChange",false).toBool();}
|
bool autoSaveChange(){return settings.value("Options/AutoSaveChange",false).toBool();}
|
||||||
|
bool backup(){return settings.value("Options/Backup",true).toBool();}
|
||||||
|
bool backupDelete(){return settings.value("Options/BackupDelete",false).toBool();}
|
||||||
|
int backupDeleteAfter(){return settings.value("Options/BackupDeleteAfter",14).toInt();}
|
||||||
int pwGenCategory(){return settings.value("Options/PwGenCategory",0).toInt();}
|
int pwGenCategory(){return settings.value("Options/PwGenCategory",0).toInt();}
|
||||||
QString pwGenCharList(){return settings.value("Options/PwGenCharList").toString();}
|
QString pwGenCharList(){return settings.value("Options/PwGenCharList").toString();}
|
||||||
bool pwGenExcludeLookAlike(){return settings.value("Options/PwGenExcludeLookAlike").toBool();}
|
bool pwGenExcludeLookAlike(){return settings.value("Options/PwGenExcludeLookAlike").toBool();}
|
||||||
|
@ -105,7 +108,8 @@ public:
|
||||||
Shortcut globalShortcut();
|
Shortcut globalShortcut();
|
||||||
bool entryTitlesMatch(){return settings.value("Options/EntryTitlesMatch",true).toBool();}
|
bool entryTitlesMatch(){return settings.value("Options/EntryTitlesMatch",true).toBool();}
|
||||||
#endif
|
#endif
|
||||||
bool featureBookmarks(){return settings.value("Features/Bookmarks",true).toBool();}
|
//bool featureBookmarks(){return settings.value("Features/Bookmarks",true).toBool();}
|
||||||
|
bool featureBookmarks(){return true;}
|
||||||
|
|
||||||
void setAlternatingRowColors(bool value){settings.setValue("Options/AlternatingRowColors",value);}
|
void setAlternatingRowColors(bool value){settings.setValue("Options/AlternatingRowColors",value);}
|
||||||
void setBannerColor1(const QColor& value){settings.setValue("Options/BannerColor1",colorToString(value));}
|
void setBannerColor1(const QColor& value){settings.setValue("Options/BannerColor1",colorToString(value));}
|
||||||
|
@ -136,6 +140,9 @@ public:
|
||||||
void setOpenLastFile(bool value){settings.setValue("Options/OpenLastFile",value);}
|
void setOpenLastFile(bool value){settings.setValue("Options/OpenLastFile",value);}
|
||||||
void setAutoSave(bool value){settings.setValue("Options/AutoSave",value);}
|
void setAutoSave(bool value){settings.setValue("Options/AutoSave",value);}
|
||||||
void setAutoSaveChange(bool value){settings.setValue("Options/AutoSaveChange",value);}
|
void setAutoSaveChange(bool value){settings.setValue("Options/AutoSaveChange",value);}
|
||||||
|
void setBackup(bool value){settings.setValue("Options/Backup",value);}
|
||||||
|
void setBackupDelete(bool value){settings.setValue("Options/BackupDelete",value);}
|
||||||
|
void setBackupDeleteAfter(int value){settings.setValue("Options/BackupDeleteAfter",value);}
|
||||||
void setPwGenCategory(int value){settings.setValue("Options/PwGenCategory",value);}
|
void setPwGenCategory(int value){settings.setValue("Options/PwGenCategory",value);}
|
||||||
void setPwGenCharList(const QString& value){settings.setValue("Options/PwGenCharList",value);}
|
void setPwGenCharList(const QString& value){settings.setValue("Options/PwGenCharList",value);}
|
||||||
void setPwGenExcludeLookAlike(bool value){settings.setValue("Options/PwGenExcludeLookAlike",value);}
|
void setPwGenExcludeLookAlike(bool value){settings.setValue("Options/PwGenExcludeLookAlike",value);}
|
||||||
|
@ -168,7 +175,7 @@ public:
|
||||||
void setGlobalShortcut(const Shortcut& s);
|
void setGlobalShortcut(const Shortcut& s);
|
||||||
void setEntryTitlesMatch(bool value){settings.setValue("Options/EntryTitlesMatch",value);}
|
void setEntryTitlesMatch(bool value){settings.setValue("Options/EntryTitlesMatch",value);}
|
||||||
#endif
|
#endif
|
||||||
void setFeatureBookmarks(bool value){settings.setValue("Features/Bookmarks",value);}
|
//void setFeatureBookmarks(bool value){settings.setValue("Features/Bookmarks",value);}
|
||||||
|
|
||||||
unsigned fileDlgHistorySize();
|
unsigned fileDlgHistorySize();
|
||||||
void clearFileDlgHistory(){settings.remove("FileDlgHistory");};
|
void clearFileDlgHistory(){settings.remove("FileDlgHistory");};
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
/***************************************************************************
|
|
||||||
* Copyright (C) 2007 by Tarek Saidi *
|
|
||||||
* tarek.saidi@arcor.de *
|
|
||||||
* *
|
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
|
||||||
* it under the terms of the GNU General Public License as published by *
|
|
||||||
* the Free Software Foundation; version 2 of the License. *
|
|
||||||
|
|
||||||
* *
|
|
||||||
* 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., *
|
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
#include "KpxFirefox.h"
|
|
||||||
/*
|
|
||||||
KpxFirefoxAdaptor::KpxFirefoxAdaptor(KpxFirefox* obj): QDBusAbstractAdaptor(obj)
|
|
||||||
{ kpx=obj; }
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,61 +0,0 @@
|
||||||
/***************************************************************************
|
|
||||||
* Copyright (C) 2007 by Tarek Saidi *
|
|
||||||
* tarek.saidi@arcor.de *
|
|
||||||
* *
|
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
|
||||||
* it under the terms of the GNU General Public License as published by *
|
|
||||||
* the Free Software Foundation; version 2 of the License. *
|
|
||||||
|
|
||||||
* *
|
|
||||||
* 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., *
|
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
#ifndef KPXFIREFOX_H
|
|
||||||
#define KPXFIREFOX_H
|
|
||||||
|
|
||||||
/*
|
|
||||||
#include <QtDBus/QtDBus>
|
|
||||||
#include <QObject>
|
|
||||||
#include "Database.h"
|
|
||||||
|
|
||||||
class KpxFirefox:public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_CLASSINFO("D-Bus Interface", "org.keepassx.DBus.KpxFirefox")
|
|
||||||
public:
|
|
||||||
KpxFirefox(IDatabase* db){};
|
|
||||||
//~KpxFirefox(){};
|
|
||||||
public slots:
|
|
||||||
QString getMyValue(int Zahl){return QString("You sent the number %1 over DBUS").arg(Zahl);}
|
|
||||||
};
|
|
||||||
|
|
||||||
class KpxFirefoxAdaptor:public QDBusAbstractAdaptor
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_CLASSINFO("D-Bus Interface", "org.keepassx.DBus.KpxFirefox")
|
|
||||||
public:
|
|
||||||
KpxFirefoxAdaptor(KpxFirefox* kpx);
|
|
||||||
~KpxFirefoxAdaptor(){};
|
|
||||||
public slots:
|
|
||||||
QString getMyValue(int Zahl){
|
|
||||||
QString serv=QDBusConnection::sender().baseService();
|
|
||||||
QDBusConnectionInterface *inter=QDBusConnection::sender().interface();
|
|
||||||
qDebug("PID=%i",inter->servicePid(serv).value());
|
|
||||||
return kpx->getMyValue(Zahl);
|
|
||||||
|
|
||||||
}
|
|
||||||
private:
|
|
||||||
KpxFirefox* kpx;
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -211,18 +211,20 @@ void CEditEntryDlg::OnButtonOK()
|
||||||
pw.setString(password,true);
|
pw.setString(password,true);
|
||||||
entry->setPassword(pw);
|
entry->setPassword(pw);
|
||||||
entry->setComment(Edit_Comment->toPlainText());
|
entry->setComment(Edit_Comment->toPlainText());
|
||||||
|
entry->setImage(IconIndex);
|
||||||
}
|
}
|
||||||
if(Combo_Group->currentIndex()!=GroupIndex){
|
if(Combo_Group->currentIndex()!=GroupIndex){
|
||||||
db->moveEntry(entry,groups[Combo_Group->currentIndex()]);
|
db->moveEntry(entry,groups[Combo_Group->currentIndex()]);
|
||||||
EntryMoved=true; ModFlag=true;
|
EntryMoved=true;
|
||||||
|
ModFlag=true;
|
||||||
}
|
}
|
||||||
// MX-COMMENT: Should not this line go inside the if(Modflag) block?
|
|
||||||
entry->setImage(IconIndex);
|
|
||||||
|
|
||||||
if(ModFlag&&EntryMoved)done(2);
|
|
||||||
else if(ModFlag)done(1);
|
|
||||||
else done(0);
|
|
||||||
|
|
||||||
|
if(EntryMoved)
|
||||||
|
done(ModFlag?2:3);
|
||||||
|
else if (ModFlag)
|
||||||
|
done(1);
|
||||||
|
else
|
||||||
|
done(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEditEntryDlg::OnButtonCancel()
|
void CEditEntryDlg::OnButtonCancel()
|
||||||
|
|
|
@ -51,6 +51,10 @@ CSettingsDlg::CSettingsDlg(QWidget* parent):QDialog(parent,Qt::Dialog)
|
||||||
|
|
||||||
connect(Button_CustomizeEntryDetails,SIGNAL(clicked()),this,SLOT(OnCustomizeEntryDetails()));
|
connect(Button_CustomizeEntryDetails,SIGNAL(clicked()),this,SLOT(OnCustomizeEntryDetails()));
|
||||||
connect(CheckBox_InactivityLock, SIGNAL(toggled(bool)), SLOT(OnInactivityLockChange(bool)));
|
connect(CheckBox_InactivityLock, SIGNAL(toggled(bool)), SLOT(OnInactivityLockChange(bool)));
|
||||||
|
|
||||||
|
connect(CheckBox_Backup, SIGNAL( toggled(bool) ), CheckBox_BackupDelete, SLOT( setEnabled(bool) ) );
|
||||||
|
connect(CheckBox_Backup, SIGNAL( toggled(bool) ), SLOT( OnBackupDeleteChange() ) );
|
||||||
|
connect(CheckBox_BackupDelete, SIGNAL( toggled(bool) ), SLOT( OnBackupDeleteChange() ) );
|
||||||
connect(CheckBox_AutoSave, SIGNAL(toggled(bool)), SLOT(OnAutoSaveToggle(bool)));
|
connect(CheckBox_AutoSave, SIGNAL(toggled(bool)), SLOT(OnAutoSaveToggle(bool)));
|
||||||
connect(CheckBox_AutoSaveChange, SIGNAL(toggled(bool)), SLOT(OnAutoSaveChangeToggle(bool)));
|
connect(CheckBox_AutoSaveChange, SIGNAL(toggled(bool)), SLOT(OnAutoSaveChangeToggle(bool)));
|
||||||
|
|
||||||
|
@ -68,7 +72,7 @@ CSettingsDlg::CSettingsDlg(QWidget* parent):QDialog(parent,Qt::Dialog)
|
||||||
connect(this,SIGNAL(rejected()),SLOT(resetGlobalShortcut()));
|
connect(this,SIGNAL(rejected()),SLOT(resetGlobalShortcut()));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//General
|
//General (1)
|
||||||
CheckBox_OpenLast->setChecked(config->openLastFile());
|
CheckBox_OpenLast->setChecked(config->openLastFile());
|
||||||
CheckBox_RememberLastKey->setChecked(config->rememberLastKey());
|
CheckBox_RememberLastKey->setChecked(config->rememberLastKey());
|
||||||
CheckBox_ShowSysTrayIcon->setChecked(config->showSysTrayIcon());
|
CheckBox_ShowSysTrayIcon->setChecked(config->showSysTrayIcon());
|
||||||
|
@ -77,9 +81,14 @@ CSettingsDlg::CSettingsDlg(QWidget* parent):QDialog(parent,Qt::Dialog)
|
||||||
CheckBox_StartMinimized->setChecked(config->startMinimized());
|
CheckBox_StartMinimized->setChecked(config->startMinimized());
|
||||||
CheckBox_StartLocked->setChecked(config->startLocked());
|
CheckBox_StartLocked->setChecked(config->startLocked());
|
||||||
checkBox_SaveFileDlgHistory->setChecked(config->saveFileDlgHistory());
|
checkBox_SaveFileDlgHistory->setChecked(config->saveFileDlgHistory());
|
||||||
|
checkBox_AskBeforeDelete->setChecked(config->askBeforeDelete());
|
||||||
|
|
||||||
|
//General (2)
|
||||||
|
CheckBox_Backup->setChecked(config->backup());
|
||||||
|
CheckBox_BackupDelete->setChecked(config->backupDelete());
|
||||||
|
SpinBox_BackupDeleteAfter->setValue(config->backupDeleteAfter());
|
||||||
CheckBox_AutoSave->setChecked(config->autoSave());
|
CheckBox_AutoSave->setChecked(config->autoSave());
|
||||||
CheckBox_AutoSaveChange->setChecked(config->autoSaveChange());
|
CheckBox_AutoSaveChange->setChecked(config->autoSaveChange());
|
||||||
checkBox_AskBeforeDelete->setChecked(config->askBeforeDelete());
|
|
||||||
|
|
||||||
switch(config->groupTreeState()){
|
switch(config->groupTreeState()){
|
||||||
case KpxConfig::RestoreLast:
|
case KpxConfig::RestoreLast:
|
||||||
|
@ -123,7 +132,8 @@ CSettingsDlg::CSettingsDlg(QWidget* parent):QDialog(parent,Qt::Dialog)
|
||||||
SpinBox_InacitivtyTime->setValue(config->lockAfterSec());
|
SpinBox_InacitivtyTime->setValue(config->lockAfterSec());
|
||||||
|
|
||||||
//Features
|
//Features
|
||||||
CheckBox_FeatureBookmarks->setChecked(config->featureBookmarks());
|
tabWidgetSettings->removeTab(tabWidgetSettings->indexOf(tabFeatures));
|
||||||
|
//CheckBox_FeatureBookmarks->setChecked(config->featureBookmarks());
|
||||||
|
|
||||||
|
|
||||||
// TODO Desktop Integration
|
// TODO Desktop Integration
|
||||||
|
@ -201,7 +211,7 @@ void CSettingsDlg::OnOtherButton(QAbstractButton* button){
|
||||||
|
|
||||||
void CSettingsDlg::apply(){
|
void CSettingsDlg::apply(){
|
||||||
|
|
||||||
//General
|
//General (1)
|
||||||
config->setShowSysTrayIcon(CheckBox_ShowSysTrayIcon->isChecked());
|
config->setShowSysTrayIcon(CheckBox_ShowSysTrayIcon->isChecked());
|
||||||
config->setMinimizeToTray(CheckBox_CloseToTray->isChecked());
|
config->setMinimizeToTray(CheckBox_CloseToTray->isChecked());
|
||||||
config->setMinimizeTray(CheckBox_MinimizeTray->isChecked());
|
config->setMinimizeTray(CheckBox_MinimizeTray->isChecked());
|
||||||
|
@ -213,9 +223,14 @@ void CSettingsDlg::apply(){
|
||||||
else config->setGroupTreeState(KpxConfig::DoNothing);
|
else config->setGroupTreeState(KpxConfig::DoNothing);
|
||||||
config->setOpenLastFile(CheckBox_OpenLast->isChecked());
|
config->setOpenLastFile(CheckBox_OpenLast->isChecked());
|
||||||
config->setRememberLastKey(CheckBox_RememberLastKey->isChecked());
|
config->setRememberLastKey(CheckBox_RememberLastKey->isChecked());
|
||||||
|
config->setAskBeforeDelete(checkBox_AskBeforeDelete->isChecked());
|
||||||
|
|
||||||
|
//General (2)
|
||||||
|
config->setBackup(CheckBox_Backup->isChecked());
|
||||||
|
config->setBackupDelete(CheckBox_BackupDelete->isChecked());
|
||||||
|
config->setBackupDeleteAfter(SpinBox_BackupDeleteAfter->value());
|
||||||
config->setAutoSave(CheckBox_AutoSave->isChecked());
|
config->setAutoSave(CheckBox_AutoSave->isChecked());
|
||||||
config->setAutoSaveChange(CheckBox_AutoSaveChange->isChecked());
|
config->setAutoSaveChange(CheckBox_AutoSaveChange->isChecked());
|
||||||
config->setAskBeforeDelete(checkBox_AskBeforeDelete->isChecked());
|
|
||||||
|
|
||||||
//Appearence
|
//Appearence
|
||||||
config->setBannerColor1(color1);
|
config->setBannerColor1(color1);
|
||||||
|
@ -232,7 +247,7 @@ void CSettingsDlg::apply(){
|
||||||
config->setLockAfterSec(SpinBox_InacitivtyTime->value());
|
config->setLockAfterSec(SpinBox_InacitivtyTime->value());
|
||||||
|
|
||||||
//Features
|
//Features
|
||||||
config->setFeatureBookmarks(CheckBox_FeatureBookmarks->isChecked());
|
//config->setFeatureBookmarks(CheckBox_FeatureBookmarks->isChecked());
|
||||||
|
|
||||||
//TODO Desktop Integration
|
//TODO Desktop Integration
|
||||||
/*PluginsModified=Label_IntPlugin_Info->isVisible();
|
/*PluginsModified=Label_IntPlugin_Info->isVisible();
|
||||||
|
@ -342,6 +357,10 @@ void CSettingsDlg::OnAutoSaveChangeToggle(bool checked){
|
||||||
CheckBox_AutoSave->setEnabled(!checked);
|
CheckBox_AutoSave->setEnabled(!checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSettingsDlg::OnBackupDeleteChange(){
|
||||||
|
SpinBox_BackupDeleteAfter->setEnabled(CheckBox_Backup->isChecked() && CheckBox_BackupDelete->isChecked());
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef GLOBAL_AUTOTYPE
|
#ifdef GLOBAL_AUTOTYPE
|
||||||
void CSettingsDlg::resetGlobalShortcut(){
|
void CSettingsDlg::resetGlobalShortcut(){
|
||||||
AutoType::unregisterGlobalShortcut();
|
AutoType::unregisterGlobalShortcut();
|
||||||
|
|
|
@ -47,6 +47,7 @@ class CSettingsDlg : public QDialog, private Ui_SettingsDialog
|
||||||
void OnInactivityLockChange(bool checked);
|
void OnInactivityLockChange(bool checked);
|
||||||
void OnAutoSaveToggle(bool checked);
|
void OnAutoSaveToggle(bool checked);
|
||||||
void OnAutoSaveChangeToggle(bool checked);
|
void OnAutoSaveChangeToggle(bool checked);
|
||||||
|
void OnBackupDeleteChange();
|
||||||
|
|
||||||
#ifdef GLOBAL_AUTOTYPE
|
#ifdef GLOBAL_AUTOTYPE
|
||||||
private slots:
|
private slots:
|
||||||
|
|
|
@ -48,9 +48,9 @@ void Export_KeePassX_Xml::addGroup(IGroupHandle* group,QDomElement& parent,QDomD
|
||||||
Icon.appendChild(doc.createTextNode(QString::number(group->image())));
|
Icon.appendChild(doc.createTextNode(QString::number(group->image())));
|
||||||
GroupElement.appendChild(Title);
|
GroupElement.appendChild(Title);
|
||||||
GroupElement.appendChild(Icon);
|
GroupElement.appendChild(Icon);
|
||||||
QList<IGroupHandle*> childs=group->childs();
|
QList<IGroupHandle*> children=group->children();
|
||||||
for(int i=0;i<childs.size();i++){
|
for(int i=0;i<children.size();i++){
|
||||||
addGroup(childs[i],GroupElement,doc);
|
addGroup(children[i],GroupElement,doc);
|
||||||
}
|
}
|
||||||
QList<IEntryHandle*> entries=db->entries(group);
|
QList<IEntryHandle*> entries=db->entries(group);
|
||||||
for(int i=0;i<entries.size();i++){
|
for(int i=0;i<entries.size();i++){
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>606</width>
|
<width>606</width>
|
||||||
<height>479</height>
|
<height>455</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle" >
|
||||||
|
@ -46,20 +46,17 @@
|
||||||
<property name="currentIndex" >
|
<property name="currentIndex" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="TabGeneral" >
|
<widget class="QWidget" name="TabGeneral1" >
|
||||||
<property name="geometry" >
|
<property name="geometry" >
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>584</width>
|
<width>584</width>
|
||||||
<height>345</height>
|
<height>321</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="whatsThis" >
|
|
||||||
<string>The integration plugins provide features like usage of the native file dialogs and message boxes of the particular desktop environments.</string>
|
|
||||||
</property>
|
|
||||||
<attribute name="title" >
|
<attribute name="title" >
|
||||||
<string>General</string>
|
<string>General (1)</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" >
|
<layout class="QVBoxLayout" >
|
||||||
<item>
|
<item>
|
||||||
|
@ -283,20 +280,6 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="CheckBox_AutoSave" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Automatically save database on exit and workspace locking</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="CheckBox_AutoSaveChange" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Automatically save database after every change</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="checkBox_AskBeforeDelete" >
|
<widget class="QCheckBox" name="checkBox_AskBeforeDelete" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
|
@ -319,13 +302,118 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QWidget" name="TabGeneral2" >
|
||||||
|
<property name="geometry" >
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>584</width>
|
||||||
|
<height>321</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<attribute name="title" >
|
||||||
|
<string>General (2)</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout" >
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="CheckBox_Backup" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Save backups of modified entries into the 'Backup' group</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout" >
|
||||||
|
<item>
|
||||||
|
<spacer name="spacer" >
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType" >
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0" >
|
||||||
|
<size>
|
||||||
|
<width>25</width>
|
||||||
|
<height>10</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="CheckBox_BackupDelete" >
|
||||||
|
<property name="enabled" >
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text" >
|
||||||
|
<string>Delete backup entries older than:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="SpinBox_BackupDeleteAfter" >
|
||||||
|
<property name="enabled" >
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy" >
|
||||||
|
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimum" >
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum" >
|
||||||
|
<number>999</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>days</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="CheckBox_AutoSave" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Automatically save database on exit and workspace locking</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="CheckBox_AutoSaveChange" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Automatically save database after every change</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer" >
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0" >
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
<widget class="QWidget" name="TabPage" >
|
<widget class="QWidget" name="TabPage" >
|
||||||
<property name="geometry" >
|
<property name="geometry" >
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>584</width>
|
<width>584</width>
|
||||||
<height>345</height>
|
<height>321</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="title" >
|
<attribute name="title" >
|
||||||
|
@ -685,7 +773,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>584</width>
|
<width>584</width>
|
||||||
<height>345</height>
|
<height>321</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="title" >
|
<attribute name="title" >
|
||||||
|
@ -847,7 +935,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>584</width>
|
<width>584</width>
|
||||||
<height>345</height>
|
<height>321</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="title" >
|
<attribute name="title" >
|
||||||
|
@ -892,7 +980,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>584</width>
|
<width>584</width>
|
||||||
<height>345</height>
|
<height>321</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="title" >
|
<attribute name="title" >
|
||||||
|
@ -1012,7 +1100,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>584</width>
|
<width>584</width>
|
||||||
<height>345</height>
|
<height>321</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="title" >
|
<attribute name="title" >
|
||||||
|
@ -1239,8 +1327,12 @@
|
||||||
<tabstop>CheckBox_StartLocked</tabstop>
|
<tabstop>CheckBox_StartLocked</tabstop>
|
||||||
<tabstop>checkBox_SaveFileDlgHistory</tabstop>
|
<tabstop>checkBox_SaveFileDlgHistory</tabstop>
|
||||||
<tabstop>Button_ClearFileDlgHistory</tabstop>
|
<tabstop>Button_ClearFileDlgHistory</tabstop>
|
||||||
<tabstop>CheckBox_AutoSave</tabstop>
|
|
||||||
<tabstop>checkBox_AskBeforeDelete</tabstop>
|
<tabstop>checkBox_AskBeforeDelete</tabstop>
|
||||||
|
<tabstop>CheckBox_Backup</tabstop>
|
||||||
|
<tabstop>CheckBox_BackupDelete</tabstop>
|
||||||
|
<tabstop>SpinBox_BackupDeleteAfter</tabstop>
|
||||||
|
<tabstop>CheckBox_AutoSave</tabstop>
|
||||||
|
<tabstop>CheckBox_AutoSaveChange</tabstop>
|
||||||
<tabstop>ButtonColor1</tabstop>
|
<tabstop>ButtonColor1</tabstop>
|
||||||
<tabstop>ButtonColor2</tabstop>
|
<tabstop>ButtonColor2</tabstop>
|
||||||
<tabstop>ButtonTextColor</tabstop>
|
<tabstop>ButtonTextColor</tabstop>
|
||||||
|
|
|
@ -170,7 +170,8 @@ void KeepassEntryView::updateEntry(EntryViewItem* item){
|
||||||
if(config->hideUsernames())
|
if(config->hideUsernames())
|
||||||
item->setText(j++,"******");
|
item->setText(j++,"******");
|
||||||
else
|
else
|
||||||
item->setText(j++,entry->username());}
|
item->setText(j++,entry->username());
|
||||||
|
}
|
||||||
if (Columns.at(2)){item->setText(j++,entry->url());}
|
if (Columns.at(2)){item->setText(j++,entry->url());}
|
||||||
if (Columns.at(3)){
|
if (Columns.at(3)){
|
||||||
if(config->hidePasswords())
|
if(config->hidePasswords())
|
||||||
|
@ -195,25 +196,40 @@ void KeepassEntryView::updateEntry(EntryViewItem* item){
|
||||||
item->setText(j++,entry->binaryDesc());}
|
item->setText(j++,entry->binaryDesc());}
|
||||||
if(Columns.at(10) && ViewMode==ShowSearchResults){
|
if(Columns.at(10) && ViewMode==ShowSearchResults){
|
||||||
item->setText(j,entry->group()->title());
|
item->setText(j,entry->group()->title());
|
||||||
item->setIcon(j++,db->icon(entry->group()->image()));}
|
item->setIcon(j++,db->icon(entry->group()->image()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeepassEntryView::editEntry(EntryViewItem* item){
|
void KeepassEntryView::editEntry(EntryViewItem* item){
|
||||||
|
CEntry old = item->EntryHandle->data();
|
||||||
|
|
||||||
CEditEntryDlg dlg(db,item->EntryHandle,this,true);
|
CEditEntryDlg dlg(db,item->EntryHandle,this,true);
|
||||||
switch(dlg.exec()){
|
int result = dlg.exec();
|
||||||
|
switch(result){
|
||||||
case 0: //canceled or no changes
|
case 0: //canceled or no changes
|
||||||
break;
|
break;
|
||||||
case 1: //modifications but same group
|
case 1: //modifications but same group
|
||||||
updateEntry(item);
|
updateEntry(item);
|
||||||
emit fileModified();
|
emit fileModified();
|
||||||
break;
|
break;
|
||||||
case 2: //entry moved to another group
|
//entry moved to another group
|
||||||
|
case 2: //modified
|
||||||
|
case 3: //not modified
|
||||||
delete item;
|
delete item;
|
||||||
Items.removeAt(Items.indexOf(item));
|
Items.removeAt(Items.indexOf(item));
|
||||||
emit fileModified();
|
emit fileModified();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((result==1 || result==2) && config->backup()){
|
||||||
|
old.LastAccess = QDateTime::currentDateTime();
|
||||||
|
old.LastMod = QDateTime::currentDateTime();
|
||||||
|
IGroupHandle* bGroup = db->backupGroup();
|
||||||
|
if (bGroup==NULL)
|
||||||
|
emit requestCreateGroup("Backup", 4, NULL);
|
||||||
|
if ((bGroup = db->backupGroup())!=NULL)
|
||||||
|
db->addEntry(&old, bGroup);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#define NUM_COLUMNS 11
|
#define NUM_COLUMNS 11
|
||||||
|
|
||||||
class EntryViewItem;
|
class EntryViewItem;
|
||||||
|
class GroupViewItem;
|
||||||
enum SelectionState{NONE,SINGLE,MULTIPLE,SEARCHGROUP};
|
enum SelectionState{NONE,SINGLE,MULTIPLE,SEARCHGROUP};
|
||||||
|
|
||||||
class KeepassEntryView:public QTreeWidget{
|
class KeepassEntryView:public QTreeWidget{
|
||||||
|
@ -44,6 +45,7 @@ class KeepassEntryView:public QTreeWidget{
|
||||||
QMenu *ContextMenu;
|
QMenu *ContextMenu;
|
||||||
QBitArray Columns;
|
QBitArray Columns;
|
||||||
void setCurrentEntry(IEntryHandle* entry);
|
void setCurrentEntry(IEntryHandle* entry);
|
||||||
|
inline IGroupHandle* getCurrentGroup() { return CurrentGroup; };
|
||||||
private:
|
private:
|
||||||
void setEntry(IEntryHandle* entry);
|
void setEntry(IEntryHandle* entry);
|
||||||
void updateEntry(EntryViewItem*);
|
void updateEntry(EntryViewItem*);
|
||||||
|
@ -97,6 +99,7 @@ class KeepassEntryView:public QTreeWidget{
|
||||||
signals:
|
signals:
|
||||||
void fileModified();
|
void fileModified();
|
||||||
void selectionChanged(SelectionState);
|
void selectionChanged(SelectionState);
|
||||||
|
void requestCreateGroup(QString title, quint32 image, GroupViewItem* parent);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ void KeepassGroupView::createItems(){
|
||||||
Items.append(new GroupViewItem(this));
|
Items.append(new GroupViewItem(this));
|
||||||
Items.back()->setText(0,groups[i]->title());
|
Items.back()->setText(0,groups[i]->title());
|
||||||
Items.back()->GroupHandle=groups[i];
|
Items.back()->GroupHandle=groups[i];
|
||||||
addChilds(Items.back());
|
addChildren(Items.back());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(int i=0;i<Items.size();i++){
|
for(int i=0;i<Items.size();i++){
|
||||||
|
@ -71,15 +71,15 @@ void KeepassGroupView::showSearchResults(){
|
||||||
emit searchResultsSelected();
|
emit searchResultsSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeepassGroupView::addChilds(GroupViewItem* item){
|
void KeepassGroupView::addChildren(GroupViewItem* item){
|
||||||
QList<IGroupHandle*>childs=item->GroupHandle->childs();
|
QList<IGroupHandle*>children=item->GroupHandle->children();
|
||||||
if(!childs.size())
|
if(!children.size())
|
||||||
return;
|
return;
|
||||||
for(int i=0; i<childs.size(); i++){
|
for(int i=0; i<children.size(); i++){
|
||||||
Items.push_back(new GroupViewItem(item));
|
Items.push_back(new GroupViewItem(item));
|
||||||
Items.back()->setText(0,childs[i]->title());
|
Items.back()->setText(0,children[i]->title());
|
||||||
Items.back()->GroupHandle=childs[i];
|
Items.back()->GroupHandle=children[i];
|
||||||
addChilds(Items.back());
|
addChildren(Items.back());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,7 +106,15 @@ void KeepassGroupView::OnNewGroup(){
|
||||||
GroupViewItem* parent=(GroupViewItem*)currentItem();
|
GroupViewItem* parent=(GroupViewItem*)currentItem();
|
||||||
CGroup NewGroup;
|
CGroup NewGroup;
|
||||||
CEditGroupDialog dlg(db,&NewGroup,parentWidget(),true);
|
CEditGroupDialog dlg(db,&NewGroup,parentWidget(),true);
|
||||||
if(dlg.exec()){
|
if(dlg.exec())
|
||||||
|
createGroup(NewGroup.Title, NewGroup.Image, parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
void KeepassGroupView::createGroup(const QString& title, quint32 image, GroupViewItem* parent){
|
||||||
|
CGroup NewGroup;
|
||||||
|
NewGroup.Title = title;
|
||||||
|
NewGroup.Image = image;
|
||||||
|
|
||||||
IGroupHandle* group;
|
IGroupHandle* group;
|
||||||
if(parent){
|
if(parent){
|
||||||
group=db->addGroup(&NewGroup,parent->GroupHandle);
|
group=db->addGroup(&NewGroup,parent->GroupHandle);
|
||||||
|
@ -114,42 +122,23 @@ void KeepassGroupView::OnNewGroup(){
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if(topLevelItemCount()){
|
if(topLevelItemCount()){
|
||||||
if(topLevelItem(topLevelItemCount()-1)==SearchResultItem)
|
int i=1;
|
||||||
Items.append(new GroupViewItem(this,topLevelItem(topLevelItemCount()-2)));
|
if(topLevelItem(topLevelItemCount()-i)==SearchResultItem)
|
||||||
else
|
i++;
|
||||||
Items.append(new GroupViewItem(this,topLevelItem(topLevelItemCount()-1)));
|
if(title!="Backup" && topLevelItem(topLevelItemCount()-i)->text(0)=="Backup")
|
||||||
}
|
i++;
|
||||||
else
|
Items.append(new GroupViewItem(this,topLevelItem(topLevelItemCount()-i)));
|
||||||
Items.append(new GroupViewItem(this));
|
|
||||||
group=db->addGroup(&NewGroup,NULL);
|
|
||||||
}
|
|
||||||
Items.back()->GroupHandle=group;
|
|
||||||
Items.back()->setText(0,group->title());
|
|
||||||
Items.back()->setIcon(0,db->icon(group->image()));
|
|
||||||
}
|
|
||||||
emit fileModified();
|
|
||||||
}
|
|
||||||
|
|
||||||
void KeepassGroupView::createGroup(const QString& title, quint32 image){
|
|
||||||
CGroup NewGroup;
|
|
||||||
NewGroup.Title = title;
|
|
||||||
NewGroup.Image = image;
|
|
||||||
|
|
||||||
IGroupHandle* group;
|
|
||||||
if(topLevelItemCount()){
|
|
||||||
if(topLevelItem(topLevelItemCount()-1)==SearchResultItem)
|
|
||||||
Items.append(new GroupViewItem(this,topLevelItem(topLevelItemCount()-2)));
|
|
||||||
else
|
|
||||||
Items.append(new GroupViewItem(this,topLevelItem(topLevelItemCount()-1)));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Items.append(new GroupViewItem(this));
|
Items.append(new GroupViewItem(this));
|
||||||
|
|
||||||
group = db->addGroup(&NewGroup,NULL);
|
group = db->addGroup(&NewGroup,NULL);
|
||||||
|
}
|
||||||
|
|
||||||
Items.back()->GroupHandle = group;
|
Items.back()->GroupHandle = group;
|
||||||
Items.back()->setText(0, group->title());
|
Items.back()->setText(0, group->title());
|
||||||
Items.back()->setIcon(0, db->icon(group->image()));
|
Items.back()->setIcon(0, db->icon(group->image()));
|
||||||
|
emit fileModified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeepassGroupView::OnEditGroup(){
|
void KeepassGroupView::OnEditGroup(){
|
||||||
|
|
|
@ -36,7 +36,9 @@ class KeepassGroupView:public QTreeWidget{
|
||||||
void createItems();
|
void createItems();
|
||||||
void showSearchResults();
|
void showSearchResults();
|
||||||
void setCurrentGroup(IGroupHandle* group);
|
void setCurrentGroup(IGroupHandle* group);
|
||||||
void createGroup(const QString& title, quint32 image);
|
|
||||||
|
public slots:
|
||||||
|
void createGroup(const QString& title, quint32 image, GroupViewItem* group=NULL);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void dragEnterEvent(QDragEnterEvent* event);
|
virtual void dragEnterEvent(QDragEnterEvent* event);
|
||||||
|
@ -49,7 +51,7 @@ class KeepassGroupView:public QTreeWidget{
|
||||||
virtual void mouseMoveEvent(QMouseEvent *event);
|
virtual void mouseMoveEvent(QMouseEvent *event);
|
||||||
virtual void paintEvent ( QPaintEvent * event );
|
virtual void paintEvent ( QPaintEvent * event );
|
||||||
virtual void contextMenuEvent(QContextMenuEvent *event);
|
virtual void contextMenuEvent(QContextMenuEvent *event);
|
||||||
void addChilds(GroupViewItem* item);
|
void addChildren(GroupViewItem* item);
|
||||||
QPoint DragStartPos;
|
QPoint DragStartPos;
|
||||||
GroupViewItem* DragItem;
|
GroupViewItem* DragItem;
|
||||||
GroupViewItem* LastHoverItem;
|
GroupViewItem* LastHoverItem;
|
||||||
|
|
|
@ -77,6 +77,7 @@ int main(int argc, char **argv)
|
||||||
fileDlgHistory.load();
|
fileDlgHistory.load();
|
||||||
|
|
||||||
// PlugIns
|
// PlugIns
|
||||||
|
/*
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
if(config->integrPlugin()!=KpxConfig::NoIntegr){
|
if(config->integrPlugin()!=KpxConfig::NoIntegr){
|
||||||
QString LibName="libkeepassx-";
|
QString LibName="libkeepassx-";
|
||||||
|
@ -121,6 +122,7 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
if(!app){
|
if(!app){
|
||||||
#if defined(Q_WS_X11) && defined(GLOBAL_AUTOTYPE)
|
#if defined(Q_WS_X11) && defined(GLOBAL_AUTOTYPE)
|
||||||
app = new KeepassApplication(argc,argv);
|
app = new KeepassApplication(argc,argv);
|
||||||
|
@ -158,7 +160,7 @@ int main(int argc, char **argv)
|
||||||
else{
|
else{
|
||||||
if(loc.name()!="en_US")
|
if(loc.name()!="en_US")
|
||||||
qWarning(CSTR(
|
qWarning(CSTR(
|
||||||
QString("Kpx: No Translation found for '%1 (%2)' using 'English (UnitedStates)'")
|
QString("Kpx: No Translation found for '%1 (%2)' using 'English (United States)'")
|
||||||
.arg(QLocale::languageToString(loc.language()))
|
.arg(QLocale::languageToString(loc.language()))
|
||||||
.arg(QLocale::countryToString(loc.country()))
|
.arg(QLocale::countryToString(loc.country()))
|
||||||
));
|
));
|
||||||
|
@ -175,7 +177,7 @@ int main(int argc, char **argv)
|
||||||
else{
|
else{
|
||||||
if(loc.name()!="en_US")
|
if(loc.name()!="en_US")
|
||||||
qWarning(CSTR(
|
qWarning(CSTR(
|
||||||
QString("Qt: No Translation found for '%1 (%2)' using 'English (UnitedStates)'")
|
QString("Qt: No Translation found for '%1 (%2)' using 'English (United States)'")
|
||||||
.arg(QLocale::languageToString(loc.language()))
|
.arg(QLocale::languageToString(loc.language()))
|
||||||
.arg(QLocale::countryToString(loc.country()))
|
.arg(QLocale::countryToString(loc.country()))
|
||||||
));
|
));
|
||||||
|
|
|
@ -152,6 +152,7 @@ void KeepassMainWindow::setupConnections(){
|
||||||
connect(EditDeleteGroupAction, SIGNAL(triggered()), GroupView, SLOT(OnDeleteGroup()));
|
connect(EditDeleteGroupAction, SIGNAL(triggered()), GroupView, SLOT(OnDeleteGroup()));
|
||||||
connect(EditNewEntryAction, SIGNAL(triggered()), EntryView, SLOT(OnNewEntry()));
|
connect(EditNewEntryAction, SIGNAL(triggered()), EntryView, SLOT(OnNewEntry()));
|
||||||
connect(EditEditEntryAction, SIGNAL(triggered()), EntryView, SLOT(OnEditEntry()));
|
connect(EditEditEntryAction, SIGNAL(triggered()), EntryView, SLOT(OnEditEntry()));
|
||||||
|
connect(EntryView, SIGNAL(requestCreateGroup(QString,quint32,GroupViewItem*)), GroupView, SLOT(createGroup(QString,quint32,GroupViewItem*)));
|
||||||
connect(EditCloneEntryAction, SIGNAL(triggered()), EntryView, SLOT(OnCloneEntry()));
|
connect(EditCloneEntryAction, SIGNAL(triggered()), EntryView, SLOT(OnCloneEntry()));
|
||||||
connect(EditDeleteEntryAction, SIGNAL(triggered()), EntryView, SLOT(OnDeleteEntry()));
|
connect(EditDeleteEntryAction, SIGNAL(triggered()), EntryView, SLOT(OnDeleteEntry()));
|
||||||
connect(EditUsernameToClipboardAction, SIGNAL(triggered()), EntryView, SLOT(OnUsernameToClipboard()));
|
connect(EditUsernameToClipboardAction, SIGNAL(triggered()), EntryView, SLOT(OnUsernameToClipboard()));
|
||||||
|
@ -860,13 +861,19 @@ bool KeepassMainWindow::OnFileSave(){
|
||||||
if(!db->file())
|
if(!db->file())
|
||||||
return OnFileSaveAs();
|
return OnFileSaveAs();
|
||||||
saveLastFilename(db->file()->fileName());
|
saveLastFilename(db->file()->fileName());
|
||||||
if(db->save())
|
if(db->save()){
|
||||||
setStateFileModified(false);
|
setStateFileModified(false);
|
||||||
|
if (config->backup() && config->backupDelete() && config->backupDeleteAfter()>0){
|
||||||
|
IGroupHandle* backupGroup = db->backupGroup();
|
||||||
|
if (backupGroup && backupGroup==EntryView->getCurrentGroup())
|
||||||
|
EntryView->showGroup(backupGroup);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
showErrMsg(QString("%1\n%2").arg(tr("File could not be saved.")).arg(db->getError()));
|
showErrMsg(QString("%1\n%2").arg(tr("File could not be saved.")).arg(db->getError()));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KeepassMainWindow::OnFileSaveAs(){
|
bool KeepassMainWindow::OnFileSaveAs(){
|
||||||
|
|
Loading…
Reference in New Issue