From d7c71a8e0b6f37a9a1832cd89a8d9c8fdccc6cf0 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Fri, 20 Sep 2024 07:46:45 +0100 Subject: [PATCH] CID: Connect `txtInstallDirectory.textChanged` sooner (#456) Co-authored-by: DavidoTek <54072917+DavidoTek@users.noreply.github.com> --- pupgui2/pupgui2customiddialog.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pupgui2/pupgui2customiddialog.py b/pupgui2/pupgui2customiddialog.py index 27183da3..f509060a 100644 --- a/pupgui2/pupgui2customiddialog.py +++ b/pupgui2/pupgui2customiddialog.py @@ -45,8 +45,8 @@ def setup_ui(self): self.txtIdBrowseAction = self.ui.txtInstallDirectory.addAction(QIcon.fromTheme('document-open'), QLineEdit.TrailingPosition) self.txtIdBrowseAction.triggered.connect(self.txt_id_browse_action_triggered) + self.ui.txtInstallDirectory.textChanged.connect(lambda text: self.ui.btnSave.setEnabled(self.is_valid_custom_install_path(text))) custom_install_directory = config_custom_install_location().get('install_dir', '') - self.ui.txtInstallDirectory.setText(custom_install_directory) self.ui.btnDefault.setEnabled(self.has_custom_install_directory(custom_install_directory)) # Don't enable btnDefault if there is no Custom Install Directory set @@ -60,8 +60,6 @@ def setup_ui(self): self.ui.btnDefault.clicked.connect(self.btn_default_clicked) self.ui.btnClose.clicked.connect(self.ui.close) - self.ui.txtInstallDirectory.textChanged.connect(lambda text: self.ui.btnSave.setEnabled(self.is_valid_custom_install_path(text))) - def btn_save_clicked(self): install_dir: str = os.path.expanduser(self.ui.txtInstallDirectory.text().strip()) if not install_dir.endswith(os.sep):