Commit Graph

34 Commits

Author SHA1 Message Date
Janek Bevendorff
596d2cf425 Refactor Config.
Replaces all string configuration options with enum types
that can be checked by the compiler. This prevents spelling
errors, in-place configuration definitions, and inconsistent
default values. The default value config getter signature was
removed in favour of consistently and centrally default-initialised
configuration values.

Individual default values were adjusted for better security,
such as the default password length, which was increased from
16 characters to 32.

The already existing config option deprecation map was extended
by a general migration procedure using configuration versioning.

Settings were split into Roaming and Local settings, which
go to their respective AppData locations on Windows.

Fixes #2574
Fixes #2193
2020-05-02 22:30:27 +02:00
Janek Bevendorff
b045160e4f Bundle icons using the Qt resource system.
Simplify resource loading logic and enable reproducible builds.
Fixes #2582
2020-03-14 10:13:12 -04:00
Jonathan White
63855346bf Fix global Auto-Type when database locked
* Store the currently active window right when the global keyboard shortcut is triggered
* Eliminate unnecessary window raise/lower and delays on macOS
* Remove duplicate addition of macutils symbols from mac Auto-Type plugin
* Fix tests to fake trigger a global autotype sequence
2019-05-12 12:37:50 -04:00
Kyle Kneitinger
4d4c839afa Customize buttons on MessageBox and confirm before recycling (#2376)
* Add confirmation prompt before moving groups to the recycling bin

Spawn a yes/no QMessage box when "Delete Group" is selected on a group
that is not already in the recycle bin (note: the prompt for deletion
from the recycle bin was already implemented).  This follows the same
pattern and language as entry deletion.

Fixes #2125

* Make prompts for destructive operations use action words on buttons

Replace yes/no, yes/cancel (and other such buttons on prompts that cause
data to be destroyed) use language that indicates the action that it is
going to take. This makes destructive/unsafe and/or irreversible operations
more clear to the user.

Address feedback on PR #2376

* Refactor MessageBox class to allow for custom buttons

Replaces arguments and return values of type QMessageBox::StandardButton(s)
with MessageBox::Button(s), which reimplements the entire set of
QMessageBox::StandardButton and allows for custom KeePassXC buttons,
such as "Skip". Modifies all calls to MessageBox functions to use
MessageBox::Button(s).

Addresses feedback on #2376

* Remove MessageBox::addButton in favor of map lookup

Replaced the switch statement mechanism in MessageBox::addButton with
a map lookup to address CodeFactor Complex Method issue. This has a
side-effect of a small performance/cleanliness increase, as an
extra QPushButton is no longer created/destroyed (to obtain it's label
text) everytime a MessageBox button based on QMessageBox::StandardButton
is created; now the text is obtained once, at application start up.
2018-12-19 23:14:11 -05: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
Louis-Bertrand Varin
8324d03f0a Formatting the code. 2018-03-31 16:01:30 -04:00
Thomas Luzat
46e8e3dbbc Test speedup (#1678)
* Tests: Speed up AutoType testing

Decrease default autotype delay to 1 to improve test suite speed by
seconds. This shaves multiple seconds off the whole test suite. In some
cases, the largest part.

Also, initialize config just creating the test instance, just in case
that it ever depends on the configuration values at that point already.

* Tests: Speed up Kdbx4 testing

This speeds up the Kdbx4 tests by using parameters optimized for speed
for the key derivation functions. On an i7-6700K the tests run close to
50% faster with this change (about 1.5s vs. 3s).
2018-03-08 10:20:25 +01:00
thez3ro
5f9f27604b fix autotype custom attributes 2018-03-04 23:08:58 +01:00
thez3ro
a76c92ed9a
change inAutotype logic, preventing multiple autotype call 2018-02-04 23:13:15 +01:00
thez3ro
a9479fd662
refactor autotype sequences and entry-point functions 2018-02-04 23:13:15 +01:00
thez3ro
065a85e05c
fix effective autotype sequence 2018-02-04 23:13:15 +01:00
Janek Bevendorff
7a6850d5fe Move useful QTest template specializations to global header file
Fix KDBX test linker errors on Windows
2018-01-24 13:32:37 +01:00
thez3ro
6d046f251e
Remove minus since it's an invalid literal 2018-01-03 12:56:18 +01:00
thez3ro
e803076063
improve regex filtering 2018-01-03 12:56:18 +01:00
thez3ro
a02a49a184
add test for syntax checking 2018-01-03 12:56:18 +01:00
frostasm
1f5a0c0130 Add test for resolved placeholders in window association title 2017-10-23 22:55:22 +03:00
thez3ro
a53b111182
Update and fix copyright headers 2017-06-14 15:54:43 +02:00
Jens Rutschmann
9a59a124aa Compare window title with entry URLs during autotype matching. (#556)
* Compare window title with entry URLs during autotype matching.

* Adapted option label to reflect that both entry title and URL are used for auto-type window matching.
2017-05-13 19:02:54 -04:00
thez3ro
51c668a0fd
fix tests with new CustomAttribute format 2017-02-08 01:14:52 +01:00
TheZ3ro
405b82588b Add Autotype Entry-Attributes, Fix Group default sequence (#107) 2016-11-25 12:26:59 -05:00
Felix Geyer
dc7b6623a9 Merge branch '2.0' 2015-10-11 10:44:30 +02:00
Felix Geyer
820941fd40 Auto-Type: Only require a substring match for regex.
This matches the behavior of KeePass.

Refs #357
2015-10-10 17:36:08 +02:00
Felix Geyer
862941abf6 TestAutoType: Restore AutoTypeEntryTitleMatch before every test. 2015-10-10 17:23:57 +02:00
Felix Geyer
c8ae31a248 Remove backported Qt5 test macros. 2015-09-23 22:21:21 +02:00
Felix Geyer
7fa0eddc5f Make C++11 mandatory. 2015-09-12 13:55:50 +02:00
Felix Geyer
0d6117bf4c Do some basic self-checks when initializing the crypto backend. 2014-06-15 11:17:40 +02:00
Florian Geyer
77af79498c Move QTEST_GUILESS_MAIN statements before test cases. 2014-05-16 12:32:52 +02:00
Felix Geyer
bf39d0b1be Enable entry title matching but always ask before performing auto-type. 2014-05-15 18:34:12 +02:00
Felix Geyer
147cd4ed7b Add option to use the entry title for auto-type window matching. 2014-05-15 18:30:57 +02:00
Felix Geyer
b194c29166 Show a dialog when no window matches for auto-type. 2014-04-14 22:57:25 +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
Florian Geyer
8347fd36ba More auto-type tests. 2012-11-02 15:09:54 +01:00
Florian Geyer
ac56ac98f7 Extend auto-type test. 2012-10-28 18:18:24 +01:00
Felix Geyer
58b6fb36f8 Add missing files for the last commit. 2012-10-28 15:42:19 +01:00