137 Commits

Author SHA1 Message Date
Gianluca Recchia e2ee82169c Remove redundant check for the version flag
Just a couple lines above, the application would already exit if the
version option is set. This extra check is not needed.
2018-10-31 14:19:01 +01:00
Gianluca Recchia f31d65bdaf Replace deprecated parts of the code (#2419)
Performing a dev build against the latest version of Qt failed
because of some deprecated members. They have been replaced
according to the Qt documentation.

Further, Q_OS_MACOS is now the only macro available to identify a
machine running macOS, the others are now deprecated.
See https://doc.qt.io/qt-5/qtglobal.html#Q_OS_OSX and
https://doc.qt.io/qt-5/qtglobal.html#Q_OS_MAC.
2018-10-26 15:19:04 +02:00
Janek Bevendorff b45f0e3e46 Enable high-DPI scaling to support 4k screens.
This enables coordinate system scaling for high-DPI
displays, which enforces correct proportions even
on small 4k displays. The icons are scaled up without
interpolation, which makes them crisp, but a bit
pixelated. A new scalable icon set will solve this
problem, but is not scope of this patch.

Resolves #548, #1381, #1710, #1888

In addition, this patch enforces the KeePassXC icon
theme for the KMessageBox close icon, since using
the system theme produces very ugly icons on some
Linux systems.
2018-10-21 20:34:46 +02:00
Janek Bevendorff 0ca7fd369a Implement review feedback 2018-10-19 22:16:44 +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
Jake Howard ca328242bc Don't show application if we're only showing the help / version 2018-10-14 16:20:28 -04:00
Nick Fox c19df0130b Allows printing version with -v when an instance is already running
Fixes #1362 by checking if the -v argument was used when deciding
whether to print the "keepassxc is already running" error message
2018-07-08 19:51:11 -04:00
Jonathan White aae6d09fd3 Merge branch 'master' into develop
Conflicts:
	src/CMakeLists.txt
	src/autotype/xcb/AutoTypeXCB.cpp
	src/browser/BrowserAction.cpp
	src/browser/BrowserService.cpp
	src/browser/BrowserService.h
	src/browser/BrowserSettings.h
	src/browser/NativeMessagingHost.cpp
	src/browser/NativeMessagingHost.h
	src/gui/EditWidgetIcons.cpp
	src/gui/EditWidgetIcons.h
	src/gui/MainWindow.cpp
	src/proxy/NativeMessagingHost.cpp
	tests/TestOpenSSHKey.cpp
2018-05-07 23:24:30 -04:00
Steven Noonan 056bbaa921 Improve fetch favicon (#1786)
* Eliminate dependency on libcurl in favor of Qt5Network code
* Supports older Qt versions without QNetworkRequest::FollowRedirectsAttribute

* Show a progress dialog when downloading the favicon. The main utility
  of this is giving the user the option to cancel a download attempt
  (e.g. if it's taking too long). Canceling will try the next fallback URL in the list.

* Try three different ways to obtain the favicon, in this order:
  1) Direct to fully-qualified domain (e.g. https://foo.bar.example.com/favicon.ico)
  2) Direct to 2nd-level domain (e.g. https://example.com/favicon.ico)
  3) Google lookup for 2nd-level domain name (if enabled in settings)

I changed the Google lookup, because a match is more likely to be found
for the 2nd level domain than for the fully-qualified name.

Google's error behavior is strange. If it doesn't find a match, it
doesn't return an error. Instead, it returns a generic default icon,
which is not really the desired result. This also means that unless we
have some way to detect that we've received the generic icon, we can't
fall back to any alternatives.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2018-04-04 22:18:58 -04:00
Louis-Bertrand Varin 8324d03f0a Formatting the code. 2018-03-31 16:01:30 -04:00
Joan Bruguera bf9c1b3205 Cover the fix/WA for Linux #1595 behind compile time flags & comment. 2018-03-12 21:30:25 +01:00
Joan Bruguera 319c8201be Fix flickering & not restoring from tray on some Linuxes (#1595).
Fix/work around KeePassXC flickering and not restoring from tray on some Linux systems, which happens if the window is hidden and minimized by code at the same time (see issue #1595).
2018-03-12 21:30:25 +01:00
Alessio Di Mauro f164847f9b Replace in.readLine() with Utils::getPassword()
Fixes #1673.
2018-03-09 11:21:58 +01:00
Janek Bevendorff 63a17f697c Fix freeze and high CPU usage on invalid STDIN data, resolves #1620 2018-03-06 21:55:32 +01:00
Janek Bevendorff ea5c6c1eb5 Process basic file, password and keyfile command line parameters
Resolves #1358, resolves #1533, resolves #1600
2018-03-03 10:18:16 +01:00
Jonathan White 542ee42313 Add Argon2Kdf and enable parameters in db settings
Note: This implementation is not yet connected to the
database itself and will corrupt existing kdbx3 db's.

* Implemented memory and parallelism parameters for Argon2Kdf
* Using libargon2; libsodium does not support Argon2d algorithm
* Moved basic rounds parameter into Kdf class
* Reimplemented benchmark algorithm; previous was utterly broken
2018-01-13 14:23:30 -05:00
varjolintu 06518c5736 keepassxc-browser 2018-01-04 21:42:20 +01:00
frostasm 165d664524 Pass (using IPC) command line filenames to already running instance 2018-01-03 16:12:05 +02:00
Janek Bevendorff 71f38f17cd Restrict Q_OS_UNIX ifdefs to non-Mac platforms 2017-12-27 20:35:05 +01:00
Rafael Sadowski e29d3497eb s/Q_OS_LINUX/Q_OS_UNIX/g
Enable support for UNIX like OS.
2017-12-27 20:35:05 +01:00
Janek Bevendorff 5b525eb9ca Refactor Translator class to load qtbase translations from local directory if available 2017-12-23 17:47:46 +01:00
Michael Lass 4c76c97762 Open previously opened databases in correct order
In LastOpenedDatabases, the most recently opened file is listed first and the
least recently opened one is listed last. If the databases are re-opened in this
order, LastOpenedDatabases is reversed afterwards. To avoid this, load the files
in reverse order, so LastOpenedDatabases is not modified.
2017-07-27 21:37:48 +02:00
thez3ro cdad46377b Fix Single Istance behavior 2017-07-19 00:23:58 +02:00
Jonathan White 702a68307a Allow multiple instances when debugging (#651) 2017-06-20 16:17:35 -04:00
thez3ro a53b111182 Update and fix copyright headers 2017-06-14 15:54:43 +02:00
Anton Gulenko 58463bc3dc Fixed string literals 2017-05-09 14:13:25 +02:00
VukoDrakkeinen d1310b3337 Raise existing instance
Closes #193
2017-05-09 14:06:45 +02:00
Louis-Bertrand Varin beba23ea2e Prioritize explicit databases. 2017-04-08 17:46:06 -04:00
seatedscribe 3fcf342fbc Merge remote-tracking branch 'upstream/develop' into feature/import-csv-format 2017-03-16 21:25:38 +01:00
Janek Bevendorff 2587bac300 Enable ASAN option in Travis build 2017-03-15 15:23:52 +01:00
Janek Bevendorff 504bd40263 Prevent massive end-of-process leak sanitizer dump 2017-03-15 15:23:50 +01:00
seatedscribe afdf02b4be Implement import of databases in CSV (Comma Separated Values) format (i.e. from other password managers) 2017-03-05 21:27:29 +01:00
Edward Jones 873871a42c Update text in HTTP settings and a hard-to-translate command line hint 2017-02-21 22:36:11 +01:00
Janek Bevendorff cc44a833d5 Revert "Enable High DPI scaling", resolves #323
This reverts commit 188cac34ce.
2017-02-19 23:42:05 +01:00
Janek Bevendorff 1b8366f040 Enable High DPI scaling, resolves #221 2017-02-16 20:57:17 -05:00
Janek Bevendorff fed210dc38 Also show when minimize on startup is enabled, but not minimize to tray 2017-02-14 22:21:53 +01:00
Janek Bevendorff 7a344930ec Don't try to show window when 'Minimize at startup' is enabled, prevents rendering glitches in Unity, resolves #304 2017-02-14 22:21:53 +01:00
Janek Bevendorff 292ed892c1 Fix Windows linker and runtime errors when building against static Qt 2017-01-26 01:15:12 +01:00
Janek Bevendorff 9261d8ae9d Force focus on password field, resolves #116 (#117)
Also remove redudant code for minimizing to tray
2016-11-26 09:37:25 -05:00
Janek Bevendorff 19a960856c Fix minimize at startup and decouple various tray and minimization options (#109)
* Hide window on startup when configured to start minimized, fixes #105
* Decouple different systray and minimization options, fixes #64
* Commit missing changes in main.cpp to minimize at startup

* Remove obsolete code
2016-11-23 18:15:51 -05:00
Jonathan White ccec84aef2 Rename application to KeePassXC and change icon (#70) 2016-11-03 00:05:30 -04:00
Jack Thomasson 7000e80465 add command line option --pw-stdin to accept password from stdin 2016-10-24 12:22:02 -06:00
Felix Geyer fff9e7ac46 Convert Q_FOREACH loops to C++11 for loops.
Q_FOREACH will de deprecated soon.
2016-10-02 21:45:55 -04:00
Jonathan White aba4fa94be Merge remote-tracking branch 'keepassx/master'
# Conflicts:
#	README.md
#	share/translations/keepassx_de.ts
#	src/CMakeLists.txt
#	src/gui/MainWindow.h
2016-02-27 19:11:09 -05:00
Felix Geyer ecfbf72a57 Merge branch '2.0' 2015-12-15 21:05:00 +01:00
Felix Geyer 17ab438c5a Make sure Windows doesn't load DLLs from the current working directory. 2015-12-06 14:32:06 +01:00
Felix Geyer dc7b6623a9 Merge branch '2.0' 2015-10-11 10:44:30 +02:00
Felix Geyer 58ed99d562 OS X: Restore main window when clicking on the docker icon.
Apparently this worked previously. Maybe a regression in Qt?

Refs #326
2015-10-10 17:10:27 +02:00
Felix Geyer 3dd98deecc Use QStandardPaths::DataLocation instead of AppDataLocation.
AppDataLocation is only available in Qt >= 5.4.
2015-09-12 18:41:48 +02:00
Felix Geyer 7fa0eddc5f Make C++11 mandatory. 2015-09-12 13:55:50 +02:00