Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show character count in password generator dialog #10940

Merged

Conversation

AgostonSzepessy
Copy link
Contributor

This adds a new label called "Characters" to the password generator dialog that displays the number of characters in the password text field. This makes it easy to figure out how many characters are in the password if the user enters or deletes characters from the generated password.

This fixes #10858.

Screenshots

keepassxc-password-dialog

Testing strategy

I piggy-backed off the existing entropy tests and verified that the length in the new password label is the same as the expected length.

Type of change

  • ✅ Bug fix (non-breaking change that fixes an issue)
  • ✅ New feature (change that adds functionality)

Displays the number of characters in the password field in the password
generator dialog. This fixes keepassxreboot#10858.
@droidmonkey droidmonkey added this to the v2.7.10 milestone Jun 22, 2024
@droidmonkey droidmonkey merged commit 1f9c25c into keepassxreboot:develop Jun 22, 2024
11 checks passed
@AgostonSzepessy AgostonSzepessy deleted the feature/password-length branch June 22, 2024 06:05
@@ -6888,6 +6888,14 @@ Do you want to overwrite it?</source>
<source>Special Characters</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>passwordLength</source>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a translatable string?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops yah that should be marked not translated

</size>
</property>
<property name="text">
<string>passwordLength</string>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. This should get overwritten at runtime with the slot function. Or is there a case where that doesn't happen? When I opened up the password generator there were already characters in the password field and the slot for the character count label fired and changed the text on it.

Copy link
Member

@varjolintu varjolintu Jun 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A string in the .ui file will get automatically translated to passwordLength. Someone just opened an issue to Transifex and asked what this text is. The default string should be something that can be translated, or maybe an empty string if it's going to be filled at runtime?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually thought it was just the string that appeared in the editor. I was basing it off the other labels in that row and they didn't have translations either:

        <widget class="QLabel" name="strengthLabel">
         <property name="minimumSize">
          <size>
           <width>70</width>
           <height>0</height>
          </size>
         </property>
         <property name="maximumSize">
          <size>
           <width>16777215</width>
           <height>30</height>
          </size>
         </property>
         <property name="text">
          <string comment="Password strength">strength</string> <----- here
         </property>
        <widget class="QLabel" name="entropyLabel">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
         <property name="minimumSize">
          <size>
           <width>70</width>
           <height>0</height>
          </size>
         </property>
         <property name="text">
          <string>entropy</string> <------- here
         </property>

Do we need translations for these as well? And does the translation tool generate entries for these? Or would I need to add them manually? I haven't worked too much with translations before so this is kind of new for me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No actions required

pull bot pushed a commit to tigerwill90/keepassxc that referenced this pull request Jun 23, 2024
Displays the number of characters in the password field in the password generator dialog. This fixes keepassxreboot#10858.
droidmonkey added a commit that referenced this pull request Jul 1, 2024
Displays the number of characters in the password field in the password generator dialog. This fixes #10858.
BryanJacobs added a commit to BryanJacobs/keepassxc that referenced this pull request Jul 26, 2024
* upstream/develop: (57 commits)
  Fix typos in tooltips from EditEntryWidgetBrowser.ui
  Refactor: separate GUI sources from core sources
  Database key settings: fix UI bug
  tests: gui: Fix NULL dereference in GUI tests
  Docs: explain how to generate passwords with the browser extension (keepassxreboot#9242)
  Fix a couple more Qt 5.15 deprecation warnings (keepassxreboot#10953)
  Update URLs to Chrome Web Store page for `KeePassXC-Browser` extension
  Update browser extension icon states in documentation (keepassxreboot#10875)
  Fix сentering icon and text on buttons
  Fix backup file path substitution
  Verify USB listener callback handle
  Refactor Database Settings (keepassxreboot#9485)
  Fix all Qt 5.15 deprecation warnings (keepassxreboot#7783)
  Passkey importer: fix file picker parent
  Require Qt >= 5.12
  Passkeys: Fix showing correct username in the reports
  Show character count in password generator dialog (keepassxreboot#10940)
  Increase the time interval for window show workaround
  Snap: Remove $HOME access from keepassxc-proxy
  Correct libusb usage on FreeBSD (keepassxreboot#10736)
  ...

# Conflicts:
#	src/CMakeLists.txt
#	src/core/Database.cpp
#	src/core/Database.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display length of manually entered password in generator dialog
3 participants