Merge branch 'main' into feature/build_preview
This commit is contained in:
@@ -172,7 +172,7 @@ class GuiDictionaries(NNonBlockingDialog):
|
||||
def closeEvent(self, event: QCloseEvent) -> None:
|
||||
"""Capture the user closing the window."""
|
||||
event.accept()
|
||||
self.deleteLater()
|
||||
self.softDelete()
|
||||
return
|
||||
|
||||
##
|
||||
|
||||
@@ -28,19 +28,20 @@ import random
|
||||
|
||||
from PyQt5.QtCore import Qt, pyqtSlot
|
||||
from PyQt5.QtWidgets import (
|
||||
QDialog, QDialogButtonBox, QGridLayout, QHBoxLayout, QLabel, QSpinBox,
|
||||
QVBoxLayout, QWidget
|
||||
QDialogButtonBox, QGridLayout, QHBoxLayout, QLabel, QSpinBox, QVBoxLayout,
|
||||
QWidget
|
||||
)
|
||||
|
||||
from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.common import readTextFile
|
||||
from novelwriter.extensions.modified import NDialog
|
||||
from novelwriter.extensions.switch import NSwitch
|
||||
from novelwriter.types import QtAlignLeft, QtAlignRight, QtDialogClose, QtRoleAction
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class GuiLipsum(QDialog):
|
||||
class GuiLipsum(NDialog):
|
||||
|
||||
def __init__(self, parent: QWidget) -> None:
|
||||
super().__init__(parent=parent)
|
||||
@@ -132,7 +133,7 @@ class GuiLipsum(QDialog):
|
||||
cls = GuiLipsum(parent)
|
||||
cls.exec()
|
||||
text = cls.lipsumText
|
||||
cls.deleteLater()
|
||||
cls.softDelete()
|
||||
return text
|
||||
|
||||
##
|
||||
|
||||
@@ -30,7 +30,7 @@ from pathlib import Path
|
||||
from PyQt5.QtCore import QTimer, pyqtSlot
|
||||
from PyQt5.QtGui import QCloseEvent
|
||||
from PyQt5.QtWidgets import (
|
||||
QAbstractButton, QAbstractItemView, QDialog, QDialogButtonBox, QFileDialog,
|
||||
QAbstractButton, QAbstractItemView, QDialogButtonBox, QFileDialog,
|
||||
QGridLayout, QHBoxLayout, QLabel, QLineEdit, QListWidget, QListWidgetItem,
|
||||
QPushButton, QSplitter, QVBoxLayout, QWidget
|
||||
)
|
||||
@@ -42,14 +42,14 @@ from novelwriter.core.buildsettings import BuildSettings
|
||||
from novelwriter.core.docbuild import NWBuildDocument
|
||||
from novelwriter.core.item import NWItem
|
||||
from novelwriter.enum import nwBuildFmt
|
||||
from novelwriter.extensions.modified import NIconToolButton
|
||||
from novelwriter.extensions.modified import NDialog, NIconToolButton
|
||||
from novelwriter.extensions.simpleprogress import NProgressSimple
|
||||
from novelwriter.types import QtAlignCenter, QtDialogClose, QtRoleAction, QtRoleReject, QtUserRole
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class GuiManuscriptBuild(QDialog):
|
||||
class GuiManuscriptBuild(NDialog):
|
||||
"""GUI Tools: Manuscript Build Dialog
|
||||
|
||||
This is the tool for running the build itself. It can be accessed
|
||||
@@ -250,7 +250,7 @@ class GuiManuscriptBuild(QDialog):
|
||||
"""
|
||||
self._saveSettings()
|
||||
event.accept()
|
||||
self.deleteLater()
|
||||
self.softDelete()
|
||||
return
|
||||
|
||||
##
|
||||
|
||||
@@ -265,7 +265,7 @@ class GuiManuscript(NToolDialog):
|
||||
if isinstance(obj, GuiBuildSettings) and obj.isVisible():
|
||||
obj.close()
|
||||
event.accept()
|
||||
self.deleteLater()
|
||||
self.softDelete()
|
||||
return
|
||||
|
||||
##
|
||||
@@ -895,9 +895,8 @@ class _PreviewWidget(QTextBrowser):
|
||||
document within the viewport.
|
||||
"""
|
||||
vBar = self.verticalScrollBar()
|
||||
sW = vBar.width() if vBar.isVisible() else 0
|
||||
tB = self.frameWidth()
|
||||
vW = self.width() - 2*tB - sW
|
||||
vW = self.width() - 2*tB - vBar.width()
|
||||
vH = self.height() - 2*tB
|
||||
tH = self.ageLabel.height()
|
||||
pS = self.buildProgress.width()
|
||||
|
||||
@@ -200,7 +200,7 @@ class GuiBuildSettings(NToolDialog):
|
||||
self._askToSaveBuild()
|
||||
self._saveSettings()
|
||||
event.accept()
|
||||
self.deleteLater()
|
||||
self.softDelete()
|
||||
return
|
||||
|
||||
##
|
||||
|
||||
@@ -150,7 +150,7 @@ class GuiNovelDetails(NNonBlockingDialog):
|
||||
"""Capture the user closing the window and save settings."""
|
||||
self._saveSettings()
|
||||
event.accept()
|
||||
self.deleteLater()
|
||||
self.softDelete()
|
||||
return
|
||||
|
||||
##
|
||||
|
||||
@@ -34,8 +34,8 @@ from PyQt5.QtCore import (
|
||||
)
|
||||
from PyQt5.QtGui import QCloseEvent, QColor, QFont, QPainter, QPaintEvent, QPen
|
||||
from PyQt5.QtWidgets import (
|
||||
QAction, QApplication, QDialog, QFileDialog, QFormLayout, QHBoxLayout,
|
||||
QLabel, QLineEdit, QListView, QMenu, QPushButton, QScrollArea, QShortcut,
|
||||
QAction, QApplication, QFileDialog, QFormLayout, QHBoxLayout, QLabel,
|
||||
QLineEdit, QListView, QMenu, QPushButton, QScrollArea, QShortcut,
|
||||
QStackedWidget, QStyledItemDelegate, QStyleOptionViewItem, QVBoxLayout,
|
||||
QWidget
|
||||
)
|
||||
@@ -46,7 +46,7 @@ from novelwriter.constants import nwFiles
|
||||
from novelwriter.core.coretools import ProjectBuilder
|
||||
from novelwriter.enum import nwItemClass
|
||||
from novelwriter.extensions.configlayout import NWrappedWidgetBox
|
||||
from novelwriter.extensions.modified import NIconToolButton, NSpinBox
|
||||
from novelwriter.extensions.modified import NDialog, NIconToolButton, NSpinBox
|
||||
from novelwriter.extensions.switch import NSwitch
|
||||
from novelwriter.extensions.versioninfo import VersionInfoWidget
|
||||
from novelwriter.types import QtAlignLeft, QtAlignRightTop, QtSelected
|
||||
@@ -56,7 +56,7 @@ logger = logging.getLogger(__name__)
|
||||
PANEL_ALPHA = 178
|
||||
|
||||
|
||||
class GuiWelcome(QDialog):
|
||||
class GuiWelcome(NDialog):
|
||||
|
||||
openProjectRequest = pyqtSignal(Path)
|
||||
|
||||
@@ -196,7 +196,7 @@ class GuiWelcome(QDialog):
|
||||
"""Capture the user closing the window and save settings."""
|
||||
self._saveSettings()
|
||||
event.accept()
|
||||
self.deleteLater()
|
||||
self.softDelete()
|
||||
return
|
||||
|
||||
##
|
||||
|
||||
@@ -318,7 +318,7 @@ class GuiWritingStats(NToolDialog):
|
||||
def closeEvent(self, event: QCloseEvent) -> None:
|
||||
"""Capture the user closing the window."""
|
||||
event.accept()
|
||||
self.deleteLater()
|
||||
self.softDelete()
|
||||
return
|
||||
|
||||
##
|
||||
|
||||
Reference in New Issue
Block a user