Tie things together to ensure title is always updated, and add some needed comments here and there

This commit is contained in:
Veronica K. B. Olsen
2020-05-01 18:11:32 +02:00
parent 7d91a15841
commit cc1113ea6c
5 changed files with 82 additions and 6 deletions
+14
View File
@@ -457,6 +457,9 @@ class GuiDocTree(QTreeWidget):
return True
def getSelectedHandle(self):
"""Get the currently selected handle. If multiple items are
selected, return the first.
"""
selItem = self.selectedItems()
if len(selItem) == 0:
return None
@@ -465,6 +468,8 @@ class GuiDocTree(QTreeWidget):
return None
def getSelectedHandles(self):
"""Return a list of all currently selected item handles.
"""
selItems = self.selectedItems()
selHandles = []
for n in range(len(selItems)):
@@ -472,6 +477,15 @@ class GuiDocTree(QTreeWidget):
selHandles.append(selItems[n].text(self.C_HANDLE))
return selHandles
def setSelectedHandle(self, tHandle):
"""Set a specific handle as the selected item.
"""
if tHandle in self.theMap:
self.clearSelection()
self.theMap[tHandle].setSelected(True)
return True
return False
##
# Internal Functions
##