Fix tests and minor issues
This commit is contained in:
@@ -460,7 +460,7 @@ class GuiProjectDetailsContents(QWidget):
|
|||||||
if tHandle != self._currentRoot:
|
if tHandle != self._currentRoot:
|
||||||
self._prepareData(tHandle)
|
self._prepareData(tHandle)
|
||||||
self._populateTree()
|
self._populateTree()
|
||||||
self._currentRoot = tHandle
|
self._currentRoot = self.novelValue.handle
|
||||||
return
|
return
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
|
|||||||
@@ -103,10 +103,7 @@ class NovelSelector(QComboBox):
|
|||||||
|
|
||||||
if includeAll:
|
if includeAll:
|
||||||
self.insertSeparator(self.count())
|
self.insertSeparator(self.count())
|
||||||
if prefix:
|
self.addItem(icon, self.tr("All Novel Folders"), "")
|
||||||
self.addItem(prefix.format(self.tr("All Novel Folders")), "")
|
|
||||||
else:
|
|
||||||
self.addItem(icon, self.tr("All Novel Folders"), "")
|
|
||||||
|
|
||||||
self.setHandle(handle)
|
self.setHandle(handle)
|
||||||
self.setEnabled(self.count() > 1)
|
self.setEnabled(self.count() > 1)
|
||||||
@@ -120,6 +117,8 @@ class NovelSelector(QComboBox):
|
|||||||
|
|
||||||
@pyqtSlot(int)
|
@pyqtSlot(int)
|
||||||
def _indexChanged(self, index):
|
def _indexChanged(self, index):
|
||||||
|
"""Re-emit the change of selected novel signal, unless blocked.
|
||||||
|
"""
|
||||||
if not self._blockSignal:
|
if not self._blockSignal:
|
||||||
self.novelSelectionChanged.emit(self.currentData())
|
self.novelSelectionChanged.emit(self.currentData())
|
||||||
return
|
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_PAGES) == thePages[i]
|
||||||
assert tocTree.topLevelItem(i).text(tocTab.C_PAGE) == thePage[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()
|
# qtbot.stop()
|
||||||
|
|
||||||
# Clean Up
|
# Clean Up
|
||||||
|
|||||||
Reference in New Issue
Block a user