Commit 5a6cf0977fa3860a1fba8e73fadbcea65ff8ca0f

Authored by Thiago Franco de Moraes
1 parent 13bcfe5a
Exists in master

Improvements in close button

Showing 1 changed file with 3 additions and 7 deletions   Show diff stats
invesalius/gui/brain_seg_dialog.py
... ... @@ -182,20 +182,15 @@ class BrainSegmenterDialog(wx.Dialog):
182 182 device_id = "llvm_cpu.0"
183 183 use_gpu = self.chk_use_gpu.GetValue()
184 184 prob_threshold = self.sld_threshold.GetValue() / 100.0
  185 + self.btn_close.Disable()
185 186 self.btn_stop.Enable()
186 187 self.btn_segment.Disable()
187   -
188   - print(device_id)
189   - # self.pg_dialog = wx.ProgressDialog(_("Brain segmenter"), _("Segmenting brain"), parent=self, style= wx.FRAME_FLOAT_ON_PARENT | wx.PD_CAN_ABORT | wx.PD_AUTO_HIDE | wx.PD_ELAPSED_TIME)
190   - # self.pg_dialog.Bind(wx.EVT_BUTTON, self.OnStop)
191   - # self.pg_dialog.Show()
192 188 self.segmenter.segment(image, prob_threshold, backend, device_id, use_gpu, self.SetProgress, self.AfterSegment)
193 189  
194 190 def OnStop(self, evt):
195 191 self.segmenter.stop = True
  192 + self.btn_close.Enable()
196 193 self.btn_stop.Disable()
197   - # self.pg_dialog.Hide()
198   - # self.pg_dialog = None
199 194 self.btn_segment.Enable()
200 195 evt.Skip()
201 196  
... ... @@ -203,6 +198,7 @@ class BrainSegmenterDialog(wx.Dialog):
203 198 self.Close()
204 199  
205 200 def AfterSegment(self):
  201 + self.btn_close.Enable()
206 202 self.btn_stop.Disable()
207 203 self.btn_segment.Disable()
208 204 Publisher.sendMessage('Reload actual slice')
... ...