Use the reject slot for dialogs since close is not actually a slot
This commit is contained in:
@@ -85,7 +85,7 @@ class GuiAbout(NDialog):
|
|||||||
|
|
||||||
# Buttons
|
# Buttons
|
||||||
self.btnBox = QDialogButtonBox(QtDialogClose, self)
|
self.btnBox = QDialogButtonBox(QtDialogClose, self)
|
||||||
self.btnBox.rejected.connect(self.close)
|
self.btnBox.rejected.connect(self.reject)
|
||||||
|
|
||||||
# Assemble
|
# Assemble
|
||||||
self.innerBox = QVBoxLayout()
|
self.innerBox = QVBoxLayout()
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ class GuiProjectSettings(NDialog):
|
|||||||
# Buttons
|
# Buttons
|
||||||
self.buttonBox = QDialogButtonBox(QtDialogSave | QtDialogCancel, self)
|
self.buttonBox = QDialogButtonBox(QtDialogSave | QtDialogCancel, self)
|
||||||
self.buttonBox.accepted.connect(self._doSave)
|
self.buttonBox.accepted.connect(self._doSave)
|
||||||
self.buttonBox.rejected.connect(self.close)
|
self.buttonBox.rejected.connect(self.reject)
|
||||||
|
|
||||||
# Content
|
# Content
|
||||||
SHARED.project.countStatus()
|
SHARED.project.countStatus()
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ class GuiWordList(NDialog):
|
|||||||
# Buttons
|
# Buttons
|
||||||
self.buttonBox = QDialogButtonBox(QtDialogSave | QtDialogClose, self)
|
self.buttonBox = QDialogButtonBox(QtDialogSave | QtDialogClose, self)
|
||||||
self.buttonBox.accepted.connect(self._doSave)
|
self.buttonBox.accepted.connect(self._doSave)
|
||||||
self.buttonBox.rejected.connect(self.close)
|
self.buttonBox.rejected.connect(self.reject)
|
||||||
|
|
||||||
# Assemble
|
# Assemble
|
||||||
self.outerBox = QVBoxLayout()
|
self.outerBox = QVBoxLayout()
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ class GuiDictionaries(NNonBlockingDialog):
|
|||||||
|
|
||||||
# Buttons
|
# Buttons
|
||||||
self.buttonBox = QDialogButtonBox(QtDialogClose, self)
|
self.buttonBox = QDialogButtonBox(QtDialogClose, self)
|
||||||
self.buttonBox.rejected.connect(self._doClose)
|
self.buttonBox.rejected.connect(self.reject)
|
||||||
|
|
||||||
# Assemble
|
# Assemble
|
||||||
self.innerBox = QVBoxLayout()
|
self.innerBox = QVBoxLayout()
|
||||||
@@ -220,12 +220,6 @@ class GuiDictionaries(NNonBlockingDialog):
|
|||||||
SHARED.error("Path not found.")
|
SHARED.error("Path not found.")
|
||||||
return
|
return
|
||||||
|
|
||||||
@pyqtSlot()
|
|
||||||
def _doClose(self) -> None:
|
|
||||||
"""Close the dialog."""
|
|
||||||
self.close()
|
|
||||||
return
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Internal Functions
|
# Internal Functions
|
||||||
##
|
##
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ from __future__ import annotations
|
|||||||
import logging
|
import logging
|
||||||
import random
|
import random
|
||||||
|
|
||||||
from PyQt5.QtCore import Qt, pyqtSlot
|
from PyQt5.QtCore import pyqtSlot
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
QDialogButtonBox, QGridLayout, QHBoxLayout, QLabel, QSpinBox, QVBoxLayout,
|
QDialogButtonBox, QGridLayout, QHBoxLayout, QLabel, QSpinBox, QVBoxLayout,
|
||||||
QWidget
|
QWidget
|
||||||
@@ -48,13 +48,10 @@ class GuiLipsum(NDialog):
|
|||||||
|
|
||||||
logger.debug("Create: GuiLipsum")
|
logger.debug("Create: GuiLipsum")
|
||||||
self.setObjectName("GuiLipsum")
|
self.setObjectName("GuiLipsum")
|
||||||
if CONFIG.osDarwin:
|
self.setWindowTitle(self.tr("Insert Placeholder Text"))
|
||||||
self.setWindowFlag(Qt.WindowType.Tool)
|
|
||||||
|
|
||||||
self._lipsumText = ""
|
self._lipsumText = ""
|
||||||
|
|
||||||
self.setWindowTitle(self.tr("Insert Placeholder Text"))
|
|
||||||
|
|
||||||
vSp = CONFIG.pxInt(4)
|
vSp = CONFIG.pxInt(4)
|
||||||
nPx = CONFIG.pxInt(64)
|
nPx = CONFIG.pxInt(64)
|
||||||
|
|
||||||
@@ -96,7 +93,7 @@ class GuiLipsum(NDialog):
|
|||||||
|
|
||||||
# Buttons
|
# Buttons
|
||||||
self.buttonBox = QDialogButtonBox(self)
|
self.buttonBox = QDialogButtonBox(self)
|
||||||
self.buttonBox.rejected.connect(self.close)
|
self.buttonBox.rejected.connect(self.reject)
|
||||||
|
|
||||||
self.btnClose = self.buttonBox.addButton(QtDialogClose)
|
self.btnClose = self.buttonBox.addButton(QtDialogClose)
|
||||||
self.btnClose.setAutoDefault(False)
|
self.btnClose.setAutoDefault(False)
|
||||||
@@ -105,8 +102,6 @@ class GuiLipsum(NDialog):
|
|||||||
self.btnInsert.clicked.connect(self._doInsert)
|
self.btnInsert.clicked.connect(self._doInsert)
|
||||||
self.btnInsert.setAutoDefault(False)
|
self.btnInsert.setAutoDefault(False)
|
||||||
|
|
||||||
self.rejected.connect(self.close)
|
|
||||||
|
|
||||||
# Assemble
|
# Assemble
|
||||||
self.outerBox = QVBoxLayout()
|
self.outerBox = QVBoxLayout()
|
||||||
self.outerBox.addLayout(self.innerBox)
|
self.outerBox.addLayout(self.innerBox)
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ class GuiNovelDetails(NNonBlockingDialog):
|
|||||||
|
|
||||||
# Buttons
|
# Buttons
|
||||||
self.buttonBox = QDialogButtonBox(QtDialogClose, self)
|
self.buttonBox = QDialogButtonBox(QtDialogClose, self)
|
||||||
self.buttonBox.rejected.connect(self.close)
|
self.buttonBox.rejected.connect(self.reject)
|
||||||
|
|
||||||
# Assemble
|
# Assemble
|
||||||
self.topBox = QHBoxLayout()
|
self.topBox = QHBoxLayout()
|
||||||
|
|||||||
Reference in New Issue
Block a user