Fix retention of selected item of novel tree in the details panel
This commit is contained in:
@@ -529,13 +529,14 @@ class GuiNovelTree(QTreeWidget):
|
|||||||
return
|
return
|
||||||
|
|
||||||
def getSelectedHandle(self):
|
def getSelectedHandle(self):
|
||||||
"""Get the currently selected handle. If multiple items are
|
"""Get the currently selected or active handle. If multiple
|
||||||
selected, return the first.
|
items are selected, return the first.
|
||||||
"""
|
"""
|
||||||
selItem = self.selectedItems()
|
selList = self.selectedItems()
|
||||||
if selItem:
|
trItem = selList[0] if selList else self.currentItem()
|
||||||
tHandle = selItem[0].data(self.C_TITLE, self.D_HANDLE)
|
if isinstance(trItem, QTreeWidgetItem):
|
||||||
sTitle = selItem[0].data(self.C_TITLE, self.D_TITLE)
|
tHandle = trItem.data(self.C_TITLE, self.D_HANDLE)
|
||||||
|
sTitle = trItem.data(self.C_TITLE, self.D_TITLE)
|
||||||
return tHandle, sTitle
|
return tHandle, sTitle
|
||||||
return None, None
|
return None, None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user