Skip to content

Commit

Permalink
hide password field if encryption is none
Browse files Browse the repository at this point in the history
  • Loading branch information
shivansh02 authored and m3nu committed May 31, 2024
1 parent 6b5f7a7 commit f252a8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/vorta/views/partials/password_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,9 @@ def create_form_widget(self, parent: Optional[QWidget] = None) -> QWidget:
self.add_form_to_layout(form_layout)
widget.setLayout(form_layout)
return widget

def set_visibility(self, visible: bool) -> None:
self._label_password.setVisible(visible)
self._label_confirm.setVisible(visible)
self.passwordLineEdit.setVisible(visible)
self.confirmLineEdit.setVisible(visible)
2 changes: 2 additions & 0 deletions src/vorta/views/repo_add_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,10 @@ def encryption_listener(self):
'''Validates passwords only if its going to be used'''
if self.values['encryption'] == 'none':
self.passwordInput.set_validation_enabled(False)
self.passwordInput.set_visibility(False)
else:
self.passwordInput.set_validation_enabled(True)
self.passwordInput.set_visibility(True)

def display_backend_warning(self):
'''Display password backend message based off current keyring'''
Expand Down

0 comments on commit f252a8e

Please sign in to comment.