Commit 240dd3735a95af3e48bfaea4fea6bd6508f54823

Authored by Renan
1 parent 900a2faf
Exists in master

ADD: Enable "set target" when orientation is not none

Showing 1 changed file with 5 additions and 1 deletions   Show diff stats
invesalius/gui/task_navigator.py
@@ -1487,6 +1487,11 @@ class MarkersPanel(wx.Panel): @@ -1487,6 +1487,11 @@ class MarkersPanel(wx.Panel):
1487 send_target_to_robot = menu_id.Append(3, _('Send target to robot')) 1487 send_target_to_robot = menu_id.Append(3, _('Send target to robot'))
1488 menu_id.Bind(wx.EVT_MENU, self.OnMenuSendTargetToRobot, send_target_to_robot) 1488 menu_id.Bind(wx.EVT_MENU, self.OnMenuSendTargetToRobot, send_target_to_robot)
1489 1489
  1490 + if all([elem is not None for elem in self.markers[self.lc.GetFocusedItem()].coord[3:]]):
  1491 + target_menu.Enable(True)
  1492 + else:
  1493 + target_menu.Enable(False)
  1494 +
1490 # Enable "Send target to robot" button only if tracker is robot, if navigation is on and if target is not none 1495 # Enable "Send target to robot" button only if tracker is robot, if navigation is on and if target is not none
1491 m_target_robot = np.array([self.robot_markers[self.lc.GetFocusedItem()].robot_target_matrix]) 1496 m_target_robot = np.array([self.robot_markers[self.lc.GetFocusedItem()].robot_target_matrix])
1492 if self.tracker.tracker_id == const.ROBOT and self.nav_status and m_target_robot.any(): 1497 if self.tracker.tracker_id == const.ROBOT and self.nav_status and m_target_robot.any():
@@ -1497,7 +1502,6 @@ class MarkersPanel(wx.Panel): @@ -1497,7 +1502,6 @@ class MarkersPanel(wx.Panel):
1497 # target_menu_rem = menu_id.Append(3, _('Remove target')) 1502 # target_menu_rem = menu_id.Append(3, _('Remove target'))
1498 # menu_id.Bind(wx.EVT_MENU, self.OnMenuRemoveTarget, target_menu_rem) 1503 # menu_id.Bind(wx.EVT_MENU, self.OnMenuRemoveTarget, target_menu_rem)
1499 1504
1500 - target_menu.Enable(True)  
1501 self.PopupMenu(menu_id) 1505 self.PopupMenu(menu_id)
1502 menu_id.Destroy() 1506 menu_id.Destroy()
1503 1507