From 596c78f7fcb6ec364389037496bba57838a83c18 Mon Sep 17 00:00:00 2001 From: Ahmad Febrianto Date: Fri, 6 Jan 2023 16:12:20 +0700 Subject: [PATCH] Trigger create db function when pressing ENTER on password confirm input --- src/view/widget_create_db.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/view/widget_create_db.py b/src/view/widget_create_db.py index f194ce3..a19f9f7 100644 --- a/src/view/widget_create_db.py +++ b/src/view/widget_create_db.py @@ -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() @@ -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