Commit 85229cb2930e1579528decbf321cee03ca4398ab
1 parent
4773dbbf
Exists in
rmatsuda-trigger_bug_fix
Disable trigger checkbox when navigation is on
Showing
1 changed file
with
11 additions
and
0 deletions
Show diff stats
invesalius/gui/task_navigator.py
| ... | ... | @@ -107,6 +107,7 @@ class InnerFoldPanel(wx.Panel): |
| 107 | 107 | default_colour = wx.SystemSettings_GetColour(wx.SYS_COLOUR_MENUBAR) |
| 108 | 108 | self.SetBackgroundColour(default_colour) |
| 109 | 109 | |
| 110 | + self.__bind_events() | |
| 110 | 111 | # Fold panel and its style settings |
| 111 | 112 | # FIXME: If we dont insert a value in size or if we set wx.DefaultSize, |
| 112 | 113 | # the fold_panel doesnt show. This means that, for some reason, Sizer |
| ... | ... | @@ -154,6 +155,7 @@ class InnerFoldPanel(wx.Panel): |
| 154 | 155 | checktrigger.SetToolTip(tooltip) |
| 155 | 156 | checktrigger.SetValue(False) |
| 156 | 157 | checktrigger.Bind(wx.EVT_CHECKBOX, partial(self.UpdateExternalTrigger, ctrl=checktrigger)) |
| 158 | + self.checktrigger = checktrigger | |
| 157 | 159 | |
| 158 | 160 | if sys.platform != 'win32': |
| 159 | 161 | checkcamera.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) |
| ... | ... | @@ -173,6 +175,15 @@ class InnerFoldPanel(wx.Panel): |
| 173 | 175 | self.SetSizer(sizer) |
| 174 | 176 | self.Update() |
| 175 | 177 | self.SetAutoLayout(1) |
| 178 | + def __bind_events(self): | |
| 179 | + Publisher.subscribe(self.OnTrigger, 'Navigation Status') | |
| 180 | + | |
| 181 | + def OnTrigger(self, pubsub_evt): | |
| 182 | + status = pubsub_evt.data | |
| 183 | + if status: | |
| 184 | + self.checktrigger.Enable(False) | |
| 185 | + else: | |
| 186 | + self.checktrigger.Enable(True) | |
| 176 | 187 | |
| 177 | 188 | def UpdateExternalTrigger(self, evt, ctrl): |
| 178 | 189 | Publisher.sendMessage('Update trigger state', ctrl.GetValue()) | ... | ... |