Skip to content

Commit

Permalink
CID: Connect txtInstallDirectory.textChanged sooner (#456)
Browse files Browse the repository at this point in the history
Co-authored-by: DavidoTek <[email protected]>
  • Loading branch information
sonic2kk and DavidoTek authored Sep 20, 2024
1 parent 01dd509 commit d7c71a8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pupgui2/pupgui2customiddialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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):
Expand Down

0 comments on commit d7c71a8

Please sign in to comment.