Skip to content

Commit

Permalink
potentially fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
th3w1zard1 committed Jul 6, 2024
1 parent a1a4e60 commit 4c15696
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Tools/HolocronToolset/src/toolset/gui/editors/dlg.py
Original file line number Diff line number Diff line change
Expand Up @@ -1661,7 +1661,7 @@ def updateItemDisplayText(self, item: DLGStandardItem, *, updateCopies: bool = T
if updateCopies:
items = self.nodeToItems[item.link.node]
for copiedItem in items:
if copiedItem is item:
if copiedItem is item or not isinstance(copiedItem, DLGStandardItem):
continue
self.updateItemDisplayText(copiedItem, updateCopies=False)

Expand Down
8 changes: 6 additions & 2 deletions Tools/HolocronToolset/src/toolset/gui/editors/jrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def __init__(self, parent: QWidget | None, installation: HTInstallation | None =

self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.ui.categoryCommentEdit.setVisible(False) # FIXME:
self._setupMenus()
self._setupSignals()
if installation is not None: # will only be none in the unittests
Expand Down Expand Up @@ -316,7 +317,7 @@ def onValueUpdated(self, *args, **kwargs):
data.plot_index = self.ui.categoryPlotSelect.currentIndex()
data.planet_id = self.ui.categoryPlanetSelect.currentIndex() - 1
data.priority = JRLQuestPriority(self.ui.categoryPrioritySelect.currentIndex())
data.comment = self.ui.categoryCommentEdit.toPlainText()
# data.comment = self.ui.categoryCommentEdit.toPlainText()
elif isinstance(data, JRLEntry):
if self.ui.entryTextEdit.locstring is not None:
data.text = self.ui.entryTextEdit.locstring
Expand Down Expand Up @@ -358,7 +359,7 @@ def onSelectionChanged(self, selection: QItemSelection, deselected: QItemSelecti
self.ui.categoryPlotSelect.setCurrentIndex(data.plot_index)
self.ui.categoryPlanetSelect.setCurrentIndex(data.planet_id + 1)
self.ui.categoryPrioritySelect.setCurrentIndex(data.priority.value)
self.ui.categoryCommentEdit.setPlainText(data.comment)
#self.ui.categoryCommentEdit.setPlainText(data.comment)
elif isinstance(data, JRLEntry):
self.ui.questPages.setCurrentIndex(1)
self._loadLocstring(self.ui.entryTextEdit, data.text)
Expand Down Expand Up @@ -400,6 +401,9 @@ def onContextMenuRequested(self, point: QPoint):
if isinstance(data, JRLQuest):
menu.addAction("Add Entry").triggered.connect(lambda: self.addEntry(item, JRLEntry()))
menu.addAction("Remove Quest").triggered.connect(lambda: self.removeQuest(item))
# it's not easy to right click without selecting an item - add the 'addQuest' action here as well.
menu.addSeparator()
menu.addAction("Add Quest").triggered.connect(lambda: self.addQuest(item, JRLQuest()))
elif isinstance(data, JRLEntry):
menu.addAction("Remove Entry").triggered.connect(lambda: self.removeEntry(item))
else:
Expand Down

0 comments on commit 4c15696

Please sign in to comment.