Skip to content

Commit

Permalink
Disable time format if we don't have a measurement date (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
mscheltienne authored Jun 29, 2023
1 parent 119872c commit c912752
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions mne_qt_browser/_pg_figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -3394,6 +3394,8 @@ def __init__(self, **kwargs):
# Disable time format toggling
del self.mne.keyboard_shortcuts['t']
else:
if self.mne.info["meas_date"] is None:
del self.mne.keyboard_shortcuts["t"]
# disable histogram of epoch PTP amplitude
del self.mne.keyboard_shortcuts["h"]

Expand Down Expand Up @@ -4344,13 +4346,14 @@ def _toggle_events(self):
self._set_events_visible(self.mne.events_visible)

def _toggle_time_format(self):
if self.mne.time_format == 'float':
self.mne.time_format = 'clock'
self.mne.time_axis.setLabel(text='Time of day')
else:
self.mne.time_format = 'float'
self.mne.time_axis.setLabel(text='Time', units='s')
self._update_yaxis_labels()
if self.mne.info["meas_date"] is not None:
if self.mne.time_format == 'float':
self.mne.time_format = 'clock'
self.mne.time_axis.setLabel(text='Time of day')
else:
self.mne.time_format = 'float'
self.mne.time_axis.setLabel(text='Time', units='s')
self._update_yaxis_labels()

def _toggle_fullscreen(self):
if self.isFullScreen():
Expand Down

0 comments on commit c912752

Please sign in to comment.