Replace exec_ with exec

This commit is contained in:
Veronica Berglyd Olsen
2024-04-03 18:41:39 +02:00
parent c8fe5e6620
commit f95bbb8760
28 changed files with 49 additions and 49 deletions
+2 -2
View File
@@ -187,7 +187,7 @@ def main(sysArgs: list | None = None):
))
for errLine in errorData:
logger.critical(errLine)
errApp.exec_()
errApp.exec()
sys.exit(errorCode)
# Finish initialising config
@@ -237,6 +237,6 @@ def main(sysArgs: list | None = None):
nwGUI = GuiMain()
nwGUI.postLaunchTasks(cmdOpen)
sys.exit(nwApp.exec_())
sys.exit(nwApp.exec())
# END Function main
+1 -1
View File
@@ -88,7 +88,7 @@ class GuiEditLabel(QDialog):
def getLabel(cls, parent: QWidget, text: str) -> tuple[str, bool]:
"""Pop the dialog and return the result."""
cls = GuiEditLabel(parent, text=text)
cls.exec_()
cls.exec()
label = cls.itemLabel
accepted = cls.result() == QDialog.Accepted
cls.deleteLater()
+1 -1
View File
@@ -123,7 +123,7 @@ class GuiQuoteSelect(QDialog):
def getQuote(cls, parent: QWidget, current: str = "") -> tuple[str, bool]:
"""Pop the dialog and return the result."""
cls = GuiQuoteSelect(parent, current=current)
cls.exec_()
cls.exec()
quote = cls._selected
accepted = cls.result() == QDialog.DialogCode.Accepted
cls.deleteLater()
+1 -1
View File
@@ -197,7 +197,7 @@ def exceptionHandler(exType: type, exValue: BaseException, exTrace: TracebackTyp
errMsg = NWErrorMessage(nwGUI)
errMsg.setMessage(exType, exValue, exTrace)
errMsg.exec_()
errMsg.exec()
try:
# Try a controlled shutdown
+1 -1
View File
@@ -1171,7 +1171,7 @@ class GuiDocEditor(QPlainTextEdit):
action.triggered.connect(lambda: self._addWord(word, block))
# Execute the context menu
ctxMenu.exec_(self.viewport().mapToGlobal(pos))
ctxMenu.exec(self.viewport().mapToGlobal(pos))
ctxMenu.deleteLater()
return
+1 -1
View File
@@ -410,7 +410,7 @@ class GuiDocViewer(QTextBrowser):
ctxMenu.addAction(mnuSelPara)
# Open the context menu
ctxMenu.exec_(self.viewport().mapToGlobal(point))
ctxMenu.exec(self.viewport().mapToGlobal(point))
ctxMenu.deleteLater()
return
+3 -3
View File
@@ -1230,7 +1230,7 @@ class GuiProjectTree(QTreeWidget):
else:
ctxMenu.buildSingleSelectMenu(hasChild)
ctxMenu.exec_(self.viewport().mapToGlobal(clickPos))
ctxMenu.exec(self.viewport().mapToGlobal(clickPos))
ctxMenu.deleteLater()
return True
@@ -1410,7 +1410,7 @@ class GuiProjectTree(QTreeWidget):
itemList.remove(tHandle)
dlgMerge = GuiDocMerge(self.mainGui, tHandle, itemList)
dlgMerge.exec_()
dlgMerge.exec()
if dlgMerge.result() == QDialog.DialogCode.Accepted:
@@ -1480,7 +1480,7 @@ class GuiProjectTree(QTreeWidget):
return False
dlgSplit = GuiDocSplit(self.mainGui, tHandle)
dlgSplit.exec_()
dlgSplit.exec()
if dlgSplit.result() == QDialog.DialogCode.Accepted:
+4 -4
View File
@@ -768,7 +768,7 @@ class GuiMain(QMainWindow):
"""Open the welcome dialog."""
dialog = GuiWelcome(self)
dialog.openProjectRequest.connect(self._openProjectFromWelcome)
dialog.exec_()
dialog.exec()
return
@pyqtSlot()
@@ -776,7 +776,7 @@ class GuiMain(QMainWindow):
"""Open the preferences dialog."""
dialog = GuiPreferences(self)
dialog.newPreferencesReady.connect(self._processConfigChanges)
dialog.exec_()
dialog.exec()
return
@pyqtSlot()
@@ -786,7 +786,7 @@ class GuiMain(QMainWindow):
if SHARED.hasProject:
dialog = GuiProjectSettings(self, gotoPage=focusTab)
dialog.newProjectSettingsReady.connect(self._processProjectSettingsChanges)
dialog.exec_()
dialog.exec()
return
@pyqtSlot()
@@ -820,7 +820,7 @@ class GuiMain(QMainWindow):
if SHARED.hasProject:
dialog = GuiWordList(self)
dialog.newWordListReady.connect(self._processWordListChanges)
dialog.exec_()
dialog.exec()
return
@pyqtSlot()
+4 -4
View File
@@ -292,7 +292,7 @@ class SharedData(QObject):
self._lastAlert = alert.logMessage
if log:
logger.info(self._lastAlert, stacklevel=2)
alert.exec_()
alert.exec()
alert.deleteLater()
return
@@ -304,7 +304,7 @@ class SharedData(QObject):
self._lastAlert = alert.logMessage
if log:
logger.warning(self._lastAlert, stacklevel=2)
alert.exec_()
alert.exec()
alert.deleteLater()
return
@@ -319,7 +319,7 @@ class SharedData(QObject):
self._lastAlert = alert.logMessage
if log:
logger.error(self._lastAlert, stacklevel=2)
alert.exec_()
alert.exec()
alert.deleteLater()
return
@@ -329,7 +329,7 @@ class SharedData(QObject):
alert.setMessage(text, info, details)
alert.setAlertType(_GuiAlert.WARN if warn else _GuiAlert.ASK, True)
self._lastAlert = alert.logMessage
alert.exec_()
alert.exec()
isYes = alert.result() == QMessageBox.StandardButton.Yes
alert.deleteLater()
return isYes
+1 -1
View File
@@ -129,7 +129,7 @@ class GuiLipsum(QDialog):
def getLipsum(cls, parent: QWidget) -> str:
"""Pop the dialog and return the lipsum text."""
cls = GuiLipsum(parent)
cls.exec_()
cls.exec()
text = cls.lipsumText
cls.deleteLater()
return text
+2 -2
View File
@@ -385,7 +385,7 @@ class GuiManuscript(QDialog):
build = self._getSelectedBuild()
if isinstance(build, BuildSettings):
dlgBuild = GuiManuscriptBuild(self, build)
dlgBuild.exec_()
dlgBuild.exec()
# After the build is done, save build settings changes
if build.changed:
@@ -398,7 +398,7 @@ class GuiManuscript(QDialog):
"""Open the print preview dialog."""
preview = QPrintPreviewDialog(self)
preview.paintRequested.connect(self.docPreview.printPreview)
preview.exec_()
preview.exec()
return
##
+1 -1
View File
@@ -377,7 +377,7 @@ class _OpenProjectPage(QWidget):
action.triggered.connect(self.openSelectedItem)
action = ctxMenu.addAction(self.tr("Remove Project"))
action.triggered.connect(self._deleteSelectedItem)
ctxMenu.exec_(self.mapToGlobal(pos))
ctxMenu.exec(self.mapToGlobal(pos))
ctxMenu.deleteLater()
return