diff --git a/.gitattributes b/.gitattributes index baae16c80..9d1ecabf4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,9 @@ src/version.h.cmake export-subst +.gitattributes export-ignore +.gitignore export-ignore +.github export-ignore +.travis.yml export-ignore +.tx export-ignore +snapcraft.yaml export-ignore +make_release.sh export-ignore +AppImage-Recipe.sh export-ignore diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 01b8d6137..67b0e1746 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,31 +1,32 @@ -# Contributing to KeePassX Reboot +# Contributing to KeePassXC :+1::tada: First off, thanks for taking the time to contribute! :tada::+1: -The following is a set of guidelines for contributing to KeePassX Reboot on GitHub. +The following is a set of guidelines for contributing to KeePassXC on GitHub. These are just guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. -#### Table Of Contents +#### Table of contents [What should I know before I get started?](#what-should-i-know-before-i-get-started) * [Open Source Contribution Policy](#open-source-contribution-policy) -[How Can I Contribute?](#how-can-i-contribute) - * [Feature Requests](#feature-requests) - * [Bug Reports](#bug-reports) - * [Your First Code Contribution](#your-first-code-contribution) - * [Pull Requests](#pull-requests) +[How can I contribute?](#how-can-i-contribute) + * [Feature requests](#feature-requests) + * [Bug reports](#bug-reports) + * [Discuss with the team](#discuss-with-the-team) + * [Your first code contribution](#your-first-code-contribution) + * [Pull requests](#pull-requests) * [Translations](#translations) [Styleguides](#styleguides) - * [Git Branch Strategy](#git_branch_strategy) - * [Git Commit Messages](#git-commit-messages) - * [Coding Styleguide](#coding-styleguide) + * [Git branch strategy](#git-branch-strategy) + * [Git commit messages](#git-commit-messages) + * [Coding styleguide](#coding-styleguide) ## What should I know before I get started? ### Open Source Contribution Policy -[Version 0.3, 2015–11–18](https://medium.com/@jmaynard/a-contribution-policy-for-open-source-that-works-bfc4600c9d83#.i9ntbhmad) +**Source**: [Version 0.3, 2015–11–18](https://medium.com/@jmaynard/a-contribution-policy-for-open-source-that-works-bfc4600c9d83#.i9ntbhmad) #### Policy @@ -49,35 +50,35 @@ If we reject your contribution, it means only that we do not consider it suitabl * 0.3, 2011–11–19: Added “irrevocably” to “we can use” and changed “it” to “your contribution” in the “if rejected” section. Thanks to Patrick Maupin. -## How Can I Contribute? -### Feature Requests +## How can I contribute? +### Feature requests -We're always looking for suggestions to improve our application. If you have a suggestion for improving an existing feature, or would like to suggest a completely new feature for KeePassX Reboot, please use the Issues section or our [Google Groups](https://groups.google.com/forum/#!forum/keepassx-reboot) forum. +We're always looking for suggestions to improve our application. If you have a suggestion to improve an existing feature, or would like to suggest a completely new feature for KeePassXC, please use the [issue tracker on GitHub][issues-section]. For more general discussion, try using our [Google Groups][google-groups] forum. -### Bug Reports +### Bug reports -Our software isn't always perfect, but we strive to always improve our work. You may file bug reports in the Issues section. +Our software isn't always perfect, but we strive to always improve our work. You may file bug reports in the issue tracker. -Before submitting a Bug Report, check if the problem has already been reported. Please refrain from opening a duplicate issue. If you want to highlight a deficiency on an existing issue, simply add a comment. +Before submitting a bug report, check if the problem has already been reported. Please refrain from opening a duplicate issue. If you want to add further information to an existing issue, simply add a comment on that issue. -### Discuss with the Team +### Discuss with the team -You can talk to the KeePassX Reboot Team about Bugs, new feature, Issue and PullRequests at our [Google Groups](https://groups.google.com/forum/#!forum/keepassx-reboot) forum +As with feature requests, you can talk to the KeePassXC team about bugs, new features, other issues and pull requests on the dedicated issue tracker, using the [Google Groups][google-groups] forum, or in the IRC channel on Freenode (`#keepassxc-dev` on `irc.freenode.net`, or use a [webchat link](https://webchat.freenode.net/?channels=%23keepassxc-dev)). -### Your First Code Contribution +### Your first code contribution -Unsure where to begin contributing to KeePassX Reboot? You can start by looking through these `beginner` and `help-wanted` issues: +Unsure where to begin contributing to KeePassXC? You can start by looking through these `beginner` and `help-wanted` issues: -* [Beginner issues][beginner] - issues which should only require a few lines of code, and a test or two. -* [Help wanted issues][help-wanted] - issues which should be a bit more involved than `beginner` issues. +* [Beginner issues][beginner] – issues which should only require a few lines of code, and a test or two. +* ['Help wanted' issues][help-wanted] – issues which should be a bit more involved than `beginner` issues. -Both issue lists are sorted by total number of comments. While not perfect, number of comments is a reasonable proxy for impact a given change will have. +Both issue lists are sorted by total number of comments. While not perfect, looking at the number of comments on an issue can give a general idea of how much an impact a given change will have. -### Pull Requests +### Pull requests Along with our desire to hear your feedback and suggestions, we're also interested in accepting direct assistance in the form of code. -All pull requests must comply with the above requirements and with the [Styleguides](#styleguides). +All pull requests must comply with the above requirements and with the [styleguides](#styleguides). ### Translations @@ -86,19 +87,20 @@ Please join an existing language team or request a new one if there is none. ## Styleguides -### Git Branch Strategy +### Git branch strategy The Branch Strategy is based on [git-flow-lite](http://nvie.com/posts/a-successful-git-branching-model/). -* **master** -> always points to the last release published -* **develop** -> points to the next planned release, tested and reviewed code -* **feature/**[name] -> points to brand new feature in codebase, candidate for merge into develop (subject to rebase) +* **master** – points to the latest public release +* **develop** – points to the development of the next release, contains tested and reviewed code +* **feature/**[name] – points to a branch with a new feature, one which is candidate for merge into develop (subject to rebase) +* **hotfix/**[id]-[description] – points to a branch with a fix for a particular issue ID -### Git Commit Messages +### Git commit messages * Use the present tense ("Add feature" not "Added feature") -* Use the imperative mood ("Move cursor to..." not "Moves cursor to...") +* Use the imperative mood ("Move cursor to…" not "Moves cursor to…") * Limit the first line to 72 characters or less * Reference issues and pull requests liberally * When only changing documentation, include `[ci skip]` in the commit description @@ -114,21 +116,21 @@ The Branch Strategy is based on [git-flow-lite](http://nvie.com/posts/a-successf * :lock: `:lock:` when dealing with security -### Coding Styleguide +### Coding styleguide This project follows the [Qt Coding Style](https://wiki.qt.io/Qt_Coding_Style). All submissions are expected to follow this style. -In particular Code must follow the following specific rules: +In particular, code must stick to the following rules: -#### Naming Convention +#### Naming convention `lowerCamelCase` -For names made of only one word, the fist letter is lowercase. -For names made of multiple concatenated words, the first letter is lowercase and each subsequent concatenated word is capitalized. +For names made of only one word, the first letter should be lowercase. +For names made of multiple concatenated words, the first letter of the whole is lowercase, and the first letter of each subsequent word is capitalized. #### Indention -For C++ files (.cpp .h): 4 spaces -For Qt-UI files (.ui): 2 spaces +For **C++ files** (*.cpp .h*): 4 spaces +For **Qt-UI files** (*.ui*): 2 spaces #### Pointers ```c @@ -165,9 +167,8 @@ Use prefix: `m_*` Example: `m_variable` -#### GUI Widget names -Widget names must be related to the desired program behaviour. -Preferably end the name with the Widget Classname +#### GUI widget names +Widget names must be related to the desired program behavior, and preferably end with the widget's classname. Example: `` @@ -175,3 +176,5 @@ Example: `` [beginner]:https://github.com/keepassxreboot/keepassx/issues?q=is%3Aopen+is%3Aissue+label%3Abeginner+label%3A%22help+wanted%22+sort%3Acomments-desc [help-wanted]:https://github.com/keepassxreboot/keepassx/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+sort%3Acomments-desc +[issues-section]:https://github.com/keepassxreboot/keepassxc/issues +[google-groups]:https://groups.google.com/forum/#!forum/keepassx-reboot diff --git a/.travis.yml b/.travis.yml index adb8afdd7..be05d6e47 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,12 +10,11 @@ os: # Define clang compiler without any frills compiler: - clang + - gcc -# Define gcc compile with deploy option (only for master/develop merges) -matrix: - include: - - compiler: gcc - env: DEPLOY=1 +env: + - CONFIG=Release + - CONFIG=Debug git: depth: 3 @@ -33,14 +32,14 @@ before_script: - mkdir build && pushd build script: - - cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUI_TESTS=ON -DWITH_XC_HTTP=ON -DWITH_XC_AUTOTYPE=ON -DWITH_XC_YUBIKEY=ON $CMAKE_ARGS .. + - cmake -DCMAKE_BUILD_TYPE=${CONFIG} -DWITH_GUI_TESTS=ON -DWITH_XC_HTTP=ON -DWITH_XC_AUTOTYPE=ON -DWITH_XC_YUBIKEY=ON $CMAKE_ARGS .. - make -j2 - if [ "$TRAVIS_OS_NAME" = "linux" ]; then make test ARGS+="-E testgui --output-on-failure"; fi - if [ "$TRAVIS_OS_NAME" = "linux" ]; then xvfb-run -a --server-args="-screen 0 800x600x24" make test ARGS+="-R testgui --output-on-failure"; fi - if [ "$TRAVIS_OS_NAME" = "osx" ]; then make test ARGS+="--output-on-failure"; fi # Generate snapcraft build when merging into master/develop branches -after_success: - - popd - - "[[ $DEPLOY = 1 ]] && [[ $TRAVIS_BRANCH =~ (master|develop) ]] && [[ $TRAVIS_PULL_REQUEST = false ]] \ - && docker run -v $(pwd):/cwd snapcore/snapcraft sh -c 'cd /cwd && apt update && snapcraft'" +#after_success: +# - popd +# - "[[ $DEPLOY = 1 ]] && [[ $CONFIG = Release ]] && [[ $TRAVIS_BRANCH =~ (master|develop) ]] && [[ $TRAVIS_PULL_REQUEST = false ]] \ +# && docker run -v $(pwd):/cwd snapcore/snapcraft sh -c 'cd /cwd && apt update && snapcraft'" diff --git a/AppImage-Recipe.sh b/AppImage-Recipe.sh new file mode 100755 index 000000000..dc30cb696 --- /dev/null +++ b/AppImage-Recipe.sh @@ -0,0 +1,92 @@ +#!/usr/bin/env bash +# +# KeePassXC AppImage Recipe +# Copyright (C) 2017 KeePassXC team +# +# 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 or (at your option) +# version 3 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, see . + +if [ "$1" == "" ] || [ "$2" == "" ]; then + echo "Usage: $(basename $0) APP_NAME RELEASE_VERSION" >&2 + exit 1 +fi + +if [ -f CHANGELOG ]; then + echo "This recipe must not be run from the sources root." >&2 + exit 1 +fi + +if [ ! -d ../bin-release ]; then + echo "../bin-release does not exist." >&2 + exit 1 +fi + +APP="$1" +LOWERAPP="$(echo "$APP" | tr '[:upper:]' '[:lower:]')" +VERSION="$2" + +mkdir -p $APP.AppDir +wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh +. ./functions.sh + +LIB_DIR=./usr/lib +if [ -d ./usr/lib/x86_64-linux-gnu ]; then + LIB_DIR=./usr/lib/x86_64-linux-gnu +fi + +cd $APP.AppDir +cp -a ../../bin-release/* . +cp -a ./usr/local/* ./usr +rm -R ./usr/local +rmdir ./opt 2> /dev/null +patch_strings_in_file /usr/local ././ +patch_strings_in_file /usr ./ + +# bundle Qt platform plugins and themes +QXCB_PLUGIN="$(find /usr/lib -name 'libqxcb.so' 2> /dev/null)" +if [ "$QXCB_PLUGIN" == "" ]; then + QXCB_PLUGIN="$(find /opt/qt*/plugins -name 'libqxcb.so' 2> /dev/null)" +fi +QT_PLUGIN_PATH="$(dirname $(dirname $QXCB_PLUGIN))" +mkdir -p ".${QT_PLUGIN_PATH}/platforms" +cp "$QXCB_PLUGIN" ".${QT_PLUGIN_PATH}/platforms/" + +get_apprun +copy_deps +delete_blacklisted + +# remove dbus and systemd libs as they are not blacklisted +find . -name libdbus-1.so.3 -exec rm {} \; +find . -name libsystemd.so.0 -exec rm {} \; + +get_desktop +get_icon +cat << EOF > ./usr/bin/keepassxc_env +#!/usr/bin/env bash +#export QT_QPA_PLATFORMTHEME=gtk2 +export LD_LIBRARY_PATH="../opt/qt58/lib:\${LD_LIBRARY_PATH}" +export QT_PLUGIN_PATH="..${QT_PLUGIN_PATH}" +exec keepassxc "\$@" +EOF +chmod +x ./usr/bin/keepassxc_env +sed -i 's/Exec=keepassxc/Exec=keepassxc_env/' keepassxc.desktop +get_desktopintegration $LOWERAPP + +GLIBC_NEEDED=$(glibc_needed) + +cd .. + +generate_type2_appimage + +mv ../out/*.AppImage .. +rmdir ../out > /dev/null 2>&1 diff --git a/CHANGELOG b/CHANGELOG index 31c619306..24ed5ea73 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,41 @@ +2.1.1 (2017-02-06) +========================= + +- Enabled HTTP plugin build; plugin is disabled by default and limited to localhost [#147] +- Escape HTML in dialog boxes [#247] +- Corrected crashes in favicon download and password generator [#233, #226] +- Increase font size of password meter [#228] +- Fixed compatibility with Qt 5.8 [#211] +- Use consistent button heights in password generator [#229] + +2.1.0 (2017-01-22) +========================= + +- Show unlock dialog when using autotype on a closed database [#10, #89] +- Show different tray icon when database is locked [#37, #46] +- Support autotype on Windows and OS X [#42, #60, #63] +- Add delay feature to autotype [#76, #77] +- Add password strength meter [#84, #92] +- Add option for automatically locking the database when minimizing + the window [#57] +- Add feature to download favicons and use them as entry icons [#30] +- Automatically reload and merge database when the file changed on + disk [#22, #33, #93] +- Add tool for merging two databases [#22, #47, #143] +- Add --pw-stdin commandline option to unlock the database by providing + a password on STDIN [#54] +- Add utility script for reading the database password from KWallet [#55] +- Fix some KeePassHTTP settings not being remembered [#34, #65] +- Make search box persistent [#15, #67, #157] +- Enhance search feature by scoping the search to selected group [#16, #118] +- Improve interaction between search field and entry list [#131, #141] +- Add stand-alone password-generator [#18, #92] +- Don't require password repetition when password is visible [#27, #92] +- Add support for entry attributes in autotype sequences [#107] +- Always focus password field when opening the database unlock widget [#116, #117] +- Fix compilation errors on various platforms [#53, #126, #130] +- Restructure and improve kdbx-extract utility [#160] + 2.0.3 (2016-09-04) ========================= diff --git a/CMakeLists.txt b/CMakeLists.txt index 0843d7ccb..343264fbe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,8 +38,8 @@ option(WITH_XC_AUTOTYPE "Include Autotype." OFF) option(WITH_XC_HTTP "Include KeePassHTTP." OFF) option(WITH_XC_YUBIKEY "Include Yubikey support." OFF) -set(KEEPASSXC_VERSION "2.1.0") -set(KEEPASSXC_VERSION_NUM "2.1.0") +set(KEEPASSXC_VERSION "2.1.1") +set(KEEPASSXC_VERSION_NUM "2.1.1") if("${CMAKE_C_COMPILER}" MATCHES "clang$" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") set(CMAKE_COMPILER_IS_CLANG 1) @@ -172,9 +172,13 @@ set(CMAKE_AUTOMOC ON) # Make sure we don't enable asserts there. set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_NONE QT_NO_DEBUG) +find_package(LibGPGError REQUIRED) + find_package(Gcrypt 1.6.0 REQUIRED) -find_package(LibMicroHTTPD REQUIRED) +if (WITH_XC_HTTP) + find_package(LibMicroHTTPD REQUIRED) +endif(WITH_XC_HTTP) find_package(ZLIB REQUIRED) diff --git a/COPYING b/COPYING index 9322a0e37..4dbaece33 100644 --- a/COPYING +++ b/COPYING @@ -198,3 +198,9 @@ Files: src/zxcvbn/zxcvbn.* Copyright: 2015, Tony Evans 2016, KeePassXC Team License: BSD 3-clause + +Files: src/gui/KMessageWidget.h + src/gui/KMessageWidget.cpp +Copyright: 2011 Aurélien Gâteau + 2014 Dominik Haumann +License: LGPL-2.1 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..9623b60dd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,54 @@ +# KeePassXC Linux Release Build Dockerfile +# Copyright (C) 2017 KeePassXC team +# +# 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 or (at your option) +# version 3 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, see . + +FROM ubuntu:14.04 + +RUN set -x \ + && apt-get update \ + && apt-get install --yes software-properties-common + +RUN set -x \ + && add-apt-repository --yes ppa:beineri/opt-qt58-trusty + +RUN set -x \ + && apt-get update \ + && apt-get install --yes \ + g++ \ + cmake \ + libgcrypt20-dev \ + qt58base \ + qt58tools \ + qt58x11extras \ + libmicrohttpd-dev \ + libxi-dev \ + libxtst-dev \ + zlib1g-dev \ + wget \ + file \ + fuse \ + python + +RUN set -x \ + && apt-get install --yes mesa-common-dev + +VOLUME /keepassxc/src +VOLUME /keepassxc/out +WORKDIR /keepassxc + +ENV CMAKE_PREFIX_PATH=/opt/qt58/lib/cmake +ENV LD_LIBRARY_PATH=/opt/qt58/lib +RUN set -x \ + && echo /opt/qt58/lib > /etc/ld.so.conf.d/qt58.conf diff --git a/README.md b/README.md index 7da76d6f0..e892f1b01 100644 --- a/README.md +++ b/README.md @@ -3,57 +3,63 @@ [![Travis Build Status](https://travis-ci.org/keepassxreboot/keepassxc.svg?branch=develop)](https://travis-ci.org/keepassxreboot/keepassxc) [![Coverage Status](https://coveralls.io/repos/github/keepassxreboot/keepassxc/badge.svg)](https://coveralls.io/github/keepassxreboot/keepassxc) ## About - -Fork of [KeePassX](https://www.keepassx.org/) that [aims to incorporate stalled Pull Requests, features, and bug fixes that are not being incorporated into the main KeePassX baseline](https://github.com/keepassxreboot/keepassx/issues/43). +KeePassXC is a fork of [KeePassX](https://www.keepassx.org/) that [aims to incorporate stalled pull requests, features, and bug fixes that have never made it into the main KeePassX repository](https://github.com/keepassxreboot/keepassx/issues/43). -#### Additional Reboot Features - - keepasshttp support for use with [PassIFox](https://addons.mozilla.org/en-us/firefox/addon/passifox/) for Mozilla Firefox and [chromeIPass](https://chrome.google.com/webstore/detail/chromeipass/ompiailgknfdndiefoaoiligalphfdae) for Google Chrome. +## Additional features compared to KeePassX +- Autotype on all three major platforms (Linux, Windows, OS X) +- Stand-alone password generator +- Password strength meter +- Use website's favicons as entry icons +- Merging of databases +- Automatic reload when the database changed on disk +- KeePassHTTP support for use with [PassIFox](https://addons.mozilla.org/en-us/firefox/addon/passifox/) in Mozilla Firefox and [chromeIPass](https://chrome.google.com/webstore/detail/chromeipass/ompiailgknfdndiefoaoiligalphfdae) in Google Chrome or Chromium. -KeePassHttp implementation has been forked from jdachtera's repository, which in turn was based on code from code with Francois Ferrand's [keepassx-http](https://gitorious.org/keepassx/keepassx-http/source/master) repository. - -This is a rebuild from [denk-mal's keepasshttp](https://github.com/denk-mal/keepassx.git) that brings it forward to Qt5 and KeePassX v2.x. +For a full list of features and changes, read the [CHANGELOG](CHANGELOG) document. +### Note about KeePassHTTP +KeePassHTTP is not a highly secure protocol and has certain flaw which allow an attacker to decrypt your passwords when they manage to intercept communication between a KeePassHTTP server and PassIFox/chromeIPass over a network connection (see [here](https://github.com/pfn/keepasshttp/issues/258) and [here](https://github.com/keepassxreboot/keepassxc/issues/147)). KeePassXC therefore strictly limits communication between itself and the browser plugin to your local computer. As long as your computer is not compromised, your passwords are fairly safe that way, but still use it at your own risk! ### Installation +Pre-compiled binaries can be found on the [downloads page](https://keepassxc.org/download). Additionally, individual Linux distributions may ship their own versions, so please check out your distribution's package list to see if KeePassXC is available. -Right now KeePassXC does not have a precompiled executable or an installation package.
-So you must install it from its source code. +### Building KeePassXC yourself -**More detailed instructions are available in the INSTALL file or at the [Wiki page](https://github.com/keepassxreboot/keepassx/wiki/Install-Instruction-from-Source).** +*More detailed instructions are available in the INSTALL file or on the [Wiki page](https://github.com/keepassxreboot/keepassx/wiki/Install-Instruction-from-Source).* -First you must download the KeePassXC source code as ZIP file or with Git. +First, you must download the KeePassXC [source tarball](https://keepassxc.org/download#source) or check out the latest version from our [Git repository](https://github.com/keepassxreboot/keepassxc). -Generally you can build and install KeePassXC with the following commands from a Terminal in the KeePassXC folder -``` -mkdir build -cd build -cmake -DWITH_TESTS=OFF .. -make -sudo make install -``` - - -### Clone Repository - -Clone the repository to a suitable location where you can extend and build this project. +To clone the project from Git, `cd` to a suitable location and run ```bash git clone https://github.com/keepassxreboot/keepassxc.git ``` -**Note:** This will clone the entire contents of the repository at the HEAD revision. +This will clone the entire contents of the repository and check out the current `develop` branch. -To update the project from within the project's folder you can run the following command: +To update the project from within the project's folder, you can run the following command: ```bash git pull ``` +Once you have downloaded the source code, you can `cd` into the source code directory and build and install KeePassXC with + +``` +mkdir build +cd build +cmake -DWITH_TESTS=OFF .. +make -j8 +sudo make install +``` + +To enable autotype, add `-DWITH_XC_AUTOTYPE=ON` to the `cmake` command. KeePassHTTP support is compiled in by adding `-DWITH_XC_HTTP=ON`. If these options are not specified, KeePassXC will be built without these plugins. + ### Contributing -We're always looking for suggestions to improve our application. If you have a suggestion for improving an existing feature, -or would like to suggest a completely new feature for KeePassX Reboot, please use the [Issues](https://github.com/keepassxreboot/keepassxc/issues) section or our [Google Groups](https://groups.google.com/forum/#!forum/keepassx-reboot) forum. +We are always looking for suggestions how to improve our application. If you find any bugs or have an idea for a new feature, please let us know by opening a report in our [issue tracker](https://github.com/keepassxreboot/keepassxc/issues) on GitHub or write to our [Google Groups](https://groups.google.com/forum/#!forum/keepassx-reboot) forum. -Please review the [CONTRIBUTING](.github/CONTRIBUTING.md) document for further information. +You can of course also directly contribute your own code. We are happy to accept your pull requests. + +Please read the [CONTRIBUTING](.github/CONTRIBUTING.md) document for further information. diff --git a/cmake/FindLibGPGError.cmake b/cmake/FindLibGPGError.cmake new file mode 100644 index 000000000..fe9ef9123 --- /dev/null +++ b/cmake/FindLibGPGError.cmake @@ -0,0 +1,9 @@ + +find_path(GPGERROR_INCLUDE_DIR gpg-error.h) + +find_library(GPGERROR_LIBRARIES gpg-error) + +mark_as_advanced(GPGERROR_LIBRARIES GPGERROR_INCLUDE_DIR) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LibGPGError DEFAULT_MSG GPGERROR_LIBRARIES GPGERROR_INCLUDE_DIR) diff --git a/release-tool b/release-tool new file mode 100755 index 000000000..3259e6396 --- /dev/null +++ b/release-tool @@ -0,0 +1,683 @@ +#!/usr/bin/env bash +# +# KeePassXC Release Preparation Helper +# Copyright (C) 2017 KeePassXC team +# +# 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 or (at your option) +# version 3 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, see . + +printf "\e[1m\e[32mKeePassXC\e[0m Release Preparation Helper\n" +printf "Copyright (C) 2017 KeePassXC Team \n\n" + + +# ----------------------------------------------------------------------- +# global default values +# ----------------------------------------------------------------------- +RELEASE_NAME="" +APP_NAME="KeePassXC" +SRC_DIR="." +GPG_KEY="CFB4C2166397D0D2" +GPG_GIT_KEY="" +OUTPUT_DIR="release" +SOURCE_BRANCH="" +TARGET_BRANCH="master" +TAG_NAME="" +DOCKER_IMAGE="" +DOCKER_CONTAINER_NAME="keepassxc-build-container" +CMAKE_OPTIONS="" +COMPILER="g++" +MAKE_OPTIONS="-j8" +BUILD_PLUGINS="autotype http" +INSTALL_PREFIX="/usr/local" +BUILD_SOURCE_TARBALL=true +ORIG_BRANCH="" +ORIG_CWD="$(pwd)" + +# ----------------------------------------------------------------------- +# helper functions +# ----------------------------------------------------------------------- +printUsage() { + local cmd + if [ "" == "$1" ] || [ "help" == "$1" ]; then + cmd="COMMAND" + elif [ "merge" == "$1" ] || [ "build" == "$1" ] || [ "sign" == "$1" ]; then + cmd="$1" + else + logError "Unknown command: '$1'\n" + cmd="COMMAND" + fi + + printf "\e[1mUsage:\e[0m $(basename $0) $cmd [options]\n" + + if [ "COMMAND" == "$cmd" ]; then + cat << EOF + +Commands: + merge Merge release branch into main branch and create release tags + build Build and package binary release from sources + sign Sign previously compiled release packages + help Show help for the given command +EOF + elif [ "merge" == "$cmd" ]; then + cat << EOF + +Merge release branch into main branch and create release tags + +Options: + -v, --version Release version number or name (required) + -a, --app-name Application name (default: '${APP_NAME}') + -s, --source-dir Source directory (default: '${SRC_DIR}') + -g, --gpg-key GPG key used to sign the merge commit and release tag, + leave empty to let Git choose your default key + (default: '${GPG_GIT_KEY}') + -r, --release-branch Source release branch to merge from (default: 'release/VERSION') + --target-branch Target branch to merge to (default: '${TARGET_BRANCH}') + -t, --tag-name Override release tag name (defaults to version number) + -h, --help Show this help +EOF + elif [ "build" == "$cmd" ]; then + cat << EOF + +Build and package binary release from sources + +Options: + -v, --version Release version number or name (required) + -a, --app-name Application name (default: '${APP_NAME}') + -s, --source-dir Source directory (default: '${SRC_DIR}') + -o, --output-dir Output directory where to build the release + (default: '${OUTPUT_DIR}') + -t, --tag-name Release tag to check out (defaults to version number) + -b, --build Build sources after exporting release + -d, --docker-image Use the specified Docker image to compile the application. + The image must have all required build dependencies installed. + This option has no effect if --build is not set. + --container-name Docker container name (default: '${DOCKER_CONTAINER_NAME}') + The container must not exist already + -c, --cmake-options Additional CMake options for compiling the sources + --compiler Compiler to use (default: '${COMPILER}') + -m, --make-options Make options for compiling sources (default: '${MAKE_OPTIONS}') + -i, --install-prefix Install prefix (default: '${INSTALL_PREFIX}') + -p, --plugins Space-separated list of plugins to build + (default: ${BUILD_PLUGINS}) + -n, --no-source-tarball Don't build source tarball + -h, --help Show this help +EOF + elif [ "sign" == "$cmd" ]; then + cat << EOF + +Sign previously compiled release packages + +Options: + -f, --files Files to sign (required) + -g, --gpg-key GPG key used to sign the files (default: '${GPG_KEY}') + -h, --help Show this help +EOF + fi +} + +logInfo() { + printf "\e[1m[ \e[34mINFO\e[39m ]\e[0m $1\n" +} + +logError() { + printf "\e[1m[ \e[31mERROR\e[39m ]\e[0m $1\n" >&2 +} + +init() { + ORIG_CWD="$(pwd)" + cd "$SRC_DIR" > /dev/null 2>&1 + ORIG_BRANCH="$(git rev-parse --abbrev-ref HEAD 2> /dev/null)" + cd "$ORIG_CWD" +} + +cleanup() { + logInfo "Checking out original branch..." + if [ "" != "$ORIG_BRANCH" ]; then + git checkout "$ORIG_BRANCH" > /dev/null 2>&1 + fi + logInfo "Leaving source directory..." + cd "$ORIG_CWD" +} + +exitError() { + logError "$1" + cleanup + exit 1 +} + +exitTrap() { + exitError "Existing upon user request..." +} + +checkSourceDirExists() { + if [ ! -d "$SRC_DIR" ]; then + exitError "Source directory '${SRC_DIR}' does not exist!" + fi +} + +checkOutputDirDoesNotExist() { + if [ -e "$OUTPUT_DIR" ]; then + exitError "Output directory '$OUTPUT_DIR' already exists. Please choose a different location!" + fi +} + +checkGitRepository() { + if [ ! -d .git ] || [ ! -f CHANGELOG ]; then + exitError "Source directory is not a valid Git repository!" + fi +} + +checkTagExists() { + git tag | grep -q "$TAG_NAME" + if [ $? -ne 0 ]; then + exitError "Tag '${TAG_NAME}' does not exist!" + fi +} + +checkReleaseDoesNotExist() { + git tag | grep -q "$TAG_NAME" + if [ $? -eq 0 ]; then + exitError "Release '$RELEASE_NAME' (tag: '$TAG_NAME') already exists!" + fi +} + +checkWorkingTreeClean() { + git diff-index --quiet HEAD -- + if [ $? -ne 0 ]; then + exitError "Current working tree is not clean! Please commit or unstage any changes." + fi +} + +checkSourceBranchExists() { + git rev-parse "$SOURCE_BRANCH" > /dev/null 2>&1 + if [ $? -ne 0 ]; then + exitError "Source branch '$SOURCE_BRANCH' does not exist!" + fi +} + +checkTargetBranchExists() { + git rev-parse "$TARGET_BRANCH" > /dev/null 2>&1 + if [ $? -ne 0 ]; then + exitError "Target branch '$TARGET_BRANCH' does not exist!" + fi +} + +checkVersionInCMake() { + local app_name_upper="$(echo "$APP_NAME" | tr '[:lower:]' '[:upper:]')" + + grep -q "${app_name_upper}_VERSION \"${RELEASE_NAME}\"" CMakeLists.txt + if [ $? -ne 0 ]; then + exitError "${app_name_upper}_VERSION version not updated to '${RELEASE_NAME}' in CMakeLists.txt!" + fi + + grep -q "${app_name_upper}_VERSION_NUM \"${RELEASE_NAME}\"" CMakeLists.txt + if [ $? -ne 0 ]; then + exitError "${app_name_upper}_VERSION_NUM version not updated to '${RELEASE_NAME}' in CMakeLists.txt!" + fi +} + +checkChangeLog() { + if [ ! -f CHANGELOG ]; then + exitError "No CHANGELOG file found!" + fi + + grep -qPzo "${RELEASE_NAME} \(\d{4}-\d{2}-\d{2}\)\n=+\n" CHANGELOG + if [ $? -ne 0 ]; then + exitError "CHANGELOG does not contain any information about the '${RELEASE_NAME}' release!" + fi +} + +checkTransifexCommandExists() { + command -v tx > /dev/null + if [ 0 -ne $? ]; then + exitError "Transifex tool 'tx' not installed! Please install it using 'pip install transifex-client'" + fi +} + +# re-implement realpath for OS X (thanks mschrag) +# https://superuser.com/questions/205127/ +if ! $(command -v realpath > /dev/null); then + realpath() { + pushd . > /dev/null + if [ -d "$1" ]; then + cd "$1" + dirs -l +0 + else + cd "$(dirname "$1")" + cur_dir=$(dirs -l +0) + + if [ "$cur_dir" == "/" ]; then + echo "$cur_dir$(basename "$1")" + else + echo "$cur_dir/$(basename "$1")" + fi + fi + popd > /dev/null + } +fi + + +trap exitTrap SIGINT SIGTERM + + +# ----------------------------------------------------------------------- +# merge command +# ----------------------------------------------------------------------- +merge() { + while [ $# -ge 1 ]; do + local arg="$1" + case "$arg" in + -v|--version) + RELEASE_NAME="$2" + shift ;; + + -a|--app-name) + APP_NAME="$2" + shift ;; + + -s|--source-dir) + SRC_DIR="$2" + shift ;; + + -g|--gpg-key) + GPG_GIT_KEY="$2" + shift ;; + + -r|--release-branch) + SOURCE_BRANCH="$2" + shift ;; + + --target-branch) + TARGET_BRANCH="$2" + shift ;; + + -t|--tag-name) + TAG_NAME="$2" + shift ;; + + -h|--help) + printUsage "merge" + exit ;; + + *) + logError "Unknown option '$arg'\n" + printUsage "merge" + exit 1 ;; + esac + shift + done + + if [ "" == "$RELEASE_NAME" ]; then + logError "Missing arguments, --version is required!\n" + printUsage "merge" + exit 1 + fi + + if [ "" == "$TAG_NAME" ]; then + TAG_NAME="$RELEASE_NAME" + fi + + if [ "" == "$SOURCE_BRANCH" ]; then + SOURCE_BRANCH="release/${RELEASE_NAME}" + fi + + init + + SRC_DIR="$(realpath "$SRC_DIR")" + + logInfo "Performing basic checks..." + + checkSourceDirExists + + logInfo "Changing to source directory..." + cd "${SRC_DIR}" + + checkTransifexCommandExists + checkGitRepository + checkReleaseDoesNotExist + checkWorkingTreeClean + checkSourceBranchExists + checkTargetBranchExists + + logInfo "Checking out source branch '${SOURCE_BRANCH}'..." + git checkout "$SOURCE_BRANCH" + + checkVersionInCMake + checkChangeLog + + logInfo "All checks pass, getting our hands dirty now!" + + logInfo "Updating language files..." + ./share/translations/update.sh + if [ 0 -ne $? ]; then + exitError "Updating translations failed!" + fi + git diff-index --quiet HEAD -- + if [ $? -ne 0 ]; then + git add ./share/translations/* + logInfo "Committing changes..." + if [ "" == "$GPG_GIT_KEY" ]; then + git commit -m "Update translations" + else + git commit -m "Update translations" -S"$GPG_GIT_KEY" + fi + fi + + CHANGELOG=$(grep -Pzo "(?<=${RELEASE_NAME} \(\d{4}-\d{2}-\d{2}\)\n)=+\n\n?(?:.|\n)+?\n(?=\n)" \ + CHANGELOG | grep -Pzo '(?<=\n\n)(.|\n)+' | tr -d \\0) + COMMIT_MSG="Release ${RELEASE_NAME}" + + logInfo "Checking out target branch '${TARGET_BRANCH}'..." + git checkout "$TARGET_BRANCH" + + logInfo "Merging '${SOURCE_BRANCH}' into '${TARGET_BRANCH}'..." + + git merge "$SOURCE_BRANCH" --no-ff -m "$COMMIT_MSG" -m "${CHANGELOG}" "$SOURCE_BRANCH" -S"$GPG_GIT_KEY" + + logInfo "Creating tag '${TAG_NAME}'..." + if [ "" == "$GPG_GIT_KEY" ]; then + git tag -a "$TAG_NAME" -m "$COMMIT_MSG" -m "${CHANGELOG}" -s + else + git tag -a "$TAG_NAME" -m "$COMMIT_MSG" -m "${CHANGELOG}" -s -u "$GPG_GIT_KEY" + fi + + cleanup + + logInfo "All done!" + logInfo "Please merge the release branch back into the develop branch now and then push your changes." + logInfo "Don't forget to also push the tags using \e[1mgit push --tags\e[0m." +} + +# ----------------------------------------------------------------------- +# build command +# ----------------------------------------------------------------------- +build() { + while [ $# -ge 1 ]; do + local arg="$1" + case "$arg" in + -v|--version) + RELEASE_NAME="$2" + shift ;; + + -a|--app-name) + APP_NAME="$2" + shift ;; + + -s|--source-dir) + SRC_DIR="$2" + shift ;; + + -o|--output-dir) + OUTPUT_DIR="$2" + shift ;; + + -t|--tag-name) + TAG_NAME="$2" + shift ;; + + -d|--docker-image) + DOCKER_IMAGE="$2" + shift ;; + + --container-name) + DOCKER_CONTAINER_NAME="$2" + shift ;; + + -c|--cmake-options) + CMAKE_OPTIONS="$2" + shift ;; + + --compiler) + COMPILER="$2" + shift ;; + + -m|--make-options) + MAKE_OPTIONS="$2" + shift ;; + + -i|--install-prefix) + INSTALL_PREFIX="$2" + shift ;; + + -p|--plugins) + BUILD_PLUGINS="$2" + shift ;; + + -n|--no-source-tarball) + BUILD_SOURCE_TARBALL=false ;; + + -h|--help) + printUsage "build" + exit ;; + + *) + logError "Unknown option '$arg'\n" + printUsage "build" + exit 1 ;; + esac + shift + done + + if [ "" == "$RELEASE_NAME" ]; then + logError "Missing arguments, --version is required!\n" + printUsage "build" + exit 1 + fi + + if [ "" == "$TAG_NAME" ]; then + TAG_NAME="$RELEASE_NAME" + fi + + init + + SRC_DIR="$(realpath "$SRC_DIR")" + OUTPUT_DIR="$(realpath "$OUTPUT_DIR")" + + logInfo "Performing basic checks..." + + checkSourceDirExists + + logInfo "Changing to source directory..." + cd "${SRC_DIR}" + + checkTagExists + checkGitRepository + checkWorkingTreeClean + checkOutputDirDoesNotExist + + logInfo "All checks pass, getting our hands dirty now!" + + logInfo "Checking out release tag '${TAG_NAME}'..." + git checkout "$TAG_NAME" + + logInfo "Creating output directory..." + mkdir -p "$OUTPUT_DIR" + + if [ $? -ne 0 ]; then + exitError "Failed to create output directory!" + fi + + if $BUILD_SOURCE_TARBALL; then + logInfo "Creating source tarball..." + local app_name_lower="$(echo "$APP_NAME" | tr '[:upper:]' '[:lower:]')" + TARBALL_NAME="${app_name_lower}-${RELEASE_NAME}-src.tar.xz" + git archive --format=tar "$TAG_NAME" --prefix="${app_name_lower}-${RELEASE_NAME}/" \ + | xz -6 > "${OUTPUT_DIR}/${TARBALL_NAME}" + fi + + logInfo "Creating build directory..." + mkdir -p "${OUTPUT_DIR}/build-release" + cd "${OUTPUT_DIR}/build-release" + + logInfo "Configuring sources..." + for p in $BUILD_PLUGINS; do + CMAKE_OPTIONS="${CMAKE_OPTIONS} -DWITH_XC_$(echo $p | tr '[:lower:]' '[:upper:]')=On" + done + + if [ "$COMPILER" == "g++" ]; then + export CC=gcc + elif [ "$COMPILER" == "clang++" ]; then + export CC=clang + fi + export CXX="$COMPILER" + + if [ "" == "$DOCKER_IMAGE" ]; then + if [ "$(uname -s)" == "Darwin" ]; then + # Building on OS X + local qt_vers="$(ls /usr/local/Cellar/qt5 2> /dev/null | sort -r | head -n1)" + if [ "" == "$qt_vers" ]; then + exitError "Couldn't find Qt5! Please make sure it is available in '/usr/local/Cellar/qt5'." + fi + export MACOSX_DEPLOYMENT_TARGET=10.7 + + logInfo "Configuring build..." + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \ + -DCMAKE_OSX_ARCHITECTURES=x86_64 -DWITH_CXX11=OFF \ + -DCMAKE_PREFIX_PATH="/usr/local/Cellar/qt5/${qt_vers}/lib/cmake" \ + -DQT_BINARY_DIR="/usr/local/Cellar/qt5/${qt_vers}/bin" $CMAKE_OPTIONS "$SRC_DIR" + + logInfo "Compiling and packaging sources..." + make $MAKE_OPTIONS package + + mv "./${APP_NAME}-${RELEASE_NAME}.dmg" ../ + elif [ "$(uname -o)" == "Msys" ]; then + # Building on Windows with Msys + logInfo "Configuring build..." + cmake -DCMAKE_BUILD_TYPE=Release -DWITH_TESTS=Off -G"MSYS Makefiles" \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" $CMAKE_OPTIONS "$SRC_DIR" + + logInfo "Compiling and packaging sources..." + make $MAKE_OPTIONS package + + mv "./${APP_NAME}-${RELEASE_NAME}-"*.{exe,zip} ../ + else + mkdir -p "${OUTPUT_DIR}/bin-release" + + # Building on Linux without Docker container + logInfo "Configuring build..." + cmake -DCMAKE_BUILD_TYPE=Release -DWITH_TESTS=Off $CMAKE_OPTIONS \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" "$SRC_DIR" + + logInfo "Compiling sources..." + make $MAKE_OPTIONS + + logInfo "Installing to bin dir..." + make DESTDIR="${OUTPUT_DIR}/bin-release" install/strip + + logInfo "Creating AppImage..." + ${SRC_DIR}/AppImage-Recipe.sh "$APP_NAME" "$RELEASE_NAME" + fi + else + mkdir -p "${OUTPUT_DIR}/bin-release" + + logInfo "Launching Docker container to compile sources..." + + docker run --name "$DOCKER_CONTAINER_NAME" --rm \ + --cap-add SYS_ADMIN --device /dev/fuse \ + -e "CC=${CC}" -e "CXX=${CXX}" \ + -v "$(realpath "$SRC_DIR"):/keepassxc/src:ro" \ + -v "$(realpath "$OUTPUT_DIR"):/keepassxc/out:rw" \ + "$DOCKER_IMAGE" \ + bash -c "cd /keepassxc/out/build-release && \ + cmake -DCMAKE_BUILD_TYPE=Release -DWITH_TESTS=Off $CMAKE_OPTIONS \ + -DCMAKE_INSTALL_PREFIX=\"${INSTALL_PREFIX}\" /keepassxc/src && \ + make $MAKE_OPTIONS && make DESTDIR=/keepassxc/out/bin-release install/strip && \ + /keepassxc/src/AppImage-Recipe.sh "$APP_NAME" "$RELEASE_NAME"" + + if [ 0 -ne $? ]; then + exitError "Docker build failed!" + fi + + logInfo "Build finished, Docker container terminated." + fi + + cleanup + + logInfo "All done!" +} + + +# ----------------------------------------------------------------------- +# sign command +# ----------------------------------------------------------------------- +sign() { + SIGN_FILES=() + + while [ $# -ge 1 ]; do + local arg="$1" + case "$arg" in + -f|--files) + while [ "${2:0:1}" != "-" ] && [ $# -ge 2 ]; do + SIGN_FILES+=("$2") + shift + done ;; + + -g|--gpg-key) + GPG_KEY="$2" + shift ;; + + -h|--help) + printUsage "sign" + exit ;; + + *) + logError "Unknown option '$arg'\n" + printUsage "sign" + exit 1 ;; + esac + shift + done + + if [ -z "$SIGN_FILES" ]; then + logError "Missing arguments, --files is required!\n" + printUsage "sign" + exit 1 + fi + + for f in "${SIGN_FILES[@]}"; do + if [ ! -f "$f" ]; then + exitError "File '${f}' does not exist!" + fi + + logInfo "Signing file '${f}'..." + gpg --output "${f}.sig" --armor --local-user "$GPG_KEY" --detach-sig "$f" + + if [ 0 -ne $? ]; then + exitError "Signing failed!" + fi + + logInfo "Creating digest for file '${f}'..." + sha256sum "$f" > "${f}.DIGEST" + done + + logInfo "All done!" +} + + +# ----------------------------------------------------------------------- +# parse global command line +# ----------------------------------------------------------------------- +MODE="$1" +shift +if [ "" == "$MODE" ]; then + logError "Missing arguments!\n" + printUsage + exit 1 +elif [ "help" == "$MODE" ]; then + printUsage "$1" + exit +elif [ "merge" == "$MODE" ] || [ "build" == "$MODE" ] || [ "sign" == "$MODE" ]; then + $MODE "$@" +else + printUsage "$MODE" +fi diff --git a/share/icons/application/22x22/actions/document-new.png b/share/icons/application/22x22/actions/document-new.png new file mode 100644 index 000000000..9ff24e2b2 Binary files /dev/null and b/share/icons/application/22x22/actions/document-new.png differ diff --git a/share/translations/keepassx_cs.ts b/share/translations/keepassx_cs.ts index 3a85ff723..b0e4ca8f9 100644 --- a/share/translations/keepassx_cs.ts +++ b/share/translations/keepassx_cs.ts @@ -1,14 +1,6 @@ - + AboutDialog - - About KeePassX - O KeePassX - - - KeePassX is distributed under the term of the GNU General Public License (GPL) version 2 or (at your option) version 3. - KeePassX je šířeno za podmínek licence GNU General Public License (GPL) verze 2 a (případně) 3. - Revision Revize @@ -17,17 +9,56 @@ Using: S použitím: + + About KeePassXC + O aplikaci KeePassXC + + + KeePassXC is distributed under the term of the GNU General Public License (GPL) version 2 or (at your option) version 3. + KeePassXC je šířeno pod GNU obecnou veřejnou licencí (GPL) verze 2 a (případně) 3. + + + Extensions: + + Rozšíření: + + + + + AccessControlDialog + + Remember this decision + Zapamatovat si toto rozhodnutí + + + Allow + Povolit + + + Deny + Zamítnout + + + %1 has requested access to passwords for the following item(s). +Please select whether you want to allow access. + %1 si vyžádalo přístup k heslům u následujících položek. +Umožnit přístup? () + + + KeePassXC HTTP Confirm Access + Potvrzení přístupu KeePassXC HTTP + AutoType - - Auto-Type - KeePassX - Automatické vyplňování – KeePassX - Couldn't find an entry that matches the window title: Nedaří se nalézt položku, která by se shodovala s titulkem okna: + + Auto-Type - KeePassXC + Automatické vyplňování – KeePassXC + AutoTypeAssociationsModel @@ -46,14 +77,14 @@ AutoTypeSelectDialog - - Auto-Type - KeePassX - Automatické vyplňování – KeePassX - Select entry to Auto-Type: Vyberte položku, kterou se bude automaticky vyplňovat: + + Auto-Type - KeePassXC + Automatické vyplňování – KeePassXC + ChangeMasterKeyWidget @@ -319,16 +350,6 @@ Uložit změny? locked zamčeno - - The database you are trying to open is locked by another instance of KeePassX. -Do you want to open it anyway? Alternatively the database is opened read-only. - Pro databázi, kterou se pokoušíte otevřít, existuje zámek úprav (stejnojmenný -.lock soubor). To znamená, že je nejspíš už otevřená v jiném okně KeePassX -(v případě sdíleného úložiště, třeba i na jiném počítači). Pokud tomu tak není, -je zámek nejspíš pozůstatkem předchozího neočekávaného ukončení aplikace -a je možné ho smazat. V každém případě, dotčenou databázi je možné otevřít - i tak, ale pouze pro čtení. Chcete? - Lock database Uzamknout databázi @@ -372,14 +393,24 @@ Přesto zavřít a zahodit změny? Zápis do CSV souboru se nezdařil. - The database you are trying to save as is locked by another instance of KeePassX. -Do you want to save it anyway? - Databáze, kterou se pokoušíte uložit, je uzamčena jinou instancí KeePassX. -Přesto uložit? + Unable to open the database. + Nepodařilo se otevřít databázi. - Unable to open the database. - + The database you are trying to open is locked by another instance of KeePassXC. +Do you want to open it anyway? Alternatively the database is opened read-only. + Databáze kterou se pokoušíte otevřít je právě používaná jinou instancí KeePassXC. +Chcete ji přesto otevřít? Případně je možné databázi otevřít pouze pro čtení. + + + Merge database + Sloučit databáze + + + The database you are trying to save as is locked by another instance of KeePassXC. +Do you want to save it anyway? + Databáze kterou se pokoušíte uložit je právě používaná jinou instancí KeePassXC. +Chcete ji přesto uložit? @@ -420,10 +451,6 @@ Přesto uložit? Do you really want to delete the group "%1" for good? Opravdu chcete nenávratně smazat skupinu „%1“? - - Current group - Stávající skupina - Error Chyba @@ -434,11 +461,71 @@ Přesto uložit? Move entry to recycle bin? - + Přesunout položku do koše? Do you really want to move entry "%1" to the recycle bin? - + Opravdu si přejete přesunout položku "%1" do koše? + + + Searching... + Hledání… + + + No current database. + Aktuálně žádná databáze. + + + No source database, nothing to do. + Není zvolena zdrojová databáze, není co dělat. + + + Search Results (%1) + Výsledky vyhledávání (%1) + + + No Results + Žádné výsledky + + + Execute command? + Spustit příkaz? + + + Do you really want to execute the following command?<br><br>%1<br> + Opravdu chcete spustit následující příkaz?<br><br>%1<br> + + + Remember my choice + Zapamatovat si pro příště + + + Autoreload Request + Požadavek na automatické opětovné načtení + + + The database file has changed. Do you want to load the changes? + Soubor s databází byl změněn. Přejete si načíst změny? + + + Merge Request + Požadavek na sloučení + + + The database file has changed and you have unsaved changes.Do you want to merge your changes? + Soubor s databází byl mezitím změněn a vaše změny nejsou uložené. Přejete si vaše změny sloučit? + + + Autoreload Failed + Automatické opětovné načtení se nezdařilo + + + Could not parse or unlock the new database file while attempting to autoreload this database. + Nepodařilo se zpracovat nebo odemknout nový soubor s databází během pokusu o její opětovné načtení. + + + Could not open the new database file while attempting to autoreload this database. + Nepodařilo se otevřít nový soubor s databází během pokusu o její opětovné načtení. @@ -629,10 +716,6 @@ Přesto uložit? Repeat: Zopakování hesla: - - Gen. - Tvoř - URL: URL adresa: @@ -750,17 +833,25 @@ Přesto uložit? Can't delete icon! Ikonu nelze smazat! - - Can't delete icon. Still used by %n item(s). - Ikonu není možné smazat. Je používána %n položkou.Ikonu není možné smazat. Je používána %n položkami.Ikonu není možné smazat. Ještě jí používá %n položek. - Error - + Chyba - Can't read icon: - + Download favicon + Stáhnout favicon + + + Unable to fetch favicon. + Favicon se nepodařilo stáhnout. + + + Can't read icon + Nepodařilo se načíst ikonu + + + Can't delete icon. Still used by %1 items. + Ikonu nelze smazat. Ještě ji používá %1 položek. @@ -782,6 +873,13 @@ Přesto uložit? Univerzálně jedinečný identifikátor: + + Entry + + - Clone + - Klon + + EntryAttributesModel @@ -834,6 +932,61 @@ Přesto uložit? Koš + + HttpPasswordGeneratorWidget + + Length: + Délka: + + + Character Types + Typy znaků + + + Upper Case Letters + Velká písmena + + + A-Z + A-Z + + + Lower Case Letters + Malá písmena + + + a-z + a-z + + + Numbers + Čísla + + + 0-9 + 0-9 + + + Special Characters + Zvláštní znaky + + + /*_& ... + /*_& ... + + + Exclude look-alike characters + Vyloučit podobné znaky + + + Ensure that the password contains characters from every group + Heslo musí obsahovat znak z každé skupiny + + + Accept + Přijmout + + KeePass1OpenWidget @@ -877,7 +1030,7 @@ Přesto uložit? Wrong key or database file is corrupt. - + Byl zadán chybný klíč, nebo je poškozen databázový soubor. @@ -916,8 +1069,8 @@ Jedná se o jednosměrný převod. Databázi, vzniklou z importu, nepůjde otev Při ověřování šifrovacích funkcí byl zjištěn fatální nedostatek. - KeePassX - Error - KeePassX – chyba + KeePassXC - Error + KeePassXC – chyba @@ -926,102 +1079,14 @@ Jedná se o jednosměrný převod. Databázi, vzniklou z importu, nepůjde otev Database Databáze - - Recent databases - Nedávno otevřené databáze - - - Help - Nápověda - - - Entries - Položky - - - Copy attribute to clipboard - Zkopírovat atribut do schránky - - - Groups - Skupiny - - - View - Zobrazit - - - Quit - Ukončit aplikaci - - - About - O aplikaci - Open database Otevřít databázi - - Save database - Uložit databázi - - - Close database - Zavřít databázi - - - New database - Nová databáze - - - Add new entry - Přidat novou položku - - - View/Edit entry - Zobrazit/upravit položku - - - Delete entry - Smazat položku - - - Add new group - Přidat novou skupinu - - - Edit group - Upravit skupinu - - - Delete group - Smazat skupinu - - - Save database as - Uložit databázi jako - - - Change master key - Změnit hlavní klíč - Database settings Nastavení databáze - - Import KeePass 1 database - Importovat databázi aplikace KeePass verze 1 - - - Clone entry - Klonovat položku - - - Find - Najít - Copy username to clipboard Zkopírovat uživatelské jméno do schránky @@ -1034,30 +1099,6 @@ Jedná se o jednosměrný převod. Databázi, vzniklou z importu, nepůjde otev Settings Nastavení - - Perform Auto-Type - Provést automatické vyplnění - - - Open URL - Otevřít URL adresu - - - Lock databases - Uzamknout databáze - - - Title - Titulek - - - URL - URL adresa - - - Notes - Poznámky - Show toolbar Zobrazit lištu nástrojů @@ -1074,22 +1115,6 @@ Jedná se o jednosměrný převod. Databázi, vzniklou z importu, nepůjde otev Tools Nástroje - - Copy username - Zkopírovat uživatelské jméno - - - Copy password - Zkopírovat heslo - - - Export to CSV file - Exportovat do CSV souboru - - - Repair database - Opravit databázi - KeePass 2 Database Databáze ve formátu KeePass 2 @@ -1110,6 +1135,265 @@ Jedná se o jednosměrný převod. Databázi, vzniklou z importu, nepůjde otev Writing the database failed. Zápis do databáze se nezdařil. + + &Recent databases + Nedávno otevřené databáze + + + He&lp + Nápověda + + + E&ntries + Položky + + + Copy att&ribute to clipboard + Zkopí&rovat atribut do schránky + + + &Groups + Skupniny + + + &View + Zobrazit + + + &Quit + Ukončit + + + &About + O &aplikaci + + + &Open database + &Otevřít databázi + + + &Save database + Uložit databázi + + + &Close database + Zavřít databázi + + + &New database + &Nová databáze + + + Merge from KeePassX database + Sloučit s databází KeePassX + + + &Add new entry + Přid&at novou položku + + + &View/Edit entry + Zobrazit/Upra&vit položku + + + &Delete entry + Smazat položku + + + &Add new group + Přid&at novou skupinu + + + &Edit group + Upravit skupinu + + + &Delete group + Smazat skupinu + + + Sa&ve database as + Uložit databázi jako + + + Change &master key + Z&měnit hlavní klíč + + + &Database settings + Nastavení &databáze + + + &Import KeePass 1 database + &Importovat databázi ve formátu KeePass 1 + + + &Clone entry + Klonovat položku + + + &Find + Najít + + + Copy &username + Zkopírovat &uživatelské jméno + + + Cop&y password + Zkopírovat heslo + + + &Settings + Na&stavení + + + &Perform Auto-Type + &Provést automatické vyplnění + + + &Open URL + &Otevřít URL adresu + + + &Lock databases + Uzamknout databázi + + + &Title + Nadpis + + + &URL + &URL adresa + + + &Notes + Poz&námky + + + &Export to CSV file + &Exportovat do CSV souboru + + + Re&pair database + O&pravit databázi + + + Password Generator + Generátor hesel + + + + OptionDialog + + Dialog + Dialog + + + General + Obecné + + + Sh&ow a notification when credentials are requested + Z&obrazit oznámení když jsou požadovány přihlašovací údaje + + + &Return only best matching entries for an URL instead +of all entries for the whole domain + V%rátit pouze položky, které nejlépe odpovídají dané +URL adrese namísto položek pro celou doménu + + + &Match URL schemes +Only entries with the same scheme (http://, https://, ftp://, ...) are returned + &Odpovídající schémata URL adres +Jsou vráceny pouze položky se stejným schématem (http://, https://, ftp://, atp.) + + + Sort matching entries by &username + Seřadit odpovídající položky dle &uživatelského jména + + + R&emove all shared encryption-keys from active database + Z právě otevřené databáze od&ebrat veškeré sdílené šifrovací klíče + + + Re&move all stored permissions from entries in active database + Z právě otevřené databáze odebrat veškerá uložená oprávnění + + + Password generator + Generátor hesel + + + Advanced + Pokročilé + + + Activate the following only, if you know what you are doing! + Následující zapněte pouze pokud víte, co děláte! + + + Always allow &access to entries + Vždy umožnit přístup k veškerým položkám + + + Always allow &updating entries + Vždy umožnit akt&ualizovat položky + + + Searc&h in all opened databases for matching entries + Vy&hledat odpovídající položky ve všech otevřených databázích + + + Only the selected database has to be connected with a client! + Je třeba, aby ke klientovi byly připojené pouze vybrané databáze! + + + &Return also advanced string fields which start with "KPH: " + V&rátit také pokročilé textové řetězce které začínají na „KPH:“ + + + Automatic creates or updates are not supported for string fields! + Automatická vytváření nebo aktualizace nejsou u textových kolonek podporované! + + + HTTP Port: + HTTP port: + + + Default port: 19455 + Výchozí port: 19455 + + + Re&quest to unlock the database if it is locked + Vyžádat odemknutí zamčené databáze + + + Sort &matching entries by title + Seřadit odpovídající položky dle názvu + + + Enable KeepassXC HTTP protocol +This is required for accessing your databases from ChromeIPass or PassIFox + Zapnout protokol KeePassXC HTTP +Toto je zapotřebí pro přístup do databáze z ChromeIPass nebo PassIFox + + + KeePassXC will listen to this port on 127.0.0.1 + Na tomto portu bude KeePassXC očekávat spojení na adrese 127.0.0.1 + + + Cannot bind to privileged ports + S oprávněními uživatele není možné navázat na porty, pro které je třeba oprávnění správce systému + + + Cannot bind to privileged ports below 1024! +Using default port 19455. + Není možné navázat na porty s číslem nižším, než 1024! +Náhradně bude použit port 19455. + PasswordGeneratorWidget @@ -1117,10 +1401,6 @@ Jedná se o jednosměrný převod. Databázi, vzniklou z importu, nepůjde otev Password: Heslo: - - Length: - Délka: - Character Types Typy znaků @@ -1145,71 +1425,72 @@ Jedná se o jednosměrný převod. Databázi, vzniklou z importu, nepůjde otev Exclude look-alike characters Vynechat podobně vypadající znaky (předejití záměně) - - Ensure that the password contains characters from every group - Zajistit, aby heslo obsahovalo znaky ze všech zvolených skupin znaků - Accept Přijmout - - - QCommandLineParser - Displays version information. - Zobrazí informace o verzi. + %p% + %p% - Displays this help. - Zobrazí tuto nápovědu. + strength + odolnost - Unknown option '%1'. - Neznámá předvolba %1. + entropy + náhodnost - Unknown options: %1. - Neznámé předvolby: %1. + &Length: + Dé&lka: - Missing value after '%1'. - Chybějící hodnota, následující za %1. + Pick characters from every group + Použít znaky ze všech skupin - Unexpected value after '%1'. - Neočekávaná hodnota, následující za %1. + Generate + Vytvořit - [options] - [předvolby] + Close + Zavřít - Usage: %1 - Použití: %1 + Apply + Použít - Options: - Předvolby: + Entropy: %1 bit + Náhodnost: %1 bit - Arguments: - Argumenty: + Password Quality: %1 + Odolnost hesla: %1 + + + Poor + Velmi nízká + + + Weak + Slabá + + + Good + Dobrá + + + Excellent + Skvělá - QSaveFile + QObject - Existing file %1 is not writable - Do stávajícího souboru %1 nelze zapisovat - - - Writing canceled by application - Zápis byl zrušen aplikací - - - Partial write. Partition full? - Zápis nebylo možné zcela dokončit. Nedostatek volného místa? + Http + Http @@ -1249,20 +1530,111 @@ Jedná se o jednosměrný převod. Databázi, vzniklou z importu, nepůjde otev SearchWidget - Find: - Najít: + Case Sensitive + Rozlišovat velikost písmen - Case sensitive - Rozlišovat malá/velká písmena + Search + Hledat - Current group - Stávající skupina + Find + Najít - Root group - Kořenová skupina + Clear + Vyčistit + + + + Service + + A shared encryption-key with the name "%1" already exists. +Do you want to overwrite it? + Už existuje sdílený šifrovací klíč s názvem „%1“. +Přejete si ho přepsat? + + + Do you want to update the information in %1 - %2? + Přejete si aktualizovat informaci v %1 – %2? + + + The active database is locked! +Please unlock the selected database or choose another one which is unlocked. + Právě otevřená databáze je uzamčená! +Buď jí odemkněte, nebo vyberte jinou, odemčenou. + + + Successfully removed %1 encryption-%2 from KeePassX/Http Settings. + Z nastavení KeePassX/Http bylo úspěšně odebráno %1 šifrování-%2. + + + No shared encryption-keys found in KeePassHttp Settings. + V nastavení KeePassHttp nebyly nalezeny žádné sdílené šifrovací klíče. + + + The active database does not contain an entry of KeePassHttp Settings. + Právě otevřená databáze neobsahuje žádnou položku nastavení KeePassHttp. + + + Removing stored permissions... + Odstraňuji uložená oprávnění... + + + Abort + Přerušit + + + Successfully removed permissions from %1 %2. + Oprávnění %1 %2 úspěšně odebrána. + + + The active database does not contain an entry with permissions. + Právě otevřená databáze neobsahuje položku s oprávněními. + + + KeePassXC: New key association request + KeePassXC: nový požadavek na přiřazení klíče + + + You have received an association request for the above key. +If you would like to allow it access to your KeePassXC database +give it a unique name to identify and accept it. + Pokud jste obdrželi požadavek na přiřazení pro výše uvedený klíč. +Pokud chcete umožnit přístup do KeePassXC databáze, dejte jí +jedinečný název pro její identifikaci a potvrďte ho. + + + KeePassXC: Overwrite existing key? + KeePassXC: Přepsat stávající klíč? + + + KeePassXC: Update Entry + KeePassXC: Aktualizovat položku + + + KeePassXC: Database locked! + KeePassXC: Databáze uzamčena! + + + KeePassXC: Removed keys from database + KeePassXC: Odebrány klíče z databáze + + + KeePassXC: No keys found + KeePassXC: Klíče nebyly nalezeny + + + KeePassXC: Settings not available! + KeePassXC: Nastavení nejsou k dispozici! + + + KeePassXC: Removed permissions + KeePassXC: Odebraná oprávnění + + + KeePassXC: No entry with permissions found! + KeePassXC: Nebyla nalezena položka s oprávněními! @@ -1286,10 +1658,6 @@ Jedná se o jednosměrný převod. Databázi, vzniklou z importu, nepůjde otev Remember last databases Pamatovat si nedávno otevřené databáze - - Open previous databases on startup - Při spuštění aplikace otevřít minule otevřené databáze - Automatically save on exit Před ukončením aplikace automaticky uložit případné změny @@ -1300,7 +1668,7 @@ Jedná se o jednosměrný převod. Databázi, vzniklou z importu, nepůjde otev Minimize when copying to clipboard - Po zkopírování údaje do schránky automaticky minimalizovat okno KeePassX (do popředí se tak dostane okno, do kterého se zkopírovaný údaj bude vkládat) + Po zkopírování údaje do schránky automaticky minimalizovat Use group icon on entry creation @@ -1331,12 +1699,20 @@ Jedná se o jednosměrný převod. Databázi, vzniklou z importu, nepůjde otev Pamatovat si nedávno otevřené soubory s klíči - Hide window to system tray instead of App Exit - + Load previous databases on startup + Při spuštění aplikace načíst minule otevřené databáze - Hide window to system tray on App start - + Automatically reload the database when modified externally + V okamžiku zásahu do databáze zvenčí ji načíst znovu + + + Hide window to system tray instead of app exit + Namísto zavření minimalizovat okno aplikace do oznamovací oblasti systémového panelu + + + Minimize window at application startup + Spouštět aplikaci s minimalizovaným oknem @@ -1361,6 +1737,14 @@ Jedná se o jednosměrný převod. Databázi, vzniklou z importu, nepůjde otev Always ask before performing auto-type Před provedením automatického vyplnění se vždy dotázat + + Lock databases after minimizing the window + Při minimalizaci okna uzamknout databáze + + + Don't require password repeat when it is visible + Pokud jsou zobrazená, nevyžadovat zopakování hesel + UnlockDatabaseWidget @@ -1378,14 +1762,6 @@ Jedná se o jednosměrný převod. Databázi, vzniklou z importu, nepůjde otev main - - KeePassX - cross-platform password manager - KeePassX – správce hesel, fungující napříč rozličnými operačními systémy - - - filename of the password database to open (*.kdbx) - který soubor s databází hesel (*.kdbx) otevřít - path to a custom config file umístění souboru s vlastními nastaveními @@ -1394,5 +1770,17 @@ Jedná se o jednosměrný převod. Databázi, vzniklou z importu, nepůjde otev key file of the database soubor s klíčem k databázi + + filename(s) of the password database(s) to open (*.kdbx) + názvy databází s hesly (*.kdbx) které otevřít ()() + + + KeePassXC - cross-platform password manager + KeePassXC – aplikace pro správu hesel, fungující na vícero operačních systémech + + + read password of the database from stdin + načíst heslo k databázi ze standardního vstupu + \ No newline at end of file diff --git a/share/translations/keepassx_de.ts b/share/translations/keepassx_de.ts index 2742de484..20bd5daeb 100644 --- a/share/translations/keepassx_de.ts +++ b/share/translations/keepassx_de.ts @@ -1,14 +1,6 @@ - + AboutDialog - - About KeePassX - Über KeePassX - - - KeePassX is distributed under the term of the GNU General Public License (GPL) version 2 or (at your option) version 3. - KeePassX steht unter der GNU General Public License (GPL) version 2 (version 3). - Revision Überarbeitung @@ -17,17 +9,56 @@ Using: In Benutzung: + + About KeePassXC + Über KeePassXC + + + KeePassXC is distributed under the term of the GNU General Public License (GPL) version 2 or (at your option) version 3. + KeePassXC steht unter der GNU General Public License (GPL) version 2 (version 3). + + + Extensions: + + Erweiterungen: + + + + + AccessControlDialog + + Remember this decision + Diese Entscheidung merken + + + Allow + Erlauben + + + Deny + Ablehnen + + + %1 has requested access to passwords for the following item(s). +Please select whether you want to allow access. + %1 hat Zugriff auf Passwörter für folgende Element(e) angefordert. +Bitte wählen Sie, ob Sie den Zugriff erlauben möchten. + + + KeePassXC HTTP Confirm Access + KeePassXC HTTP Erlaube Zugriff + AutoType - - Auto-Type - KeePassX - Auto-Type - KeePassX - Couldn't find an entry that matches the window title: Konnte keinen Eintrag finden, welcher mit dem Fenstertitel übereinstimmt: + + Auto-Type - KeePassXC + Auto-Type - KeePassXC + AutoTypeAssociationsModel @@ -46,14 +77,14 @@ AutoTypeSelectDialog - - Auto-Type - KeePassX - Auto-Type - KeePassX - Select entry to Auto-Type: Wählen Sie einen Eintrag für Auto-Type: + + Auto-Type - KeePassXC + Auto-Type - KeePassXC + ChangeMasterKeyWidget @@ -318,11 +349,6 @@ Save changes? locked gesperrt - - The database you are trying to open is locked by another instance of KeePassX. -Do you want to open it anyway? Alternatively the database is opened read-only. - Die Datenbank, die geöffnet werden soll, ist aktuell von einer anderen Instanz von KeePassX blockiert. Soll sie dennoch geöffnet werden? Andererseits wird die Datenbank schreibgeschützt geöffnet. - Lock database Datenbank sperren @@ -366,14 +392,24 @@ Discard changes and close anyway? Die CSV Datei konnte nicht gespeichert werden. - The database you are trying to save as is locked by another instance of KeePassX. -Do you want to save it anyway? - Die Datenbank, die gespeichert werden soll, ist von einer anderen Instanz von KeePassX blockiert. -Soll sie dennoch gespeichert werden? + Unable to open the database. + Öffnen der Datenbank ist nicht möglich. - Unable to open the database. - + The database you are trying to open is locked by another instance of KeePassXC. +Do you want to open it anyway? Alternatively the database is opened read-only. + Die Datenbank, die geöffnet werden soll, ist aktuell von einer anderen Instanz von KeePassXC blockiert. +Soll sie dennoch geöffnet werden? Alternativ wird die Datenbank schreibgeschützt geöffnet. + + + Merge database + Datenbank zusammenführen + + + The database you are trying to save as is locked by another instance of KeePassXC. +Do you want to save it anyway? + Die Datenbank, die gespeichert werden soll, ist von einer anderen Instanz von KeePassXC blockiert. +Soll sie dennoch gespeichert werden? @@ -414,10 +450,6 @@ Soll sie dennoch gespeichert werden? Do you really want to delete the group "%1" for good? Wollen Sie die Gruppe "%1" wirklich löschen? - - Current group - Aktuelle Gruppe - Error Fehler @@ -428,11 +460,71 @@ Soll sie dennoch gespeichert werden? Move entry to recycle bin? - + Eintrag in den Papierkorb verschieben? Do you really want to move entry "%1" to the recycle bin? - + Möchten Sie wirklich Eintrag "%1" in den Papierkorb verschieben? + + + Searching... + Am suchen... + + + No current database. + Keine aktuelle Datenbank + + + No source database, nothing to do. + Keine Quelldatenbank, es gibt nichts zu tun. + + + Search Results (%1) + Suchergebnisse (%1) + + + No Results + Keine Ergebnisse + + + Execute command? + Befehl ausführen? + + + Do you really want to execute the following command?<br><br>%1<br> + Den folgenden Befehl wirklich ausführen?<br><br>%1<br> + + + Remember my choice + Meine Auswahl merken + + + Autoreload Request + Autoreload Anfrage + + + The database file has changed. Do you want to load the changes? + Die Datenbank wurde verändert. Möchten Sie die Änderungen laden? + + + Merge Request + Zusammenführ-Anfrage + + + The database file has changed and you have unsaved changes.Do you want to merge your changes? + Die Datenbank wurde verändert und Sie haben ungespeicherte Änderungen. Möchten Sie Ihre Änderungen zusammenfügen? + + + Autoreload Failed + Autoreload fehlgeschlagen + + + Could not parse or unlock the new database file while attempting to autoreload this database. + Kann Datenbank nicht durchsuchen oder entsperren während dem Autoreload-Versuch dieser Datenbank. + + + Could not open the new database file while attempting to autoreload this database. + Kann die Datenbank nicht öffnen während dem Versuch, diese Datenbank automatisch neu zu laden. @@ -622,10 +714,6 @@ Soll sie dennoch gespeichert werden? Repeat: Wiederholen: - - Gen. - Gen. - URL: URL: @@ -743,17 +831,25 @@ Soll sie dennoch gespeichert werden? Can't delete icon! Symbol kann nicht gelöscht werden! - - Can't delete icon. Still used by %n item(s). - Symbol kann nicht gelöscht werden. Es wird von %n Eintrag verwendet.Symbol kann nicht gelöscht werden. Es wird von %n Einträgen verwendet. - Error - + Fehler - Can't read icon: - + Download favicon + Favicon herunterladen + + + Unable to fetch favicon. + Abrufen des Favicons nicht möglich + + + Can't read icon + Icon kann nicht gelesen werden + + + Can't delete icon. Still used by %1 items. + Symbol kann nicht gelöscht werden. Es wird noch von %1 Einträgen verwendet. @@ -775,6 +871,13 @@ Soll sie dennoch gespeichert werden? Uuid: + + Entry + + - Clone + - Klone + + EntryAttributesModel @@ -827,6 +930,61 @@ Soll sie dennoch gespeichert werden? Papierkorb + + HttpPasswordGeneratorWidget + + Length: + Länge: + + + Character Types + Zeichenarten + + + Upper Case Letters + Großbuchstaben + + + A-Z + A-Z + + + Lower Case Letters + Kleinbuchstaben + + + a-z + a-z + + + Numbers + Zahlen + + + 0-9 + 0-9 + + + Special Characters + Sonderzeichen + + + /*_& ... + /*_& ... + + + Exclude look-alike characters + Gleich aussehende Zeichen ausschließen + + + Ensure that the password contains characters from every group + Sicherstellen, dass das Passwort Zeichen aus allen Gruppen enthält. + + + Accept + Akzeptieren + + KeePass1OpenWidget @@ -870,7 +1028,7 @@ Soll sie dennoch gespeichert werden? Wrong key or database file is corrupt. - + Falscher Schlüssel oder die Datenbank ist beschädigt. @@ -909,8 +1067,8 @@ Dieser Vorgang ist nur in eine Richtung möglich. Die importierte Datenbank kann Fataler Fehler beim Testen der kryptografischen Funktionen. - KeePassX - Error - KeePassX - Fehler + KeePassXC - Error + KeePassXC - Fehler @@ -919,102 +1077,14 @@ Dieser Vorgang ist nur in eine Richtung möglich. Die importierte Datenbank kann Database Datenbank - - Recent databases - Aktuelle Datenbanken - - - Help - Hilfe - - - Entries - Einträge - - - Copy attribute to clipboard - Eingenschaft in die Zwischenablage kopieren - - - Groups - Gruppen - - - View - Ansicht - - - Quit - Beenden - - - About - Über - Open database Datenbank öffnen - - Save database - Datenbank speichern - - - Close database - Datenbank schließen - - - New database - Neue Datenbank - - - Add new entry - Neuen Eintrag hinzufügen - - - View/Edit entry - Eintrag anzeigen/bearbeiten - - - Delete entry - Eintrag löschen - - - Add new group - Neue Gruppe hinzufügen - - - Edit group - Gruppe bearbeiten - - - Delete group - Gruppe löschen - - - Save database as - Datenbank speichern als - - - Change master key - Hauptschlüssel ändern - Database settings Datenbankeinstellungen - - Import KeePass 1 database - KeePass 1 Datenbank importieren - - - Clone entry - Eintrag klonen - - - Find - Suchen - Copy username to clipboard Benutzername in die Zwischenablage kopieren @@ -1027,30 +1097,6 @@ Dieser Vorgang ist nur in eine Richtung möglich. Die importierte Datenbank kann Settings Einstellungen - - Perform Auto-Type - Auto-Type ausführen - - - Open URL - URL öffnen - - - Lock databases - Datenbank sperren - - - Title - Titel - - - URL - URL - - - Notes - Notizen - Show toolbar Symbolleiste anzeigen @@ -1067,22 +1113,6 @@ Dieser Vorgang ist nur in eine Richtung möglich. Die importierte Datenbank kann Tools Tools - - Copy username - Benutzername kopieren - - - Copy password - Passwort kopieren - - - Export to CSV file - Als CSV Datei exportieren - - - Repair database - Datenbank reparieren - KeePass 2 Database KeePass 2 Datenbank @@ -1103,6 +1133,265 @@ Dieser Vorgang ist nur in eine Richtung möglich. Die importierte Datenbank kann Writing the database failed. Schreiben der Datenbank fehlgeschlagen. + + &Recent databases + &Letzte Datenbanken + + + He&lp + Hi&lfe + + + E&ntries + Ei&nträge + + + Copy att&ribute to clipboard + Eigenschaft in &Zwischenablage kopieren + + + &Groups + &Gruppen + + + &View + &Ansicht + + + &Quit + &Beenden + + + &About + &Über + + + &Open database + &Öffne Datenbank + + + &Save database + Datenbank &speichern + + + &Close database + &Datenbank schließen + + + &New database + &Neue Datenbank + + + Merge from KeePassX database + Von KeePassX-Datenbank zusammenführen + + + &Add new entry + Neuen Eintrag &hinzufügen + + + &View/Edit entry + Eintrag &anzeigen/bearbeiten + + + &Delete entry + Eintrag &löschen + + + &Add new group + &Neue Gruppe hinzufügen + + + &Edit group + Gruppe b&earbeiten + + + &Delete group + Gruppe &löschen + + + Sa&ve database as + Datenbank s&peichern als + + + Change &master key + &Hauptschlüssel ändern + + + &Database settings + &Datenbankeinstellungen + + + &Import KeePass 1 database + &KeePass 1 Datenbank importieren + + + &Clone entry + Eintrag &klonen + + + &Find + &Suchen + + + Copy &username + &Benutzername kopieren + + + Cop&y password + Passwort kop&ieren + + + &Settings + &Einstellungen + + + &Perform Auto-Type + &Auto-Type ausführen + + + &Open URL + URL &öffnen + + + &Lock databases + Datenbank &sperren + + + &Title + &Titel + + + &URL + &URL + + + &Notes + &Notizen + + + &Export to CSV file + Als CSV Datei &exportieren + + + Re&pair database + Datenbank re&parieren + + + Password Generator + Passwortgenerator + + + + OptionDialog + + Dialog + Dialog + + + General + Allgemein + + + Sh&ow a notification when credentials are requested + Zeig&e eine Benachrichtigung, wenn Anmeldedaten angefordert werden. + + + &Return only best matching entries for an URL instead +of all entries for the whole domain + Zeige nur die passendsten Einträge für eine URL, statt +alle Einträge der ganzen Domäne. + + + &Match URL schemes +Only entries with the same scheme (http://, https://, ftp://, ...) are returned + Passendes URL Schema +Nur Einträge mit dem gleichen Schema (hhtp://, https://, ftp://, ...) werden angezeigt + + + Sort matching entries by &username + Sortiere gefundene Einträge nach &Benutzername + + + R&emove all shared encryption-keys from active database + Entferne alle freigegebenen Chiffrierschlüssel aus der aktiven Datenbank + + + Re&move all stored permissions from entries in active database + Entferne alle gespeicherten Berechtigungen von Einträgen in der aktiven Datenbank + + + Password generator + Passwortgenerator + + + Advanced + Fortgeschritten + + + Activate the following only, if you know what you are doing! + Aktivieren Sie das Nachfolgende nur dann, wenn Sie sich sicher sind, was sie tun! + + + Always allow &access to entries + &Zugriff auf Einträge immer erlauben + + + Always allow &updating entries + &Aktualisierung von Einträgen immer erlauben + + + Searc&h in all opened databases for matching entries + Suche in allen offenen Datenbanken nach übereinstimmenden Einträgen + + + Only the selected database has to be connected with a client! + Nur die ausgewählte Datenbank muss mit dem Client verbunden sein. + + + &Return also advanced string fields which start with "KPH: " + Zeige auch erweiterte Zeichenfelder, welche mit "KPH: " beginnen + + + Automatic creates or updates are not supported for string fields! + Automatisches Erstellen und Aktualisieren von Zeichenfeldern wird nicht unterstützt! + + + HTTP Port: + HTTP Port: + + + Default port: 19455 + Standard Port:19455 + + + Re&quest to unlock the database if it is locked + Verlange Entsperrung, wenn die Datenbank gesperrt ist. + + + Sort &matching entries by title + Sortiere gefundene Einträge nach Titel + + + Enable KeepassXC HTTP protocol +This is required for accessing your databases from ChromeIPass or PassIFox + Aktiviere KeePassXC HTTP Protokoll +Dies wird benötigt um von ChromeIPass oder PassIFox auf Deine Datenbank zu zugreifen + + + KeePassXC will listen to this port on 127.0.0.1 + KeePassXC überwacht diesen Port auf 127.0..0.1 + + + Cannot bind to privileged ports + Kann nicht zu privilegierte Ports verbinden + + + Cannot bind to privileged ports below 1024! +Using default port 19455. + Kann nicht zu privilegierten Ports unter 1024 verbinden! +Benutze Standardport 19455. + PasswordGeneratorWidget @@ -1110,10 +1399,6 @@ Dieser Vorgang ist nur in eine Richtung möglich. Die importierte Datenbank kann Password: Passwort: - - Length: - Länge: - Character Types Zeichenarten @@ -1138,71 +1423,72 @@ Dieser Vorgang ist nur in eine Richtung möglich. Die importierte Datenbank kann Exclude look-alike characters Gleich aussehende Zeichen ausschließen - - Ensure that the password contains characters from every group - Sicher stellen, dass das Passwort Zeichen aller Gruppen enthält - Accept Akzeptieren - - - QCommandLineParser - Displays version information. - Versionsinformationen anzeigen. + %p% + %p% - Displays this help. - Zeigt diese Hilfe an. + strength + Stärke - Unknown option '%1'. - Unbekannte Option '%1'. + entropy + Entropie - Unknown options: %1. - Unbekannte Optionen: '%1'. + &Length: + &Länge: - Missing value after '%1'. - Fehlender Wert nach '%1'. + Pick characters from every group + Zeichen aus allen Gruppen wählen - Unexpected value after '%1'. - Unerwarteter Wert nach '%1'. + Generate + Generiere - [options] - [Optionen] + Close + Schließen - Usage: %1 - Verwendung: %1 + Apply + Anwenden - Options: - Optionen: + Entropy: %1 bit + Entropie: %1 bit - Arguments: - Argumente: + Password Quality: %1 + Passwort Qualität: %1 + + + Poor + Schlecht + + + Weak + Schwach + + + Good + Gut + + + Excellent + Exzellent - QSaveFile + QObject - Existing file %1 is not writable - Bestehende Datei(en) %1 ist nicht schreibbar - - - Writing canceled by application - Schreiben von der Applikation abgebrochen - - - Partial write. Partition full? - Unvollständiger Schreibvorgang. Partition voll? + Http + Http @@ -1242,20 +1528,112 @@ Dieser Vorgang ist nur in eine Richtung möglich. Die importierte Datenbank kann SearchWidget - Find: - Suchen nach: + Case Sensitive + Groß- /Kleinschreibung beachten - Case sensitive - Groß-/Kleinschreibung unterscheiden + Search + Suche - Current group - Aktuelle Gruppe + Find + Suchen - Root group - Root-Gruppe + Clear + löschen + + + + Service + + A shared encryption-key with the name "%1" already exists. +Do you want to overwrite it? + Ein freigegebener Chiffrierschlüssel mit dem Namen "%1" existiert schon. +Willst Du ihn überschreiben? + + + Do you want to update the information in %1 - %2? + Möchten Sie wirklich die Informationen in %1 - %2 aktualisieren? + + + The active database is locked! +Please unlock the selected database or choose another one which is unlocked. + Die aktive Datenbank ist gesperrt! +Bitte entsperren Sie die markierte Datenbank oder wählen Sie eine andere, die entsperrt ist. + + + Successfully removed %1 encryption-%2 from KeePassX/Http Settings. + %1 Verschlüsselungs-%2 erfolgreich von KeePassX/Http Einstellungen entfernt. + + + No shared encryption-keys found in KeePassHttp Settings. + Kein freigegebener Chiffrierschlüssel in den KeePassHttp-Einstellungen gefunden. + + + The active database does not contain an entry of KeePassHttp Settings. + Die aktive Datenbank enthält keinen Eintrag für KeePassHttp Einstellungen. + + + Removing stored permissions... + Gespeicherte Berechtigungen werden gelöscht... + + + Abort + Abbrechen + + + Successfully removed permissions from %1 %2. + Berechtigungen wurden von %1 %2 erfolgreich gelöscht. + + + The active database does not contain an entry with permissions. + The aktive Datenbank enthält keinen Eintrag mit Zugangsdaten. + + + KeePassXC: New key association request + KeePassXC: Neue Schlüsselverbindungsanfrage + + + You have received an association request for the above key. +If you would like to allow it access to your KeePassXC database +give it a unique name to identify and accept it. + Sie haben eine Verbindungsanfrage für den obigen Schlüssel +erhalten. Wenn Sie den Zugriff auf Ihre KeePassXC-Datenbank +erlauben möchten, geben Sie der Verbindungen einen eindeutigen +Namen und akzeptieren Sie. + + + KeePassXC: Overwrite existing key? + KeePassXC: Bestehenden Schlüssel überschreiben? + + + KeePassXC: Update Entry + KeePassXC: Eintrag aktualisiert + + + KeePassXC: Database locked! + KeePassXC: Datenbank gesperrt! + + + KeePassXC: Removed keys from database + KeePassXC: Entfernte Schlüssel von der Datenbank + + + KeePassXC: No keys found + KeePassXC: Kein Schlüssel gefunden + + + KeePassXC: Settings not available! + KeePassXC: Einstellung nicht verfügbar! + + + KeePassXC: Removed permissions + KeePassXC: Entfernte Zugangsdaten + + + KeePassXC: No entry with permissions found! + KeePassXC: Kein Eintrag mit Zugangsdaten gefunden! @@ -1279,10 +1657,6 @@ Dieser Vorgang ist nur in eine Richtung möglich. Die importierte Datenbank kann Remember last databases Letzte Datenbank merken - - Open previous databases on startup - Letzte Datenbank beim Starten öffnen - Automatically save on exit Automatisch speichern beim Schließen @@ -1324,12 +1698,20 @@ Dieser Vorgang ist nur in eine Richtung möglich. Die importierte Datenbank kann Letzte Schlüsseldateien merken - Hide window to system tray instead of App Exit - Fenster zu Taskleistensymbol minimieren statt Programm beenden + Load previous databases on startup + Letzte Datenbank beim Starten laden - Hide window to system tray on App start - Fenster zu Taskleistensymbol minimieren wenn Programm started + Automatically reload the database when modified externally + Datenbank nach externer Modifikation automatisch neu laden. + + + Hide window to system tray instead of app exit + Fenster zur Taskleiste minimieren statt das Programm zu beenden + + + Minimize window at application startup + Fenster beim Programmstart minimieren @@ -1354,6 +1736,14 @@ Dieser Vorgang ist nur in eine Richtung möglich. Die importierte Datenbank kann Always ask before performing auto-type Immer vor einem Auto-type fragen + + Lock databases after minimizing the window + Datenbank sperren nach dem Minimieren des Fensters + + + Don't require password repeat when it is visible + Keine erneute Eingabe verlangen wenn Passwort sichtbar. + UnlockDatabaseWidget @@ -1371,14 +1761,6 @@ Dieser Vorgang ist nur in eine Richtung möglich. Die importierte Datenbank kann main - - KeePassX - cross-platform password manager - KeePassX - plattformübergreifender Passwortmanager - - - filename of the password database to open (*.kdbx) - Dateiname für die zu öffnende Passwortdatenbank (*.kdbx) - path to a custom config file Pfad zu einer benutzerdefinierten Konfigurationsdatei @@ -1387,5 +1769,17 @@ Dieser Vorgang ist nur in eine Richtung möglich. Die importierte Datenbank kann key file of the database Schlüsseldatei der Datenbank + + filename(s) of the password database(s) to open (*.kdbx) + Dateiname(n) der zu öffnenden Passwortdatenbank(en) (*.kdbx) + + + KeePassXC - cross-platform password manager + KeePassXC - plattformübergreifender Passwortmanager + + + read password of the database from stdin + passwort der datenbank von stdin lesen + \ No newline at end of file diff --git a/share/translations/keepassx_en.ts b/share/translations/keepassx_en.ts index bbf574b47..d55617134 100644 --- a/share/translations/keepassx_en.ts +++ b/share/translations/keepassx_en.ts @@ -19,6 +19,11 @@ KeePassXC is distributed under the term of the GNU General Public License (GPL) version 2 or (at your option) version 3. + + Extensions: + + + AccessControlDialog @@ -475,6 +480,46 @@ Do you want to save it anyway? No Results + + Execute command? + + + + Do you really want to execute the following command?<br><br>%1<br> + + + + Remember my choice + + + + Autoreload Request + + + + The database file has changed. Do you want to load the changes? + + + + Merge Request + + + + The database file has changed and you have unsaved changes.Do you want to merge your changes? + + + + Autoreload Failed + + + + Could not parse or unlock the new database file while attempting to autoreload this database. + + + + Could not open the new database file while attempting to autoreload this database. + + EditEntryWidget @@ -669,10 +714,6 @@ Do you want to save it anyway? Repeat: - - Gen. - - URL: @@ -830,6 +871,13 @@ Do you want to save it anyway? + + Entry + + - Clone + + + EntryAttributesModel @@ -1226,6 +1274,10 @@ This is a one-way migration. You won't be able to open the imported databas Re&pair database + + Password Generator + + OptionDialog @@ -1299,14 +1351,6 @@ Only entries with the same scheme (http://, https://, ftp://, ...) are returned< Automatic creates or updates are not supported for string fields! - - HTTP Host: - - - - Default host: localhost - - HTTP Port: @@ -1315,11 +1359,6 @@ Only entries with the same scheme (http://, https://, ftp://, ...) are returned< Default port: 19455 - - Enable KeepassXC Http protocol -This is required for accessing your databases from ChromeIPass or PassIFox - - Re&quest to unlock the database if it is locked @@ -1328,6 +1367,24 @@ This is required for accessing your databases from ChromeIPass or PassIFoxSort &matching entries by title + + Enable KeepassXC HTTP protocol +This is required for accessing your databases from ChromeIPass or PassIFox + + + + KeePassXC will listen to this port on 127.0.0.1 + + + + Cannot bind to privileged ports + + + + Cannot bind to privileged ports below 1024! +Using default port 19455. + + PasswordGeneratorWidget @@ -1335,10 +1392,6 @@ This is required for accessing your databases from ChromeIPass or PassIFoxPassword: - - Length: - - Character Types @@ -1364,11 +1417,63 @@ This is required for accessing your databases from ChromeIPass or PassIFox - Ensure that the password contains characters from every group + Accept - Accept + %p% + + + + strength + + + + entropy + + + + &Length: + + + + Pick characters from every group + + + + Generate + + + + Close + + + + Apply + + + + Entropy: %1 bit + + + + Password Quality: %1 + + + + Poor + + + + Weak + + + + Good + + + + Excellent @@ -1415,16 +1520,20 @@ This is required for accessing your databases from ChromeIPass or PassIFox SearchWidget - - Find: - - Case Sensitive - Search Current Group + Search + + + + Find + + + + Clear @@ -1536,10 +1645,6 @@ give it a unique name to identify and accept it. Remember last databases - - Open previous databases on startup - - Automatically save on exit @@ -1581,11 +1686,19 @@ give it a unique name to identify and accept it. - Hide window to system tray instead of App Exit + Load previous databases on startup - Hide window to system tray on App start + Automatically reload the database when modified externally + + + + Hide window to system tray instead of app exit + + + + Minimize window at application startup @@ -1615,6 +1728,10 @@ give it a unique name to identify and accept it. Lock databases after minimizing the window + + Don't require password repeat when it is visible + + UnlockDatabaseWidget diff --git a/share/translations/keepassx_lt.ts b/share/translations/keepassx_lt.ts index 41aa94df7..824101c51 100644 --- a/share/translations/keepassx_lt.ts +++ b/share/translations/keepassx_lt.ts @@ -1,14 +1,6 @@ - + AboutDialog - - About KeePassX - Apie KeePassX - - - KeePassX is distributed under the term of the GNU General Public License (GPL) version 2 or (at your option) version 3. - KeePassX yra platinama GNU Bendrosios Viešosios Licencijos (GPL) versijos 2 arba (jūsų pasirinkimu) versijos 3 sąlygomis. - Revision Poversijis @@ -17,17 +9,56 @@ Using: Naudojama: + + About KeePassXC + Apie KeePassXC + + + KeePassXC is distributed under the term of the GNU General Public License (GPL) version 2 or (at your option) version 3. + KeePassXC yra platinama GNU Bendrosios Viešosios Licencijos (GPL) versijos 2 arba (jūsų pasirinkimu) versijos 3 sąlygomis. + + + Extensions: + + Plėtiniai: + + + + + AccessControlDialog + + Remember this decision + Prisiminti šį sprendimą + + + Allow + Leisti + + + Deny + Atmesti + + + %1 has requested access to passwords for the following item(s). +Please select whether you want to allow access. + %1 užklausė prieigos prie slaptažodžių šiam elementui(-ams). +Pasirinkite, ar norite leisti prieigą. + + + KeePassXC HTTP Confirm Access + KeePassXC HTTP prieigos patvirtinimas + AutoType - - Auto-Type - KeePassX - Automatinis rinkimas - KeePassX - Couldn't find an entry that matches the window title: Nepavyko rasti įrašo, kuris atitiktų lango antraštę: + + Auto-Type - KeePassXC + Automatinis rinkimas - KeePassXC + AutoTypeAssociationsModel @@ -46,14 +77,14 @@ AutoTypeSelectDialog - - Auto-Type - KeePassX - Automatinis rinkimas - KeePassX - Select entry to Auto-Type: Pasirinkite įrašą automatiniam rinkimui: + + Auto-Type - KeePassXC + Automatinis rinkimas - KeePassXC + ChangeMasterKeyWidget @@ -319,12 +350,6 @@ Save changes? locked užrakinta - - The database you are trying to open is locked by another instance of KeePassX. -Do you want to open it anyway? Alternatively the database is opened read-only. - Duomenų bazė, kurią bandote atverti, yra užrakinta kito KeePassX egzemplioriaus. -Ar vis tiek norite ją atverti? Kitu atveju duomenų bazė bus atverta tik skaitymui. - Lock database Užrakinti duomenų bazę @@ -368,14 +393,24 @@ Vis tiek atmesti pakeitimus ir užverti? CSV failo įrašymas nepavyko. - The database you are trying to save as is locked by another instance of KeePassX. -Do you want to save it anyway? - Duomenų bazė, kurią bandote įrašyti yra užrakinta kito KeePassX programos egzemplioriaus. -Ar vis tiek norite ją įrašyti? + Unable to open the database. + Nepavyko atverti duomenų bazės. - Unable to open the database. - + The database you are trying to open is locked by another instance of KeePassXC. +Do you want to open it anyway? Alternatively the database is opened read-only. + Duomenų bazė, kurią bandote atverti, yra užrakinta kito KeePassXC egzemplioriaus. +Ar vis tiek norite ją atverti? Tokiu atveju duomenų bazė bus atverta tik skaitymui. + + + Merge database + Sulieti duomenų bazę + + + The database you are trying to save as is locked by another instance of KeePassXC. +Do you want to save it anyway? + Duomenų bazė, kurią bandote įrašyti yra užrakinta kito KeePassXC programos egzemplioriaus. +Ar vis tiek norite ją įrašyti? @@ -416,10 +451,6 @@ Ar vis tiek norite ją įrašyti? Do you really want to delete the group "%1" for good? Ar tikrai norite ištrinti grupę "%1"? - - Current group - Esama grupė - Error Klaida @@ -430,11 +461,71 @@ Ar vis tiek norite ją įrašyti? Move entry to recycle bin? - + Perkelti įrašą į šiukšlinę? Do you really want to move entry "%1" to the recycle bin? - + Ar tikrai norite perkelti įrašą "%1" į šiukšlinę? + + + Searching... + Ieškoma... + + + No current database. + Nėra esamos duomenų bazės. + + + No source database, nothing to do. + Nėra šaltinio duomenų bazės, nėra ką atlikti. + + + Search Results (%1) + Paieškos rezultatai (%1) + + + No Results + Nėra rezultatų + + + Execute command? + Vykdyti komandą? + + + Do you really want to execute the following command?<br><br>%1<br> + Ar tikrai norite vykdyti šią komandą?<br><br>%1<br> + + + Remember my choice + Prisiminti mano pasirinkimą + + + Autoreload Request + Automatinio įkėlimo iš naujo užklausa + + + The database file has changed. Do you want to load the changes? + Duomenų bazės failas pasikeitė. Ar norite įkelti pakeitimus? + + + Merge Request + Suliejimo užklausa + + + The database file has changed and you have unsaved changes.Do you want to merge your changes? + Duomenų bazės failas pasikeitė ir jūs turite neįrašytų pakeitimų. Ar norite sulieti savo pakeitimus? + + + Autoreload Failed + Automatinis įkėlimas iš naujo nepavyko + + + Could not parse or unlock the new database file while attempting to autoreload this database. + Nepavyko išanalizuoti ar atrakinti naujos duomenų bazės failo, bandant automatiškai iš naujo įkelti šią duomenų bazę. + + + Could not open the new database file while attempting to autoreload this database. + Nepavyko atverti naujos duomenų bazės failo, bandant automatiškai iš naujo įkelti šią duomenų bazę. @@ -625,10 +716,6 @@ Ar vis tiek norite ją įrašyti? Repeat: Pakartokite: - - Gen. - Kurti - URL: URL: @@ -746,17 +833,25 @@ Ar vis tiek norite ją įrašyti? Can't delete icon! Nepavyksta ištrinti piktogramos! - - Can't delete icon. Still used by %n item(s). - Nepavyksta ištrinti piktogramos. Vis dar naudojama %n elemento.Nepavyksta ištrinti piktogramos. Vis dar naudojama %n elementų.Nepavyksta ištrinti piktogramos. Vis dar naudojama %n elementų. - Error - + Klaida - Can't read icon: - + Download favicon + Atsisiųsti svetainės piktogramą + + + Unable to fetch favicon. + Nepavyko gauti svetainės piktogramos. + + + Can't read icon + Nepavyksta perskaityti piktogramos + + + Can't delete icon. Still used by %1 items. + Nepavyksta ištrinti piktogramos. Vis dar naudojama %1 elementų. @@ -778,6 +873,13 @@ Ar vis tiek norite ją įrašyti? Uuid: + + Entry + + - Clone + - Dublikatas + + EntryAttributesModel @@ -830,6 +932,61 @@ Ar vis tiek norite ją įrašyti? Šiukšlinė + + HttpPasswordGeneratorWidget + + Length: + Ilgis: + + + Character Types + Simbolių tipai + + + Upper Case Letters + Viršutinio registro raidės + + + A-Z + A-Z + + + Lower Case Letters + Apatinio registro raidės + + + a-z + a-z + + + Numbers + Skaičiai + + + 0-9 + 0-9 + + + Special Characters + Specialūs simboliai + + + /*_& ... + /*_& ... + + + Exclude look-alike characters + Pašalinti panašiai atrodančius simbolius + + + Ensure that the password contains characters from every group + Užtikrinti, kad slaptažodyje būtų simboliai iš kiekvienos grupės + + + Accept + Priimti + + KeePass1OpenWidget @@ -873,7 +1030,7 @@ Ar vis tiek norite ją įrašyti? Wrong key or database file is corrupt. - + Neteisingas raktas arba duomenų bazės failas yra pažeistas. @@ -912,8 +1069,8 @@ Tai yra vienakryptis perkėlimas. Jūs negalėsite atverti importuotos duomenų Lemtingoji klaida, testuojant šifravimo funkcijas. - KeePassX - Error - KeePassX - Klaida + KeePassXC - Error + KeePassXC - Klaida @@ -922,102 +1079,14 @@ Tai yra vienakryptis perkėlimas. Jūs negalėsite atverti importuotos duomenų Database Duomenų bazė - - Recent databases - Paskiausios duomenų bazės - - - Help - Pagalba - - - Entries - Įrašai - - - Copy attribute to clipboard - Kopijuoti požymį į iškarpinę - - - Groups - Grupės - - - View - Rodinys - - - Quit - Baigti - - - About - Apie - Open database Atverti duomenų bazę - - Save database - Įrašyti duomenų bazę - - - Close database - Užverti duomenų bazę - - - New database - Nauja duomenų bazė - - - Add new entry - Pridėti naują įrašą - - - View/Edit entry - Žiūrėti/Keisti įrašą - - - Delete entry - Ištrinti įrašą - - - Add new group - Pridėti naują grupę - - - Edit group - Keisti grupę - - - Delete group - Ištrinti grupę - - - Save database as - Įrašyti duomenų bazę kaip - - - Change master key - Pakeisti pagrindinį raktą - Database settings Duomenų bazės nustatymai - - Import KeePass 1 database - Importuoti KeePass 1 duomenų bazę - - - Clone entry - Dublikuoti įrašą - - - Find - Rasti - Copy username to clipboard Kopijuoti naudotojo vardą į iškarpinę @@ -1030,30 +1099,6 @@ Tai yra vienakryptis perkėlimas. Jūs negalėsite atverti importuotos duomenų Settings Nustatymai - - Perform Auto-Type - Atlikti automatinį rinkimą - - - Open URL - Atverti URL - - - Lock databases - Užrakinti duomenų bazes - - - Title - Antraštė - - - URL - URL - - - Notes - Pastabos - Show toolbar Rodyti įrankių juostą @@ -1070,22 +1115,6 @@ Tai yra vienakryptis perkėlimas. Jūs negalėsite atverti importuotos duomenų Tools Įrankiai - - Copy username - Kopijuoti naudotojo vardą - - - Copy password - Kopijuoti slaptažodį - - - Export to CSV file - Eksportuoti į CSV failą - - - Repair database - Taisyti duomenų bazę - KeePass 2 Database KeePass 2 duomenų bazė @@ -1106,6 +1135,265 @@ Tai yra vienakryptis perkėlimas. Jūs negalėsite atverti importuotos duomenų Writing the database failed. Duomenų bazės rašymas nepavyko. + + &Recent databases + &Paskiausiai naudotos duomenų bazės + + + He&lp + Pa&galba + + + E&ntries + Į&rašai + + + Copy att&ribute to clipboard + Kopijuoti &požymį į iškarpinę + + + &Groups + &Grupės + + + &View + R&odinys + + + &Quit + &Baigti + + + &About + &Apie + + + &Open database + &Atverti duomenų bazę + + + &Save database + Į&rašyti duomenų bazę + + + &Close database + &Užverti duomenų bazę + + + &New database + &Nauja duomenų bazė + + + Merge from KeePassX database + Sulieti su KeePassX duomenų baze + + + &Add new entry + &Pridėti naują įrašą + + + &View/Edit entry + &Rodyti/Taisyti įrašą + + + &Delete entry + &Ištrinti įrašą + + + &Add new group + &Pridėti naują grupę + + + &Edit group + &Taisyti grupę + + + &Delete group + &Ištrinti grupę + + + Sa&ve database as + Įraš&yti duomenų bazę kaip + + + Change &master key + Pakeisti &pagrindinį raktą + + + &Database settings + &Duomenų bazės nustatymai + + + &Import KeePass 1 database + &Importuoti KeePass 1 duomenų bazę + + + &Clone entry + &Dublikuoti įrašą + + + &Find + &Rasti + + + Copy &username + Kopijuoti &naudotojo vardą + + + Cop&y password + Kopijuoti &slaptažodį + + + &Settings + &Nustatymai + + + &Perform Auto-Type + &Atlikti automatinį rinkimą + + + &Open URL + Atverti &URL + + + &Lock databases + &Užrakinti duomenų bazes + + + &Title + &Antraštė + + + &URL + &URL + + + &Notes + &Pastabos + + + &Export to CSV file + &Eksportuoti į CSV failą + + + Re&pair database + Pa&taisyti duomenų bazę + + + Password Generator + Slaptažodžių generatorius + + + + OptionDialog + + Dialog + Dialogas + + + General + Bendra + + + Sh&ow a notification when credentials are requested + R&odyti pranešimą, kai reikalaujama prisijungimo duomenų + + + &Return only best matching entries for an URL instead +of all entries for the whole domain + &Vietoj visų įrašų, skirtų visai sričiai, +grąžinti tik geriausiai atitinkančius įrašus, skirtus URL + + + &Match URL schemes +Only entries with the same scheme (http://, https://, ftp://, ...) are returned + &Atitikti URL schemas +Bus grąžinami įrašai tik su ta pačia schema (http://, https://, ftp://, ...) + + + Sort matching entries by &username + Rikiuoti atitinkančius įrašus pagal na&udotojo vardą + + + R&emove all shared encryption-keys from active database + Ša&linti iš aktyvios duomenų bazės visus bendrinamus šifravimo raktus + + + Re&move all stored permissions from entries in active database + Šal&inti iš įrašų aktyvioje duomenų bazėje visus saugomus leidimus + + + Password generator + Slaptažodžių generatorius + + + Advanced + Išplėstiniai + + + Activate the following only, if you know what you are doing! + Aktyvuokite tai tik tuo atveju, jeigu žinote ką darote! + + + Always allow &access to entries + Visada leisti &prieigą prie įrašų + + + Always allow &updating entries + Visada leisti įrašų at&naujinimą + + + Searc&h in all opened databases for matching entries + Ieš&koti atitinkančių įrašų visose atvertose duomenų bazėse + + + Only the selected database has to be connected with a client! + Su klientu turi būti sujungta tik pasirinkta duomenų bazė! + + + &Return also advanced string fields which start with "KPH: " + &Taip pat grąžinti ir išplėstines eilutes, kurios prasideda "KPH: " + + + Automatic creates or updates are not supported for string fields! + Šiems eilutės laukams automatiniai kūrimai ir atnaujinimai neprieinami! + + + HTTP Port: + HTTP prievadas: + + + Default port: 19455 + Numatytasis prievadas: 19455 + + + Re&quest to unlock the database if it is locked + Už&klausti atrakinti duomenų bazę, jeigu ji yra užrakinta + + + Sort &matching entries by title + Rikiuoti atitinkančius įrašus pagal &antraštę + + + Enable KeepassXC HTTP protocol +This is required for accessing your databases from ChromeIPass or PassIFox + Įjungti KeepassXC HTTP protokolą +Tai reikalinga, norint prie savo duomenų bazių gauti prieigą iš ChromeIPass ar PassIFox + + + KeePassXC will listen to this port on 127.0.0.1 + KeePassXC klausysis šio prievado ties 127.0.0.1 + + + Cannot bind to privileged ports + Nepavyksta susieti su privilegijuotais prievadais + + + Cannot bind to privileged ports below 1024! +Using default port 19455. + Nepavyksta susieti su privilegijuotais prievadais žemiau 1024! +Naudojamas numatytasis prievadas 19455. + PasswordGeneratorWidget @@ -1113,10 +1401,6 @@ Tai yra vienakryptis perkėlimas. Jūs negalėsite atverti importuotos duomenų Password: Slaptažodis: - - Length: - Ilgis: - Character Types Simbolių tipai @@ -1141,71 +1425,72 @@ Tai yra vienakryptis perkėlimas. Jūs negalėsite atverti importuotos duomenų Exclude look-alike characters Pašalinti panašiai atrodančius simbolius - - Ensure that the password contains characters from every group - Užtikrinti, kad slaptažodyje yra simboliai iš kiekvienos grupės - Accept Priimti - - - QCommandLineParser - Displays version information. - Rodo versijos informaciją. + %p% + %p% - Displays this help. - Rodo šią pagalbą. + strength + stiprumas - Unknown option '%1'. - Nežinoma parinktis "%1". + entropy + entropija - Unknown options: %1. - Nežinomos parinktys: %1. + &Length: + &Ilgis: - Missing value after '%1'. - Trūksta reikšmės po "%1". + Pick characters from every group + Parinkti simbolius iš kiekvienos grupės - Unexpected value after '%1'. - Netikėta reikšmė po "%1". + Generate + Generuoti - [options] - [parinktys] + Close + Užverti - Usage: %1 - Naudojimas: %1 + Apply + Taikyti - Options: - Parinktys: + Entropy: %1 bit + Entropija: %1 bit - Arguments: - Argumentai: + Password Quality: %1 + Slaptažodžio kokybė: %1 + + + Poor + Blogas + + + Weak + Silpnas + + + Good + Geras + + + Excellent + Puikus - QSaveFile + QObject - Existing file %1 is not writable - Esamas failas %1 nėra įrašomas - - - Writing canceled by application - Programa atšaukė įrašymą - - - Partial write. Partition full? - Dalinis įrašymas. Pilnas skaidinys? + Http + Http @@ -1245,20 +1530,112 @@ Tai yra vienakryptis perkėlimas. Jūs negalėsite atverti importuotos duomenų SearchWidget - Find: - Rasti: + Case Sensitive + Skirti raidžių dydį - Case sensitive - Skiriant raidžių registrą + Search + Ieškoti - Current group - Esama grupė + Find + Rasti - Root group - Šakninė grupė + Clear + Išvalyti + + + + Service + + A shared encryption-key with the name "%1" already exists. +Do you want to overwrite it? + Bendrinamas šifravimo raktas, pavadinimu "%1" jau yra. +Ar norite jį perrašyti? + + + Do you want to update the information in %1 - %2? + Ar norite atnaujinti informaciją ties %1 - %2? + + + The active database is locked! +Please unlock the selected database or choose another one which is unlocked. + Aktyvi duomenų bazė yra užrakinta! +Prašome atrakinti pasirinktą duomenų bazę arba pasirinkti kitą, kuri būtų atrakinta. + + + Successfully removed %1 encryption-%2 from KeePassX/Http Settings. + Sėkmingai pašalinta %1 šifravimo-%2 iš KeePassX/Http nustatymų. + + + No shared encryption-keys found in KeePassHttp Settings. + KeePassHttp nustatymuose nerasta jokių bendrinamų šifravimo raktų. + + + The active database does not contain an entry of KeePassHttp Settings. + Aktyvioje duomenų bazėje nėra KeePassHttp nustatymų įrašo. + + + Removing stored permissions... + Šalinami saugomi leidimai... + + + Abort + Nutraukti + + + Successfully removed permissions from %1 %2. + Leidimai sėkmingai pašalinti iš %1 %2. + + + The active database does not contain an entry with permissions. + Aktyvioje duomenų bazėje nėra įrašo su leidimais. + + + KeePassXC: New key association request + KeePassXC: Naujo rakto susiejimo užklausa + + + You have received an association request for the above key. +If you would like to allow it access to your KeePassXC database +give it a unique name to identify and accept it. + Jūs gavote susiejimo užklausą aukščiau esančiam raktui. +Jei norite leisti jam gauti prieigą prie savo KeePassXC +duomenų bazės, suteikite jam unikalų pavadinimą, kad atpažintumėte +ir priimtumėte jį. + + + KeePassXC: Overwrite existing key? + KeePassXC: Perrašyti esamą raktą? + + + KeePassXC: Update Entry + KeePassXC: Atnaujinti įrašą + + + KeePassXC: Database locked! + KeePassXC: Duomenų bazė užrakinta! + + + KeePassXC: Removed keys from database + KeePassXC: Pašalinti raktai iš duomenų bazės + + + KeePassXC: No keys found + KeePassXC: Raktų nerasta + + + KeePassXC: Settings not available! + KeePassXC: Nustatymai neprieinami! + + + KeePassXC: Removed permissions + KeePassXC: Pašalinti leidimai + + + KeePassXC: No entry with permissions found! + KeePassXC: Nerasta jokių įrašų su leidimais! @@ -1282,10 +1659,6 @@ Tai yra vienakryptis perkėlimas. Jūs negalėsite atverti importuotos duomenų Remember last databases Prisiminti paskutines duomenų bazes - - Open previous databases on startup - Paleidžiant programą, atverti ankstesnes duomenų bazes - Automatically save on exit Išeinant, automatiškai įrašyti @@ -1327,12 +1700,20 @@ Tai yra vienakryptis perkėlimas. Jūs negalėsite atverti importuotos duomenų Prisiminti paskutinius rakto failus - Hide window to system tray instead of App Exit - + Load previous databases on startup + Paleidžiant programą, įkelti ankstesnes duomenų bazes - Hide window to system tray on App start - + Automatically reload the database when modified externally + Išoriškai modifikavus duomenų bazę, automatiškai įkelti ją iš naujo + + + Hide window to system tray instead of app exit + Neužverti lango, bet vietoj to, suskleisti jį į sistemos dėklą + + + Minimize window at application startup + Paleidus programą, suskleisti langą @@ -1357,6 +1738,14 @@ Tai yra vienakryptis perkėlimas. Jūs negalėsite atverti importuotos duomenų Always ask before performing auto-type Visuomet klausti prieš atliekant automatinį rinkimą + + Lock databases after minimizing the window + Suskleidus langą, užrakinti duomenų bazes + + + Don't require password repeat when it is visible + Nereikalauti pakartoti slaptažodį, kai šis yra matomas + UnlockDatabaseWidget @@ -1374,14 +1763,6 @@ Tai yra vienakryptis perkėlimas. Jūs negalėsite atverti importuotos duomenų main - - KeePassX - cross-platform password manager - KeePassX - daugiaplatformė slaptažodžių tvarkytuvė - - - filename of the password database to open (*.kdbx) - norimos atverti slaptažodžių duomenų bazės failo pavadinimas (*.kdbx) - path to a custom config file kelias į tinkintą konfigūracijos failą @@ -1390,5 +1771,17 @@ Tai yra vienakryptis perkėlimas. Jūs negalėsite atverti importuotos duomenų key file of the database duomenų bazės rakto failas + + filename(s) of the password database(s) to open (*.kdbx) + norimos atverti slaptažodžių duomenų bazės(-ių) failo pavadinimas(-ai) (*.kdbx) + + + KeePassXC - cross-platform password manager + KeePassXC - daugiaplatformė slaptažodžių tvarkytuvė + + + read password of the database from stdin + nuskaityti duomenų bazės slaptažodį iš stdin + \ No newline at end of file diff --git a/share/translations/keepassx_pt_BR.ts b/share/translations/keepassx_pt_BR.ts index 07400920e..22acf42be 100644 --- a/share/translations/keepassx_pt_BR.ts +++ b/share/translations/keepassx_pt_BR.ts @@ -1,14 +1,6 @@ - + AboutDialog - - About KeePassX - Sobre KeePassX - - - KeePassX is distributed under the term of the GNU General Public License (GPL) version 2 or (at your option) version 3. - KeePassX é distribuído nos termos da Licença Pública Geral (GPL), versão 2 ou (à sua escolha) versão 3, do GNU. - Revision Revisão @@ -17,17 +9,56 @@ Using: Usando: + + About KeePassXC + Sobre KeePassXC + + + KeePassXC is distributed under the term of the GNU General Public License (GPL) version 2 or (at your option) version 3. + KeePassXC é distribuído nos termos da Licença Pública Geral (GPL), versão 2 ou (à sua escolha) versão 3, do GNU. + + + Extensions: + + Extensões: + + + + + AccessControlDialog + + Remember this decision + Lembrar esta escolha + + + Allow + Permitir + + + Deny + Negar + + + %1 has requested access to passwords for the following item(s). +Please select whether you want to allow access. + %1 solicitou acesso a senhas para o(s) seguinte(s) iten(s). +Selecione se deseja permitir o acesso. + + + KeePassXC HTTP Confirm Access + KeePassXC HTTP Confirmar Acesso + AutoType - - Auto-Type - KeePassX - Auto-Digitação - KeePassX - Couldn't find an entry that matches the window title: Não foi possível localizar uma entrada que corresponda ao título da janela: + + Auto-Type - KeePassXC + Auto-Digitação - KeePassXC + AutoTypeAssociationsModel @@ -46,14 +77,14 @@ AutoTypeSelectDialog - - Auto-Type - KeePassX - Auto-Digitação - KeePassX - Select entry to Auto-Type: Escolha uma entrada para Auto-Digitar: + + Auto-Type - KeePassXC + Auto-Digitação - KeePassXC + ChangeMasterKeyWidget @@ -319,12 +350,6 @@ Salvar alterações? locked trancado - - The database you are trying to open is locked by another instance of KeePassX. -Do you want to open it anyway? Alternatively the database is opened read-only. - O banco de dados que você está tentando abrir está bloqueado por outra instância do KeePassX. -Você quer abri-lo de qualquer forma? Alternativamente, o banco de dados é aberto como somente leitura. - Lock database Trancar Banco de Dados @@ -368,14 +393,24 @@ Descartar alterações e fechar mesmo assim? Falha ao gravar arquivo CSV. - The database you are trying to save as is locked by another instance of KeePassX. -Do you want to save it anyway? - O banco de dados que você está tentando salvar como está travado por uma outra instância de KeePassX. -Você deseja salvá-lo mesmo assim? + Unable to open the database. + Não foi possível abrir o banco de dados. - Unable to open the database. - + The database you are trying to open is locked by another instance of KeePassXC. +Do you want to open it anyway? Alternatively the database is opened read-only. + A base de dados que você está tentando abrir está bloqueada por outra instância de KeePassXC. +Mesmo assim deseja abrir? Alternativamente, a base de dados é aberta somente para leitura. + + + Merge database + Juntar banco de dados + + + The database you are trying to save as is locked by another instance of KeePassXC. +Do you want to save it anyway? + A base de dados que você está tentando abrir está bloqueada por outra instância de KeePassXC. +Mesmo assim deseja salvá-la? @@ -416,10 +451,6 @@ Você deseja salvá-lo mesmo assim? Do you really want to delete the group "%1" for good? Você realmente quer apagar o grupo "%1" para sempre? - - Current group - Grupo atual - Error Erro @@ -430,11 +461,71 @@ Você deseja salvá-lo mesmo assim? Move entry to recycle bin? - + Mover entrada para a lixeira? Do you really want to move entry "%1" to the recycle bin? - + Pretende realmente mover a entrada "%1" para a lixeira? + + + Searching... + Pesquisando... + + + No current database. + Nenhuma base de dados atual. + + + No source database, nothing to do. + Nenhuma base de dados de origem, nada a fazer. + + + Search Results (%1) + Resultados da Pesquisa (%1) + + + No Results + Sem Resultados + + + Execute command? + Executar comando? + + + Do you really want to execute the following command?<br><br>%1<br> + Você quer realmente executar o comando seguinte?<br><br>%1<br> + + + Remember my choice + Lembrar minha escolha + + + Autoreload Request + Recarregar Automaticamente Pedido + + + The database file has changed. Do you want to load the changes? + A base de dados foi alterada. Deseja carregar as alterações? + + + Merge Request + Juntar Pedido + + + The database file has changed and you have unsaved changes.Do you want to merge your changes? + A base de dados foi alterada e tem alterações não gravadas. Deseja juntar as suas alterações? + + + Autoreload Failed + Carregamento Automático Falhou + + + Could not parse or unlock the new database file while attempting to autoreload this database. + Não foi possível analisar ou desbloquear o novo arquivo da base de dados ao tentar recarregar automaticamente essa base de dados. + + + Could not open the new database file while attempting to autoreload this database. + Não foi possível abrir a nova base de dados ao tentar recarregar automaticamente essa base de dados. @@ -625,10 +716,6 @@ Você deseja salvá-lo mesmo assim? Repeat: Repetir: - - Gen. - Gerar - URL: URL: @@ -746,17 +833,25 @@ Você deseja salvá-lo mesmo assim? Can't delete icon! Não é possível apagar o ícone! - - Can't delete icon. Still used by %n item(s). - Não é possível apagar o ícone. Ainda usado por %n item.Não é possível apagar o ícone. Ainda usado por %n itens. - Error - + Erro - Can't read icon: - + Download favicon + Baixar favicon + + + Unable to fetch favicon. + Não foi possível obter favicon. + + + Can't read icon + Não foi possível ler ícone + + + Can't delete icon. Still used by %1 items. + Não é possível apagar ícone. Ainda usado por %1 itens. @@ -778,6 +873,13 @@ Você deseja salvá-lo mesmo assim? Uuid: + + Entry + + - Clone + - Clone + + EntryAttributesModel @@ -830,6 +932,61 @@ Você deseja salvá-lo mesmo assim? Lixeira + + HttpPasswordGeneratorWidget + + Length: + Comprimento: + + + Character Types + Tipo de Caracteres + + + Upper Case Letters + Letras Maiúsculas + + + A-Z + A-Z + + + Lower Case Letters + Letras Minúsculas + + + a-z + a-z + + + Numbers + Números + + + 0-9 + 0-9 + + + Special Characters + Caracteres Especiais + + + /*_& ... + /*_& ... + + + Exclude look-alike characters + Excluir caracteres semelhantes + + + Ensure that the password contains characters from every group + Verificar se a senha contém caracteres de todos os grupos + + + Accept + Aceitar + + KeePass1OpenWidget @@ -873,7 +1030,7 @@ Você deseja salvá-lo mesmo assim? Wrong key or database file is corrupt. - + Chave errada ou base de dados corrompida. @@ -912,8 +1069,8 @@ Esta é uma migração de uma via. Você não poderá abrir o banco de dados imp Erro fatal enquanto testava as funções criptográficas. - KeePassX - Error - KeePassX - Erro + KeePassXC - Error + KeePassXC - Erro @@ -922,102 +1079,14 @@ Esta é uma migração de uma via. Você não poderá abrir o banco de dados imp Database Banco de Dados - - Recent databases - Bancos de dados recentes - - - Help - Ajuda - - - Entries - Entradas - - - Copy attribute to clipboard - Copiar atributo para a área de transferência - - - Groups - Grupos - - - View - Ver - - - Quit - Sair - - - About - Sobre - Open database Abrir banco de dados - - Save database - Salvar banco de dados - - - Close database - Fechar banco de dados - - - New database - Novo banco de dados - - - Add new entry - Adicionar nova entrada - - - View/Edit entry - Ver/Editar entrada - - - Delete entry - Excluir entrada - - - Add new group - Adicionar novo grupo - - - Edit group - Editar grupo - - - Delete group - Excluir grupo - - - Save database as - Salvar banco de dados como - - - Change master key - Alterar chave-mestra - Database settings Configurações do Banco de Dados - - Import KeePass 1 database - Importar banco de dados KeePass1 - - - Clone entry - Clonar entrada - - - Find - Localizar - Copy username to clipboard Copiar nome de usuário para área de transferência @@ -1030,30 +1099,6 @@ Esta é uma migração de uma via. Você não poderá abrir o banco de dados imp Settings Configurações - - Perform Auto-Type - Realizar Auto-Digitação - - - Open URL - Abrir URL - - - Lock databases - Trancar bancos de dados - - - Title - Título - - - URL - URL - - - Notes - Notas - Show toolbar Mostrar barra de ferramentas @@ -1070,22 +1115,6 @@ Esta é uma migração de uma via. Você não poderá abrir o banco de dados imp Tools Ferramentas - - Copy username - Copiar nome de usuário - - - Copy password - Copiar senha - - - Export to CSV file - Exportar para arquivo CSV - - - Repair database - Reparar banco de dados - KeePass 2 Database Banco de dados Keepass 2 @@ -1106,6 +1135,265 @@ Esta é uma migração de uma via. Você não poderá abrir o banco de dados imp Writing the database failed. Escrita do banco de dados falhou. + + &Recent databases + &Bancos de dados recentes + + + He&lp + &Ajuda + + + E&ntries + E&ntradas + + + Copy att&ribute to clipboard + Copiar at&ributo para área de transferência + + + &Groups + &Grupos + + + &View + &Ver + + + &Quit + &Sair + + + &About + &Sobre + + + &Open database + &Abrir base de dados + + + &Save database + &Salvar base de dados + + + &Close database + &Fechar base de dados + + + &New database + &Nova base de dados + + + Merge from KeePassX database + Juntar base de dados a partir de KeePassX + + + &Add new entry + &Adicionar nova entrada + + + &View/Edit entry + &Ver/Editar entrada + + + &Delete entry + &Apagar entrada + + + &Add new group + &Adicionar novo grupo + + + &Edit group + &Editar grupo + + + &Delete group + &Apagar grupo + + + Sa&ve database as + Sal&var base de dados como + + + Change &master key + Alterar chave &mestra + + + &Database settings + &Definições da base de dados + + + &Import KeePass 1 database + &Importar base de dados KeePass 1 + + + &Clone entry + &Clonar entrada + + + &Find + &Encontrar + + + Copy &username + Copiar nome de &usuário + + + Cop&y password + Cop&iar senha + + + &Settings + &Configurações + + + &Perform Auto-Type + &Executar escrita automática + + + &Open URL + &Abrir URL + + + &Lock databases + &Trancar base de dados + + + &Title + &Título + + + &URL + &URL + + + &Notes + &Notas + + + &Export to CSV file + &Exportar para arquivo CSV + + + Re&pair database + Re&parar banco de dados + + + Password Generator + Gerador de Senha + + + + OptionDialog + + Dialog + Diálogo + + + General + Geral + + + Sh&ow a notification when credentials are requested + M&ostrar uma notificação quando as credenciais forem solicitadas + + + &Return only best matching entries for an URL instead +of all entries for the whole domain + &Mostrar apenas as melhores entradas correspondentes para um URL em vez de +todas as entradas para o domínio completo + + + &Match URL schemes +Only entries with the same scheme (http://, https://, ftp://, ...) are returned + &Esquemas de URL coincidentes +Somente entradas com o mesmo esquema (http://, https://, ftp://, ...) são mostradas + + + Sort matching entries by &username + Ordenar entradas coincidentes por nome de &usuário + + + R&emove all shared encryption-keys from active database + R&emover todas as chaves criptografadas compartilhadas da base de dados ativa + + + Re&move all stored permissions from entries in active database + R&emover todas as permissões armazenadas de entradas na base de dados ativa + + + Password generator + Gerador de senha + + + Advanced + Avançado + + + Activate the following only, if you know what you are doing! + Ativar apenas os seguintes, se souber o que está fazendo! + + + Always allow &access to entries + Permitir sempre &acesso as entradas + + + Always allow &updating entries + Permitir sempre &atualizar as entradas + + + Searc&h in all opened databases for matching entries + Procurar em todas as base de dados abertas por entradas semel&hantes + + + Only the selected database has to be connected with a client! + Somente a base de dados selecionada tem que ser conectada com um cliente! + + + &Return also advanced string fields which start with "KPH: " + &Mostrar também campos avançados que começam com "KPH: " + + + Automatic creates or updates are not supported for string fields! + Criação automática ou atualizações não são suportadas para os valores dos campos! + + + HTTP Port: + Porta HTTP: + + + Default port: 19455 + Porta padrão: 19455 + + + Re&quest to unlock the database if it is locked + Pe&dir para desbloquear a base de dados se estiver bloqueada + + + Sort &matching entries by title + Ordenar &entradas por título + + + Enable KeepassXC HTTP protocol +This is required for accessing your databases from ChromeIPass or PassIFox + Habilitar KeepassXC protocolo HTTP +Isso é necessário para acessar os seus bancos de dados de ChromeIPass ou de PassIFox + + + KeePassXC will listen to this port on 127.0.0.1 + KeePassXC irá escutar esta porta em 127.0.0.1 + + + Cannot bind to privileged ports + Não é possível ligar a portas privilegiadas + + + Cannot bind to privileged ports below 1024! +Using default port 19455. + Não é possível ligar a portas privilegiadas abaixo de 1024! +Usando porta padrão 19455. + PasswordGeneratorWidget @@ -1113,10 +1401,6 @@ Esta é uma migração de uma via. Você não poderá abrir o banco de dados imp Password: Senha: - - Length: - Tamanho: - Character Types Tipos de Caracteres @@ -1141,71 +1425,72 @@ Esta é uma migração de uma via. Você não poderá abrir o banco de dados imp Exclude look-alike characters Excluir caracteres similares - - Ensure that the password contains characters from every group - Assegurar que a senha contenha caracteres de todos os grupos - Accept Aceitar - - - QCommandLineParser - Displays version information. - Mostrar informações da versão. + %p% + %p% - Displays this help. - Mostrar esta ajuda. + strength + força - Unknown option '%1'. - Opção desconhecida '%1'. + entropy + entropia - Unknown options: %1. - Opções desconhecidas: %1. + &Length: + &Tamanho: - Missing value after '%1'. - Falta valor após '%1'. + Pick characters from every group + Selecione caracteres de todos os grupos - Unexpected value after '%1'. - Valor inesperado após '%1'. + Generate + Gerar - [options] - [opções] + Close + Fechar - Usage: %1 - Utilização: %1 + Apply + Aplicar - Options: - Opções: + Entropy: %1 bit + Entropia: %1 bit - Arguments: - Argumentos: + Password Quality: %1 + Qualidade da senha: %1 + + + Poor + Pobre + + + Weak + Fraco + + + Good + Bom + + + Excellent + Excelente - QSaveFile + QObject - Existing file %1 is not writable - O arquivo existente %1 não é gravável - - - Writing canceled by application - Escrita cancelada pelo aplicativo - - - Partial write. Partition full? - Escrita parcial. Partição cheia? + Http + Http @@ -1245,20 +1530,111 @@ Esta é uma migração de uma via. Você não poderá abrir o banco de dados imp SearchWidget - Find: - Localizar: - - - Case sensitive + Case Sensitive Diferenciar maiúsculas e minúsculas - Current group - Grupo atual + Search + Pesquisar - Root group - Grupo Raiz + Find + Localizar + + + Clear + Limpar + + + + Service + + A shared encryption-key with the name "%1" already exists. +Do you want to overwrite it? + Já existe uma chave de criptografia compartilhada com o nome "%1". +Deseja substituí-la? + + + Do you want to update the information in %1 - %2? + Deseja atualizar as informações em %1 - %2? + + + The active database is locked! +Please unlock the selected database or choose another one which is unlocked. + A base de dados ativa está bloqueada! +Desbloqueie base de dados selecionada ou escolha outra que esteja desbloqueada. + + + Successfully removed %1 encryption-%2 from KeePassX/Http Settings. + Removido com sucesso %1 criptografia-%2 do KeePassX/Http Configurações. + + + No shared encryption-keys found in KeePassHttp Settings. + Nenhuma chave de criptografia compartilhada encontrada nas Configurações do KeePassHttp. + + + The active database does not contain an entry of KeePassHttp Settings. + A base de dados ativa não contém uma entrada de Configurações KeePassHttp. + + + Removing stored permissions... + Removendo permissões armazenadas... + + + Abort + Cancelar + + + Successfully removed permissions from %1 %2. + Foram removidas com êxito as permissões de %1 %2. + + + The active database does not contain an entry with permissions. + A base de dados ativa não contém uma entrada com permissões. + + + KeePassXC: New key association request + KeePassXC: Nova associação de chaves requisitada + + + You have received an association request for the above key. +If you would like to allow it access to your KeePassXC database +give it a unique name to identify and accept it. + Recebeu uma solicitação de associação para a chave acima. +Se quiser permitir o acesso a sua base de dados KeePassXC +dar-lhe um nome único para identificá-lo e aceitá-lo. + + + KeePassXC: Overwrite existing key? + KeePassXC: Substituir chave existente? + + + KeePassXC: Update Entry + KeePassXC: Atualizar entrada + + + KeePassXC: Database locked! + KeePassXC: Banco de dados bloqueado! + + + KeePassXC: Removed keys from database + KeePassXC: Chaves removidas do banco de dados + + + KeePassXC: No keys found + KeePassXC: Nenhuma chave localizada + + + KeePassXC: Settings not available! + KeePassXC: Configurações não disponíveis! + + + KeePassXC: Removed permissions + KeePassXC: Permissões removidas + + + KeePassXC: No entry with permissions found! + KeePassXC: Nenhuma entrada com permissões localizada! @@ -1282,10 +1658,6 @@ Esta é uma migração de uma via. Você não poderá abrir o banco de dados imp Remember last databases Lembrar dos últimos bancos de dados - - Open previous databases on startup - Abrir bancos de dados anteriores na inicialização - Automatically save on exit Salvar automaticamente ao sair @@ -1327,12 +1699,20 @@ Esta é uma migração de uma via. Você não poderá abrir o banco de dados imp Lembrar dos últimos arquivos-chave - Hide window to system tray instead of App Exit - + Load previous databases on startup + Abrir bancos de dados anteriores na inicialização - Hide window to system tray on App start - + Automatically reload the database when modified externally + Automaticamente recarregar o banco de dados quando houver modificações externas + + + Hide window to system tray instead of app exit + Ocultar janela na bandeja de sistema em vez de sair do programa + + + Minimize window at application startup + Iniciar programa com janela minimizada @@ -1357,6 +1737,14 @@ Esta é uma migração de uma via. Você não poderá abrir o banco de dados imp Always ask before performing auto-type Sempre perguntar antes de realizar auto-digitação + + Lock databases after minimizing the window + Bloquear bancos de dados após minimizar a janela + + + Don't require password repeat when it is visible + Quando a senha for visível não pedir para repeti-la + UnlockDatabaseWidget @@ -1374,14 +1762,6 @@ Esta é uma migração de uma via. Você não poderá abrir o banco de dados imp main - - KeePassX - cross-platform password manager - KeePassX - gerenciador de senhas multiplataforma - - - filename of the password database to open (*.kdbx) - nome de arquivo do banco de dados de senhas a ser aberto (*.kdbx) - path to a custom config file caminho para um arquivo de configuração personalizado @@ -1390,5 +1770,17 @@ Esta é uma migração de uma via. Você não poderá abrir o banco de dados imp key file of the database arquivo-chave do banco de dados + + filename(s) of the password database(s) to open (*.kdbx) + nome(s) de arquivo(s) do banco de dados de senhas a ser aberto (*.kdbx) + + + KeePassXC - cross-platform password manager + KeePassXC - gerenciador de senhas multiplataforma + + + read password of the database from stdin + ler a senha do banco de dados da entrada padrão + \ No newline at end of file diff --git a/share/translations/keepassx_ru.ts b/share/translations/keepassx_ru.ts index 733d64c85..f3321c9b3 100644 --- a/share/translations/keepassx_ru.ts +++ b/share/translations/keepassx_ru.ts @@ -1,14 +1,6 @@ - + AboutDialog - - About KeePassX - О KeePassX - - - KeePassX is distributed under the term of the GNU General Public License (GPL) version 2 or (at your option) version 3. - KeePassX распространяется на условиях Стандартной общественной лицензии GNU (GPL) версии 2 или (на ваше усмотрение) версии 3. - Revision Ревизия @@ -17,17 +9,55 @@ Using: С помощью: + + About KeePassXC + О KeePassXC + + + KeePassXC is distributed under the term of the GNU General Public License (GPL) version 2 or (at your option) version 3. + KeePassXC распространяется на условиях Стандартной общественной лицензии GNU (GPL) версии 2 или (на ваше усмотрение) версии 3. + + + Extensions: + + Расширения: + + + + + AccessControlDialog + + Remember this decision + Запомнить это решение + + + Allow + Разрешить + + + Deny + Запретить + + + %1 has requested access to passwords for the following item(s). +Please select whether you want to allow access. + %1 запросил доступ к паролям для следующего элемента(ов). Выберете, хотите ли вы разрешить доступ. + + + KeePassXC HTTP Confirm Access + Подтверждение доступа KeePassXC HTTP + AutoType - - Auto-Type - KeePassX - Автоввод — KeePassX - Couldn't find an entry that matches the window title: Невозможно найти запись, соответствующую заголовку окна: + + Auto-Type - KeePassXC + Автоввод — KeePassXC + AutoTypeAssociationsModel @@ -46,14 +76,14 @@ AutoTypeSelectDialog - - Auto-Type - KeePassX - Автоввод — KeePassX - Select entry to Auto-Type: Выберите запись для автоввода: + + Auto-Type - KeePassXC + Автоввод — KeePassXC + ChangeMasterKeyWidget @@ -187,7 +217,7 @@ Database opened fine. Nothing to do. - + Хранилище открылось. Больше нечего делать. Unable to open the database. @@ -319,11 +349,6 @@ Save changes? locked заблокировано - - The database you are trying to open is locked by another instance of KeePassX. -Do you want to open it anyway? Alternatively the database is opened read-only. - Хранилище, которое Вы хотите открыть, заблокировано другой запущенной копией KeePassX. Всё равно открыть? В качестве альтернативы хранилище будет открыто в режиме для чтения. - Lock database Заблокировать хранилище @@ -367,14 +392,24 @@ Discard changes and close anyway? Не удалось записать CSV файл. - The database you are trying to save as is locked by another instance of KeePassX. -Do you want to save it anyway? - Данное хранилище заблокировано другой запущенной копией KeePassX. -Вы уверены, что хотите продолжить сохранение? + Unable to open the database. + Не удаётся открыть хранилище. - Unable to open the database. - + The database you are trying to open is locked by another instance of KeePassXC. +Do you want to open it anyway? Alternatively the database is opened read-only. + Хранилище, которое Вы хотите открыть, заблокировано другой запущенной копией KeePassXC. +Всё равно открыть? В качестве альтернативы хранилище будет открыто в режиме для чтения. + + + Merge database + Объединить хранилище + + + The database you are trying to save as is locked by another instance of KeePassXC. +Do you want to save it anyway? + Хранилище, которые вы пытаетесь сохранить, заблокировано другим экземпляром KeePassXC. +Хотите сохранить во всех случаях? @@ -415,10 +450,6 @@ Do you want to save it anyway? Do you really want to delete the group "%1" for good? Вы действительно хотите навсегда удалить группу «%1»? - - Current group - Текущая группа - Error Ошибка @@ -429,11 +460,71 @@ Do you want to save it anyway? Move entry to recycle bin? - + Переместить запись в корзину? Do you really want to move entry "%1" to the recycle bin? - + Действительно переместить запись "%1" в корзину? + + + Searching... + Поиск... + + + No current database. + Нет текущего хранилища. + + + No source database, nothing to do. + Нет исходного хранилища, нечего обрабатывать. + + + Search Results (%1) + Результаты поиска (%1) + + + No Results + Нет результатов + + + Execute command? + Выполнить комманду? + + + Do you really want to execute the following command?<br><br>%1<br> + Вы действительно хотите выполнить следующую команду?<br><br>%1<br> + + + Remember my choice + Запомнить выбор + + + Autoreload Request + Запрос на автоматическую загрузку + + + The database file has changed. Do you want to load the changes? + Хранилище было изменено. Вы хотите загрузить изменения? + + + Merge Request + Запрос на слияние + + + The database file has changed and you have unsaved changes.Do you want to merge your changes? + Файл хранилища был изменён, а так же присутствуют несохранённые изменения. Вы хотите объеденить изменения? + + + Autoreload Failed + Ошибка автоматической загрузки + + + Could not parse or unlock the new database file while attempting to autoreload this database. + Не удаётся разобрать или разблокировать новый файл хранилища при попытке автоматической загрузки этого хранилища. + + + Could not open the new database file while attempting to autoreload this database. + Не удаётся открыть новый файл хранилища при попытке автоматической загрузки этого файла. @@ -624,10 +715,6 @@ Do you want to save it anyway? Repeat: Пароль ещё раз: - - Gen. - Генеральный. - URL: URL: @@ -745,17 +832,25 @@ Do you want to save it anyway? Can't delete icon! Не могу удалить значок! - - Can't delete icon. Still used by %n item(s). - Не могу удалить иконку, %n запись всё ещё использует её.Не могу удалить иконку, %n записи всё ещё использует её.Не могу удалить иконку, %n записей всё ещё использует её.Не могу удалить значок, %n записей всё ещё использует его. - Error - + Ошибка - Can't read icon: - + Download favicon + Скачать значок сайта + + + Unable to fetch favicon. + Не удалось получить значок сайта + + + Can't read icon + Не могу прочитать значок + + + Can't delete icon. Still used by %1 items. + Не удается удалить значок, она продолжает использоваться %1 записями. @@ -777,6 +872,13 @@ Do you want to save it anyway? Uuid: + + Entry + + - Clone + - Колинировать + + EntryAttributesModel @@ -829,6 +931,61 @@ Do you want to save it anyway? Корзина + + HttpPasswordGeneratorWidget + + Length: + Длина: + + + Character Types + Виды символов + + + Upper Case Letters + Заглавные буквы + + + A-Z + A-Z + + + Lower Case Letters + Строчные буквы + + + a-z + a-z + + + Numbers + Цифры + + + 0-9 + 0-9 + + + Special Characters + Особые символы + + + /*_& ... + /*_& ... + + + Exclude look-alike characters + Исключить выглядящие похожие символы + + + Ensure that the password contains characters from every group + Убедитесь, что пароль содержит символы всех видов + + + Accept + Принять + + KeePass1OpenWidget @@ -872,7 +1029,7 @@ Do you want to save it anyway? Wrong key or database file is corrupt. - + Неверный ключ или файл хранилища повреждён. @@ -911,8 +1068,8 @@ This is a one-way migration. You won't be able to open the imported databas Неисправимая ошибка в процессе тестирования криптографических функций. - KeePassX - Error - KeePassX — Ошибка + KeePassXC - Error + KeePassXC — Ошибка @@ -921,102 +1078,14 @@ This is a one-way migration. You won't be able to open the imported databas Database Хранилище - - Recent databases - Недавние хранилища - - - Help - Помощь - - - Entries - Записи - - - Copy attribute to clipboard - Скопировать атрибут в буфер обмена - - - Groups - Группы - - - View - Вид - - - Quit - Выход - - - About - О программе - Open database Открыть хранилище - - Save database - Сохранить хранилище - - - Close database - Закрыть хранилище - - - New database - Новое хранилище - - - Add new entry - Добавить новую запись - - - View/Edit entry - Посмотреть/редактировать запись - - - Delete entry - Удалить запись - - - Add new group - Добавить новую группу - - - Edit group - Редактировать группу - - - Delete group - Удалить группу - - - Save database as - Сохранить хранилище как - - - Change master key - Сменить мастер-пароль - Database settings Параметры хранилища - - Import KeePass 1 database - Импортировать хранилище KeePass 1 - - - Clone entry - Клонировать запись - - - Find - Найти - Copy username to clipboard Скопировать имя пользователя в буфер обмена @@ -1029,30 +1098,6 @@ This is a one-way migration. You won't be able to open the imported databas Settings Настройки - - Perform Auto-Type - Произвести автоввод - - - Open URL - Открыть URL - - - Lock databases - Заблокировать хранилище - - - Title - Заголовок - - - URL - URL - - - Notes - Примечания - Show toolbar Показать панель инструментов @@ -1069,25 +1114,9 @@ This is a one-way migration. You won't be able to open the imported databas Tools Инструменты - - Copy username - Скопировать имя пользователя - - - Copy password - Скопировать пароль - - - Export to CSV file - Экспортировать в файл CSV - - - Repair database - Восстановление хранилища - KeePass 2 Database - + Хранилище KeePass 2 All files @@ -1103,7 +1132,265 @@ This is a one-way migration. You won't be able to open the imported databas Writing the database failed. - + Не удалось записать хранилище. + + + &Recent databases + Недавние хранилища + + + He&lp + Помощь + + + E&ntries + &Записи + + + Copy att&ribute to clipboard + Скопировать атрибут в буфер обмена + + + &Groups + Группы + + + &View + Вид + + + &Quit + Выход + + + &About + О программе + + + &Open database + Открыть хранилище + + + &Save database + Сохранить хранилище + + + &Close database + Закрыть хранилище + + + &New database + Новое хранилище + + + Merge from KeePassX database + Объединить из хранилища KeePassX + + + &Add new entry + Добавить новую запись + + + &View/Edit entry + Посмотреть/редактировать запись + + + &Delete entry + Удалить запись + + + &Add new group + Добавить новую группу + + + &Edit group + Редактировать группу + + + &Delete group + Удалить группу + + + Sa&ve database as + Сохранить хранилище как + + + Change &master key + Изменить мастер-пароль + + + &Database settings + Параметры хранилища + + + &Import KeePass 1 database + Импортировать хранилище KeePass 1 + + + &Clone entry + Клонировать запись + + + &Find + Найти + + + Copy &username + Скопировать имя пользователя + + + Cop&y password + Скопировать пароль + + + &Settings + Настройки + + + &Perform Auto-Type + Произвести автоввод + + + &Open URL + Открыть URL + + + &Lock databases + Заблокировать хранилище + + + &Title + Заголовок + + + &URL + URL + + + &Notes + Примечания + + + &Export to CSV file + Экспортировать в файл CSV + + + Re&pair database + Восстановление хранилища + + + Password Generator + Генератор паролей + + + + OptionDialog + + Dialog + Диалог + + + General + Общие + + + Sh&ow a notification when credentials are requested + Показывать уведомление при запросе данных для входа + + + &Return only best matching entries for an URL instead +of all entries for the whole domain + Возвращать только наиболее совпавшие с URL записи, а не все записи для домена + + + &Match URL schemes +Only entries with the same scheme (http://, https://, ftp://, ...) are returned + Совпадение со схемой URL +Возвращать только записи с соответствующей схемой (http://, https://, ftp://, ...) + + + Sort matching entries by &username + Сортировать совпавшие записи по &имени пользователя + + + R&emove all shared encryption-keys from active database + Удалить все общие ключи шифрования из активного хранилища + + + Re&move all stored permissions from entries in active database + Удалить все сохраненные права доступа из активного хранилища + + + Password generator + Генератор паролей + + + Advanced + Расширенные + + + Activate the following only, if you know what you are doing! + Включайте эти настройки только если знаете что делаете! + + + Always allow &access to entries + Всегда разрешать доступ к записям + + + Always allow &updating entries + Всегда разрешать обновление записей + + + Searc&h in all opened databases for matching entries + Искать соответствующие записи по всем открытым хранилищам + + + Only the selected database has to be connected with a client! + Только выбранное хранилище должно быть соединено с клиентом! + + + &Return also advanced string fields which start with "KPH: " + Возвращать дополнительные строковые поля, начинающиеся с "KPH: " + + + Automatic creates or updates are not supported for string fields! + Автоматическое создание или обновление не поддерживается строковыми полями! + + + HTTP Port: + Порт HTTP: + + + Default port: 19455 + Порт по умолчанию: 19455 + + + Re&quest to unlock the database if it is locked + Запрашивать разблокировку хранилища, если оно заблокировано + + + Sort &matching entries by title + Сортировать совпавшие записи по названию + + + Enable KeepassXC HTTP protocol +This is required for accessing your databases from ChromeIPass or PassIFox + Включить протокол KeepassXC HTTP +Это требуется для доступа к хранилищам из ChromeIPass или PassIFox + + + KeePassXC will listen to this port on 127.0.0.1 + KeePassXC будет слушать указнный порт на 127.0.0.1 + + + Cannot bind to privileged ports + Не удается выполнить привязку к привилегированным портам + + + Cannot bind to privileged ports below 1024! +Using default port 19455. + Не удается привязать к привилегированные порты ниже 1024! +Используется порт по умолчанию 19455. @@ -1112,10 +1399,6 @@ This is a one-way migration. You won't be able to open the imported databas Password: Пароль: - - Length: - Длина: - Character Types Виды символов @@ -1140,71 +1423,72 @@ This is a one-way migration. You won't be able to open the imported databas Exclude look-alike characters Исключить похожие символы - - Ensure that the password contains characters from every group - Убедитесь, что пароль содержит символы всех видов - Accept Принять - - - QCommandLineParser - Displays version information. - Показывает информацию о версии. + %p% + %p% - Displays this help. - Показывает эту справку. + strength + надёжность - Unknown option '%1'. - Неизвестная опция «%1». + entropy + энтропия - Unknown options: %1. - Неизвестные опции %1. + &Length: + Длина: - Missing value after '%1'. - Пропущено значение после «%1». + Pick characters from every group + Выберете символы из каждой группы - Unexpected value after '%1'. - Непредвиденное значение после «%1». + Generate + Генерировать - [options] - [опции] + Close + Закрыть - Usage: %1 - Использование: %1 + Apply + Применить - Options: - Опции: + Entropy: %1 bit + Энтропия: %1 бит - Arguments: - Аргументы: + Password Quality: %1 + Качество пароля: %1 + + + Poor + Плохой + + + Weak + Слабый + + + Good + Хороший + + + Excellent + Отличный - QSaveFile + QObject - Existing file %1 is not writable - Существующий файл %1 непригоден для записи - - - Writing canceled by application - Запись отменена приложением - - - Partial write. Partition full? - Частичная запись. Раздел переполнен? + Http + Http @@ -1244,20 +1528,110 @@ This is a one-way migration. You won't be able to open the imported databas SearchWidget - Find: - Найти: - - - Case sensitive + Case Sensitive Чувствительно к регистру - Current group - Текущая группа + Search + Поиск - Root group - Корневая группа + Find + Найти + + + Clear + Очистить + + + + Service + + A shared encryption-key with the name "%1" already exists. +Do you want to overwrite it? + Общий ключ шифрования с именем "%1" уже существует. +Вы хотите его перезаписать? + + + Do you want to update the information in %1 - %2? + Вы хотите обновить информацию в %1 - %2? + + + The active database is locked! +Please unlock the selected database or choose another one which is unlocked. + Активное хранилище заблокировано! +Разблокируйте выбранное хранилище или выберите другое, незаблокированное. + + + Successfully removed %1 encryption-%2 from KeePassX/Http Settings. + Успешно удалено %1 шифрование-%2 из настроек KeePassXC/Http. + + + No shared encryption-keys found in KeePassHttp Settings. + Не найдено общих ключей шифрования в настройках KeePassHttp. + + + The active database does not contain an entry of KeePassHttp Settings. + Активное хранилизе не содержит записей настроек KeePassHttp. + + + Removing stored permissions... + Удаляются сохранённые права доступа... + + + Abort + Отмена + + + Successfully removed permissions from %1 %2. + Права доступа из %1 %2 успешно удалены. + + + The active database does not contain an entry with permissions. + Активное хранилище не содержит записей с назначенными правами доступа. + + + KeePassXC: New key association request + KeePassXC: Запрос на ассоциацию нового ключа + + + You have received an association request for the above key. +If you would like to allow it access to your KeePassXC database +give it a unique name to identify and accept it. + Вы получили запрос на ассоциацию указанного ключа. +Если вы хотите разрешить доступ к вашему хранилищу KeePassXC, дайте ему уникальное имя и примите запрос. + + + KeePassXC: Overwrite existing key? + KeePassXC: Перезаписать существующий ключ? + + + KeePassXC: Update Entry + KeePassXC: Обновить запись + + + KeePassXC: Database locked! + KeePassXC: Хранилище заблокировано! + + + KeePassXC: Removed keys from database + KeePassXC: Ключи удалены из хранилища + + + KeePassXC: No keys found + KeePassXC: Ключи не найдены + + + KeePassXC: Settings not available! + KeePassXC% Настройки недоступны! + + + KeePassXC: Removed permissions + KeePassXC: Права доступа удалены + + + KeePassXC: No entry with permissions found! + KeePassXC: Не найдено записей с назначенными правами доступа! @@ -1281,10 +1655,6 @@ This is a one-way migration. You won't be able to open the imported databas Remember last databases Помнить последнее хранилище - - Open previous databases on startup - Открывать предыдущее хранилище при запуске - Automatically save on exit Автоматически сохранять при выходе @@ -1326,12 +1696,20 @@ This is a one-way migration. You won't be able to open the imported databas Запоминать последние файл-ключи - Hide window to system tray instead of App Exit - + Load previous databases on startup + Открывать предыдущие хранилища при запуске - Hide window to system tray on App start - + Automatically reload the database when modified externally + Автоматически перечитывать хранилище при его изменении внешними приложениями + + + Hide window to system tray instead of app exit + Прятать окно в системный лоток вместо выхода + + + Minimize window at application startup + Сворачивать окно при запуске приложения @@ -1356,6 +1734,14 @@ This is a one-way migration. You won't be able to open the imported databas Always ask before performing auto-type Всегда спрашивать перед тем, как производить автоввод + + Lock databases after minimizing the window + Заблокировать хранилище при сворачивании окна + + + Don't require password repeat when it is visible + Не требовать поворный ввод пароля когда он показывается + UnlockDatabaseWidget @@ -1373,14 +1759,6 @@ This is a one-way migration. You won't be able to open the imported databas main - - KeePassX - cross-platform password manager - KeePassX — кросс-платформенный менеджер паролей - - - filename of the password database to open (*.kdbx) - имя файла открываемого хранилища паролей (*.kdbx) - path to a custom config file путь к своему файлу настроек @@ -1389,5 +1767,17 @@ This is a one-way migration. You won't be able to open the imported databas key file of the database файл-ключ хранилища + + filename(s) of the password database(s) to open (*.kdbx) + имена(имя) файлов хранилищ(а) для открытия (*.kdbx) + + + KeePassXC - cross-platform password manager + KeePassXC — кросс-платформенный менеджер паролей + + + read password of the database from stdin + читать пароли хранилища из стандартного ввода "stdin" + \ No newline at end of file diff --git a/share/windows/installer-header.bmp b/share/windows/installer-header.bmp new file mode 100644 index 000000000..f9e17cae7 Binary files /dev/null and b/share/windows/installer-header.bmp differ diff --git a/share/windows/installer-wizard.bmp b/share/windows/installer-wizard.bmp new file mode 100644 index 000000000..76d04518f Binary files /dev/null and b/share/windows/installer-wizard.bmp differ diff --git a/snapcraft.yaml b/snapcraft.yaml index 22462aa85..6e8ef7985 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -1,10 +1,11 @@ name: keepassxc -version: develop +version: 2.1.0 +grade: stable summary: community driven port of the windows application “Keepass Password Safe” description: | - KeePassXC is an application for people with extremly high demands on secure + KeePassXC is an application for people with extremely high demands on secure personal data management. It has a light interface, is cross platform and - published under the terms of the GNU General Public License. + is published under the terms of the GNU General Public License. confinement: strict apps: @@ -19,10 +20,10 @@ parts: configflags: - -DCMAKE_BUILD_TYPE=Release - -DWITH_TESTS=OFF + - -DWITH_XC_AUTOTYPE=ON build-packages: - g++ - libgcrypt20-dev - - libmicrohttpd-dev - libqt5x11extras5-dev - qtbase5-dev - qttools5-dev diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cf4d593ab..4350d0b70 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -86,9 +86,11 @@ set(keepassx_SOURCES gui/FileDialog.cpp gui/IconModels.cpp gui/KeePass1OpenWidget.cpp + gui/KMessageWidget.cpp gui/LineEdit.cpp gui/MainWindow.cpp gui/MessageBox.cpp + gui/MessageWidget.cpp gui/PasswordEdit.cpp gui/PasswordGeneratorWidget.cpp gui/PasswordComboBox.cpp @@ -226,6 +228,7 @@ target_link_libraries(${PROGNAME} Qt5::Widgets Qt5::Network ${GCRYPT_LIBRARIES} + ${GPGERROR_LIBRARIES} ${ZLIB_LIBRARIES}) if(YUBIKEY_FOUND) @@ -269,9 +272,25 @@ if(APPLE) endif() if(MINGW) - set(CPACK_GENERATOR "ZIP") + string(REPLACE "AMD" "Win" OUTPUT_FILE_POSTFIX "${CMAKE_HOST_SYSTEM_PROCESSOR}") + set(CPACK_GENERATOR "ZIP;NSIS") set(CPACK_STRIP_FILES ON) - set(CPACK_PACKAGE_FILE_NAME "${PROGNAME}-${KEEPASSXC_VERSION_NUM}") + set(CPACK_PACKAGE_FILE_NAME "${PROGNAME}-${KEEPASSXC_VERSION}-${OUTPUT_FILE_POSTFIX}") + set(CPACK_PACKAGE_INSTALL_DIRECTORY ${PROGNAME}) + set(CPACK_PACKAGE_VERSION ${KEEPASSXC_VERSION}) + set(CPACK_PACKAGE_VENDOR "${PROGNAME} Team") + string(REGEX REPLACE "/" "\\\\\\\\" CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/share/windows/installer-header.bmp") + set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.GPL-2") + set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/share/windows/keepassxc.ico") + set(CPACK_NSIS_MUI_UNIICON "${CPACK_NSIS_MUI_ICON}") + set(CPACK_NSIS_INSTALLED_ICON_NAME "\\\\${PROGNAME}.exe") + string(REGEX REPLACE "/" "\\\\\\\\" CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP "${CMAKE_SOURCE_DIR}/share/windows/installer-wizard.bmp") + set(CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP "${CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP}") + set(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${PROGNAME}.lnk' '$INSTDIR\\\\${PROGNAME}.exe'") + set(CPACK_NSIS_DELETE_ICONS_EXTRA "Delete '$SMPROGRAMS\\\\$START_MENU\\\\${PROGNAME}.lnk'") + set(CPACK_NSIS_URL_INFO_ABOUT "https://keepassxc.org") + set(CPACK_NSIS_PACKAGE_NAME "${PROGNAME} v${KEEPASSXC_VERSION}") + set(CPACK_NSIS_MUI_FINISHPAGE_RUN "../${PROGNAME}.exe") include(CPack) install(CODE " @@ -279,5 +298,9 @@ if(MINGW) " COMPONENT Runtime) include(DeployQt4) - install_qt4_executable(${PROGNAME}.exe "qjpeg;qgif;qico;qtaccessiblewidgets") + install_qt4_executable(${PROGNAME}.exe) + add_custom_command(TARGET ${PROGNAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${Qt5Core_DIR}/../../../share/qt5/plugins/platforms/qwindows$<$:d>.dll + $) + install(FILES $/qwindows$<$:d>.dll DESTINATION "platforms") endif() diff --git a/src/autotype/AutoType.cpp b/src/autotype/AutoType.cpp index 0c942e728..40ece6e13 100644 --- a/src/autotype/AutoType.cpp +++ b/src/autotype/AutoType.cpp @@ -396,6 +396,9 @@ QList AutoType::createActionFromTemplate(const QString& tmpl, c else if (tmplName.compare("enter",Qt::CaseInsensitive)==0) { list.append(new AutoTypeKey(Qt::Key_Enter)); } + else if (tmplName.compare("space",Qt::CaseInsensitive)==0) { + list.append(new AutoTypeKey(Qt::Key_Space)); + } else if (tmplName.compare("up",Qt::CaseInsensitive)==0) { list.append(new AutoTypeKey(Qt::Key_Up)); } diff --git a/src/autotype/mac/AutoTypeMac.cpp b/src/autotype/mac/AutoTypeMac.cpp index 90563a23a..e55c336cb 100644 --- a/src/autotype/mac/AutoTypeMac.cpp +++ b/src/autotype/mac/AutoTypeMac.cpp @@ -98,7 +98,9 @@ QString AutoTypePlatformMac::activeWindowTitle() if (windowLayer(window) == 0) { // First toplevel window in list (front to back order) title = windowTitle(window); - break; + if (!title.isEmpty()) { + break; + } } } diff --git a/src/autotype/xcb/AutoTypeXCB.cpp b/src/autotype/xcb/AutoTypeXCB.cpp index f419875dc..a07a916c4 100644 --- a/src/autotype/xcb/AutoTypeXCB.cpp +++ b/src/autotype/xcb/AutoTypeXCB.cpp @@ -435,6 +435,8 @@ KeySym AutoTypePlatformX11::keyToKeySym(Qt::Key key) return XK_Tab; case Qt::Key_Enter: return XK_Return; + case Qt::Key_Space: + return XK_space; case Qt::Key_Up: return XK_Up; case Qt::Key_Down: diff --git a/src/core/Entry.cpp b/src/core/Entry.cpp index b2b06e7c8..162d3f089 100644 --- a/src/core/Entry.cpp +++ b/src/core/Entry.cpp @@ -353,6 +353,12 @@ void Entry::setTitle(const QString& title) void Entry::setUrl(const QString& url) { + bool remove = url != m_attributes->value(EntryAttributes::URLKey) && + (m_attributes->value(EntryAttributes::RememberCmdExecAttr) == "1" || + m_attributes->value(EntryAttributes::RememberCmdExecAttr) == "0"); + if (remove) { + m_attributes->remove(EntryAttributes::RememberCmdExecAttr); + } m_attributes->set(EntryAttributes::URLKey, url, m_attributes->isProtected(EntryAttributes::URLKey)); } @@ -508,7 +514,8 @@ Entry* Entry::clone(CloneFlags flags) const entry->m_data.timeInfo.setLocationChanged(now); } - + if (flags & CloneRenameTitle) + entry->setTitle(entry->title() + tr(" - Clone")); return entry; } @@ -639,12 +646,17 @@ QString Entry::resolvePlaceholder(const QString& str) const const QList keyList = attributes()->keys(); for (const QString& key : keyList) { Qt::CaseSensitivity cs = Qt::CaseInsensitive; + QString k = key; + if (!EntryAttributes::isDefaultAttribute(key)) { cs = Qt::CaseSensitive; + k.prepend("{S:"); + } else { + k.prepend("{"); } - QString k = key; - k.prepend("{").append("}"); + + k.append("}"); if (result.compare(k,cs)==0) { result.replace(result,attributes()->value(key)); break; diff --git a/src/core/Entry.h b/src/core/Entry.h index 66b9362a6..ae60b596c 100644 --- a/src/core/Entry.h +++ b/src/core/Entry.h @@ -115,7 +115,8 @@ public: CloneNoFlags = 0, CloneNewUuid = 1, // generate a random uuid for the clone CloneResetTimeInfo = 2, // set all TimeInfo attributes to the current time - CloneIncludeHistory = 4 // clone the history items + CloneIncludeHistory = 4, // clone the history items + CloneRenameTitle = 8 // add "-Clone" after the original title }; Q_DECLARE_FLAGS(CloneFlags, CloneFlag) diff --git a/src/core/EntryAttributes.cpp b/src/core/EntryAttributes.cpp index 195a8f14a..b633cae32 100644 --- a/src/core/EntryAttributes.cpp +++ b/src/core/EntryAttributes.cpp @@ -24,6 +24,7 @@ const QString EntryAttributes::URLKey = "URL"; const QString EntryAttributes::NotesKey = "Notes"; const QStringList EntryAttributes::DefaultAttributes(QStringList() << TitleKey << UserNameKey << PasswordKey << URLKey << NotesKey); +const QString EntryAttributes::RememberCmdExecAttr = "_EXEC_CMD"; EntryAttributes::EntryAttributes(QObject* parent) : QObject(parent) diff --git a/src/core/EntryAttributes.h b/src/core/EntryAttributes.h index 1c0ddaaeb..211b6d483 100644 --- a/src/core/EntryAttributes.h +++ b/src/core/EntryAttributes.h @@ -52,6 +52,7 @@ public: static const QString URLKey; static const QString NotesKey; static const QStringList DefaultAttributes; + static const QString RememberCmdExecAttr; static bool isDefaultAttribute(const QString& key); Q_SIGNALS: diff --git a/src/core/EntrySearcher.cpp b/src/core/EntrySearcher.cpp index c0360a36c..01e152e2a 100644 --- a/src/core/EntrySearcher.cpp +++ b/src/core/EntrySearcher.cpp @@ -42,7 +42,11 @@ QList EntrySearcher::searchEntries(const QString& searchTerm, const Grou const QList children = group->children(); for (Group* childGroup : children) { if (childGroup->searchingEnabled() != Group::Disable) { - searchResult.append(searchEntries(searchTerm, childGroup, caseSensitivity)); + if (matchGroup(searchTerm, childGroup, caseSensitivity)) { + searchResult.append(childGroup->entriesRecursive()); + } else { + searchResult.append(searchEntries(searchTerm, childGroup, caseSensitivity)); + } } } @@ -69,3 +73,21 @@ bool EntrySearcher::wordMatch(const QString& word, Entry* entry, Qt::CaseSensiti entry->url().contains(word, caseSensitivity) || entry->notes().contains(word, caseSensitivity); } + +bool EntrySearcher::matchGroup(const QString& searchTerm, const Group* group, Qt::CaseSensitivity caseSensitivity) +{ + const QStringList wordList = searchTerm.split(QRegExp("\\s"), QString::SkipEmptyParts); + for (const QString& word : wordList) { + if (!wordMatch(word, group, caseSensitivity)) { + return false; + } + } + + return true; +} + +bool EntrySearcher::wordMatch(const QString& word, const Group* group, Qt::CaseSensitivity caseSensitivity) +{ + return group->name().contains(word, caseSensitivity) || + group->notes().contains(word, caseSensitivity); +} diff --git a/src/core/EntrySearcher.h b/src/core/EntrySearcher.h index c7075dc9b..4e8d4eabe 100644 --- a/src/core/EntrySearcher.h +++ b/src/core/EntrySearcher.h @@ -33,6 +33,8 @@ private: QList searchEntries(const QString& searchTerm, const Group* group, Qt::CaseSensitivity caseSensitivity); QList matchEntry(const QString& searchTerm, Entry* entry, Qt::CaseSensitivity caseSensitivity); bool wordMatch(const QString& word, Entry* entry, Qt::CaseSensitivity caseSensitivity); + bool matchGroup(const QString& searchTerm, const Group* group, Qt::CaseSensitivity caseSensitivity); + bool wordMatch(const QString& word, const Group* group, Qt::CaseSensitivity caseSensitivity); }; #endif // KEEPASSX_ENTRYSEARCHER_H diff --git a/src/core/FilePath.cpp b/src/core/FilePath.cpp index 24c9e3528..0506e3ab7 100644 --- a/src/core/FilePath.cpp +++ b/src/core/FilePath.cpp @@ -211,6 +211,9 @@ FilePath::FilePath() else if (testSetDir(appDirPath + "/share")) { } #endif + // Last ditch test when running in the build directory (mainly for travis tests) + else if (testSetDir(QString(KEEPASSX_SOURCE_DIR) + "/share")) { + } if (m_dataPath.isEmpty()) { qWarning("FilePath::DataPath: can't find data dir"); diff --git a/src/crypto/SymmetricCipher.cpp b/src/crypto/SymmetricCipher.cpp index 12ec264f5..98d481969 100644 --- a/src/crypto/SymmetricCipher.cpp +++ b/src/crypto/SymmetricCipher.cpp @@ -83,3 +83,23 @@ QString SymmetricCipher::errorString() const { return m_backend->errorString(); } + +SymmetricCipher::Algorithm SymmetricCipher::cipherToAlgorithm(Uuid cipher) +{ + if (cipher == KeePass2::CIPHER_AES) { + return SymmetricCipher::Aes256; + } + else { + return SymmetricCipher::Twofish; + } +} + +Uuid SymmetricCipher::algorithmToCipher(SymmetricCipher::Algorithm algo) +{ + switch (algo) { + case SymmetricCipher::Aes256: + return KeePass2::CIPHER_AES; + default: + return KeePass2::CIPHER_TWOFISH; + } +} diff --git a/src/crypto/SymmetricCipher.h b/src/crypto/SymmetricCipher.h index 4fc06b7de..0070ed7de 100644 --- a/src/crypto/SymmetricCipher.h +++ b/src/crypto/SymmetricCipher.h @@ -23,6 +23,7 @@ #include #include "crypto/SymmetricCipherBackend.h" +#include "format/KeePass2.h" class SymmetricCipher { @@ -71,6 +72,9 @@ public: int blockSize() const; QString errorString() const; + static SymmetricCipher::Algorithm cipherToAlgorithm(Uuid cipher); + static Uuid algorithmToCipher(SymmetricCipher::Algorithm algo); + private: static SymmetricCipherBackend* createBackend(SymmetricCipher::Algorithm algo, SymmetricCipher::Mode mode, SymmetricCipher::Direction direction); diff --git a/src/format/KeePass2.h b/src/format/KeePass2.h index b49ae4f6a..91ee48293 100644 --- a/src/format/KeePass2.h +++ b/src/format/KeePass2.h @@ -33,6 +33,7 @@ namespace KeePass2 const QSysInfo::Endian BYTEORDER = QSysInfo::LittleEndian; const Uuid CIPHER_AES = Uuid(QByteArray::fromHex("31c1f2e6bf714350be5805216afc5aff")); + const Uuid CIPHER_TWOFISH = Uuid(QByteArray::fromHex("ad68f29f576f4bb9a36ad47af965346c")); const QByteArray INNER_STREAM_SALSA20_IV("\xE8\x30\x09\x4B\x97\x20\x5D\x2A"); diff --git a/src/format/KeePass2Reader.cpp b/src/format/KeePass2Reader.cpp index 0512be601..33bea620c 100644 --- a/src/format/KeePass2Reader.cpp +++ b/src/format/KeePass2Reader.cpp @@ -124,7 +124,7 @@ Database* KeePass2Reader::readDatabase(QIODevice* device, const CompositeKey& ke hash.addData(m_db->transformedMasterKey()); QByteArray finalKey = hash.result(); - SymmetricCipherStream cipherStream(m_device, SymmetricCipher::Aes256, + SymmetricCipherStream cipherStream(m_device, SymmetricCipher::cipherToAlgorithm(m_db->cipher()), SymmetricCipher::Cbc, SymmetricCipher::Decrypt); if (!cipherStream.init(finalKey, m_encryptionIV)) { raiseError(cipherStream.errorString()); @@ -336,7 +336,7 @@ void KeePass2Reader::setCipher(const QByteArray& data) else { Uuid uuid(data); - if (uuid != KeePass2::CIPHER_AES) { + if (uuid != KeePass2::CIPHER_AES && uuid != KeePass2::CIPHER_TWOFISH) { raiseError("Unsupported cipher"); } else { diff --git a/src/format/KeePass2Writer.cpp b/src/format/KeePass2Writer.cpp index 6bb316bac..d63151c84 100644 --- a/src/format/KeePass2Writer.cpp +++ b/src/format/KeePass2Writer.cpp @@ -93,8 +93,8 @@ void KeePass2Writer::writeDatabase(QIODevice* device, Database* db) QByteArray headerHash = CryptoHash::hash(header.data(), CryptoHash::Sha256); CHECK_RETURN(writeData(header.data())); - SymmetricCipherStream cipherStream(device, SymmetricCipher::Aes256, SymmetricCipher::Cbc, - SymmetricCipher::Encrypt); + SymmetricCipherStream cipherStream(device, SymmetricCipher::cipherToAlgorithm(db->cipher()), + SymmetricCipher::Cbc, SymmetricCipher::Encrypt); cipherStream.init(finalKey, encryptionIV); if (!cipherStream.open(QIODevice::WriteOnly)) { raiseError(cipherStream.errorString()); diff --git a/src/format/KeePass2XmlReader.cpp b/src/format/KeePass2XmlReader.cpp index dfb03bd06..dca387b19 100644 --- a/src/format/KeePass2XmlReader.cpp +++ b/src/format/KeePass2XmlReader.cpp @@ -388,7 +388,7 @@ void KeePass2XmlReader::parseBinaries() QString id = attr.value("ID").toString(); QByteArray data; - if (attr.value("Compressed").compare("True", Qt::CaseInsensitive) == 0) { + if (attr.value("Compressed").compare(QLatin1String("True"), Qt::CaseInsensitive) == 0) { data = readCompressedBinary(); } else { diff --git a/src/gui/Application.cpp b/src/gui/Application.cpp index d982f22ca..26d9d2283 100644 --- a/src/gui/Application.cpp +++ b/src/gui/Application.cpp @@ -17,12 +17,20 @@ */ #include "Application.h" +#include "MainWindow.h" #include #include +#include #include "autotype/AutoType.h" +#if defined(Q_OS_UNIX) +#include +#include +#include +#endif + #if defined(Q_OS_UNIX) && !defined(Q_OS_OSX) class XcbEventFilter : public QAbstractNativeEventFilter { @@ -65,12 +73,18 @@ public: Application::Application(int& argc, char** argv) : QApplication(argc, argv) , m_mainWindow(nullptr) +#ifdef Q_OS_UNIX + , m_unixSignalNotifier(nullptr) +#endif { #if defined(Q_OS_UNIX) && !defined(Q_OS_OSX) installNativeEventFilter(new XcbEventFilter()); #elif defined(Q_OS_WIN) installNativeEventFilter(new WinEventFilter()); #endif +#if defined(Q_OS_UNIX) + registerUnixSignals(); +#endif } void Application::setMainWindow(QWidget* mainWindow) @@ -98,3 +112,57 @@ bool Application::event(QEvent* event) return QApplication::event(event); } + +#if defined(Q_OS_UNIX) +int Application::unixSignalSocket[2]; + +void Application::registerUnixSignals() +{ + int result = ::socketpair(AF_UNIX, SOCK_STREAM, 0, unixSignalSocket); + Q_ASSERT(0 == result); + if (0 != result) { + // do not register handles when socket creation failed, otherwise + // application will be unresponsive to signals such as SIGINT or SIGTERM + return; + } + + QVector const handledSignals = { SIGQUIT, SIGINT, SIGTERM, SIGHUP }; + for (auto s: handledSignals) { + struct sigaction sigAction; + + sigAction.sa_handler = handleUnixSignal; + sigemptyset(&sigAction.sa_mask); + sigAction.sa_flags = 0 | SA_RESTART; + sigaction(s, &sigAction, nullptr); + } + + m_unixSignalNotifier = new QSocketNotifier(unixSignalSocket[1], QSocketNotifier::Read, this); + connect(m_unixSignalNotifier, SIGNAL(activated(int)), this, SLOT(quitBySignal())); +} + +void Application::handleUnixSignal(int sig) +{ + switch (sig) { + case SIGQUIT: + case SIGINT: + case SIGTERM: + { + char buf = 0; + ::write(unixSignalSocket[0], &buf, sizeof(buf)); + return; + } + case SIGHUP: + return; + } +} + +void Application::quitBySignal() +{ + m_unixSignalNotifier->setEnabled(false); + char buf; + ::read(unixSignalSocket[1], &buf, sizeof(buf)); + + if (nullptr != m_mainWindow) + static_cast(m_mainWindow)->appExit(); +} +#endif diff --git a/src/gui/Application.h b/src/gui/Application.h index 149b61ddf..9bfe4d549 100644 --- a/src/gui/Application.h +++ b/src/gui/Application.h @@ -21,6 +21,8 @@ #include +class QSocketNotifier; + class Application : public QApplication { Q_OBJECT @@ -34,8 +36,23 @@ public: Q_SIGNALS: void openFile(const QString& filename); +private Q_SLOTS: +#if defined(Q_OS_UNIX) + void quitBySignal(); +#endif + private: QWidget* m_mainWindow; + +#if defined(Q_OS_UNIX) + /** + * Register Unix signals such as SIGINT and SIGTERM for clean shutdown. + */ + void registerUnixSignals(); + QSocketNotifier* m_unixSignalNotifier; + static void handleUnixSignal(int sig); + static int unixSignalSocket[2]; +#endif }; #endif // KEEPASSX_APPLICATION_H diff --git a/src/gui/ChangeMasterKeyWidget.cpp b/src/gui/ChangeMasterKeyWidget.cpp index f2cf3b8d9..274cdd8ba 100644 --- a/src/gui/ChangeMasterKeyWidget.cpp +++ b/src/gui/ChangeMasterKeyWidget.cpp @@ -34,6 +34,8 @@ ChangeMasterKeyWidget::ChangeMasterKeyWidget(QWidget* parent) { m_ui->setupUi(this); + m_ui->messageWidget->setHidden(true); + connect(m_ui->buttonBox, SIGNAL(accepted()), SLOT(generateKey())); connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(reject())); m_ui->togglePasswordButton->setIcon(filePath()->onOffIcon("actions", "password-show")); @@ -60,7 +62,7 @@ void ChangeMasterKeyWidget::createKeyFile() QString errorMsg; bool created = FileKey::create(fileName, &errorMsg); if (!created) { - MessageBox::warning(this, tr("Error"), tr("Unable to create Key File : ") + errorMsg); + m_ui->messageWidget->showMessage(tr("Unable to create Key File : ").append(errorMsg), MessageWidget::Error); } else { m_ui->keyFileCombo->setEditText(fileName); @@ -125,7 +127,7 @@ void ChangeMasterKeyWidget::generateKey() m_key.addKey(PasswordKey(m_ui->enterPasswordEdit->text())); } else { - MessageBox::warning(this, tr("Error"), tr("Different passwords supplied.")); + m_ui->messageWidget->showMessage(tr("Different passwords supplied."), MessageWidget::Error); m_ui->enterPasswordEdit->setText(""); m_ui->repeatPasswordEdit->setText(""); return; @@ -134,10 +136,10 @@ void ChangeMasterKeyWidget::generateKey() if (m_ui->keyFileGroup->isChecked()) { FileKey fileKey; QString errorMsg; - if (!fileKey.load(m_ui->keyFileCombo->currentText(), &errorMsg)) { - MessageBox::critical(this, tr("Failed to set key file"), - tr("Failed to set %1 as the Key file:\n%2") - .arg(m_ui->keyFileCombo->currentText(), errorMsg)); + QString fileKeyName = m_ui->keyFileCombo->currentText(); + if (!fileKey.load(fileKeyName, &errorMsg)) { + m_ui->messageWidget->showMessage( + tr("Failed to set %1 as the Key file:\n%2").arg(fileKeyName, errorMsg), MessageWidget::Error); return; } m_key.addKey(fileKey); @@ -151,6 +153,7 @@ void ChangeMasterKeyWidget::generateKey() m_key.addChallengeResponseKey(key); } + m_ui->messageWidget->hideMessage(); Q_EMIT editFinished(true); } diff --git a/src/gui/ChangeMasterKeyWidget.ui b/src/gui/ChangeMasterKeyWidget.ui index 335a67c92..f03f9e371 100644 --- a/src/gui/ChangeMasterKeyWidget.ui +++ b/src/gui/ChangeMasterKeyWidget.ui @@ -7,10 +7,13 @@ 0 0 438 - 256 + 342 + + + @@ -176,6 +179,12 @@ QLineEdit
gui/PasswordEdit.h
+ + MessageWidget + QWidget +
gui/MessageWidget.h
+ 1 +
passwordGroup diff --git a/src/gui/DatabaseOpenWidget.cpp b/src/gui/DatabaseOpenWidget.cpp index 0b63bc0fc..92a03663d 100644 --- a/src/gui/DatabaseOpenWidget.cpp +++ b/src/gui/DatabaseOpenWidget.cpp @@ -40,6 +40,8 @@ DatabaseOpenWidget::DatabaseOpenWidget(QWidget* parent) { m_ui->setupUi(this); + m_ui->messageWidget->setHidden(true); + QFont font = m_ui->labelHeadline->font(); font.setBold(true); font.setPointSize(font.pointSize() + 2); @@ -127,8 +129,8 @@ void DatabaseOpenWidget::openDatabase() QFile file(m_filename); if (!file.open(QIODevice::ReadOnly)) { - MessageBox::warning(this, tr("Error"), tr("Unable to open the database.").append("\n") - .append(file.errorString())); + m_ui->messageWidget->showMessage( + tr("Unable to open the database.").append("\n").append(file.errorString()), MessageWidget::Error); return; } if (m_db) { @@ -139,11 +141,14 @@ void DatabaseOpenWidget::openDatabase() QApplication::restoreOverrideCursor(); if (m_db) { + if (m_ui->messageWidget->isVisible()) { + m_ui->messageWidget->animatedHide(); + } Q_EMIT editFinished(true); } else { - MessageBox::warning(this, tr("Error"), tr("Unable to open the database.").append("\n") - .append(reader.errorString())); + m_ui->messageWidget->showMessage(tr("Unable to open the database.") + .append("\n").append(reader.errorString()), MessageWidget::Error); m_ui->editPassword->clear(); } } @@ -163,7 +168,8 @@ CompositeKey DatabaseOpenWidget::databaseKey() QString keyFilename = m_ui->comboKeyFile->currentText(); QString errorMsg; if (!key.load(keyFilename, &errorMsg)) { - MessageBox::warning(this, tr("Error"), tr("Can't open key file").append(":\n").append(errorMsg)); + m_ui->messageWidget->showMessage(tr("Can't open key file").append(":\n") + .append(errorMsg), MessageWidget::Error); return CompositeKey(); } masterKey.addKey(key); diff --git a/src/gui/DatabaseOpenWidget.ui b/src/gui/DatabaseOpenWidget.ui index 3d651ee8d..79b9cd87f 100644 --- a/src/gui/DatabaseOpenWidget.ui +++ b/src/gui/DatabaseOpenWidget.ui @@ -10,10 +10,13 @@ 250 - + 8 + + + @@ -161,6 +164,12 @@ QLineEdit
gui/PasswordEdit.h
+ + MessageWidget + QWidget +
gui/MessageWidget.h
+ 1 +
checkPassword diff --git a/src/gui/DatabaseSettingsWidget.cpp b/src/gui/DatabaseSettingsWidget.cpp index b0759bf3a..59a3c5c3a 100644 --- a/src/gui/DatabaseSettingsWidget.cpp +++ b/src/gui/DatabaseSettingsWidget.cpp @@ -21,6 +21,8 @@ #include "core/Database.h" #include "core/Group.h" #include "core/Metadata.h" +#include "crypto/SymmetricCipher.h" +#include "format/KeePass2.h" #include "keys/CompositeKey.h" DatabaseSettingsWidget::DatabaseSettingsWidget(QWidget* parent) @@ -53,6 +55,7 @@ void DatabaseSettingsWidget::load(Database* db) m_ui->dbDescriptionEdit->setText(meta->description()); m_ui->recycleBinEnabledCheckBox->setChecked(meta->recycleBinEnabled()); m_ui->defaultUsernameEdit->setText(meta->defaultUserName()); + m_ui->AlgorithmComboBox->setCurrentIndex(SymmetricCipher::cipherToAlgorithm(m_db->cipher())); m_ui->transformRoundsSpinBox->setValue(m_db->transformRounds()); if (meta->historyMaxItems() > -1) { m_ui->historyMaxItemsSpinBox->setValue(meta->historyMaxItems()); @@ -82,6 +85,8 @@ void DatabaseSettingsWidget::save() meta->setName(m_ui->dbNameEdit->text()); meta->setDescription(m_ui->dbDescriptionEdit->text()); meta->setDefaultUserName(m_ui->defaultUsernameEdit->text()); + m_db->setCipher(SymmetricCipher::algorithmToCipher(static_cast + (m_ui->AlgorithmComboBox->currentIndex()))); meta->setRecycleBinEnabled(m_ui->recycleBinEnabledCheckBox->isChecked()); if (static_cast(m_ui->transformRoundsSpinBox->value()) != m_db->transformRounds()) { QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); diff --git a/src/gui/DatabaseSettingsWidget.ui b/src/gui/DatabaseSettingsWidget.ui index 5d1f3d9f1..1c233bdd4 100644 --- a/src/gui/DatabaseSettingsWidget.ui +++ b/src/gui/DatabaseSettingsWidget.ui @@ -49,35 +49,7 @@ - - - - Transform rounds: - - - - - - - Default username: - - - - - - - true - - - - - - - Use recycle bin: - - - - + @@ -100,7 +72,7 @@ - + @@ -117,7 +89,7 @@ - + @@ -144,23 +116,72 @@ - + Max. history items: - + Max. history size: - + + + + Transform rounds: + + + + + + + + Default username: + + + + + + + Use recycle bin: + + + + + + + true + + + + + + + Algorithm: + + + + + + + + AES: 256 Bit (default) + + + + + Twofish: 256 Bit + + + +
diff --git a/src/gui/DatabaseTabWidget.cpp b/src/gui/DatabaseTabWidget.cpp index af6907001..8b29cfd03 100644 --- a/src/gui/DatabaseTabWidget.cpp +++ b/src/gui/DatabaseTabWidget.cpp @@ -116,7 +116,7 @@ void DatabaseTabWidget::openDatabase(const QString& fileName, const QString& pw, QFileInfo fileInfo(fileName); QString canonicalFilePath = fileInfo.canonicalFilePath(); if (canonicalFilePath.isEmpty()) { - MessageBox::warning(this, tr("Warning"), tr("File not found!")); + Q_EMIT messageGlobal(tr("File not found!"), MessageWidget::Error); return; } @@ -136,8 +136,9 @@ void DatabaseTabWidget::openDatabase(const QString& fileName, const QString& pw, QFile file(fileName); if (!file.open(QIODevice::ReadWrite)) { if (!file.open(QIODevice::ReadOnly)) { - MessageBox::warning(this, tr("Error"), tr("Unable to open the database.").append("\n") - .append(file.errorString())); + // can't open + Q_EMIT messageGlobal( + tr("Unable to open the database.").append("\n").append(file.errorString()), MessageWidget::Error); return; } else { @@ -184,6 +185,10 @@ void DatabaseTabWidget::openDatabase(const QString& fileName, const QString& pw, insertDatabase(db, dbStruct); + if (dbStruct.readOnly) { + Q_EMIT messageTab(tr("File opened in read only mode."), MessageWidget::Warning); + } + updateLastDatabases(dbStruct.filePath); if (!pw.isNull() || !keyFile.isEmpty()) { @@ -192,6 +197,7 @@ void DatabaseTabWidget::openDatabase(const QString& fileName, const QString& pw, else { dbStruct.dbWidget->switchToOpenDatabase(dbStruct.filePath); } + Q_EMIT messageDismissGlobal(); } void DatabaseTabWidget::mergeDatabase() @@ -246,7 +252,7 @@ bool DatabaseTabWidget::closeDatabase(Database* db) QMessageBox::StandardButton result = MessageBox::question( this, tr("Close?"), - tr("\"%1\" is in edit mode.\nDiscard changes and close anyway?").arg(dbName), + tr("\"%1\" is in edit mode.\nDiscard changes and close anyway?").arg(dbName.toHtmlEscaped()), QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Cancel); if (result == QMessageBox::Cancel) { return false; @@ -262,7 +268,7 @@ bool DatabaseTabWidget::closeDatabase(Database* db) QMessageBox::StandardButton result = MessageBox::question( this, tr("Save changes?"), - tr("\"%1\" was modified.\nSave changes?").arg(dbName), + tr("\"%1\" was modified.\nSave changes?").arg(dbName.toHtmlEscaped()), QMessageBox::Yes | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Yes); if (result == QMessageBox::Yes) { if (!saveDatabase(db)) { @@ -322,8 +328,8 @@ bool DatabaseTabWidget::saveDatabase(Database* db) // write the database to the file m_writer.writeDatabase(&saveFile, db); if (m_writer.hasError()) { - MessageBox::critical(this, tr("Error"), tr("Writing the database failed.") + "\n\n" - + m_writer.errorString()); + Q_EMIT messageTab(tr("Writing the database failed.").append("\n") + .append(m_writer.errorString()), MessageWidget::Error); return false; } @@ -332,17 +338,18 @@ bool DatabaseTabWidget::saveDatabase(Database* db) dbStruct.modified = false; dbStruct.dbWidget->databaseSaved(); updateTabName(db); + Q_EMIT messageDismissTab(); return true; } else { - MessageBox::critical(this, tr("Error"), tr("Writing the database failed.") + "\n\n" - + saveFile.errorString()); + Q_EMIT messageTab(tr("Writing the database failed.").append("\n") + .append(saveFile.errorString()), MessageWidget::Error); return false; } } else { - MessageBox::critical(this, tr("Error"), tr("Writing the database failed.") + "\n\n" - + saveFile.errorString()); + Q_EMIT messageTab(tr("Writing the database failed.").append("\n") + .append(saveFile.errorString()), MessageWidget::Error); return false; } } @@ -486,8 +493,9 @@ void DatabaseTabWidget::exportToCsv() CsvExporter csvExporter; if (!csvExporter.exportDatabase(fileName, db)) { - MessageBox::critical(this, tr("Error"), tr("Writing the CSV file failed.") + "\n\n" - + csvExporter.errorString()); + Q_EMIT messageGlobal( + tr("Writing the CSV file failed.").append("\n") + .append(csvExporter.errorString()), MessageWidget::Error); } } @@ -716,6 +724,7 @@ void DatabaseTabWidget::lockDatabases() } else if (result == QMessageBox::Discard) { m_dbList[db].modified = false; + m_dbList[db].dbWidget->databaseSaved(); } else if (result == QMessageBox::Cancel) { continue; diff --git a/src/gui/DatabaseTabWidget.h b/src/gui/DatabaseTabWidget.h index 24bdbde2f..8f01a987d 100644 --- a/src/gui/DatabaseTabWidget.h +++ b/src/gui/DatabaseTabWidget.h @@ -23,12 +23,14 @@ #include "format/KeePass2Writer.h" #include "gui/DatabaseWidget.h" +#include "gui/MessageWidget.h" class DatabaseWidget; class DatabaseWidgetStateSync; class DatabaseOpenWidget; class QFile; class QLockFile; +class MessageWidget; struct DatabaseManagerStruct { @@ -84,6 +86,10 @@ Q_SIGNALS: void activateDatabaseChanged(DatabaseWidget* dbWidget); void databaseLocked(DatabaseWidget* dbWidget); void databaseUnlocked(DatabaseWidget* dbWidget); + void messageGlobal(const QString&, MessageWidget::MessageType type); + void messageTab(const QString&, MessageWidget::MessageType type); + void messageDismissGlobal(); + void messageDismissTab(); private Q_SLOTS: void updateTabName(Database* db); diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index 985374c49..2d65352f9 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -59,7 +60,14 @@ DatabaseWidget::DatabaseWidget(Database* db, QWidget* parent) , m_newParent(nullptr) { m_mainWidget = new QWidget(this); - QLayout* layout = new QHBoxLayout(m_mainWidget); + + m_messageWidget = new MessageWidget(this); + m_messageWidget->setHidden(true); + + QVBoxLayout* mainLayout = new QVBoxLayout(); + QLayout* layout = new QHBoxLayout(); + mainLayout->addWidget(m_messageWidget); + mainLayout->addLayout(layout); m_splitter = new QSplitter(m_mainWidget); m_splitter->setChildrenCollapsible(false); @@ -104,7 +112,7 @@ DatabaseWidget::DatabaseWidget(Database* db, QWidget* parent) m_splitter->setStretchFactor(1, 70); layout->addWidget(m_splitter); - m_mainWidget->setLayout(layout); + m_mainWidget->setLayout(mainLayout); m_editEntryWidget = new EditEntryWidget(); m_editEntryWidget->setObjectName("editEntryWidget"); @@ -312,8 +320,10 @@ void DatabaseWidget::cloneEntry() return; } - Entry* entry = currentEntry->clone(Entry::CloneNewUuid | Entry::CloneResetTimeInfo); + Entry* entry = currentEntry->clone(Entry::CloneNewUuid | Entry::CloneResetTimeInfo | Entry::CloneRenameTitle); entry->setGroup(currentEntry->group()); + if (isInSearchMode()) + search(m_lastSearchText); m_entryView->setFocus(); m_entryView->setCurrentEntry(entry); } @@ -341,7 +351,7 @@ void DatabaseWidget::deleteEntries() result = MessageBox::question( this, tr("Delete entry?"), tr("Do you really want to delete the entry \"%1\" for good?") - .arg(selectedEntries.first()->title()), + .arg(selectedEntries.first()->title().toHtmlEscaped()), QMessageBox::Yes | QMessageBox::No); } else { @@ -365,7 +375,7 @@ void DatabaseWidget::deleteEntries() result = MessageBox::question( this, tr("Move entry to recycle bin?"), tr("Do you really want to move entry \"%1\" to the recycle bin?") - .arg(selectedEntries.first()->title()), + .arg(selectedEntries.first()->title().toHtmlEscaped()), QMessageBox::Yes | QMessageBox::No); } else { @@ -494,8 +504,46 @@ void DatabaseWidget::openUrlForEntry(Entry* entry) } if (urlString.startsWith("cmd://")) { + // check if decision to execute command was stored + if (entry->attributes()->hasKey(EntryAttributes::RememberCmdExecAttr)) { + if (entry->attributes()->value(EntryAttributes::RememberCmdExecAttr) == "1") { + QProcess::startDetached(urlString.mid(6)); + } + return; + } + + // otherwise ask user if (urlString.length() > 6) { - QProcess::startDetached(urlString.mid(6)); + QString cmdTruncated = urlString.mid(6); + if (cmdTruncated.length() > 400) + cmdTruncated = cmdTruncated.left(400) + " […]"; + QMessageBox msgbox(QMessageBox::Icon::Question, + tr("Execute command?"), + tr("Do you really want to execute the following command?

%1
") + .arg(cmdTruncated.toHtmlEscaped()), + QMessageBox::Yes | QMessageBox::No, + this + ); + msgbox.setDefaultButton(QMessageBox::No); + + QCheckBox* checkbox = new QCheckBox(tr("Remember my choice"), &msgbox); + msgbox.setCheckBox(checkbox); + bool remember = false; + QObject::connect(checkbox, &QCheckBox::stateChanged, [&](int state) { + if (static_cast(state) == Qt::CheckState::Checked) { + remember = true; + } + }); + + int result = msgbox.exec(); + if (result == QMessageBox::Yes) { + QProcess::startDetached(urlString.mid(6)); + } + + if (remember) { + entry->attributes()->set(EntryAttributes::RememberCmdExecAttr, + result == QMessageBox::Yes ? "1" : "0"); + } } } else { @@ -532,7 +580,7 @@ void DatabaseWidget::deleteGroup() QMessageBox::StandardButton result = MessageBox::question( this, tr("Delete group?"), tr("Do you really want to delete the group \"%1\" for good?") - .arg(currentGroup->name()), + .arg(currentGroup->name().toHtmlEscaped()), QMessageBox::Yes | QMessageBox::No); if (result == QMessageBox::Yes) { delete currentGroup; @@ -648,7 +696,7 @@ void DatabaseWidget::updateMasterKey(bool accepted) QApplication::restoreOverrideCursor(); if (!result) { - MessageBox::critical(this, tr("Error"), tr("Unable to calculate master key")); + m_messageWidget->showMessage(tr("Unable to calculate master key"), MessageWidget::Error); return; } } @@ -688,14 +736,14 @@ void DatabaseWidget::mergeDatabase(bool accepted) { if (accepted) { if (!m_db) { - MessageBox::critical(this, tr("Error"), tr("No current database.")); + m_messageWidget->showMessage(tr("No current database."), MessageWidget::Error); return; } Database* srcDb = static_cast(sender())->database(); if (!srcDb) { - MessageBox::critical(this, tr("Error"), tr("No source database, nothing to do.")); + m_messageWidget->showMessage(tr("No source database, nothing to do."), MessageWidget::Error); return; } @@ -722,15 +770,10 @@ void DatabaseWidget::unlockDatabase(bool accepted) replaceDatabase(db); - const QList groups = m_db->rootGroup()->groupsRecursive(true); - for (Group* group : groups) { - if (group->uuid() == m_groupBeforeLock) { - m_groupView->setCurrentGroup(group); - break; - } - } - + restoreGroupEntryFocus(m_groupBeforeLock, m_entryBeforeLock); m_groupBeforeLock = Uuid(); + m_entryBeforeLock = Uuid(); + setCurrentWidget(m_mainWidget); m_unlockDatabaseWidget->clearForms(); Q_EMIT unlockedDatabase(); @@ -755,7 +798,7 @@ void DatabaseWidget::entryActivationSignalReceived(Entry* entry, EntryModel::Mod void DatabaseWidget::switchToEntryEdit() { Entry* entry = m_entryView->currentEntry(); - Q_ASSERT(entry); + if (!entry) { return; } @@ -766,7 +809,7 @@ void DatabaseWidget::switchToEntryEdit() void DatabaseWidget::switchToGroupEdit() { Group* group = m_groupView->currentGroup(); - Q_ASSERT(group); + if (!group) { return; } @@ -943,6 +986,10 @@ void DatabaseWidget::lock() m_groupBeforeLock = m_db->rootGroup()->uuid(); } + if (m_entryView->currentEntry()) { + m_entryBeforeLock = m_entryView->currentEntry()->uuid(); + } + clearAllWidgets(); m_unlockDatabaseWidget->load(m_filename); setCurrentWidget(m_unlockDatabaseWidget); @@ -1028,18 +1075,33 @@ void DatabaseWidget::reloadDatabaseFile() } } + Uuid groupBeforeReload; + if (m_groupView && m_groupView->currentGroup()) { + groupBeforeReload = m_groupView->currentGroup()->uuid(); + } + else { + groupBeforeReload = m_db->rootGroup()->uuid(); + } + + Uuid entryBeforeReload; + if (m_entryView && m_entryView->currentEntry()) { + entryBeforeReload = m_entryView->currentEntry()->uuid(); + } + replaceDatabase(db); + restoreGroupEntryFocus(groupBeforeReload, entryBeforeReload); + } else { - MessageBox::critical(this, tr("Autoreload Failed"), - tr("Could not parse or unlock the new database file while attempting" - " to autoreload this database.")); + m_messageWidget->showMessage( + tr("Could not parse or unlock the new database file while attempting" + " to autoreload this database."), MessageWidget::Error); } } else { - MessageBox::critical(this, tr("Autoreload Failed"), - tr("Could not open the new database file while attempting to autoreload" - " this database.")); + m_messageWidget->showMessage( + tr("Could not open the new database file while attempting to autoreload this database."), + MessageWidget::Error); } // Rewatch the database file @@ -1061,6 +1123,35 @@ QStringList DatabaseWidget::customEntryAttributes() const return entry->attributes()->customKeys(); } +/* + * Restores the focus on the group and entry that was focused + * before the database was locked or reloaded. + */ +void DatabaseWidget::restoreGroupEntryFocus(Uuid groupUuid, Uuid entryUuid) +{ + Group* restoredGroup = nullptr; + const QList groups = m_db->rootGroup()->groupsRecursive(true); + for (Group* group : groups) { + if (group->uuid() == groupUuid) { + restoredGroup = group; + break; + } + } + + if (restoredGroup != nullptr) { + m_groupView->setCurrentGroup(restoredGroup); + + const QList entries = restoredGroup->entries(); + for (Entry* entry : entries) { + if (entry->uuid() == entryUuid) { + m_entryView->setCurrentEntry(entry); + break; + } + } + } + +} + bool DatabaseWidget::isGroupSelected() const { return m_groupView->currentGroup() != nullptr; @@ -1136,3 +1227,15 @@ void DatabaseWidget::closeUnlockDialog() { m_unlockDatabaseDialog->close(); } + +void DatabaseWidget::showMessage(const QString& text, MessageWidget::MessageType type) +{ + m_messageWidget->showMessage(text, type); +} + +void DatabaseWidget::hideMessage() +{ + if (m_messageWidget->isVisible()) { + m_messageWidget->animatedHide(); + } +} diff --git a/src/gui/DatabaseWidget.h b/src/gui/DatabaseWidget.h index f55fa2027..4133e52b4 100644 --- a/src/gui/DatabaseWidget.h +++ b/src/gui/DatabaseWidget.h @@ -26,6 +26,7 @@ #include "core/Uuid.h" #include "gui/entry/EntryModel.h" +#include "gui/MessageWidget.h" class ChangeMasterKeyWidget; class DatabaseOpenWidget; @@ -43,9 +44,14 @@ class QMenu; class QSplitter; class QLabel; class UnlockDatabaseWidget; +class MessageWidget; class UnlockDatabaseDialog; class QFileSystemWatcher; +namespace Ui { + class SearchWidget; +} + class DatabaseWidget : public QStackedWidget { Q_OBJECT @@ -145,6 +151,8 @@ public Q_SLOTS: void search(const QString& searchtext); void setSearchCaseSensitive(bool state); void endSearch(); + void showMessage(const QString& text, MessageWidget::MessageType type); + void hideMessage(); private Q_SLOTS: void entryActivationSignalReceived(Entry* entry, EntryModel::ModelColumn column); @@ -163,6 +171,7 @@ private Q_SLOTS: // Database autoreload slots void onWatchedFileChanged(); void reloadDatabaseFile(); + void restoreGroupEntryFocus(Uuid groupUuid, Uuid EntryUuid); private: void setClipboardTextAndMinimize(const QString& text); @@ -190,6 +199,8 @@ private: Group* m_newParent; QString m_filename; Uuid m_groupBeforeLock; + Uuid m_entryBeforeLock; + MessageWidget* m_messageWidget; // Search state QString m_lastSearchText; diff --git a/src/gui/DatabaseWidgetStateSync.cpp b/src/gui/DatabaseWidgetStateSync.cpp index fd5719f5a..1510d8440 100644 --- a/src/gui/DatabaseWidgetStateSync.cpp +++ b/src/gui/DatabaseWidgetStateSync.cpp @@ -149,3 +149,4 @@ QVariant DatabaseWidgetStateSync::intListToVariant(const QList& list) return result; } + diff --git a/src/gui/EditWidget.cpp b/src/gui/EditWidget.cpp index b3d9842be..ef29f0132 100644 --- a/src/gui/EditWidget.cpp +++ b/src/gui/EditWidget.cpp @@ -25,6 +25,8 @@ EditWidget::EditWidget(QWidget* parent) m_ui->setupUi(this); setReadOnly(false); + m_ui->messageWidget->setHidden(true); + QFont headerLabelFont = m_ui->headerLabel->font(); headerLabelFont.setBold(true); headerLabelFont.setPointSize(headerLabelFont.pointSize() + 2); @@ -86,3 +88,15 @@ bool EditWidget::readOnly() const { return m_readOnly; } + +void EditWidget::showMessage(const QString& text, MessageWidget::MessageType type) +{ + m_ui->messageWidget->showMessage(text, type); +} + +void EditWidget::hideMessage() +{ + if (m_ui->messageWidget->isVisible()) { + m_ui->messageWidget->animatedHide(); + } +} diff --git a/src/gui/EditWidget.h b/src/gui/EditWidget.h index c5f507ac9..6f2c8f2dc 100644 --- a/src/gui/EditWidget.h +++ b/src/gui/EditWidget.h @@ -21,6 +21,7 @@ #include #include "gui/DialogyWidget.h" +#include "gui/MessageWidget.h" class QLabel; @@ -48,6 +49,10 @@ Q_SIGNALS: void accepted(); void rejected(); +protected Q_SLOTS: + void showMessage(const QString& text, MessageWidget::MessageType type); + void hideMessage(); + private: const QScopedPointer m_ui; bool m_readOnly; diff --git a/src/gui/EditWidget.ui b/src/gui/EditWidget.ui index 3891007a1..05b06b909 100644 --- a/src/gui/EditWidget.ui +++ b/src/gui/EditWidget.ui @@ -11,6 +11,9 @@ + + + @@ -58,6 +61,12 @@
+ + MessageWidget + QWidget +
gui/MessageWidget.h
+ 1 +
CategoryListWidget QListWidget diff --git a/src/gui/EditWidgetIcons.cpp b/src/gui/EditWidgetIcons.cpp index e0ac5227b..ba395b592 100644 --- a/src/gui/EditWidgetIcons.cpp +++ b/src/gui/EditWidgetIcons.cpp @@ -158,12 +158,11 @@ void EditWidgetIcons::fetchFavicon(QUrl url) void EditWidgetIcons::fetchFaviconFromGoogle(QString domain) { - if (m_fallbackToGoogle) { + if (m_fallbackToGoogle) { abortFaviconDownload(); m_fallbackToGoogle = false; fetchFavicon(QUrl("http://www.google.com/s2/favicons?domain=" + domain)); - } - else { + } else { abortFaviconDownload(); MessageBox::warning(this, tr("Error"), tr("Unable to fetch favicon.")); } @@ -190,6 +189,10 @@ void EditWidgetIcons::abortFaviconDownload(bool clearRedirect) void EditWidgetIcons::onRequestFinished(QNetworkReply *reply) { + if (m_database == nullptr) { + return; + } + if (!reply->error()) { QImage image; image.loadFromData(reply->readAll()); @@ -244,7 +247,7 @@ void EditWidgetIcons::addCustomIcon() m_ui->customIconsView->setCurrentIndex(index); } else { - MessageBox::critical(this, tr("Error"), tr("Can't read icon")); + Q_EMIT messageEditEntry(tr("Can't read icon"), MessageWidget::Error); } } } @@ -298,9 +301,8 @@ void EditWidgetIcons::removeCustomIcon() } } else { - MessageBox::information(this, tr("Can't delete icon!"), - tr("Can't delete icon. Still used by %1 items.") - .arg(iconUsedCount)); + Q_EMIT messageEditEntry( + tr("Can't delete icon. Still used by %1 items.").arg(iconUsedCount), MessageWidget::Error); } } } diff --git a/src/gui/EditWidgetIcons.h b/src/gui/EditWidgetIcons.h index 508c56864..ae5f86951 100644 --- a/src/gui/EditWidgetIcons.h +++ b/src/gui/EditWidgetIcons.h @@ -26,6 +26,7 @@ #include "core/Global.h" #include "core/Uuid.h" +#include "gui/MessageWidget.h" class Database; class DefaultIconModel; @@ -58,6 +59,10 @@ public: public Q_SLOTS: void setUrl(const QString &url); +Q_SIGNALS: + void messageEditEntry(QString, MessageWidget::MessageType); + void messageEditEntryDismiss(); + private Q_SLOTS: void downloadFavicon(); void fetchFavicon(QUrl url); diff --git a/src/gui/KMessageWidget.cpp b/src/gui/KMessageWidget.cpp new file mode 100644 index 000000000..f2c48c253 --- /dev/null +++ b/src/gui/KMessageWidget.cpp @@ -0,0 +1,480 @@ +/* This file is part of the KDE libraries + * + * Copyright (c) 2011 Aurélien Gâteau + * Copyright (c) 2014 Dominik Haumann + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA + */ +#include "KMessageWidget.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//--------------------------------------------------------------------- +// KMessageWidgetPrivate +//--------------------------------------------------------------------- +class KMessageWidgetPrivate +{ +public: + void init(KMessageWidget *); + + KMessageWidget *q; + QFrame *content; + QLabel *iconLabel; + QLabel *textLabel; + QToolButton *closeButton; + QTimeLine *timeLine; + QIcon icon; + + KMessageWidget::MessageType messageType; + bool wordWrap; + QList buttons; + QPixmap contentSnapShot; + + void createLayout(); + void updateSnapShot(); + void updateLayout(); + void slotTimeLineChanged(qreal); + void slotTimeLineFinished(); + + int bestContentHeight() const; +}; + +void KMessageWidgetPrivate::init(KMessageWidget *q_ptr) +{ + q = q_ptr; + + q->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); + + timeLine = new QTimeLine(500, q); + QObject::connect(timeLine, SIGNAL(valueChanged(qreal)), q, SLOT(slotTimeLineChanged(qreal))); + QObject::connect(timeLine, SIGNAL(finished()), q, SLOT(slotTimeLineFinished())); + + content = new QFrame(q); + content->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + + wordWrap = false; + + iconLabel = new QLabel(content); + iconLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + iconLabel->hide(); + + textLabel = new QLabel(content); + textLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + textLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); + QObject::connect(textLabel, SIGNAL(linkActivated(QString)), q, SIGNAL(linkActivated(QString))); + QObject::connect(textLabel, SIGNAL(linkHovered(QString)), q, SIGNAL(linkHovered(QString))); + + QAction *closeAction = new QAction(q); + closeAction->setText(KMessageWidget::tr("&Close")); + closeAction->setToolTip(KMessageWidget::tr("Close message")); + closeAction->setIcon(q->style()->standardIcon(QStyle::SP_DialogCloseButton)); + + QObject::connect(closeAction, SIGNAL(triggered(bool)), q, SLOT(animatedHide())); + + closeButton = new QToolButton(content); + closeButton->setAutoRaise(true); + closeButton->setDefaultAction(closeAction); + + q->setMessageType(KMessageWidget::Information); +} + +void KMessageWidgetPrivate::createLayout() +{ + delete content->layout(); + + content->resize(q->size()); + + qDeleteAll(buttons); + buttons.clear(); + + Q_FOREACH (QAction *action, q->actions()) { + QToolButton *button = new QToolButton(content); + button->setDefaultAction(action); + button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + buttons.append(button); + } + + // AutoRaise reduces visual clutter, but we don't want to turn it on if + // there are other buttons, otherwise the close button will look different + // from the others. + closeButton->setAutoRaise(buttons.isEmpty()); + + if (wordWrap) { + QGridLayout *layout = new QGridLayout(content); + // Set alignment to make sure icon does not move down if text wraps + layout->addWidget(iconLabel, 0, 0, 1, 1, Qt::AlignHCenter | Qt::AlignTop); + layout->addWidget(textLabel, 0, 1); + + QHBoxLayout *buttonLayout = new QHBoxLayout; + buttonLayout->addStretch(); + Q_FOREACH (QToolButton *button, buttons) { + // For some reason, calling show() is necessary if wordwrap is true, + // otherwise the buttons do not show up. It is not needed if + // wordwrap is false. + button->show(); + buttonLayout->addWidget(button); + } + buttonLayout->addWidget(closeButton); + layout->addItem(buttonLayout, 1, 0, 1, 2); + } else { + QHBoxLayout *layout = new QHBoxLayout(content); + layout->addWidget(iconLabel); + layout->addWidget(textLabel); + + Q_FOREACH (QToolButton *button, buttons) { + layout->addWidget(button); + } + + layout->addWidget(closeButton); + }; + + if (q->isVisible()) { + q->setFixedHeight(content->sizeHint().height()); + } + q->updateGeometry(); +} + +void KMessageWidgetPrivate::updateLayout() +{ + if (content->layout()) { + createLayout(); + } +} + +void KMessageWidgetPrivate::updateSnapShot() +{ + // Attention: updateSnapShot calls QWidget::render(), which causes the whole + // window layouts to be activated. Calling this method from resizeEvent() + // can lead to infinite recursion, see: + // https://bugs.kde.org/show_bug.cgi?id=311336 + contentSnapShot = QPixmap(content->size() * q->devicePixelRatio()); + contentSnapShot.setDevicePixelRatio(q->devicePixelRatio()); + contentSnapShot.fill(Qt::transparent); + content->render(&contentSnapShot, QPoint(), QRegion(), QWidget::DrawChildren); +} + +void KMessageWidgetPrivate::slotTimeLineChanged(qreal value) +{ + q->setFixedHeight(qMin(value * 2, qreal(1.0)) * content->height()); + q->update(); +} + +void KMessageWidgetPrivate::slotTimeLineFinished() +{ + if (timeLine->direction() == QTimeLine::Forward) { + // Show + // We set the whole geometry here, because it may be wrong if a + // KMessageWidget is shown right when the toplevel window is created. + content->setGeometry(0, 0, q->width(), bestContentHeight()); + + // notify about finished animation + emit q->showAnimationFinished(); + } else { + // hide and notify about finished animation + q->hide(); + emit q->hideAnimationFinished(); + } +} + +int KMessageWidgetPrivate::bestContentHeight() const +{ + int height = content->heightForWidth(q->width()); + if (height == -1) { + height = content->sizeHint().height(); + } + return height; +} + +//--------------------------------------------------------------------- +// KMessageWidget +//--------------------------------------------------------------------- +KMessageWidget::KMessageWidget(QWidget *parent) +: QFrame(parent) +, d(new KMessageWidgetPrivate) +{ + d->init(this); +} + +KMessageWidget::KMessageWidget(const QString &text, QWidget *parent) +: QFrame(parent) +, d(new KMessageWidgetPrivate) +{ + d->init(this); + setText(text); +} + +KMessageWidget::~KMessageWidget() +{ + delete d; +} + +QString KMessageWidget::text() const +{ + return d->textLabel->text(); +} + +void KMessageWidget::setText(const QString &text) +{ + d->textLabel->setText(text); + updateGeometry(); +} + +KMessageWidget::MessageType KMessageWidget::messageType() const +{ + return d->messageType; +} + +static QColor darkShade(QColor c) +{ + qreal contrast = 0.7; // taken from kcolorscheme for the dark shade + + qreal darkAmount; + if (c.lightnessF() < 0.006) { /* too dark */ + darkAmount = 0.02 + 0.40 * contrast; + } else if (c.lightnessF() > 0.93) { /* too bright */ + darkAmount = -0.06 - 0.60 * contrast; + } else { + darkAmount = (-c.lightnessF()) * (0.55 + contrast * 0.35); + } + + qreal v = c.lightnessF() + darkAmount; + v = v > 0.0 ? (v < 1.0 ? v : 1.0) : 0.0; + c.setHsvF(c.hslHueF(), c.hslSaturationF(), v); + return c; +} + +void KMessageWidget::setMessageType(KMessageWidget::MessageType type) +{ + d->messageType = type; + QColor bg0, bg1, bg2, border, fg; + switch (type) { + case Positive: + bg1.setRgb(0, 110, 40); // values taken from kcolorscheme.cpp (Positive) + break; + case Information: + bg1 = palette().highlight().color(); + break; + case Warning: + bg1.setRgb(176, 128, 0); // values taken from kcolorscheme.cpp (Neutral) + break; + case Error: + bg1.setRgb(191, 3, 3); // values taken from kcolorscheme.cpp (Negative) + break; + } + + // Colors + fg = palette().highlightedText().color(); + bg0 = bg1.lighter(110); + bg2 = bg1.darker(110); + border = darkShade(bg1); + + d->content->setStyleSheet( + QString(QLatin1String(".QFrame {" + "background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1," + " stop: 0 %1," + " stop: 0.1 %2," + " stop: 1.0 %3);" + "border-radius: 5px;" + "border: 1px solid %4;" + "margin: %5px;" + "}" + ".QLabel { color: %6; }" + )) + .arg(bg0.name()) + .arg(bg1.name()) + .arg(bg2.name()) + .arg(border.name()) + // DefaultFrameWidth returns the size of the external margin + border width. We know our border is 1px, so we subtract this from the frame normal QStyle FrameWidth to get our margin + .arg(style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, this) - 1) + .arg(fg.name()) + ); +} + +QSize KMessageWidget::sizeHint() const +{ + ensurePolished(); + return d->content->sizeHint(); +} + +QSize KMessageWidget::minimumSizeHint() const +{ + ensurePolished(); + return d->content->minimumSizeHint(); +} + +bool KMessageWidget::event(QEvent *event) +{ + if (event->type() == QEvent::Polish && !d->content->layout()) { + d->createLayout(); + } + return QFrame::event(event); +} + +void KMessageWidget::resizeEvent(QResizeEvent *event) +{ + QFrame::resizeEvent(event); + + if (d->timeLine->state() == QTimeLine::NotRunning) { + d->content->resize(width(), d->bestContentHeight()); + } +} + +int KMessageWidget::heightForWidth(int width) const +{ + ensurePolished(); + return d->content->heightForWidth(width); +} + +void KMessageWidget::paintEvent(QPaintEvent *event) +{ + QFrame::paintEvent(event); + if (d->timeLine->state() == QTimeLine::Running) { + QPainter painter(this); + painter.setOpacity(d->timeLine->currentValue() * d->timeLine->currentValue()); + painter.drawPixmap(0, 0, d->contentSnapShot); + } +} + +bool KMessageWidget::wordWrap() const +{ + return d->wordWrap; +} + +void KMessageWidget::setWordWrap(bool wordWrap) +{ + d->wordWrap = wordWrap; + d->textLabel->setWordWrap(wordWrap); + QSizePolicy policy = sizePolicy(); + policy.setHeightForWidth(wordWrap); + setSizePolicy(policy); + d->updateLayout(); + // Without this, when user does wordWrap -> !wordWrap -> wordWrap, a minimum + // height is set, causing the widget to be too high. + // Mostly visible in test programs. + if (wordWrap) { + setMinimumHeight(0); + } +} + +bool KMessageWidget::isCloseButtonVisible() const +{ + return d->closeButton->isVisible(); +} + +void KMessageWidget::setCloseButtonVisible(bool show) +{ + d->closeButton->setVisible(show); + updateGeometry(); +} + +void KMessageWidget::addAction(QAction *action) +{ + QFrame::addAction(action); + d->updateLayout(); +} + +void KMessageWidget::removeAction(QAction *action) +{ + QFrame::removeAction(action); + d->updateLayout(); +} + +void KMessageWidget::animatedShow() +{ + if (!style()->styleHint(QStyle::SH_Widget_Animate, 0, this)) { + show(); + emit showAnimationFinished(); + return; + } + + if (isVisible()) { + return; + } + + QFrame::show(); + setFixedHeight(0); + int wantedHeight = d->bestContentHeight(); + d->content->setGeometry(0, -wantedHeight, width(), wantedHeight); + + d->updateSnapShot(); + + d->timeLine->setDirection(QTimeLine::Forward); + if (d->timeLine->state() == QTimeLine::NotRunning) { + d->timeLine->start(); + } +} + +void KMessageWidget::animatedHide() +{ + if (!style()->styleHint(QStyle::SH_Widget_Animate, 0, this)) { + hide(); + emit hideAnimationFinished(); + return; + } + + if (!isVisible()) { + hide(); + return; + } + + d->content->move(0, -d->content->height()); + d->updateSnapShot(); + + d->timeLine->setDirection(QTimeLine::Backward); + if (d->timeLine->state() == QTimeLine::NotRunning) { + d->timeLine->start(); + } +} + +bool KMessageWidget::isHideAnimationRunning() const +{ + return (d->timeLine->direction() == QTimeLine::Backward) + && (d->timeLine->state() == QTimeLine::Running); +} + +bool KMessageWidget::isShowAnimationRunning() const +{ + return (d->timeLine->direction() == QTimeLine::Forward) + && (d->timeLine->state() == QTimeLine::Running); +} + +QIcon KMessageWidget::icon() const +{ + return d->icon; +} + +void KMessageWidget::setIcon(const QIcon &icon) +{ + d->icon = icon; + if (d->icon.isNull()) { + d->iconLabel->hide(); + } else { + const int size = style()->pixelMetric(QStyle::PM_ToolBarIconSize); + d->iconLabel->setPixmap(d->icon.pixmap(size)); + d->iconLabel->show(); + } +} + +#include "moc_KMessageWidget.cpp" diff --git a/src/gui/KMessageWidget.h b/src/gui/KMessageWidget.h new file mode 100644 index 000000000..4398e0f99 --- /dev/null +++ b/src/gui/KMessageWidget.h @@ -0,0 +1,342 @@ +/* This file is part of the KDE libraries + * + * Copyright (c) 2011 Aurélien Gâteau + * Copyright (c) 2014 Dominik Haumann + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA + */ +#ifndef KMESSAGEWIDGET_H +#define KMESSAGEWIDGET_H + +#include + +class KMessageWidgetPrivate; + +/** + * @short A widget to provide feedback or propose opportunistic interactions. + * + * KMessageWidget can be used to provide inline positive or negative + * feedback, or to implement opportunistic interactions. + * + * As a feedback widget, KMessageWidget provides a less intrusive alternative + * to "OK Only" message boxes. If you want to avoid a modal KMessageBox, + * consider using KMessageWidget instead. + * + * Examples of KMessageWidget look as follows, all of them having an icon set + * with setIcon(), and the first three show a close button: + * + * \image html kmessagewidget.png "KMessageWidget with different message types" + * + * Negative feedback + * + * The KMessageWidget can be used as a secondary indicator of failure: the + * first indicator is usually the fact the action the user expected to happen + * did not happen. + * + * Example: User fills a form, clicks "Submit". + * + * @li Expected feedback: form closes + * @li First indicator of failure: form stays there + * @li Second indicator of failure: a KMessageWidget appears on top of the + * form, explaining the error condition + * + * When used to provide negative feedback, KMessageWidget should be placed + * close to its context. In the case of a form, it should appear on top of the + * form entries. + * + * KMessageWidget should get inserted in the existing layout. Space should not + * be reserved for it, otherwise it becomes "dead space", ignored by the user. + * KMessageWidget should also not appear as an overlay to prevent blocking + * access to elements the user needs to interact with to fix the failure. + * + * Positive feedback + * + * KMessageWidget can be used for positive feedback but it shouldn't be + * overused. It is often enough to provide feedback by simply showing the + * results of an action. + * + * Examples of acceptable uses: + * + * @li Confirm success of "critical" transactions + * @li Indicate completion of background tasks + * + * Example of unadapted uses: + * + * @li Indicate successful saving of a file + * @li Indicate a file has been successfully removed + * + * Opportunistic interaction + * + * Opportunistic interaction is the situation where the application suggests to + * the user an action he could be interested in perform, either based on an + * action the user just triggered or an event which the application noticed. + * + * Example of acceptable uses: + * + * @li A browser can propose remembering a recently entered password + * @li A music collection can propose ripping a CD which just got inserted + * @li A chat application may notify the user a "special friend" just connected + * + * @author Aurélien Gâteau + * @since 4.7 + */ +class KMessageWidget : public QFrame +{ + Q_OBJECT + Q_ENUMS(MessageType) + + Q_PROPERTY(QString text READ text WRITE setText) + Q_PROPERTY(bool wordWrap READ wordWrap WRITE setWordWrap) + Q_PROPERTY(bool closeButtonVisible READ isCloseButtonVisible WRITE setCloseButtonVisible) + Q_PROPERTY(MessageType messageType READ messageType WRITE setMessageType) + Q_PROPERTY(QIcon icon READ icon WRITE setIcon) +public: + + /** + * Available message types. + * The background colors are chosen depending on the message type. + */ + enum MessageType { + Positive, + Information, + Warning, + Error + }; + + /** + * Constructs a KMessageWidget with the specified @p parent. + */ + explicit KMessageWidget(QWidget *parent = 0); + + /** + * Constructs a KMessageWidget with the specified @p parent and + * contents @p text. + */ + explicit KMessageWidget(const QString &text, QWidget *parent = 0); + + /** + * Destructor. + */ + ~KMessageWidget(); + + /** + * Get the text of this message widget. + * @see setText() + */ + QString text() const; + + /** + * Check whether word wrap is enabled. + * + * If word wrap is enabled, the message widget wraps the displayed text + * as required to the available width of the widget. This is useful to + * avoid breaking widget layouts. + * + * @see setWordWrap() + */ + bool wordWrap() const; + + /** + * Check whether the close button is visible. + * + * @see setCloseButtonVisible() + */ + bool isCloseButtonVisible() const; + + /** + * Get the type of this message. + * By default, the type is set to KMessageWidget::Information. + * + * @see KMessageWidget::MessageType, setMessageType() + */ + MessageType messageType() const; + + /** + * Add @p action to the message widget. + * For each action a button is added to the message widget in the + * order the actions were added. + * + * @param action the action to add + * @see removeAction(), QWidget::actions() + */ + void addAction(QAction *action); + + /** + * Remove @p action from the message widget. + * + * @param action the action to remove + * @see KMessageWidget::MessageType, addAction(), setMessageType() + */ + void removeAction(QAction *action); + + /** + * Returns the preferred size of the message widget. + */ + QSize sizeHint() const Q_DECL_OVERRIDE; + + /** + * Returns the minimum size of the message widget. + */ + QSize minimumSizeHint() const Q_DECL_OVERRIDE; + + /** + * Returns the required height for @p width. + * @param width the width in pixels + */ + int heightForWidth(int width) const Q_DECL_OVERRIDE; + + /** + * The icon shown on the left of the text. By default, no icon is shown. + * @since 4.11 + */ + QIcon icon() const; + + /** + * Check whether the hide animation started by calling animatedHide() + * is still running. If animations are disabled, this function always + * returns @e false. + * + * @see animatedHide(), hideAnimationFinished() + * @since 5.0 + */ + bool isHideAnimationRunning() const; + + /** + * Check whether the show animation started by calling animatedShow() + * is still running. If animations are disabled, this function always + * returns @e false. + * + * @see animatedShow(), showAnimationFinished() + * @since 5.0 + */ + bool isShowAnimationRunning() const; + +public Q_SLOTS: + /** + * Set the text of the message widget to @p text. + * If the message widget is already visible, the text changes on the fly. + * + * @param text the text to display, rich text is allowed + * @see text() + */ + void setText(const QString &text); + + /** + * Set word wrap to @p wordWrap. If word wrap is enabled, the text() + * of the message widget is wrapped to fit the available width. + * If word wrap is disabled, the message widget's minimum size is + * such that the entire text fits. + * + * @param wordWrap disable/enable word wrap + * @see wordWrap() + */ + void setWordWrap(bool wordWrap); + + /** + * Set the visibility of the close button. If @p visible is @e true, + * a close button is shown that calls animatedHide() if clicked. + * + * @see closeButtonVisible(), animatedHide() + */ + void setCloseButtonVisible(bool visible); + + /** + * Set the message type to @p type. + * By default, the message type is set to KMessageWidget::Information. + * + * @see messageType(), KMessageWidget::MessageType + */ + void setMessageType(KMessageWidget::MessageType type); + + /** + * Show the widget using an animation. + */ + void animatedShow(); + + /** + * Hide the widget using an animation. + */ + void animatedHide(); + + /** + * Define an icon to be shown on the left of the text + * @since 4.11 + */ + void setIcon(const QIcon &icon); + +Q_SIGNALS: + /** + * This signal is emitted when the user clicks a link in the text label. + * The URL referred to by the href anchor is passed in contents. + * @param contents text of the href anchor + * @see QLabel::linkActivated() + * @since 4.10 + */ + void linkActivated(const QString &contents); + + /** + * This signal is emitted when the user hovers over a link in the text label. + * The URL referred to by the href anchor is passed in contents. + * @param contents text of the href anchor + * @see QLabel::linkHovered() + * @since 4.11 + */ + void linkHovered(const QString &contents); + + /** + * This signal is emitted when the hide animation is finished, started by + * calling animatedHide(). If animations are disabled, this signal is + * emitted immediately after the message widget got hidden. + * + * @note This signal is @e not emitted if the widget was hidden by + * calling hide(), so this signal is only useful in conjunction + * with animatedHide(). + * + * @see animatedHide() + * @since 5.0 + */ + void hideAnimationFinished(); + + /** + * This signal is emitted when the show animation is finished, started by + * calling animatedShow(). If animations are disabled, this signal is + * emitted immediately after the message widget got shown. + * + * @note This signal is @e not emitted if the widget was shown by + * calling show(), so this signal is only useful in conjunction + * with animatedShow(). + * + * @see animatedShow() + * @since 5.0 + */ + void showAnimationFinished(); + +protected: + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + + bool event(QEvent *event) Q_DECL_OVERRIDE; + + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + +private: + KMessageWidgetPrivate *const d; + friend class KMessageWidgetPrivate; + + Q_PRIVATE_SLOT(d, void slotTimeLineChanged(qreal)) + Q_PRIVATE_SLOT(d, void slotTimeLineFinished()) +}; + +#endif /* KMESSAGEWIDGET_H */ diff --git a/src/gui/KeePass1OpenWidget.cpp b/src/gui/KeePass1OpenWidget.cpp index 4f70a9787..b63bbc485 100644 --- a/src/gui/KeePass1OpenWidget.cpp +++ b/src/gui/KeePass1OpenWidget.cpp @@ -49,8 +49,8 @@ void KeePass1OpenWidget::openDatabase() QFile file(m_filename); if (!file.open(QIODevice::ReadOnly)) { - MessageBox::warning(this, tr("Error"), tr("Unable to open the database.").append("\n") - .append(file.errorString())); + m_ui->messageWidget->showMessage( tr("Unable to open the database.").append("\n") + .append(file.errorString()), MessageWidget::Error); return; } if (m_db) { @@ -65,8 +65,9 @@ void KeePass1OpenWidget::openDatabase() Q_EMIT editFinished(true); } else { - MessageBox::warning(this, tr("Error"), tr("Unable to open the database.").append("\n") - .append(reader.errorString())); + m_ui->messageWidget->showMessage(tr("Unable to open the database.").append("\n") + .append(reader.errorString()), MessageWidget::Error); + m_ui->editPassword->clear(); } } diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index cc94ca9a9..2f3d7083b 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -104,6 +104,7 @@ MainWindow::MainWindow() #endif setWindowIcon(filePath()->applicationIcon()); + m_ui->globalMessageWidget->setHidden(true); QAction* toggleViewAction = m_ui->toolBar->toggleViewAction(); toggleViewAction->setText(tr("Show toolbar")); m_ui->menuView->addAction(toggleViewAction); @@ -137,13 +138,14 @@ MainWindow::MainWindow() this, SLOT(lockDatabasesAfterInactivity())); applySettingsChanges(); + setShortcut(m_ui->actionDatabaseNew, QKeySequence::New, Qt::CTRL + Qt::Key_N); setShortcut(m_ui->actionDatabaseOpen, QKeySequence::Open, Qt::CTRL + Qt::Key_O); setShortcut(m_ui->actionDatabaseSave, QKeySequence::Save, Qt::CTRL + Qt::Key_S); setShortcut(m_ui->actionDatabaseSaveAs, QKeySequence::SaveAs); setShortcut(m_ui->actionDatabaseClose, QKeySequence::Close, Qt::CTRL + Qt::Key_W); m_ui->actionLockDatabases->setShortcut(Qt::CTRL + Qt::Key_L); setShortcut(m_ui->actionQuit, QKeySequence::Quit, Qt::CTRL + Qt::Key_Q); - m_ui->actionEntryNew->setShortcut(Qt::CTRL + Qt::Key_N); + m_ui->actionEntryNew->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_N); m_ui->actionEntryEdit->setShortcut(Qt::CTRL + Qt::Key_E); m_ui->actionEntryDelete->setShortcut(Qt::CTRL + Qt::Key_D); m_ui->actionEntryClone->setShortcut(Qt::CTRL + Qt::Key_K); @@ -275,8 +277,18 @@ MainWindow::MainWindow() connect(m_ui->actionPasswordGenerator, SIGNAL(toggled(bool)), SLOT(switchToPasswordGen(bool))); connect(m_ui->passwordGeneratorWidget, SIGNAL(dialogTerminated()), SLOT(closePasswordGen())); + connect(m_ui->welcomeWidget, SIGNAL(newDatabase()), SLOT(switchToNewDatabase())); + connect(m_ui->welcomeWidget, SIGNAL(openDatabase()), SLOT(switchToOpenDatabase())); + connect(m_ui->welcomeWidget, SIGNAL(openDatabaseFile(QString)), SLOT(switchToDatabaseFile(QString))); + connect(m_ui->welcomeWidget, SIGNAL(importKeePass1Database()), SLOT(switchToKeePass1Database())); + connect(m_ui->actionAbout, SIGNAL(triggered()), SLOT(showAboutDialog())); + connect(m_ui->tabWidget, SIGNAL(messageGlobal(QString,MessageWidget::MessageType)), this, SLOT(displayGlobalMessage(QString, MessageWidget::MessageType))); + connect(m_ui->tabWidget, SIGNAL(messageDismissGlobal()), this, SLOT(hideGlobalMessage())); + connect(m_ui->tabWidget, SIGNAL(messageTab(QString,MessageWidget::MessageType)), this, SLOT(displayTabMessage(QString, MessageWidget::MessageType))); + connect(m_ui->tabWidget, SIGNAL(messageDismissTab()), this, SLOT(hideTabMessage())); + updateTrayIcon(); } @@ -364,7 +376,7 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode) bool groupSelected = dbWidget->isGroupSelected(); m_ui->actionEntryNew->setEnabled(!inSearch); - m_ui->actionEntryClone->setEnabled(singleEntrySelected && !inSearch); + m_ui->actionEntryClone->setEnabled(singleEntrySelected); m_ui->actionEntryEdit->setEnabled(singleEntrySelected); m_ui->actionEntryDelete->setEnabled(entriesSelected); m_ui->actionEntryCopyTitle->setEnabled(singleEntrySelected && dbWidget->currentEntryHasTitle()); @@ -530,6 +542,30 @@ void MainWindow::closePasswordGen() switchToPasswordGen(false); } +void MainWindow::switchToNewDatabase() +{ + m_ui->tabWidget->newDatabase(); + switchToDatabases(); +} + +void MainWindow::switchToOpenDatabase() +{ + m_ui->tabWidget->openDatabase(); + switchToDatabases(); +} + +void MainWindow::switchToDatabaseFile(QString file) +{ + m_ui->tabWidget->openDatabase(file); + switchToDatabases(); +} + +void MainWindow::switchToKeePass1Database() +{ + m_ui->tabWidget->importKeePass1Database(); + switchToDatabases(); +} + void MainWindow::databaseStatusChanged(DatabaseWidget *) { updateTrayIcon(); @@ -755,7 +791,7 @@ void MainWindow::repairDatabase() if (fileName.isEmpty()) { return; } - + QScopedPointer dialog(new QDialog(this)); DatabaseRepairWidget* dbRepairWidget = new DatabaseRepairWidget(dialog.data()); connect(dbRepairWidget, SIGNAL(success()), dialog.data(), SLOT(accept())); @@ -770,8 +806,9 @@ void MainWindow::repairDatabase() KeePass2Writer writer; writer.writeDatabase(saveFileName, dbRepairWidget->database()); if (writer.hasError()) { - QMessageBox::critical(this, tr("Error"), - tr("Writing the database failed.").append("\n\n").append(writer.errorString())); + displayGlobalMessage( + tr("Writing the database failed.").append("\n").append(writer.errorString()), + MessageWidget::Error); } } } @@ -787,3 +824,26 @@ bool MainWindow::isTrayIconEnabled() const && QSystemTrayIcon::isSystemTrayAvailable(); #endif } + +void MainWindow::displayGlobalMessage(const QString& text, MessageWidget::MessageType type) +{ + m_ui->globalMessageWidget->showMessage(text, type); +} + +void MainWindow::displayTabMessage(const QString& text, MessageWidget::MessageType type) +{ + m_ui->tabWidget->currentDatabaseWidget()->showMessage(text, type); +} + +void MainWindow::hideGlobalMessage() +{ + m_ui->globalMessageWidget->hideMessage(); +} + +void MainWindow::hideTabMessage() +{ + if (m_ui->stackedWidget->currentIndex() == 0) { + m_ui->tabWidget->currentDatabaseWidget()->hideMessage(); + } +} + diff --git a/src/gui/MainWindow.h b/src/gui/MainWindow.h index cf2c9cd96..694b38e7a 100644 --- a/src/gui/MainWindow.h +++ b/src/gui/MainWindow.h @@ -42,6 +42,7 @@ public: public Q_SLOTS: void openDatabase(const QString& fileName, const QString& pw = QString(), const QString& keyFile = QString()); + void appExit(); protected: void closeEvent(QCloseEvent* event) override; @@ -54,6 +55,10 @@ private Q_SLOTS: void switchToDatabases(); void switchToSettings(); void switchToPasswordGen(bool enabled); + void switchToNewDatabase(); + void switchToOpenDatabase(); + void switchToDatabaseFile(QString file); + void switchToKeePass1Database(); void closePasswordGen(); void databaseStatusChanged(DatabaseWidget *dbWidget); void databaseTabChanged(int tabIndex); @@ -68,9 +73,12 @@ private Q_SLOTS: void applySettingsChanges(); void trayIconTriggered(QSystemTrayIcon::ActivationReason reason); void toggleWindow(); - void appExit(); void lockDatabasesAfterInactivity(); void repairDatabase(); + void displayGlobalMessage(const QString& text, MessageWidget::MessageType type); + void displayTabMessage(const QString& text, MessageWidget::MessageType type); + void hideGlobalMessage(); + void hideTabMessage(); private: static void setShortcut(QAction* action, QKeySequence::StandardKey standard, int fallback = 0); diff --git a/src/gui/MainWindow.ui b/src/gui/MainWindow.ui index 05b80caa2..6e3ecf684 100644 --- a/src/gui/MainWindow.ui +++ b/src/gui/MainWindow.ui @@ -2,6 +2,9 @@ MainWindow + + true + 0 @@ -14,6 +17,9 @@ KeePassXC + + true + 0 @@ -27,8 +33,24 @@ 0 + + + + + 0 + 0 + + + + + + + 0 + 0 + + 2 @@ -83,7 +105,45 @@ - + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 50 + 20 + + + + + + + horizontalSpacer_2 + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 50 + 20 + + + + + @@ -104,7 +164,7 @@ 0 0 800 - 26 + 29 @@ -155,15 +215,15 @@ - - - - + + + + @@ -203,6 +263,7 @@ false + @@ -254,9 +315,9 @@ - - Merge from KeePassX database - + + Merge from KeePassX database + @@ -452,6 +513,12 @@ + + MessageWidget + QWidget +
gui/MessageWidget.h
+ 1 +
DatabaseTabWidget QTabWidget diff --git a/src/gui/MessageWidget.cpp b/src/gui/MessageWidget.cpp new file mode 100644 index 000000000..9360a6e62 --- /dev/null +++ b/src/gui/MessageWidget.cpp @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2015 Pedro Alves + * + * 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 or (at your option) + * version 3 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, see . + */ + +#include "MessageWidget.h" + +MessageWidget::MessageWidget(QWidget* parent) + :KMessageWidget(parent) +{ + +} + +void MessageWidget::showMessage(const QString& text, MessageWidget::MessageType type) +{ + setMessageType(type); + setText(text); + animatedShow(); +} + +void MessageWidget::hideMessage() +{ + animatedHide(); +} diff --git a/src/gui/MessageWidget.h b/src/gui/MessageWidget.h new file mode 100644 index 000000000..34c06743c --- /dev/null +++ b/src/gui/MessageWidget.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2015 Pedro Alves + * + * 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 or (at your option) + * version 3 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, see . + */ + +#ifndef MESSAGEWIDGET_H +#define MESSAGEWIDGET_H + +#include "gui/KMessageWidget.h" + +class MessageWidget : public KMessageWidget +{ + Q_OBJECT + +public: + explicit MessageWidget(QWidget* parent = 0); + +public Q_SLOTS: + void showMessage(const QString& text, MessageWidget::MessageType type); + void hideMessage(); + +}; + +#endif // MESSAGEWIDGET_H diff --git a/src/gui/PasswordGeneratorWidget.cpp b/src/gui/PasswordGeneratorWidget.cpp index 6495d83a2..4a4b438e3 100644 --- a/src/gui/PasswordGeneratorWidget.cpp +++ b/src/gui/PasswordGeneratorWidget.cpp @@ -45,11 +45,15 @@ PasswordGeneratorWidget::PasswordGeneratorWidget(QWidget* parent) connect(m_ui->optionButtons, SIGNAL(buttonClicked(int)), SLOT(updateGenerator())); - // set font size of password quality and entropy labels dynamically to 80% of the default font size + // set font size of password quality and entropy labels dynamically to 80% of + // the default font size, but make it no smaller than 8pt QFont defaultFont; - defaultFont.setPointSize(static_cast(defaultFont.pointSize() * 0.8f)); - m_ui->entropyLabel->setFont(defaultFont); - m_ui->strengthLabel->setFont(defaultFont); + int smallerSize = static_cast(defaultFont.pointSize() * 0.8f); + if (smallerSize >= 8) { + defaultFont.setPointSize(smallerSize); + m_ui->entropyLabel->setFont(defaultFont); + m_ui->strengthLabel->setFont(defaultFont); + } loadSettings(); reset(); @@ -132,8 +136,10 @@ void PasswordGeneratorWidget::updatePasswordStrength(const QString& password) void PasswordGeneratorWidget::generatePassword() { - QString password = m_generator->generatePassword(); - m_ui->editNewPassword->setText(password); + if (m_generator->isValid()) { + QString password = m_generator->generatePassword(); + m_ui->editNewPassword->setText(password); + } } void PasswordGeneratorWidget::applyPassword() @@ -279,5 +285,11 @@ void PasswordGeneratorWidget::updateGenerator() m_generator->setCharClasses(classes); m_generator->setFlags(flags); + if (m_generator->isValid()) { + m_ui->buttonGenerate->setEnabled(true); + } else { + m_ui->buttonGenerate->setEnabled(false); + } + regeneratePassword(); } diff --git a/src/gui/PasswordGeneratorWidget.ui b/src/gui/PasswordGeneratorWidget.ui index a2e798abf..b7413f56b 100644 --- a/src/gui/PasswordGeneratorWidget.ui +++ b/src/gui/PasswordGeneratorWidget.ui @@ -104,11 +104,6 @@ QProgressBar::chunk { 30 - - - 8 - - strength @@ -144,11 +139,6 @@ QProgressBar::chunk { 0 - - - 8 - - entropy @@ -295,6 +285,12 @@ QProgressBar::chunk { + + + 0 + 26 + + Qt::StrongFocus @@ -314,6 +310,12 @@ QProgressBar::chunk { + + + 0 + 26 + + Qt::StrongFocus diff --git a/src/gui/SearchWidget.cpp b/src/gui/SearchWidget.cpp index 5edf17cdd..933686dfa 100644 --- a/src/gui/SearchWidget.cpp +++ b/src/gui/SearchWidget.cpp @@ -34,12 +34,14 @@ SearchWidget::SearchWidget(QWidget *parent) m_searchTimer->setSingleShot(true); connect(m_ui->searchEdit, SIGNAL(textChanged(QString)), SLOT(startSearchTimer())); - connect(m_ui->searchEdit, SIGNAL(returnPressed()), SLOT(startSearch())); - connect(m_ui->searchIcon, SIGNAL(triggered(QAction*)), m_ui->searchEdit, SLOT(setFocus())); + connect(m_ui->searchIcon, SIGNAL(pressed()), m_ui->searchEdit, SLOT(setFocus())); + connect(m_ui->clearIcon, SIGNAL(pressed()), m_ui->searchEdit, SLOT(clear())); + connect(m_ui->clearIcon, SIGNAL(pressed()), m_ui->searchEdit, SLOT(setFocus())); connect(m_searchTimer, SIGNAL(timeout()), this, SLOT(startSearch())); connect(this, SIGNAL(escapePressed()), m_ui->searchEdit, SLOT(clear())); - new QShortcut(Qt::CTRL + Qt::Key_F, m_ui->searchEdit, SLOT(setFocus()), nullptr, Qt::ApplicationShortcut); + new QShortcut(Qt::CTRL + Qt::Key_F, this, SLOT(searchFocus()), nullptr, Qt::ApplicationShortcut); + new QShortcut(Qt::Key_Escape, m_ui->searchEdit, SLOT(clear()), nullptr, Qt::ApplicationShortcut); m_ui->searchEdit->installEventFilter(this); @@ -51,6 +53,9 @@ SearchWidget::SearchWidget(QWidget *parent) m_ui->searchIcon->setIcon(filePath()->icon("actions", "system-search")); m_ui->searchIcon->setMenu(searchMenu); m_ui->searchIcon->setPopupMode(QToolButton::MenuButtonPopup); + + m_ui->clearIcon->setIcon(filePath()->icon("actions", "edit-clear-locationbar-rtl")); + m_ui->clearIcon->setEnabled(false); } SearchWidget::~SearchWidget() @@ -67,23 +72,24 @@ bool SearchWidget::eventFilter(QObject *obj, QEvent *event) return true; } else if (keyEvent->matches(QKeySequence::Copy)) { - // If Control+C is pressed in the search edit when no - // text is selected, copy the password of the current - // entry. + // If Control+C is pressed in the search edit when no text + // is selected, copy the password of the current entry if (!m_ui->searchEdit->hasSelectedText()) { emit copyPressed(); return true; } } else if (keyEvent->matches(QKeySequence::MoveToNextLine)) { - // If Down is pressed at EOL in the search edit, move - // the focus to the entry view. - QLineEdit* searchEdit = m_ui->searchEdit; - if (!searchEdit->hasSelectedText() && - searchEdit->cursorPosition() == searchEdit->text().length()) { + if (m_ui->searchEdit->cursorPosition() == m_ui->searchEdit->text().length()) { + // If down is pressed at EOL, move the focus to the entry view emit downPressed(); return true; } + else { + // Otherwise move the cursor to EOL + m_ui->searchEdit->setCursorPosition(m_ui->searchEdit->text().length()); + return true; + } } } @@ -96,6 +102,7 @@ void SearchWidget::connectSignals(SignalMultiplexer& mx) mx.connect(this, SIGNAL(caseSensitiveChanged(bool)), SLOT(setSearchCaseSensitive(bool))); mx.connect(this, SIGNAL(copyPressed()), SLOT(copyPassword())); mx.connect(this, SIGNAL(downPressed()), SLOT(setFocus())); + mx.connect(m_ui->searchEdit, SIGNAL(returnPressed()), SLOT(switchToEntryEdit())); } void SearchWidget::databaseChanged(DatabaseWidget *dbWidget) @@ -125,6 +132,9 @@ void SearchWidget::startSearch() m_searchTimer->stop(); } + bool hasText = m_ui->searchEdit->text().length() > 0; + m_ui->clearIcon->setEnabled(hasText); + search(m_ui->searchEdit->text()); } @@ -138,3 +148,9 @@ void SearchWidget::setCaseSensitive(bool state) m_actionCaseSensitive->setChecked(state); updateCaseSensitive(); } + +void SearchWidget::searchFocus() +{ + m_ui->searchEdit->setFocus(); + m_ui->searchEdit->selectAll(); +} diff --git a/src/gui/SearchWidget.h b/src/gui/SearchWidget.h index 01f9e5365..d2b94d979 100644 --- a/src/gui/SearchWidget.h +++ b/src/gui/SearchWidget.h @@ -48,6 +48,7 @@ signals: void escapePressed(); void copyPressed(); void downPressed(); + void enterPressed(); public slots: void databaseChanged(DatabaseWidget* dbWidget); @@ -56,6 +57,7 @@ private slots: void startSearchTimer(); void startSearch(); void updateCaseSensitive(); + void searchFocus(); private: const QScopedPointer m_ui; diff --git a/src/gui/SearchWidget.ui b/src/gui/SearchWidget.ui index 3959582cf..46c2699f0 100644 --- a/src/gui/SearchWidget.ui +++ b/src/gui/SearchWidget.ui @@ -10,45 +10,69 @@ 34 - + + + 0 + 0 + + + - 0 + 3 0 - 0 + 7 0 - - - - - - Qt::ClickFocus - - - Qt::ToolButtonIconOnly - - - true - - - - - - - Find: - - - - + + + + Qt::ClickFocus + + + Search + + + Qt::ToolButtonIconOnly + + + true + + - - + + + + padding:3px + + + Find + + + false + + + + + + + Qt::ClickFocus + + + Clear + + + Qt::ToolButtonIconOnly + + + true + + diff --git a/src/gui/WelcomeWidget.cpp b/src/gui/WelcomeWidget.cpp index 842546ecc..cb7a1de2e 100644 --- a/src/gui/WelcomeWidget.cpp +++ b/src/gui/WelcomeWidget.cpp @@ -18,13 +18,51 @@ #include "WelcomeWidget.h" #include "ui_WelcomeWidget.h" +#include "config-keepassx.h" +#include "core/FilePath.h" +#include "core/Config.h" + WelcomeWidget::WelcomeWidget(QWidget* parent) : QWidget(parent) , m_ui(new Ui::WelcomeWidget()) { m_ui->setupUi(this); + + m_ui->welcomeLabel->setText(m_ui->welcomeLabel->text() + " " + KEEPASSX_VERSION); + QFont welcomeLabelFont = m_ui->welcomeLabel->font(); + welcomeLabelFont.setBold(true); + welcomeLabelFont.setPointSize(welcomeLabelFont.pointSize() + 4); + m_ui->welcomeLabel->setFont(welcomeLabelFont); + + m_ui->iconLabel->setPixmap(filePath()->applicationIcon().pixmap(64)); + + m_ui->recentListWidget->clear(); + const QStringList lastDatabases = config()->get("LastDatabases", QVariant()).toStringList(); + for (const QString& database : lastDatabases) { + QListWidgetItem *itm = new QListWidgetItem; + itm->setText(database); + m_ui->recentListWidget->addItem(itm); + } + bool recent_visibility = (m_ui->recentListWidget->count() > 0); + m_ui->startLabel->setVisible(!recent_visibility); + m_ui->recentListWidget->setVisible(recent_visibility); + m_ui->recentLabel->setVisible(recent_visibility); + + connect(m_ui->buttonNewDatabase, SIGNAL(clicked()), SIGNAL(newDatabase())); + connect(m_ui->buttonOpenDatabase, SIGNAL(clicked()), SIGNAL(openDatabase())); + connect(m_ui->buttonImportKeePass1, SIGNAL(clicked()), SIGNAL(importKeePass1Database())); + connect(m_ui->recentListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, + SLOT(openDatabaseFromFile(QListWidgetItem*))); } WelcomeWidget::~WelcomeWidget() { } + +void WelcomeWidget::openDatabaseFromFile(QListWidgetItem* item) +{ + if (item->text().isEmpty()) { + return; + } + Q_EMIT openDatabaseFile(item->text()); +} \ No newline at end of file diff --git a/src/gui/WelcomeWidget.h b/src/gui/WelcomeWidget.h index 80a0dde1c..dbd0d2e27 100644 --- a/src/gui/WelcomeWidget.h +++ b/src/gui/WelcomeWidget.h @@ -19,6 +19,7 @@ #define KEEPASSX_WELCOMEWIDGET_H #include +#include namespace Ui { class WelcomeWidget; @@ -32,6 +33,15 @@ public: explicit WelcomeWidget(QWidget* parent = nullptr); ~WelcomeWidget(); +Q_SIGNALS: + void newDatabase(); + void openDatabase(); + void openDatabaseFile(QString); + void importKeePass1Database(); + +private Q_SLOTS: + void openDatabaseFromFile(QListWidgetItem* item); + private: const QScopedPointer m_ui; }; diff --git a/src/gui/WelcomeWidget.ui b/src/gui/WelcomeWidget.ui index 4382e7c77..b08ec917e 100644 --- a/src/gui/WelcomeWidget.ui +++ b/src/gui/WelcomeWidget.ui @@ -2,17 +2,176 @@ WelcomeWidget + + + 0 + 0 + 450 + 419 + + + + + 0 + 0 + + + + + 450 + 0 + + - + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 0 + 0 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + - Welcome! + Welcome to KeePassXC Qt::AlignCenter + + + + Start storing your passwords securely in a KeePassXC database + + + Qt::AlignCenter + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Create new database + + + + + + + Open existing database + + + + + + + Import from KeePass 1 + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 0 + 5 + + + + + + + + Recent databases + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 110 + + + + diff --git a/src/gui/entry/EditEntryWidget.cpp b/src/gui/entry/EditEntryWidget.cpp index d9ba5bd83..58e2a7707 100644 --- a/src/gui/entry/EditEntryWidget.cpp +++ b/src/gui/entry/EditEntryWidget.cpp @@ -77,6 +77,9 @@ EditEntryWidget::EditEntryWidget(QWidget* parent) connect(this, SIGNAL(accepted()), SLOT(saveEntry())); connect(this, SIGNAL(rejected()), SLOT(cancel())); + + connect(m_iconsWidget, SIGNAL(messageEditEntry(QString, MessageWidget::MessageType)), SLOT(showMessage(QString, MessageWidget::MessageType))); + connect(m_iconsWidget, SIGNAL(messageEditEntryDismiss()), SLOT(hideMessage())); } EditEntryWidget::~EditEntryWidget() @@ -89,6 +92,7 @@ void EditEntryWidget::setupMain() add(tr("Entry"), m_mainWidget); m_mainUi->togglePasswordButton->setIcon(filePath()->onOffIcon("actions", "password-show")); + m_mainUi->togglePasswordGeneratorButton->setIcon(filePath()->icon("actions", "password-generator", false)); connect(m_mainUi->togglePasswordButton, SIGNAL(toggled(bool)), m_mainUi->passwordEdit, SLOT(setShowPassword(bool))); connect(m_mainUi->togglePasswordGeneratorButton, SIGNAL(toggled(bool)), SLOT(togglePasswordGeneratorButton(bool))); connect(m_mainUi->expireCheck, SIGNAL(toggled(bool)), m_mainUi->expireDatePicker, SLOT(setEnabled(bool))); @@ -271,14 +275,15 @@ void EditEntryWidget::loadEntry(Entry* entry, bool create, bool history, const Q m_history = history; if (history) { - setHeadline(QString("%1 > %2").arg(parentName, tr("Entry history"))); + setHeadline(QString("%1 > %2").arg(parentName.toHtmlEscaped(), tr("Entry history"))); } else { if (create) { - setHeadline(QString("%1 > %2").arg(parentName, tr("Add entry"))); + setHeadline(QString("%1 > %2").arg(parentName.toHtmlEscaped(), tr("Add entry"))); } else { - setHeadline(QString("%1 > %2 > %3").arg(parentName, entry->title(), tr("Edit entry"))); + setHeadline(QString("%1 > %2 > %3").arg(parentName.toHtmlEscaped(), + entry->title().toHtmlEscaped(), tr("Edit entry"))); } } @@ -393,12 +398,13 @@ void EditEntryWidget::saveEntry() { if (m_history) { clear(); + hideMessage(); Q_EMIT editFinished(false); return; } if (!passwordsEqual()) { - MessageBox::warning(this, tr("Error"), tr("Different passwords supplied.")); + showMessage(tr("Different passwords supplied."), MessageWidget::Error); return; } @@ -433,6 +439,9 @@ void EditEntryWidget::saveEntry() void EditEntryWidget::updateEntryData(Entry* entry) const { + entry->attributes()->copyCustomKeysFrom(m_entryAttributes); + entry->attachments()->copyDataFrom(m_entryAttachments); + entry->setTitle(m_mainUi->titleEdit->text()); entry->setUsername(m_mainUi->usernameEdit->text()); entry->setUrl(m_mainUi->urlEdit->text()); @@ -442,9 +451,6 @@ void EditEntryWidget::updateEntryData(Entry* entry) const entry->setNotes(m_mainUi->notesEdit->toPlainText()); - entry->attributes()->copyCustomKeysFrom(m_entryAttributes); - entry->attachments()->copyDataFrom(m_entryAttachments); - IconStruct iconStruct = m_iconsWidget->state(); if (iconStruct.number < 0) { @@ -472,6 +478,7 @@ void EditEntryWidget::cancel() { if (m_history) { clear(); + hideMessage(); Q_EMIT editFinished(false); return; } @@ -495,6 +502,7 @@ void EditEntryWidget::clear() m_autoTypeAssoc->clear(); m_historyModel->clear(); m_iconsWidget->reset(); + hideMessage(); } bool EditEntryWidget::hasBeenModified() const @@ -628,15 +636,13 @@ void EditEntryWidget::insertAttachment() QFile file(filename); if (!file.open(QIODevice::ReadOnly)) { - MessageBox::warning(this, tr("Error"), - tr("Unable to open file").append(":\n").append(file.errorString())); + showMessage(tr("Unable to open file").append(":\n").append(file.errorString()), MessageWidget::Error); return; } QByteArray data; if (!Tools::readAllFromDevice(&file, data)) { - MessageBox::warning(this, tr("Error"), - tr("Unable to open file").append(":\n").append(file.errorString())); + showMessage(tr("Unable to open file").append(":\n").append(file.errorString()), MessageWidget::Error); return; } @@ -663,13 +669,11 @@ void EditEntryWidget::saveCurrentAttachment() QFile file(savePath); if (!file.open(QIODevice::WriteOnly)) { - MessageBox::warning(this, tr("Error"), - tr("Unable to save the attachment:\n").append(file.errorString())); + showMessage(tr("Unable to save the attachment:\n").append(file.errorString()), MessageWidget::Error); return; } if (file.write(attachmentData) != attachmentData.size()) { - MessageBox::warning(this, tr("Error"), - tr("Unable to save the attachment:\n").append(file.errorString())); + showMessage(tr("Unable to save the attachment:\n").append(file.errorString()), MessageWidget::Error); return; } } @@ -690,20 +694,17 @@ void EditEntryWidget::openAttachment(const QModelIndex& index) QTemporaryFile* file = new QTemporaryFile(tmpFileTemplate, this); if (!file->open()) { - MessageBox::warning(this, tr("Error"), - tr("Unable to save the attachment:\n").append(file->errorString())); + showMessage(tr("Unable to save the attachment:\n").append(file->errorString()), MessageWidget::Error); return; } if (file->write(attachmentData) != attachmentData.size()) { - MessageBox::warning(this, tr("Error"), - tr("Unable to save the attachment:\n").append(file->errorString())); + showMessage(tr("Unable to save the attachment:\n").append(file->errorString()), MessageWidget::Error); return; } if (!file->flush()) { - MessageBox::warning(this, tr("Error"), - tr("Unable to save the attachment:\n").append(file->errorString())); + showMessage(tr("Unable to save the attachment:\n").append(file->errorString()), MessageWidget::Error); return; } diff --git a/src/gui/entry/EditEntryWidgetMain.ui b/src/gui/entry/EditEntryWidgetMain.ui index 083f1c033..b896963c0 100644 --- a/src/gui/entry/EditEntryWidgetMain.ui +++ b/src/gui/entry/EditEntryWidgetMain.ui @@ -77,9 +77,6 @@ - - Generate - true diff --git a/src/gui/group/EditGroupWidget.cpp b/src/gui/group/EditGroupWidget.cpp index 177c62bb0..5b9dfcbc8 100644 --- a/src/gui/group/EditGroupWidget.cpp +++ b/src/gui/group/EditGroupWidget.cpp @@ -43,6 +43,9 @@ EditGroupWidget::EditGroupWidget(QWidget* parent) connect(this, SIGNAL(accepted()), SLOT(save())); connect(this, SIGNAL(rejected()), SLOT(cancel())); + + connect(m_editGroupWidgetIcons, SIGNAL(messageEditEntry(QString, MessageWidget::MessageType)), SLOT(showMessage(QString, MessageWidget::MessageType))); + connect(m_editGroupWidgetIcons, SIGNAL(messageEditEntryDismiss()), SLOT(hideMessage())); } EditGroupWidget::~EditGroupWidget() diff --git a/src/gui/group/EditGroupWidget.h b/src/gui/group/EditGroupWidget.h index 94ad891db..606cc77b0 100644 --- a/src/gui/group/EditGroupWidget.h +++ b/src/gui/group/EditGroupWidget.h @@ -45,6 +45,8 @@ public: Q_SIGNALS: void editFinished(bool accepted); + void messageEditEntry(QString, MessageWidget::MessageType); + void messageEditEntryDismiss(); private Q_SLOTS: void save(); diff --git a/src/http/HttpSettings.cpp b/src/http/HttpSettings.cpp index 0d6b6f1f1..e51f87cfb 100644 --- a/src/http/HttpSettings.cpp +++ b/src/http/HttpSettings.cpp @@ -18,7 +18,7 @@ PasswordGenerator HttpSettings::m_generator; bool HttpSettings::isEnabled() { - return config()->get("Http/Enabled", true).toBool(); + return config()->get("Http/Enabled", false).toBool(); } void HttpSettings::setEnabled(bool enabled) @@ -126,18 +126,6 @@ void HttpSettings::setSupportKphFields(bool supportKphFields) config()->set("Http/SupportKphFields", supportKphFields); } -QString HttpSettings::httpHost() -{ - static const QString host = "localhost"; - - return config()->get("Http/Host", host).toString().toUtf8(); -} - -void HttpSettings::setHttpHost(QString host) -{ - config()->set("Http/Host", host); -} - int HttpSettings::httpPort() { static const int PORT = 19455; diff --git a/src/http/HttpSettings.h b/src/http/HttpSettings.h index c1987f7ea..bea5648c9 100644 --- a/src/http/HttpSettings.h +++ b/src/http/HttpSettings.h @@ -42,8 +42,6 @@ public: static void setSearchInAllDatabases(bool searchInAllDatabases); static bool supportKphFields(); static void setSupportKphFields(bool supportKphFields); - static QString httpHost(); - static void setHttpHost(QString host); static int httpPort(); static void setHttpPort(int port); diff --git a/src/http/OptionDialog.cpp b/src/http/OptionDialog.cpp index e92c6e1a5..5245d333b 100644 --- a/src/http/OptionDialog.cpp +++ b/src/http/OptionDialog.cpp @@ -15,6 +15,8 @@ #include "ui_OptionDialog.h" #include "HttpSettings.h" +#include + OptionDialog::OptionDialog(QWidget *parent) : QWidget(parent), ui(new Ui::OptionDialog()) @@ -41,7 +43,6 @@ void OptionDialog::loadSettings() ui->sortByUsername->setChecked(true); else ui->sortByTitle->setChecked(true); - ui->httpHost->setText(settings.httpHost()); ui->httpPort->setText(QString::number(settings.httpPort())); /* @@ -70,8 +71,14 @@ void OptionDialog::saveSettings() settings.setUnlockDatabase(ui->unlockDatabase->isChecked()); settings.setMatchUrlScheme(ui->matchUrlScheme->isChecked()); settings.setSortByUsername(ui->sortByUsername->isChecked()); - settings.setHttpHost(ui->httpHost->text()); - settings.setHttpPort(ui->httpPort->text().toInt()); + + int port = ui->httpPort->text().toInt(); + if (port < 1024) { + QMessageBox::warning(this, tr("Cannot bind to privileged ports"), + tr("Cannot bind to privileged ports below 1024!\nUsing default port 19455.")); + port = 19455; + } + settings.setHttpPort(port); /* settings.setPasswordUseLowercase(ui->checkBoxLower->isChecked()); diff --git a/src/http/OptionDialog.ui b/src/http/OptionDialog.ui index ee09f9537..963280860 100644 --- a/src/http/OptionDialog.ui +++ b/src/http/OptionDialog.ui @@ -7,7 +7,7 @@ 0 0 605 - 389 + 429 @@ -17,7 +17,7 @@ - Enable KeepassXC Http protocol + Enable KeepassXC HTTP protocol This is required for accessing your databases from ChromeIPass or PassIFox @@ -28,7 +28,7 @@ This is required for accessing your databases from ChromeIPass or PassIFoxQTabWidget::Rounded - 0 + 2 @@ -201,32 +201,41 @@ Only entries with the same scheme (http://, https://, ftp://, ...) are returned< - - - - - - 0 - 0 - - - - HTTP Host: - - - - - - - Default host: localhost - - - - + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + - - + + + + + d0000 + + + Default port: 19455 + + + + + + + KeePassXC will listen to this port on 127.0.0.1 + + + + @@ -237,15 +246,8 @@ Only entries with the same scheme (http://, https://, ftp://, ...) are returned< HTTP Port: - - - - - - d0000 - - - Default port: 19455 + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter diff --git a/src/http/Server.cpp b/src/http/Server.cpp index 16423d8cf..f09493829 100644 --- a/src/http/Server.cpp +++ b/src/http/Server.cpp @@ -331,68 +331,34 @@ void Server::start(void) if (m_started) return; - bool nohost = true; + // local loopback hardcoded, since KeePassHTTP handshake + // is not safe against interception + QHostAddress address("127.0.0.1"); int port = HttpSettings::httpPort(); + + void* addrx = NULL; + unsigned int flags = MHD_USE_SELECT_INTERNALLY; - QHostInfo info = QHostInfo::fromName(HttpSettings::httpHost()); - if (!info.addresses().isEmpty()) { - void* addrx = NULL; - unsigned int flags = MHD_USE_SELECT_INTERNALLY; - QHostAddress address = info.addresses().first(); + struct sockaddr_in *addr = static_cast(calloc(1, sizeof(struct sockaddr_in))); + addrx = static_cast(addr); + addr->sin_family = AF_INET; + addr->sin_port = htons(port); + addr->sin_addr.s_addr = htonl(address.toIPv4Address()); - if (address.protocol() == QAbstractSocket::IPv4Protocol) { - struct sockaddr_in *addr = static_cast(calloc(1, sizeof(struct sockaddr_in))); - addrx = static_cast(addr); - addr->sin_family = AF_INET; - addr->sin_port = htons(HttpSettings::httpPort()); - addr->sin_addr.s_addr = htonl(address.toIPv4Address()); - nohost = false; - } else { - struct sockaddr_in6 *addr = static_cast(calloc(1, sizeof(struct sockaddr_in6))); - addrx = static_cast(addr); - addr->sin6_family = AF_INET6; - addr->sin6_port = htons(HttpSettings::httpPort()); - memcpy(&addr->sin6_addr, address.toIPv6Address().c, 16); - nohost = false; - flags |= MHD_USE_IPv6; - } - - if (nohost) { - qWarning("HTTPPlugin: Faled to get configured host!"); - } else { - if (NULL == (daemon = MHD_start_daemon(flags, port, NULL, NULL, - &this->request_handler_wrapper, this, - MHD_OPTION_NOTIFY_COMPLETED, - this->request_completed, NULL, - MHD_OPTION_SOCK_ADDR, - addrx, - MHD_OPTION_END))) { - nohost = true; - qWarning("HTTPPlugin: Failed to bind to configured host!"); - } else { - nohost = false; - //qWarning("HTTPPlugin: Binded to configured host."); - } - - } - - if (addrx != NULL) - free(addrx); + if (NULL == (daemon = MHD_start_daemon(flags, port, NULL, NULL, + &this->request_handler_wrapper, this, + MHD_OPTION_NOTIFY_COMPLETED, + this->request_completed, NULL, + MHD_OPTION_SOCK_ADDR, + addrx, + MHD_OPTION_END))) { + qWarning("HTTPPlugin: Failed to bind to localhost!"); + } else { + m_started = true; } - if (nohost) { - if (NULL == (daemon = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY, port, NULL, NULL, - &this->request_handler_wrapper, this, - MHD_OPTION_NOTIFY_COMPLETED, - this->request_completed, NULL, - MHD_OPTION_END))) { - qWarning("HTTPPlugin: Fatal! Failed to bind to both configured and default hosts!"); - } else { - qWarning("HTTPPlugin: Bound to fallback address 0.0.0.0/:::!"); - } - } - - m_started = true; + if (addrx != NULL) + free(addrx); } diff --git a/src/http/Service.cpp b/src/http/Service.cpp index ceec292d6..0ac0fd836 100644 --- a/src/http/Service.cpp +++ b/src/http/Service.cpp @@ -480,7 +480,8 @@ void Service::updateEntry(const QString &, const QString &uuid, const QString &l //ShowNotification(QString("%0: You have an entry change prompt waiting, click to activate").arg(requestId)); if ( HttpSettings::alwaysAllowUpdate() || QMessageBox::warning(0, tr("KeePassXC: Update Entry"), - tr("Do you want to update the information in %1 - %2?").arg(QUrl(url).host()).arg(u), + tr("Do you want to update the information in %1 - %2?") + .arg(QUrl(url).host().toHtmlEscaped()).arg(u.toHtmlEscaped()), QMessageBox::Yes|QMessageBox::No) == QMessageBox::Yes ) { entry->beginUpdate(); entry->setUsername(login); diff --git a/src/main.cpp b/src/main.cpp index a94d65eaa..224e54d1e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -28,6 +28,16 @@ #include "gui/MainWindow.h" #include "gui/MessageBox.h" +#ifdef QT_STATIC +#include + +#ifdef Q_OS_WIN +Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) +#elif Q_OS_LINUX +Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) +#endif +#endif + int main(int argc, char** argv) { #ifdef QT_NO_DEBUG diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7edf89395..db1750d7d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -92,6 +92,7 @@ set(TEST_LIBRARIES Qt5::Widgets Qt5::Test ${GCRYPT_LIBRARIES} + ${GPGERROR_LIBRARIES} ${ZLIB_LIBRARIES} ) diff --git a/tests/TestAutoType.cpp b/tests/TestAutoType.cpp index c5c1a5933..a73298866 100644 --- a/tests/TestAutoType.cpp +++ b/tests/TestAutoType.cpp @@ -96,10 +96,10 @@ void TestAutoType::init() m_entry4->setPassword("custom_attr"); m_entry4->attributes()->set("CUSTOM","Attribute",false); association.window = "//^CustomAttr1$//"; - association.sequence = "{PASSWORD}:{CUSTOM}"; + association.sequence = "{PASSWORD}:{S:CUSTOM}"; m_entry4->autoTypeAssociations()->add(association); association.window = "//^CustomAttr2$//"; - association.sequence = "{CuStOm}"; + association.sequence = "{S:CuStOm}"; m_entry4->autoTypeAssociations()->add(association); association.window = "//^CustomAttr3$//"; association.sequence = "{PaSSworD}"; diff --git a/tests/TestSymmetricCipher.cpp b/tests/TestSymmetricCipher.cpp index 698ecb204..3edf735b8 100644 --- a/tests/TestSymmetricCipher.cpp +++ b/tests/TestSymmetricCipher.cpp @@ -123,6 +123,127 @@ void TestSymmetricCipher::testAes256CbcDecryption() plainText); } +void TestSymmetricCipher::testTwofish256CbcEncryption() +{ + // NIST MCT Known-Answer Tests (cbc_e_m.txt) + // https://www.schneier.com/code/twofish-kat.zip + + QVector keys { + QByteArray::fromHex("0000000000000000000000000000000000000000000000000000000000000000"), + QByteArray::fromHex("D0A260EB41755B19374BABF259A79DB3EA7162E65490B03B1AE4871FB35EF23B"), + QByteArray::fromHex("8D55E4849A4DED08D89881E6708EDD26BEEE942073DFB3790B2798B240ACD74A"), + QByteArray::fromHex("606EFDC2066A837AF0430EBE4CF1F21071CCB236C33B4B9D82404FDB05C74621"), + QByteArray::fromHex("B119AA9485CEEEB4CC778AF21121E54DE4BDBA3498C61C8FD9004AA0C71909C3") + }; + QVector ivs { + QByteArray::fromHex("00000000000000000000000000000000"), + QByteArray::fromHex("EA7162E65490B03B1AE4871FB35EF23B"), + QByteArray::fromHex("549FF6C6274F034211C31FADF3F22571"), + QByteArray::fromHex("CF222616B0E4F8E48967D769456B916B"), + QByteArray::fromHex("957108025BFD57125B40057BC2DE4FE2") + }; + QVector plainTexts { + QByteArray::fromHex("00000000000000000000000000000000"), + QByteArray::fromHex("D0A260EB41755B19374BABF259A79DB3"), + QByteArray::fromHex("5DF7846FDB38B611EFD32A1429294095"), + QByteArray::fromHex("ED3B19469C276E7228DB8F583C7F2F36"), + QByteArray::fromHex("D177575683A46DCE3C34844C5DD0175D") + }; + QVector cipherTexts { + QByteArray::fromHex("EA7162E65490B03B1AE4871FB35EF23B"), + QByteArray::fromHex("549FF6C6274F034211C31FADF3F22571"), + QByteArray::fromHex("CF222616B0E4F8E48967D769456B916B"), + QByteArray::fromHex("957108025BFD57125B40057BC2DE4FE2"), + QByteArray::fromHex("6F725C5950133F82EF021A94CADC8508") + }; + + SymmetricCipher cipher(SymmetricCipher::Twofish, SymmetricCipher::Cbc, SymmetricCipher::Encrypt); + bool ok; + + for (int i = 0; i < keys.size(); ++i) { + cipher.init(keys[i], ivs[i]); + QByteArray ptNext = plainTexts[i]; + QByteArray ctPrev = ivs[i]; + QByteArray ctCur; + QCOMPARE(cipher.blockSize(), 16); + for (int j = 0; j < 5000; ++j) { + ctCur = cipher.process(ptNext, &ok); + if (!ok) + break; + ptNext = ctPrev; + ctPrev = ctCur; + + ctCur = cipher.process(ptNext, &ok); + if (!ok) + break; + ptNext = ctPrev; + ctPrev = ctCur; + } + + QVERIFY(ok); + QCOMPARE(ctCur, cipherTexts[i]); + } +} + +void TestSymmetricCipher::testTwofish256CbcDecryption() +{ + // NIST MCT Known-Answer Tests (cbc_d_m.txt) + // https://www.schneier.com/code/twofish-kat.zip + + QVector keys { + QByteArray::fromHex("0000000000000000000000000000000000000000000000000000000000000000"), + QByteArray::fromHex("1B1FE8F5A911CD4C0D800EDCE8ED0A942CBA6271A1044F90C30BA8FE91E1C163"), + QByteArray::fromHex("EBA31FF8D2A24FDD769A937353E23257294A33394E4D17A668060AD8230811A1"), + QByteArray::fromHex("1DCF1915C389AB273F80F897BF008F058ED89F58A95C1BE523C4B11295ED2D0F"), + QByteArray::fromHex("491B9A66D3ED4EF19F02180289D5B1A1C2596AE568540A95DC5244198A9B8869") + }; + QVector ivs { + QByteArray::fromHex("00000000000000000000000000000000"), + QByteArray::fromHex("1B1FE8F5A911CD4C0D800EDCE8ED0A94"), + QByteArray::fromHex("F0BCF70D7BB382917B1A9DAFBB0F38C3"), + QByteArray::fromHex("F66C06ED112BE4FA491A6BE4ECE2BD52"), + QByteArray::fromHex("54D483731064E5D6A082E09536D53EA4") + }; + QVector plainTexts { + QByteArray::fromHex("2CBA6271A1044F90C30BA8FE91E1C163"), + QByteArray::fromHex("05F05148EF495836AB0DA226B2E9D0C2"), + QByteArray::fromHex("A792AC61E7110C434BC2BBCAB6E53CAE"), + QByteArray::fromHex("4C81F5BDC1081170FF96F50B1F76A566"), + QByteArray::fromHex("BD959F5B787037631A37051EA5F369F8") + }; + QVector cipherTexts { + QByteArray::fromHex("00000000000000000000000000000000"), + QByteArray::fromHex("2CBA6271A1044F90C30BA8FE91E1C163"), + QByteArray::fromHex("05F05148EF495836AB0DA226B2E9D0C2"), + QByteArray::fromHex("A792AC61E7110C434BC2BBCAB6E53CAE"), + QByteArray::fromHex("4C81F5BDC1081170FF96F50B1F76A566") + }; + + SymmetricCipher cipher(SymmetricCipher::Twofish, SymmetricCipher::Cbc, SymmetricCipher::Decrypt); + bool ok; + + for (int i = 0; i < keys.size(); ++i) { + cipher.init(keys[i], ivs[i]); + QByteArray ctNext = cipherTexts[i]; + QByteArray ptCur; + QCOMPARE(cipher.blockSize(), 16); + for (int j = 0; j < 5000; ++j) { + ptCur = cipher.process(ctNext, &ok); + if (!ok) + break; + ctNext = ptCur; + + ptCur = cipher.process(ctNext, &ok); + if (!ok) + break; + ctNext = ptCur; + } + + QVERIFY(ok); + QCOMPARE(ptCur, plainTexts[i]); + } +} + void TestSymmetricCipher::testSalsa20() { // http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20/full/verified.test-vectors?logsort=rev&rev=210&view=markup diff --git a/tests/TestSymmetricCipher.h b/tests/TestSymmetricCipher.h index 1ac45793f..17fa77a49 100644 --- a/tests/TestSymmetricCipher.h +++ b/tests/TestSymmetricCipher.h @@ -28,6 +28,8 @@ private Q_SLOTS: void initTestCase(); void testAes256CbcEncryption(); void testAes256CbcDecryption(); + void testTwofish256CbcEncryption(); + void testTwofish256CbcDecryption(); void testSalsa20(); void testPadding(); void testStreamReset(); diff --git a/tests/gui/TestGui.cpp b/tests/gui/TestGui.cpp index babab8ab7..0c776e021 100644 --- a/tests/gui/TestGui.cpp +++ b/tests/gui/TestGui.cpp @@ -401,7 +401,13 @@ void TestGui::testSearch() QTRY_COMPARE(searchTextEdit->text(), QString("ZZZ")); QTRY_VERIFY(m_dbWidget->isInSearchMode()); QTRY_COMPARE(entryView->model()->rowCount(), 0); + // Press the search clear button + QToolButton* clearButton = searchWidget->findChild("clearIcon"); + QTest::mouseClick(clearButton, Qt::LeftButton); + QTRY_VERIFY(searchTextEdit->text().isEmpty()); + QTRY_VERIFY(searchTextEdit->hasFocus()); // Escape clears searchedit and retains focus + QTest::keyClicks(searchTextEdit, "ZZZ"); QTest::keyClick(searchTextEdit, Qt::Key_Escape); QTRY_VERIFY(searchTextEdit->text().isEmpty()); QTRY_VERIFY(searchTextEdit->hasFocus()); @@ -413,19 +419,26 @@ void TestGui::testSearch() // Search for "someTHING" QTest::keyClicks(searchTextEdit, "THING"); QTRY_COMPARE(entryView->model()->rowCount(), 2); - // Press Down to focus on the entry view if at EOL + // Press Down to focus on the entry view QTest::keyClick(searchTextEdit, Qt::Key_Right, Qt::ControlModifier); QTRY_VERIFY(searchTextEdit->hasFocus()); QTest::keyClick(searchTextEdit, Qt::Key_Down); QTRY_VERIFY(entryView->hasFocus()); - // Test clipboard + // Restore focus and search text selection + QTest::keyClick(m_mainWindow, Qt::Key_F, Qt::ControlModifier); + QTRY_COMPARE(searchTextEdit->selectedText(), QString("someTHING")); + // Ensure Down focuses on entry view when search text is selected + QTest::keyClick(searchTextEdit, Qt::Key_Down); + QTRY_VERIFY(entryView->hasFocus()); + // Refocus back to search edit + QTest::mouseClick(searchTextEdit, Qt::LeftButton); + QTRY_VERIFY(searchTextEdit->hasFocus()); + // Test password copy QClipboard *clipboard = QApplication::clipboard(); - QTest::keyClick(entryView, Qt::Key_C, Qt::ControlModifier); + QTest::keyClick(searchTextEdit, Qt::Key_C, Qt::ControlModifier); QModelIndex searchedItem = entryView->model()->index(0, 1); Entry* searchedEntry = entryView->entryFromIndex(searchedItem); QTRY_COMPARE(searchedEntry->password(), clipboard->text()); - // Restore focus - QTest::mouseClick(searchTextEdit, Qt::LeftButton); // Test case sensitive search searchWidget->setCaseSensitive(true); @@ -445,16 +458,14 @@ void TestGui::testSearch() QCOMPARE(groupView->currentGroup(), m_db->rootGroup()); // Try to edit the first entry from the search view + // Refocus back to search edit + QTest::mouseClick(searchTextEdit, Qt::LeftButton); + QTRY_VERIFY(searchTextEdit->hasFocus()); + QVERIFY(m_dbWidget->isInSearchMode()); + QModelIndex item = entryView->model()->index(0, 1); Entry* entry = entryView->entryFromIndex(item); - QVERIFY(m_dbWidget->isInSearchMode()); - clickIndex(item, entryView, Qt::LeftButton); - QAction* entryEditAction = m_mainWindow->findChild("actionEntryEdit"); - QVERIFY(entryEditAction->isEnabled()); - QWidget* entryEditWidget = toolBar->widgetForAction(entryEditAction); - QVERIFY(entryEditWidget->isVisible()); - QVERIFY(entryEditWidget->isEnabled()); - QTest::mouseClick(entryEditWidget, Qt::LeftButton); + QTest::keyClick(searchTextEdit, Qt::Key_Return); QCOMPARE(m_dbWidget->currentMode(), DatabaseWidget::EditMode); // Perform the edit and save it @@ -465,13 +476,12 @@ void TestGui::testSearch() QDialogButtonBox* editEntryWidgetButtonBox = editEntryWidget->findChild("buttonBox"); QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton); - // Confirm the edit was made and we are back in view mode + // Confirm the edit was made and we are back in search mode QTRY_VERIFY(m_dbWidget->isInSearchMode()); QCOMPARE(entry->title(), origTitle.append("_edited")); // Cancel search, should return to normal view - QTest::mouseClick(searchTextEdit, Qt::LeftButton); - QTest::keyClick(searchTextEdit, Qt::Key_Escape); + QTest::keyClick(m_mainWindow, Qt::Key_Escape); QTRY_COMPARE(m_dbWidget->currentMode(), DatabaseWidget::ViewMode); } @@ -556,7 +566,7 @@ void TestGui::testCloneEntry() QCOMPARE(entryView->model()->rowCount(), 2); Entry* entryClone = entryView->entryFromIndex(entryView->model()->index(1, 1)); QVERIFY(entryOrg->uuid() != entryClone->uuid()); - QCOMPARE(entryClone->title(), entryOrg->title()); + QCOMPARE(entryClone->title(), entryOrg->title() + QString(" - Clone")); } void TestGui::testDragAndDropEntry() diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index 846e39230..83f00b4bc 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -20,6 +20,7 @@ target_link_libraries(kdbx-extract keepassx_core Qt5::Core ${GCRYPT_LIBRARIES} + ${GPGERROR_LIBRARIES} ${ZLIB_LIBRARIES}) add_executable(kdbx-merge kdbx-merge.cpp) @@ -27,6 +28,7 @@ target_link_libraries(kdbx-merge keepassx_core Qt5::Core ${GCRYPT_LIBRARIES} + ${GPGERROR_LIBRARIES} ${ZLIB_LIBRARIES}) diff --git a/utils/entropy-meter.cpp b/utils/entropy-meter.cpp index a5e6e50e9..74f6bc11a 100644 --- a/utils/entropy-meter.cpp +++ b/utils/entropy-meter.cpp @@ -101,9 +101,10 @@ int main(int argc, char **argv) break; } } - if (line[0]) + if (line[0]) { calculate(line,advanced); printf("> "); + } } } else