Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CID: Connect txtInstallDirectory.textChanged sooner #456

Merged
merged 2 commits into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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