File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 3535from datalab .adapters_plotpy import CURVESTYLES , create_adapter_from_object
3636from datalab .config import Conf , _
3737from datalab .h5 import H5Importer
38- from datalab .utils .qthelpers import qt_handle_error_message
38+ from datalab .utils .qthelpers import block_signals , qt_handle_error_message
3939
4040if TYPE_CHECKING :
4141 from plotpy .plot import BasePlot
@@ -851,7 +851,13 @@ def __item_selected_on_tree(self, item: QW.QTreeWidgetItem) -> None:
851851 self .plotpreview .update_plot_preview (node )
852852 self .groupandattrs .update_from_node (node )
853853 # Update the file selector combo box
854- self .selector .set_current_fname (node .h5file .filename )
854+ with block_signals (self .selector .combo ):
855+ # Avoid triggering current file changed signal, which would result in
856+ # loosing the current selection on the tree (side effect: "Show array"
857+ # button would still be enabled if the previous node was an array, except
858+ # that now the current node is not an array, thus causing an error if
859+ # the user clicks on the button).
860+ self .selector .set_current_fname (node .h5file .filename )
855861
856862 def __selector_current_file_changed (self , fname : str ) -> None :
857863 """Selector current file changed
You can’t perform that action at this time.
0 commit comments