Skip to content

Commit

Permalink
Fix issue with sliders appearing again
Browse files Browse the repository at this point in the history
  • Loading branch information
Nabil Freij committed May 6, 2022
1 parent f84b919 commit 5267763
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
12 changes: 3 additions & 9 deletions glue/viewers/profile/layer_artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,9 @@ def _calculate_profile(self, reset=False):
self._calculate_profile_postthread()

def _calculate_profile_thread(self, reset=False):
# We need to ignore any warnings that happen inside the thread
# otherwise the thread tries to send these to the glue logger (which
# uses Qt), which then results in this kind of error:
# QObject::connect: Cannot queue arguments of type 'QTextCursor'
with warnings.catch_warnings():
warnings.simplefilter("ignore")
if reset:
self.state.reset_cache()
self.state.update_profile(update_limits=False)
if reset:
self.state.reset_cache()
self.state.update_profile(update_limits=True)

def _calculate_profile_postthread(self):

Expand Down
6 changes: 2 additions & 4 deletions glue/viewers/profile/qt/options_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,20 @@ def _on_function_change(self, *args):
else:
if self.profile_slice_helper:
self.profile_slice_helper.remove()
# Has to be set to None otherwise it will re-appear for other functions
self.profile_slice_helper = None

def _on_attribute_change(self, *args):

if (self.viewer_state.reference_data is None or
self.viewer_state.x_att_pixel is None or
self.viewer_state.x_att is self.viewer_state.x_att_pixel):
self.ui.text_warning.hide()
return

if self.viewer_state.function != 'slice':

world_warning = len(dependent_axes(self.viewer_state.reference_data.coords,
self.viewer_state.x_att_pixel.axis)) > 1

self.ui.text_warning.hide()

if world_warning:
self.ui.text_warning.show()
self.ui.text_warning.setText(WARNING_TEXT.format(label=self.viewer_state.x_att.label))
Expand Down

0 comments on commit 5267763

Please sign in to comment.