Fix tests and minor issues

This commit is contained in:
Veronica Berglyd Olsen
2022-11-22 13:05:05 +01:00
parent 3a77228aaa
commit 4fa6329eb6
3 changed files with 9 additions and 5 deletions
+1 -1
View File
@@ -460,7 +460,7 @@ class GuiProjectDetailsContents(QWidget):
if tHandle != self._currentRoot:
self._prepareData(tHandle)
self._populateTree()
self._currentRoot = tHandle
self._currentRoot = self.novelValue.handle
return
@pyqtSlot()
+3 -4
View File
@@ -103,10 +103,7 @@ class NovelSelector(QComboBox):
if includeAll:
self.insertSeparator(self.count())
if prefix:
self.addItem(prefix.format(self.tr("All Novel Folders")), "")
else:
self.addItem(icon, self.tr("All Novel Folders"), "")
self.addItem(icon, self.tr("All Novel Folders"), "")
self.setHandle(handle)
self.setEnabled(self.count() > 1)
@@ -120,6 +117,8 @@ class NovelSelector(QComboBox):
@pyqtSlot(int)
def _indexChanged(self, index):
"""Re-emit the change of selected novel signal, unless blocked.
"""
if not self._blockSignal:
self.novelSelectionChanged.emit(self.currentData())
return
@@ -93,6 +93,11 @@ def testDlgProjDetails_Dialog(qtbot, nwGUI, nwLipsum):
assert tocTree.topLevelItem(i).text(tocTab.C_PAGES) == thePages[i]
assert tocTree.topLevelItem(i).text(tocTab.C_PAGE) == thePage[i]
# Re-populate
assert tocTab._currentRoot is None
tocTab._novelValueChanged("7a992350f3eb6") # Not a root
assert tocTab._currentRoot == "b3643d0f92e32" # The actual novel root
# qtbot.stop()
# Clean Up