Skip to content

Commit

Permalink
Web-loading GUI: Update OK button (#2851)
Browse files Browse the repository at this point in the history
  • Loading branch information
btbest committed May 8, 2024
1 parent dc5bf54 commit 2d44486
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ilastik/applets/dataSelection/precomputedVolumeBrowser.py
Expand Up @@ -7,6 +7,7 @@
- check whether can me somehow merged with dvidDataSelctionBrowser
"""

import logging

from requests.exceptions import SSLError, ConnectionError
Expand Down Expand Up @@ -79,10 +80,19 @@ def setup_ui(self):
self.qbuttons.rejected.connect(self.reject)
self.qbuttons.button(QDialogButtonBox.Ok).setText("Add to project")
self.qbuttons.button(QDialogButtonBox.Ok).setEnabled(False)

def update_ok_button(text):
if text == self.selected_url:
self.qbuttons.button(QDialogButtonBox.Ok).setEnabled(True)
else:
self.qbuttons.button(QDialogButtonBox.Ok).setEnabled(False)

self.combo.lineEdit().textChanged.connect(update_ok_button)
main_layout.addWidget(self.qbuttons)
self.setLayout(main_layout)

def handle_chk_button_clicked(self, event):
self.selected_url = None
url = self.combo.currentText().strip().lstrip("precomputed://")
if url == "":
return
Expand Down

0 comments on commit 2d44486

Please sign in to comment.