Fix a few minor typing issues
This commit is contained in:
@@ -814,7 +814,7 @@ class NWProject:
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def closeProject(self, idleTime=0):
|
def closeProject(self, idleTime=0.0):
|
||||||
"""Close the current project and clear all meta data.
|
"""Close the current project and clear all meta data.
|
||||||
"""
|
"""
|
||||||
logger.info("Closing project: %s", self.projPath)
|
logger.info("Closing project: %s", self.projPath)
|
||||||
|
|||||||
@@ -199,8 +199,8 @@ def exceptionHandler(exType, exValue, exTrace):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
# Try a controlled shutdown
|
# Try a controlled shutdown
|
||||||
nwGUI.closeProject(isYes=True)
|
nwGUI.closeProject(isYes=True) # type: ignore
|
||||||
nwGUI.closeMain()
|
nwGUI.closeMain() # type: ignore
|
||||||
logger.info("Emergency shutdown successful")
|
logger.info("Emergency shutdown successful")
|
||||||
|
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
|
|||||||
@@ -626,7 +626,7 @@ class GuiMain(QMainWindow):
|
|||||||
fHandle = None # The first file handle we encounter
|
fHandle = None # The first file handle we encounter
|
||||||
foundIt = False # We've found tHandle, pick the next we see
|
foundIt = False # We've found tHandle, pick the next we see
|
||||||
for tItem in self.theProject.tree:
|
for tItem in self.theProject.tree:
|
||||||
if not self.theProject.tree.checkType(tItem.itemHandle, nwItemType.FILE):
|
if tItem is None or not tItem.isFileType():
|
||||||
continue
|
continue
|
||||||
if fHandle is None:
|
if fHandle is None:
|
||||||
fHandle = tItem.itemHandle
|
fHandle = tItem.itemHandle
|
||||||
@@ -950,6 +950,7 @@ class GuiMain(QMainWindow):
|
|||||||
dlgDetails = getGuiItem("GuiProjectDetails")
|
dlgDetails = getGuiItem("GuiProjectDetails")
|
||||||
if dlgDetails is None:
|
if dlgDetails is None:
|
||||||
dlgDetails = GuiProjectDetails(self)
|
dlgDetails = GuiProjectDetails(self)
|
||||||
|
assert isinstance(dlgDetails, GuiProjectDetails)
|
||||||
|
|
||||||
dlgDetails.setModal(False)
|
dlgDetails.setModal(False)
|
||||||
dlgDetails.show()
|
dlgDetails.show()
|
||||||
@@ -968,6 +969,7 @@ class GuiMain(QMainWindow):
|
|||||||
dlgBuild = getGuiItem("GuiBuildNovel")
|
dlgBuild = getGuiItem("GuiBuildNovel")
|
||||||
if dlgBuild is None:
|
if dlgBuild is None:
|
||||||
dlgBuild = GuiBuildNovel(self)
|
dlgBuild = GuiBuildNovel(self)
|
||||||
|
assert isinstance(dlgBuild, GuiBuildNovel)
|
||||||
|
|
||||||
dlgBuild.setModal(False)
|
dlgBuild.setModal(False)
|
||||||
dlgBuild.show()
|
dlgBuild.show()
|
||||||
@@ -987,6 +989,7 @@ class GuiMain(QMainWindow):
|
|||||||
dlgLipsum = getGuiItem("GuiLipsum")
|
dlgLipsum = getGuiItem("GuiLipsum")
|
||||||
if dlgLipsum is None:
|
if dlgLipsum is None:
|
||||||
dlgLipsum = GuiLipsum(self)
|
dlgLipsum = GuiLipsum(self)
|
||||||
|
assert isinstance(dlgLipsum, GuiLipsum)
|
||||||
|
|
||||||
dlgLipsum.setModal(False)
|
dlgLipsum.setModal(False)
|
||||||
dlgLipsum.show()
|
dlgLipsum.show()
|
||||||
@@ -1021,6 +1024,7 @@ class GuiMain(QMainWindow):
|
|||||||
dlgStats = getGuiItem("GuiWritingStats")
|
dlgStats = getGuiItem("GuiWritingStats")
|
||||||
if dlgStats is None:
|
if dlgStats is None:
|
||||||
dlgStats = GuiWritingStats(self)
|
dlgStats = GuiWritingStats(self)
|
||||||
|
assert isinstance(dlgStats, GuiWritingStats)
|
||||||
|
|
||||||
dlgStats.setModal(False)
|
dlgStats.setModal(False)
|
||||||
dlgStats.show()
|
dlgStats.show()
|
||||||
@@ -1036,6 +1040,7 @@ class GuiMain(QMainWindow):
|
|||||||
dlgAbout = getGuiItem("GuiAbout")
|
dlgAbout = getGuiItem("GuiAbout")
|
||||||
if dlgAbout is None:
|
if dlgAbout is None:
|
||||||
dlgAbout = GuiAbout(self)
|
dlgAbout = GuiAbout(self)
|
||||||
|
assert isinstance(dlgAbout, GuiAbout)
|
||||||
|
|
||||||
dlgAbout.setModal(True)
|
dlgAbout.setModal(True)
|
||||||
dlgAbout.show()
|
dlgAbout.show()
|
||||||
@@ -1061,6 +1066,7 @@ class GuiMain(QMainWindow):
|
|||||||
dlgUpdate = getGuiItem("GuiUpdates")
|
dlgUpdate = getGuiItem("GuiUpdates")
|
||||||
if dlgUpdate is None:
|
if dlgUpdate is None:
|
||||||
dlgUpdate = GuiUpdates(self)
|
dlgUpdate = GuiUpdates(self)
|
||||||
|
assert isinstance(dlgUpdate, GuiUpdates)
|
||||||
|
|
||||||
dlgUpdate.setModal(True)
|
dlgUpdate.setModal(True)
|
||||||
dlgUpdate.show()
|
dlgUpdate.show()
|
||||||
|
|||||||
Reference in New Issue
Block a user