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

silx view: Fixed setting focus at startup when opening a dataset #3953

Merged
merged 4 commits into from
Oct 24, 2023

Conversation

t20100
Copy link
Member

@t20100 t20100 commented Oct 23, 2023

This PR aims at opening the vis at startup when providing a data path along with the file to open: closes #3916

To achieve so, this PR adds an extra argument to Hdf5TreeModel.sigH5pyObjectLoaded in order to pass the full filename used to open the item.

@t20100 t20100 added this to the 2.0.0 milestone Oct 23, 2023
@@ -453,9 +453,9 @@ def __createCustomNxdataWindow(self, customNxdataWidget):
layout.addWidget(customNxdataWidget)
return widget

def __h5FileLoaded(self, loadedH5):
def __h5FileLoaded(self, loadedH5, filename):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retrieved from Hdf5TreeModel.sigH5pyObjectLoaded

@@ -250,7 +250,6 @@ def _closeFileList(fileList):
"""Static method to close explicit references to internal objects."""
_logger.debug("Clear Hdf5TreeModel")
for obj in fileList:
_logger.debug("Close file %s", obj.filename)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was causing issues with the tests since h5py.Dataset do not have a filename attribute.

Comment on lines +712 to 713
self.sigH5pyObjectLoaded.emit(h5file, filename)
self.insertH5pyObject(h5file, row=row, filename=filename)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure here why the signal is emitted before inserting the item into the model? 🤷

@pierrepaleo
Copy link
Contributor

I can't really review the code, but I gave a few tries and it seems to be working.

Thanks!

@vallsv vallsv merged commit 9afd301 into silx-kit:main Oct 24, 2023
8 checks passed
@t20100 t20100 deleted the fix-silx-view-startup-focus branch November 28, 2023 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

silx view: focus is not done when specifying the internal HDF5 path
3 participants