Skip to content

Commit

Permalink
Trigger create db function when pressing ENTER on password confirm input
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadfebrianto committed Jan 6, 2023
1 parent e978543 commit 596c78f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/view/widget_create_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def setup_ui(self):
self.label_db_password_confirm.setFixedWidth(Constants.LABEL_MAX_WIDTH)
self.input_db_password_confirm = QLineEdit()
self.input_db_password_confirm.setEchoMode(QLineEdit.Password)
self.input_db_password_confirm.returnPressed.connect(self.create_db)
# Check if the passwords match
self.input_db_password_confirm.textChanged.connect(self.check_passwords)
self.hlayout_db_password_confirm = QHBoxLayout()
Expand Down Expand Up @@ -96,6 +97,8 @@ def open_db_location_dialog(self):
self.input_db_location.setText(label_db_location)

def create_db(self):
if not self.btn_create_db.isEnabled():
return
# Get the database path
db_path = get_db_path(
self.input_db_location.text(), self.input_db_name.text(), String.APP_DB_EXT
Expand Down

0 comments on commit 596c78f

Please sign in to comment.