Commit Graph

113 Commits

Author SHA1 Message Date
louib
48d9fb3e79
Remove GUI bootstraping from core/ (#5513) 2020-10-08 22:48:45 -04:00
Jonathan White
9886b1075f Cleanup config initialization, add local config options
* Fix #5313, allow specifying local config path using environment variable and command line flag
* Add command line flag `--localconfig <path>` to specify a file path to use for the local configuration settings.
* Add environment variable support to set config files paths: `KPXC_CONFIG` and `KPXC_CONFIG_LOCAL` to override default locations.
* Reorder startup sequence to load specified config files earlier to allow for theme settings and other early options to be picked up.
* Removed old command line option `--pw`, no longer used.

* Attempt a fix of application not closing when last window is gone. Only set `QApplication::setQuitOnLastWindowClosed(true)` when tray icon is enabled instead of always.
2020-09-26 09:26:10 -04:00
Jonathan White
9042ef7557
Correct scaling on Linux and other minor fixes
* Fixes #5081 - Initialize MessageWidget::m_animate prior to use

* Fixes #5021 - Don't change tray icon type with unfocused mouse wheel

* Fixes #5029 - Only use HighDpiScaleFactorRoundingPolicy::PassThrough on Windows platforms. Prevents significant scaling bugs on Linux. MacOS does not support fractional scaling.
2020-08-01 09:01:12 -04:00
Jonathan White
13c86cbdc5
Fix auto-restart when a space is in the file path 2020-07-06 21:09:59 -04:00
database64128
790b3382a3 Call QGuiApplication::setHighDpiScaleFactorRoundingPolicy to fix #2815 2020-06-28 23:07:22 -04:00
Sven Grewe
3596fabc78
Fix --pw-stdin by initializing text streams (#4912)
Co-authored-by: Sven qoreQyaS Grewe <sven.grewe@akquinet.de>
2020-06-28 16:24:37 -04:00
Jonathan White
4bf6d8d94d Introduce View Menu
* Move user interface settings from the settings widget into the view menu.
* Add auto-restart prompt to make theme changes easy
2020-06-28 16:21:50 -04:00
Jonathan White
2073f2ddc3 Fix theming with Qt 5.15
* Fixes #4765
* Fixes #4766
2020-06-04 10:03:40 -04:00
Janek Bevendorff
4ba8ef30f2 Add option to launch KeePassXC at system startup
Fixes #1218
2020-05-06 10:44:53 +02:00
Jonathan White
1d7ef5d4eb Move theme detection into Application
* Add function to Application to quickly determine if in light or dark theme
* Add kpxcApp symbol
* Explicitly define main function for GUI tests to improve performance and use custom Application.
2020-03-09 18:03:20 -04:00
Janek Bevendorff
557736ea5e Add custom light and dark UI themes 2020-03-05 09:24:11 +01:00
Wolfram Rösler
05ef937e92 Use Qt::AA_UseHighDpiPixmaps on all platforms
... not only on Linux, in order to prevent icons from being fuzzy.

Fixes #475
2020-01-11 19:00:15 +01:00
guihkx
6339d61419 Properly stylize the application name (#3775)
This is just a cosmetic change. On KDE Plasma, the title of the tray icon is set by either the name of the binary, or by calling `setApplicationName()`. So having it properly stylized looks better.
2019-11-08 23:54:56 +01:00
Elvis Angelaccio
1722397040 Show application icon in Plasma Wayland sessions (#3777)
This is required to show the keepassxc icon on Wayland windows in a
Plasma Wayland session.

kwin_wayland fetches application icons from .desktop files and it
expects the desktop filename to be set on the QGuiApplication instance.

Without this, kwin sets a generic Wayland icon as fallback.
2019-11-03 12:00:16 +01:00
Gigadoc2
82cfedfa43 re-enable wayland 2019-10-13 22:00:50 -04:00
Chih-Hsuan Yen
65cec901d5 Skip the Wayland warning if QT_QPA_PLATFORM already set 2019-07-07 14:23:01 -04:00
therealfarfetchd
12f42a555e Fix icon scaling for HiDPI displays (#3332)
* Only apply hidpi icons on Linux
2019-06-30 11:06:58 -04:00
Jonathan White
2ee97ed191 Code formatting 2019-05-19 18:21:34 -04:00
Jack Thomasson
1cbd395d71 multiple database with --pw-stdin (#2916)
* Updated utilities to unlock KDBX with OS password manager on macOS and Linux
* Use a static stream on stdin for --pw-stdin otherwise buffer loss eliminates subsequent passwords
* Update INSTALL requirements
2019-04-25 10:37:13 -04:00
louib
a58e3d5ee0 Adding debug info to CLI.
Adding debug info to the CLI and the general option
of the main Qt app. Also took time to:
* use `EXIT_SUCCESS`/`EXIT_FAILURE` constants
for main.cpp (this is what is used in `src/cli`);
* fixed `m_initalized` typo;
* added info on debugging mode being disabled
or not;
* regrouped Qt related stuff in the debug output.
2019-03-24 08:35:33 -04:00
Jonathan White
fb5faf0ff5
Ran make format 2019-03-19 18:56:17 -04:00
Jonathan White
5a34f90319
Update translations
* Corrected use of QCoreApplication::translate -> QObject::tr
* Corrected plural usage in EntryAttachmentsWidget.cpp
2019-01-30 20:54:35 -05:00
Jonathan White
f446774605 Prevent use of wayland theme on Linux
* Wayland theme is buggy yet enforced by default
on Qt 5.11+ on Gnome desktop environment
* Resolves #2006
2019-01-28 22:39:20 -05:00
Gianluca Recchia
395a88a5ef Prevent post-compilation Qt downgrades (#2576)
* Abort the app if a Qt downgrade is detected

The app will now exit immediately if it was compiled with a Qt version
higher than the one present on the machine.

* Add function for checking the Qt version at runtime

* Re-register global D-Bus menu only if DE is Unity
2019-01-24 22:45:05 -05:00
Gianluca Recchia
fc930bae69
Restore correct formatting
Many lines were not conformant with the project's formatting rules.
This patch should fix all formatting and whitespace issues in the code
base.
A clang-format directive was put around the connect() calls containing
SIGNALs and SLOTs whose signatures would be denormalized because of the
formatting rules.
2018-11-28 18:29:15 -05:00
Jonathan White
880c3aeb34
Add search help pop-up
* Support ! modifier (same as '-')
* Create reusable PopupHelpWidget as self-contained popup that can
be positioned around a parent widget and will follow the movement
and sizing of the window
* Eliminated KEEPASSXC_MAIN_WINDOW macro and replaced with
getMainWindow() function
* Add tests to cover search help show/hide
2018-11-17 09:04:15 -05:00
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