Skip to content

Commit

Permalink
OME-Zarr: Hide datasetName (internal path) widget
Browse files Browse the repository at this point in the history
  • Loading branch information
btbest committed Oct 7, 2024
1 parent 9bca34a commit 5292923
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions volumina/widgets/hierarchicalFileExportOptionsWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ def __init__(self, parent, file_extensions: Tuple[str, ...], extension_descripti
# We need to watch the textEdited signal because Qt has a bug that causes the OK button
# to receive it's click event BEFORE the LineEdit receives its FocusOut event.
# (That is, we can't just watch for FocusOut events and disable the button before the click.)
self.datasetEdit.textEdited.connect(lambda: self._handleTextEdited(self.datasetEdit))
self.filepathEdit.textEdited.connect(lambda: self._handleTextEdited(self.filepathEdit))
if self.default_extension == ".zarr":
self.datasetLabel.setVisible(False)
self.datasetEdit.setVisible(False)
self.datasetEdit.setEnabled(False)

Check warning on line 49 in volumina/widgets/hierarchicalFileExportOptionsWidget.py

View check run for this annotation

Codecov / codecov/patch

volumina/widgets/hierarchicalFileExportOptionsWidget.py#L46-L49

Added lines #L46 - L49 were not covered by tests
else:
self.datasetEdit.textEdited.connect(lambda: self._handleTextEdited(self.datasetEdit))

Check warning on line 51 in volumina/widgets/hierarchicalFileExportOptionsWidget.py

View check run for this annotation

Codecov / codecov/patch

volumina/widgets/hierarchicalFileExportOptionsWidget.py#L51

Added line #L51 was not covered by tests

def initSlots(self, filepathSlot, datasetNameSlot, fullPathOutputSlot):
self._filepathSlot = filepathSlot
Expand Down Expand Up @@ -74,7 +79,7 @@ def _applyDataset(self):
was_valid = self.settings_are_valid
datasetName = self.datasetEdit.text()
self._datasetNameSlot.setValue(str(datasetName))
self.settings_are_valid = str(datasetName) != "" or self.default_extension == ".zarr"
self.settings_are_valid = str(datasetName) != ""
if self.settings_are_valid != was_valid:
self.pathValidityChange.emit(self.settings_are_valid)

Expand Down
2 changes: 1 addition & 1 deletion volumina/widgets/hierarchicalFileExportOptionsWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<widget class="QLineEdit" name="filepathEdit"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="datasetLabel">
<property name="text">
<string>Dataset:</string>
</property>
Expand Down

0 comments on commit 5292923

Please sign in to comment.