Commit Graph

44 Commits

Author SHA1 Message Date
Andrew Meyer
45848c3f61 Implement 'Save Database Backup' option
Add an option in the 'Database' menu to save a backup of the current database.

Add unit test for saving database copy

* Open a test database, mark it as modified, and save a copy
* Fail if the copy is not a valid database
* Fail if the original database is saved
* Fail if the original database is no longer marked as modified
2020-05-16 11:00:27 -04:00
Jonathan White
689a85a071 Make GUI tests more robust for CI 2020-05-16 00:47:01 +02:00
Jonathan White
fb5173cebd Remove inline password generator when editing entries
* Always use a pop-up generator to avoid cluttering the user interface and making it clear that a password is being created
2020-03-09 18:03:20 -04:00
Jonathan White
1e694271a3 Improve Database and CLI tests 2019-10-20 18:56:41 -04:00
Balazs Gyurak
09181fab13 Add group sorting feature
* Enabling sorting of groups and their children in ascending and descending direction
2019-06-18 18:51:38 -04:00
Janek Bevendorff
d612cad09a
Refactor Database and Database widgets (#2491)
The Database, DatabaseWidget, and DatabaseTabWidget classes share many responsibilities in inconsistent ways resulting in impenetrable and unmaintainable code and a diverse set of bugs and architecture restrictions. This patch reworks the architecture, responsibilities of, and dependencies between these classes.

The core changes are:

* Move loading and saving logic from widgets into the Database class
* Get rid of the DatabaseManagerStruct and move all the information contained in it into the Database
* Let database objects keep track of modifications and dirty/clean state instead of handing this to external widgets
* Move GUI interactions for loading and saving from the DatabaseTabWidget into the DatabaseWidget (resolves #2494 as a side-effect)
* Heavily clean up DatabaseTabWidget and degrade it to a slightly glorified QTabWidget
* Use QSharedPointers for all Database objects
* Remove the modifiedImmediate signal and replace it with a markAsModified() method
* Implement proper tabName() method instead of reading back titles from GUI widgets (resolves #1389 and its duplicates #2146 #855)
* Fix unwanted AES-KDF downgrade if database uses Argon2 and has CustomData
* Improve code

This patch is also the first major step towards solving issues #476 and #2322.
2018-11-22 11:47:31 +01:00
Janek Bevendorff
108e4efc8a Fix tests on Windows 2018-10-19 21:49:55 +02:00
Janek Bevendorff
113c8eb702 Add CLI tests and improve coding style and i18n
The CLI module was lacking unit test coverage and showed some severe
coding style violations, which this patch addresses.

In addition, all uses of qCritical() with untranslatble raw char*
sequences were removed in favor of proper locale strings. These are
written to STDERR through QTextStreams and support output
redirection for testing purposes. With this change, error messages don't
depend on the global Qt logging settings and targets anymore and go
directly to the terminal or into a file if needed.

This patch also fixes a bug discovered during unit test development,
where the extract command would just dump the raw XML contents without
decrypting embedded Salsa20-protected values first, making the XML
export mostly useless, since passwords are scrambled.

Lastly, all CLI commands received a dedicated -h/--help option.
2018-10-19 21:49:54 +02:00
Janek Bevendorff
e443cde452 Add a new database settings wizard
This patch implements a new database wizard to guide users through the process
of setting up a new database and choosing sane encryption settings.

It also reimplements the master key settings to be more
user-friendly. Users can now add, change, or remove individual composite
key components instead of having to set all components at once. This
avoids confusion about a password being reset if the user only wants to
add a key file.

With these changes comes a major refactor of how database composite keys and key
components are handled. Copying of keys is prohibited and each key
exists only once in memory and is referenced via shared pointers. GUI
components for changing individual keys are encapsulated into separate
classes to be more reusable. The password edit and generator widgets
have also been refactored to be more reusable.
2018-09-25 21:12:47 +02:00
Louis-Bertrand Varin
8324d03f0a Formatting the code. 2018-03-31 16:01:30 -04:00
Joan Bruguera
8646586c1a Add GUI test for issue #1595 (minus the minimize at startup case). 2018-03-12 21:30:25 +01:00
Nick Spain
7dfcad6f8f Write regression test for #1447 2018-02-18 16:17:12 +01:00
Janek Bevendorff
72a1c65d00
Fix memory leaks in tests 2018-01-13 14:24:58 -05:00
frostasm
3720c5ef79 Add test for drag and drop database files into main window 2018-01-03 16:12:05 +02:00
Janek Bevendorff
8651736e61
Merge branch 'release/2.2.3' into develop 2017-11-26 18:23:48 +01:00
thez3ro
c3c67f18b8
add test for DB creation 2017-11-02 20:07:41 +01:00
Jonathan White
4e7f2c6a4f
Fix apply button not saving new entries 2017-10-28 09:23:45 -04:00
thez3ro
a53b111182
Update and fix copyright headers 2017-06-14 15:54:43 +02:00
Weslly
bf57a28654 Add TOTP support 2017-05-03 20:55:14 -03:00
thez3ro
be9bd16b4c
Add diceware tests 2017-03-22 00:00:23 +01:00
thez3ro
e3602e3c75
fix regex for placeholders, fix #402, add regression test 2017-03-16 20:32:29 +01:00
Janek Bevendorff
8d487d31a4
Replace Q_EMIT, Q_SIGNALS and Q_SLOTS macros with MOC keywords 2017-03-10 16:12:02 +01:00
Jonathan White
5f1b9a17ca
Fix testgui for Windows (PR #137)
Introduces TemporaryFile class to act as a proxy to fix autoreload test cases failing on windows due to the behavior of QTemporaryFile.
2017-01-03 22:27:41 -05:00
Jonathan White
3d249365c2
Merge remote-tracking branch 'origin/feature/autoreload-db' into develop 2016-11-25 12:04:44 -05:00
Jonathan White
7fb33653ad
Implemented major autoreload functionality
* Ignore autoreload on save / save-as
* Consolidated db save code
* Corrected bug (crash) in merge entry code due to not cloning the entry
* Enhanced known modified status of database
* Implemented test cases for autoreload
2016-11-25 12:03:36 -05:00
TheZ3ro
b2f3cc6903 Add some password-related feature (#92)
* Add Standalone Password Generator. Closes #18 
* Add an entropy meter for passwords. Closes #84
* Don't require password repeat when it is visible. Fixes #27
2016-11-23 21:59:24 -05:00
Jonathan White
e25cd9ba48 Add Merge database utility function (#47)
Thank you to @TheZ3ro and @monomon for there major contributions to this PR!
2016-11-07 22:37:42 -05:00
Jonathan White
13983d0e51 Make search always visible (PR #67)
* Moved search bar to toolbar and consolidated search options into dropdown list
* Updated GUI tests to be atomic and rewrote search tests
* Searches are saved between databases
* Search is cleared when all databases are closed
* Implemented global search shortcut (CTRL+F) and a notification bar when in search mode
2016-11-02 21:01:02 -04:00
Felix Geyer
3d1c27ceb7 Copy the database in TestGui before opening it.
We don't want to create lock files in the source tree.
2015-07-19 19:33:47 +02:00
Felix Geyer
f7dd63a126 Add gui tests for deleting entries from the recycle bin. 2013-10-08 22:36:27 +02:00
Felix Geyer
6504b6f2bd Drop Qt module name from include statements.
This is a preparation to be able to build KeePassX against Qt 5.
2013-10-03 15:18:16 +02:00
Felix Geyer
8b8e55aa17 Store the filename instead of a QTemporaryFile in TestGui.
On Windows QTemporaryFile keeps the file handle open
which conflicts with QSaveFile.
2012-10-22 17:52:08 +02:00
Felix Geyer
e166722026 Implement database locking.
Closes #35
2012-10-12 12:12:00 +02:00
Felix Geyer
edb644baef Add TestGui::testCloneEntry(). 2012-07-22 22:02:06 +02:00
Felix Geyer
4781fc19fe Add a few drag'n'drop tests. 2012-07-17 23:29:25 +02:00
Felix Geyer
f767a098d6 Add GUI test for changing the database transform rounds.
Refs #34
2012-07-17 10:56:56 +02:00
Felix Geyer
2b694bab16 Refactor TestGui a bit. 2012-07-17 10:16:59 +02:00
Felix Geyer
2e38b01d80 Add Save and SaveAs gui tests. 2012-07-06 19:21:19 +02:00
Felix Geyer
dedce07530 Add KeePass1 import GUI test. 2012-06-29 15:54:34 +02:00
Florian Geyer
b08d2d45b7 Add gui test for search. 2012-05-16 10:18:27 +02:00
Florian Geyer
44489bf6f8 Fix creation of history item when a new entry is added.
Add corresponding gui test.
2012-05-11 09:16:45 +02:00
Felix Geyer
3baaf6be97 Add TestGui::testEditEntry().
This tests that the database isn't marked as modified when we don't change
anything but still press the Ok button.
2012-04-14 20:31:35 +02:00
Florian Geyer
ccc8725bb3 Clean up gui test. 2011-12-29 20:10:19 +01:00
Felix Geyer
4da6da8828 Add a GUI unit test. 2011-12-26 19:18:21 +01:00