Clean up flags in all GUI classes
This commit is contained in:
@@ -71,7 +71,7 @@ class GuiDictionaries(QDialog):
|
||||
self.tr("Download a dictionary from one of the links, and add it below."),
|
||||
f" \u203a <a href='{foUrl}'>{foUrl}</a>",
|
||||
f" \u203a <a href='{loUrl}'>{loUrl}</a>",
|
||||
]))
|
||||
]), self)
|
||||
self.huInfo.setOpenExternalLinks(True)
|
||||
self.huInfo.setWordWrap(True)
|
||||
self.huInput = QLineEdit(self)
|
||||
@@ -90,7 +90,7 @@ class GuiDictionaries(QDialog):
|
||||
self.huAddBox.addWidget(self.huImport)
|
||||
|
||||
# Install Path
|
||||
self.inInfo = QLabel(self.tr("Dictionary install location"))
|
||||
self.inInfo = QLabel(self.tr("Dictionary install location"), self)
|
||||
self.inPath = QLineEdit(self)
|
||||
self.inPath.setReadOnly(True)
|
||||
self.inBrowse = NIconToolButton(self, iSz, "browse")
|
||||
@@ -108,7 +108,7 @@ class GuiDictionaries(QDialog):
|
||||
self.infoBox.setFrameStyle(QFrame.Shape.NoFrame)
|
||||
|
||||
# Buttons
|
||||
self.buttonBox = QDialogButtonBox(QtDialogClose)
|
||||
self.buttonBox = QDialogButtonBox(QtDialogClose, self)
|
||||
self.buttonBox.rejected.connect(self._doClose)
|
||||
|
||||
# Assemble
|
||||
|
||||
@@ -61,7 +61,7 @@ class GuiLipsum(QDialog):
|
||||
self.innerBox.setSpacing(CONFIG.pxInt(16))
|
||||
|
||||
# Icon
|
||||
self.docIcon = QLabel()
|
||||
self.docIcon = QLabel(self)
|
||||
self.docIcon.setPixmap(SHARED.theme.getPixmap("proj_document", (nPx, nPx)))
|
||||
|
||||
self.leftBox = QVBoxLayout()
|
||||
@@ -71,15 +71,16 @@ class GuiLipsum(QDialog):
|
||||
self.innerBox.addLayout(self.leftBox)
|
||||
|
||||
# Form
|
||||
self.headLabel = QLabel("<b>{0}</b>".format(self.tr("Insert Lorem Ipsum Text")))
|
||||
self.headLabel = QLabel(self.tr("Insert Lorem Ipsum Text"))
|
||||
self.headLabel.setFont(SHARED.theme.guiFontB)
|
||||
|
||||
self.paraLabel = QLabel(self.tr("Number of paragraphs"))
|
||||
self.paraCount = QSpinBox()
|
||||
self.paraLabel = QLabel(self.tr("Number of paragraphs"), self)
|
||||
self.paraCount = QSpinBox(self)
|
||||
self.paraCount.setMinimum(1)
|
||||
self.paraCount.setMaximum(100)
|
||||
self.paraCount.setValue(5)
|
||||
|
||||
self.randLabel = QLabel(self.tr("Randomise order"))
|
||||
self.randLabel = QLabel(self.tr("Randomise order"), self)
|
||||
self.randSwitch = NSwitch(self)
|
||||
|
||||
self.formBox = QGridLayout()
|
||||
@@ -93,7 +94,7 @@ class GuiLipsum(QDialog):
|
||||
self.innerBox.addLayout(self.formBox)
|
||||
|
||||
# Buttons
|
||||
self.buttonBox = QDialogButtonBox()
|
||||
self.buttonBox = QDialogButtonBox(self)
|
||||
self.buttonBox.rejected.connect(self.close)
|
||||
|
||||
self.btnClose = self.buttonBox.addButton(QtDialogClose)
|
||||
|
||||
@@ -90,8 +90,8 @@ class GuiManuscriptBuild(QDialog):
|
||||
# Output Format
|
||||
# =============
|
||||
|
||||
self.lblFormat = QLabel(self.tr("Output Format"))
|
||||
self.listFormats = QListWidget()
|
||||
self.lblFormat = QLabel(self.tr("Output Format"), self)
|
||||
self.listFormats = QListWidget(self)
|
||||
self.listFormats.setIconSize(iSz)
|
||||
current = None
|
||||
for key in nwBuildFmt:
|
||||
@@ -109,14 +109,14 @@ class GuiManuscriptBuild(QDialog):
|
||||
self.formatBox.addWidget(self.listFormats, 1)
|
||||
self.formatBox.setContentsMargins(0, 0, 0, 0)
|
||||
|
||||
self.formatWidget = QWidget()
|
||||
self.formatWidget = QWidget(self)
|
||||
self.formatWidget.setLayout(self.formatBox)
|
||||
self.formatWidget.setContentsMargins(0, 0, 0, 0)
|
||||
|
||||
# Table of Contents
|
||||
# =================
|
||||
|
||||
self.lblContent = QLabel(self.tr("Table of Contents"))
|
||||
self.lblContent = QLabel(self.tr("Table of Contents"), self)
|
||||
|
||||
self.listContent = QListWidget(self)
|
||||
self.listContent.setIconSize(iSz)
|
||||
@@ -127,7 +127,7 @@ class GuiManuscriptBuild(QDialog):
|
||||
self.contentBox.addWidget(self.listContent, 0)
|
||||
self.contentBox.setContentsMargins(0, 0, 0, 0)
|
||||
|
||||
self.contentWidget = QWidget()
|
||||
self.contentWidget = QWidget(self)
|
||||
self.contentWidget.setLayout(self.contentBox)
|
||||
self.contentWidget.setContentsMargins(0, 0, 0, 0)
|
||||
|
||||
@@ -139,12 +139,12 @@ class GuiManuscriptBuild(QDialog):
|
||||
font.setUnderline(True)
|
||||
font.setPointSizeF(1.5*font.pointSizeF())
|
||||
|
||||
self.lblMain = QLabel(self._build.name)
|
||||
self.lblMain = QLabel(self._build.name, self)
|
||||
self.lblMain.setWordWrap(True)
|
||||
self.lblMain.setFont(font)
|
||||
|
||||
# Build Path
|
||||
self.lblPath = QLabel(self.tr("Path"))
|
||||
self.lblPath = QLabel(self.tr("Path"), self)
|
||||
self.buildPath = QLineEdit(self)
|
||||
self.btnBrowse = NIconToolButton(self, iSz, "browse")
|
||||
|
||||
@@ -154,7 +154,7 @@ class GuiManuscriptBuild(QDialog):
|
||||
self.pathBox.setSpacing(sp8)
|
||||
|
||||
# Build Name
|
||||
self.lblName = QLabel(self.tr("File Name"))
|
||||
self.lblName = QLabel(self.tr("File Name"), self)
|
||||
self.buildName = QLineEdit(self)
|
||||
self.btnReset = NIconToolButton(self, iSz, "revert")
|
||||
self.btnReset.setToolTip(self.tr("Reset file name to default"))
|
||||
@@ -181,19 +181,19 @@ class GuiManuscriptBuild(QDialog):
|
||||
self.buildBox.setVerticalSpacing(sp4)
|
||||
|
||||
# Dialog Buttons
|
||||
self.btnOpen = QPushButton(SHARED.theme.getIcon("browse"), self.tr("Open Folder"))
|
||||
self.btnOpen = QPushButton(SHARED.theme.getIcon("browse"), self.tr("Open Folder"), self)
|
||||
self.btnOpen.setIconSize(bSz)
|
||||
self.btnBuild = QPushButton(SHARED.theme.getIcon("export"), self.tr("&Build"))
|
||||
self.btnBuild = QPushButton(SHARED.theme.getIcon("export"), self.tr("&Build"), self)
|
||||
self.btnBuild.setIconSize(bSz)
|
||||
|
||||
self.dlgButtons = QDialogButtonBox(QtDialogClose)
|
||||
self.dlgButtons = QDialogButtonBox(QtDialogClose, self)
|
||||
self.dlgButtons.addButton(self.btnOpen, QtRoleAction)
|
||||
self.dlgButtons.addButton(self.btnBuild, QtRoleAction)
|
||||
|
||||
# Assemble GUI
|
||||
# ============
|
||||
|
||||
self.mainSplit = QSplitter()
|
||||
self.mainSplit = QSplitter(self)
|
||||
self.mainSplit.addWidget(self.formatWidget)
|
||||
self.mainSplit.addWidget(self.contentWidget)
|
||||
self.mainSplit.setHandleWidth(sp16)
|
||||
|
||||
@@ -124,7 +124,7 @@ class GuiManuscript(QDialog):
|
||||
self.tbEdit.setStyleSheet(buttonStyle)
|
||||
self.tbEdit.clicked.connect(self._editSelectedBuild)
|
||||
|
||||
self.lblBuilds = QLabel("<b>{0}</b>".format(self.tr("Builds")))
|
||||
self.lblBuilds = QLabel("<b>{0}</b>".format(self.tr("Builds")), self)
|
||||
|
||||
self.listToolBox = QHBoxLayout()
|
||||
self.listToolBox.addWidget(self.lblBuilds)
|
||||
@@ -141,8 +141,8 @@ class GuiManuscript(QDialog):
|
||||
self.buildList.setIconSize(iSz)
|
||||
self.buildList.doubleClicked.connect(self._editSelectedBuild)
|
||||
self.buildList.currentItemChanged.connect(self._updateBuildDetails)
|
||||
self.buildList.setSelectionMode(QAbstractItemView.SingleSelection)
|
||||
self.buildList.setDragDropMode(QAbstractItemView.InternalMove)
|
||||
self.buildList.setSelectionMode(QAbstractItemView.SelectionMode.SingleSelection)
|
||||
self.buildList.setDragDropMode(QAbstractItemView.DragDropMode.InternalMove)
|
||||
|
||||
# Details Tabs
|
||||
# ============
|
||||
@@ -170,16 +170,16 @@ class GuiManuscript(QDialog):
|
||||
# Process Controls
|
||||
# ================
|
||||
|
||||
self.btnPreview = QPushButton(self.tr("Preview"))
|
||||
self.btnPreview = QPushButton(self.tr("Preview"), self)
|
||||
self.btnPreview.clicked.connect(self._generatePreview)
|
||||
|
||||
self.btnPrint = QPushButton(self.tr("Print"))
|
||||
self.btnPrint = QPushButton(self.tr("Print"), self)
|
||||
self.btnPrint.clicked.connect(self._printDocument)
|
||||
|
||||
self.btnBuild = QPushButton(self.tr("Build"))
|
||||
self.btnBuild = QPushButton(self.tr("Build"), self)
|
||||
self.btnBuild.clicked.connect(self._buildManuscript)
|
||||
|
||||
self.btnClose = QPushButton(self.tr("Close"))
|
||||
self.btnClose = QPushButton(self.tr("Close"), self)
|
||||
self.btnClose.clicked.connect(self.close)
|
||||
|
||||
self.processBox = QGridLayout()
|
||||
@@ -211,7 +211,7 @@ class GuiManuscript(QDialog):
|
||||
self.optsWidget = QWidget(self)
|
||||
self.optsWidget.setLayout(self.controlBox)
|
||||
|
||||
self.mainSplit = QSplitter()
|
||||
self.mainSplit = QSplitter(self)
|
||||
self.mainSplit.addWidget(self.optsWidget)
|
||||
self.mainSplit.addWidget(self.docWdiget)
|
||||
self.mainSplit.setCollapsible(0, False)
|
||||
@@ -906,7 +906,7 @@ class _PreviewWidget(QTextBrowser):
|
||||
def printPreview(self, printer: QPrinter) -> None:
|
||||
"""Connect the print preview painter to the document viewer."""
|
||||
QApplication.setOverrideCursor(QCursor(Qt.CursorShape.WaitCursor))
|
||||
printer.setOrientation(QPrinter.Portrait)
|
||||
printer.setOrientation(QPrinter.Orientation.Portrait)
|
||||
self.document().print(printer)
|
||||
QApplication.restoreOverrideCursor()
|
||||
return
|
||||
@@ -1054,10 +1054,10 @@ class _StatsWidget(QWidget):
|
||||
"""Build the minimal stats page."""
|
||||
mPx = CONFIG.pxInt(8)
|
||||
|
||||
self.lblWordCount = QLabel(self.tr("Words"))
|
||||
self.lblWordCount = QLabel(self.tr("Words"), self)
|
||||
self.minWordCount = QLabel(self)
|
||||
|
||||
self.lblCharCount = QLabel(self.tr("Characters"))
|
||||
self.lblCharCount = QLabel(self.tr("Characters"), self)
|
||||
self.minCharCount = QLabel(self)
|
||||
|
||||
# Assemble
|
||||
|
||||
@@ -102,7 +102,7 @@ class GuiBuildSettings(QDialog):
|
||||
)
|
||||
|
||||
# Settings Name
|
||||
self.lblBuildName = QLabel(self.tr("Name"))
|
||||
self.lblBuildName = QLabel(self.tr("Name"), self)
|
||||
self.editBuildName = QLineEdit(self)
|
||||
|
||||
# SideBar
|
||||
@@ -134,7 +134,7 @@ class GuiBuildSettings(QDialog):
|
||||
self.toolStack.addWidget(self.optTabOutput)
|
||||
|
||||
# Buttons
|
||||
self.buttonBox = QDialogButtonBox(QtDialogApply | QtDialogSave | QtDialogClose)
|
||||
self.buttonBox = QDialogButtonBox(QtDialogApply | QtDialogSave | QtDialogClose, self)
|
||||
self.buttonBox.clicked.connect(self._dialogButtonClicked)
|
||||
|
||||
# Assemble
|
||||
@@ -331,15 +331,15 @@ class _FilterTab(NFixedPage):
|
||||
treeHeader = self.optTree.header()
|
||||
treeHeader.setStretchLastSection(False)
|
||||
treeHeader.setMinimumSectionSize(iPx + cMg) # See Issue #1551
|
||||
treeHeader.setSectionResizeMode(self.C_NAME, QHeaderView.Stretch)
|
||||
treeHeader.setSectionResizeMode(self.C_ACTIVE, QHeaderView.Fixed)
|
||||
treeHeader.setSectionResizeMode(self.C_STATUS, QHeaderView.Fixed)
|
||||
treeHeader.setSectionResizeMode(self.C_NAME, QHeaderView.ResizeMode.Stretch)
|
||||
treeHeader.setSectionResizeMode(self.C_ACTIVE, QHeaderView.ResizeMode.Fixed)
|
||||
treeHeader.setSectionResizeMode(self.C_STATUS, QHeaderView.ResizeMode.Fixed)
|
||||
treeHeader.resizeSection(self.C_ACTIVE, iPx + cMg)
|
||||
treeHeader.resizeSection(self.C_STATUS, iPx + cMg)
|
||||
|
||||
self.optTree.setDragDropMode(QAbstractItemView.NoDragDrop)
|
||||
self.optTree.setSelectionMode(QAbstractItemView.ExtendedSelection)
|
||||
self.optTree.setSelectionBehavior(QAbstractItemView.SelectRows)
|
||||
self.optTree.setDragDropMode(QAbstractItemView.DragDropMode.NoDragDrop)
|
||||
self.optTree.setSelectionMode(QAbstractItemView.SelectionMode.ExtendedSelection)
|
||||
self.optTree.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectRows)
|
||||
|
||||
# Filters
|
||||
# =======
|
||||
@@ -359,7 +359,7 @@ class _FilterTab(NFixedPage):
|
||||
self.resetButton.clicked.connect(lambda: self._setSelectedMode(self.F_FILTERED))
|
||||
|
||||
self.modeBox = QHBoxLayout()
|
||||
self.modeBox.addWidget(QLabel(self.tr("Mark selection as")))
|
||||
self.modeBox.addWidget(QLabel(self.tr("Mark selection as"), self))
|
||||
self.modeBox.addStretch(1)
|
||||
self.modeBox.addWidget(self.includedButton)
|
||||
self.modeBox.addWidget(self.excludedButton)
|
||||
@@ -369,7 +369,7 @@ class _FilterTab(NFixedPage):
|
||||
# Filer Options
|
||||
self.filterOpt = NSwitchBox(self, iPx)
|
||||
self.filterOpt.switchToggled.connect(self._applyFilterSwitch)
|
||||
self.filterOpt.setFrameStyle(QFrame.NoFrame)
|
||||
self.filterOpt.setFrameStyle(QFrame.Shape.NoFrame)
|
||||
|
||||
# Assemble GUI
|
||||
# ============
|
||||
@@ -381,10 +381,10 @@ class _FilterTab(NFixedPage):
|
||||
self.selectionBox.addLayout(self.modeBox)
|
||||
self.selectionBox.setContentsMargins(0, 0, 0, 0)
|
||||
|
||||
self.selectionWidget = QWidget()
|
||||
self.selectionWidget = QWidget(self)
|
||||
self.selectionWidget.setLayout(self.selectionBox)
|
||||
|
||||
self.mainSplit = QSplitter()
|
||||
self.mainSplit = QSplitter(self)
|
||||
self.mainSplit.addWidget(self.selectionWidget)
|
||||
self.mainSplit.addWidget(self.filterOpt)
|
||||
self.mainSplit.setCollapsible(0, False)
|
||||
@@ -703,7 +703,7 @@ class _HeadingsTab(NScrollablePage):
|
||||
# Edit Form
|
||||
# =========
|
||||
|
||||
self.lblEditForm = QLabel(self.tr("Editing: {0}").format(self.tr("None")))
|
||||
self.lblEditForm = QLabel(self.tr("Editing: {0}").format(self.tr("None")), self)
|
||||
|
||||
self.editTextBox = QPlainTextEdit(self)
|
||||
self.editTextBox.setFixedHeight(5*iPx)
|
||||
@@ -759,12 +759,12 @@ class _HeadingsTab(NScrollablePage):
|
||||
self.layoutMatrix.addWidget(self.layoutHeading, 0, 0, 1, 5)
|
||||
|
||||
# Title Layout
|
||||
self.mtxTitle = QLabel(self._build.getLabel("headings.fmtTitle"))
|
||||
self.mtxTitle = QLabel(self._build.getLabel("headings.fmtTitle"), self)
|
||||
self.centerTitle = NSwitch(self, height=iPx)
|
||||
self.breakTitle = NSwitch(self, height=iPx)
|
||||
lblCenterT = QLabel(self.tr("Centre"))
|
||||
lblCenterT = QLabel(self.tr("Centre"), self)
|
||||
lblCenterT.setIndent(sSp)
|
||||
lblBreakT = QLabel(self.tr("Page Break"))
|
||||
lblBreakT = QLabel(self.tr("Page Break"), self)
|
||||
lblBreakT.setIndent(sSp)
|
||||
|
||||
self.layoutMatrix.addWidget(self.mtxTitle, 1, 0)
|
||||
@@ -774,12 +774,12 @@ class _HeadingsTab(NScrollablePage):
|
||||
self.layoutMatrix.addWidget(self.breakTitle, 1, 4)
|
||||
|
||||
# Chapter Layout
|
||||
self.mtxChapter = QLabel(self._build.getLabel("headings.fmtChapter"))
|
||||
self.mtxChapter = QLabel(self._build.getLabel("headings.fmtChapter"), self)
|
||||
self.centerChapter = NSwitch(self, height=iPx)
|
||||
self.breakChapter = NSwitch(self, height=iPx)
|
||||
lblCenterC = QLabel(self.tr("Centre"))
|
||||
lblCenterC = QLabel(self.tr("Centre"), self)
|
||||
lblCenterC.setIndent(sSp)
|
||||
lblBreakC = QLabel(self.tr("Page Break"))
|
||||
lblBreakC = QLabel(self.tr("Page Break"), self)
|
||||
lblBreakC.setIndent(sSp)
|
||||
|
||||
self.layoutMatrix.addWidget(self.mtxChapter, 2, 0)
|
||||
@@ -789,12 +789,12 @@ class _HeadingsTab(NScrollablePage):
|
||||
self.layoutMatrix.addWidget(self.breakChapter, 2, 4)
|
||||
|
||||
# Scene Layout
|
||||
self.mtxScene = QLabel(self._build.getLabel("headings.fmtScene"))
|
||||
self.mtxScene = QLabel(self._build.getLabel("headings.fmtScene"), self)
|
||||
self.centerScene = NSwitch(self, height=iPx)
|
||||
self.breakScene = NSwitch(self, height=iPx)
|
||||
lblCenterS = QLabel(self.tr("Centre"))
|
||||
lblCenterS = QLabel(self.tr("Centre"), self)
|
||||
lblCenterS.setIndent(sSp)
|
||||
lblBreakS = QLabel(self.tr("Page Break"))
|
||||
lblBreakS = QLabel(self.tr("Page Break"), self)
|
||||
lblBreakS.setIndent(sSp)
|
||||
|
||||
self.layoutMatrix.addWidget(self.mtxScene, 3, 0)
|
||||
|
||||
@@ -95,7 +95,7 @@ class GuiNovelDetails(QDialog):
|
||||
self.mainStack.addWidget(self.contentsPage)
|
||||
|
||||
# Buttons
|
||||
self.buttonBox = QDialogButtonBox(QtDialogClose)
|
||||
self.buttonBox = QDialogButtonBox(QtDialogClose, self)
|
||||
self.buttonBox.rejected.connect(self.close)
|
||||
|
||||
# Assemble
|
||||
@@ -366,7 +366,7 @@ class _ContentsPage(NFixedPage):
|
||||
countFrom = options.getInt("GuiNovelDetails", "countFrom", 1)
|
||||
clearDouble = options.getBool("GuiNovelDetails", "clearDouble", True)
|
||||
|
||||
self.wpLabel = QLabel(self.tr("Words per page"))
|
||||
self.wpLabel = QLabel(self.tr("Words per page"), self)
|
||||
|
||||
self.wpValue = QSpinBox(self)
|
||||
self.wpValue.setMinimum(10)
|
||||
@@ -375,7 +375,7 @@ class _ContentsPage(NFixedPage):
|
||||
self.wpValue.setValue(wordsPerPage)
|
||||
self.wpValue.valueChanged.connect(self._populateTree)
|
||||
|
||||
self.poLabel = QLabel(self.tr("First page offset"))
|
||||
self.poLabel = QLabel(self.tr("First page offset"), self)
|
||||
|
||||
self.poValue = QSpinBox(self)
|
||||
self.poValue.setMinimum(1)
|
||||
@@ -384,7 +384,7 @@ class _ContentsPage(NFixedPage):
|
||||
self.poValue.setValue(countFrom)
|
||||
self.poValue.valueChanged.connect(self._populateTree)
|
||||
|
||||
self.dblLabel = QLabel(self.tr("Chapters on odd pages"))
|
||||
self.dblLabel = QLabel(self.tr("Chapters on odd pages"), self)
|
||||
|
||||
self.dblValue = NSwitch(self, height=iPx)
|
||||
self.dblValue.setChecked(clearDouble)
|
||||
|
||||
@@ -682,10 +682,10 @@ class _NewProjectForm(QWidget):
|
||||
# ========
|
||||
|
||||
self.extraBox = QVBoxLayout()
|
||||
self.extraBox.addWidget(QLabel("<b>{0}</b>".format(self.tr("Chapters and Scenes"))))
|
||||
self.extraBox.addWidget(QLabel("<b>{0}</b>".format(self.tr("Chapters and Scenes")), self))
|
||||
self.extraBox.addLayout(self.novelForm)
|
||||
self.extraBox.addSpacing(sPx)
|
||||
self.extraBox.addWidget(QLabel("<b>{0}</b>".format(self.tr("Project Notes"))))
|
||||
self.extraBox.addWidget(QLabel("<b>{0}</b>".format(self.tr("Project Notes")), self))
|
||||
self.extraBox.addLayout(self.notesForm)
|
||||
self.extraBox.setContentsMargins(0, 0, 0, 0)
|
||||
|
||||
@@ -694,7 +694,7 @@ class _NewProjectForm(QWidget):
|
||||
self.extraWidget.setContentsMargins(0, 0, 0, 0)
|
||||
|
||||
self.formBox = QVBoxLayout()
|
||||
self.formBox.addWidget(QLabel("<b>{0}</b>".format(self.tr("Create New Project"))))
|
||||
self.formBox.addWidget(QLabel("<b>{0}</b>".format(self.tr("Create New Project")), self))
|
||||
self.formBox.addLayout(self.projectForm)
|
||||
self.formBox.addSpacing(sPx)
|
||||
self.formBox.addWidget(self.extraWidget)
|
||||
@@ -738,7 +738,7 @@ class _NewProjectForm(QWidget):
|
||||
"""Select a project folder."""
|
||||
if projDir := QFileDialog.getExistingDirectory(
|
||||
self, self.tr("Select Project Folder"),
|
||||
str(self._basePath), options=QFileDialog.ShowDirsOnly
|
||||
str(self._basePath), options=QFileDialog.Option.ShowDirsOnly
|
||||
):
|
||||
self._basePath = Path(projDir)
|
||||
self._updateProjPath()
|
||||
|
||||
@@ -105,7 +105,7 @@ class GuiWritingStats(QDialog):
|
||||
pOptions.getInt("GuiWritingStats", "widthCol3", 80)
|
||||
)
|
||||
|
||||
self.listBox = QTreeWidget()
|
||||
self.listBox = QTreeWidget(self)
|
||||
self.listBox.setHeaderLabels([
|
||||
self.tr("Session Start"),
|
||||
self.tr("Length"),
|
||||
@@ -145,36 +145,36 @@ class GuiWritingStats(QDialog):
|
||||
self.infoForm = QGridLayout(self)
|
||||
self.infoBox.setLayout(self.infoForm)
|
||||
|
||||
self.labelTotal = QLabel(formatTime(0))
|
||||
self.labelTotal = QLabel(formatTime(0), self)
|
||||
self.labelTotal.setFont(SHARED.theme.guiFontFixed)
|
||||
self.labelTotal.setAlignment(QtAlignRightMiddle)
|
||||
|
||||
self.labelIdleT = QLabel(formatTime(0))
|
||||
self.labelIdleT = QLabel(formatTime(0), self)
|
||||
self.labelIdleT.setFont(SHARED.theme.guiFontFixed)
|
||||
self.labelIdleT.setAlignment(QtAlignRightMiddle)
|
||||
|
||||
self.labelFilter = QLabel(formatTime(0))
|
||||
self.labelFilter = QLabel(formatTime(0), self)
|
||||
self.labelFilter.setFont(SHARED.theme.guiFontFixed)
|
||||
self.labelFilter.setAlignment(QtAlignRightMiddle)
|
||||
|
||||
self.novelWords = QLabel("0")
|
||||
self.novelWords = QLabel("0", self)
|
||||
self.novelWords.setFont(SHARED.theme.guiFontFixed)
|
||||
self.novelWords.setAlignment(QtAlignRightMiddle)
|
||||
|
||||
self.notesWords = QLabel("0")
|
||||
self.notesWords = QLabel("0", self)
|
||||
self.notesWords.setFont(SHARED.theme.guiFontFixed)
|
||||
self.notesWords.setAlignment(QtAlignRightMiddle)
|
||||
|
||||
self.totalWords = QLabel("0")
|
||||
self.totalWords = QLabel("0", self)
|
||||
self.totalWords.setFont(SHARED.theme.guiFontFixed)
|
||||
self.totalWords.setAlignment(QtAlignRightMiddle)
|
||||
|
||||
lblTTime = QLabel(self.tr("Total Time:"))
|
||||
lblITime = QLabel(self.tr("Idle Time:"))
|
||||
lblFTime = QLabel(self.tr("Filtered Time:"))
|
||||
lblNvCount = QLabel(self.tr("Novel Word Count:"))
|
||||
lblNtCount = QLabel(self.tr("Notes Word Count:"))
|
||||
lblTtCount = QLabel(self.tr("Total Word Count:"))
|
||||
lblTTime = QLabel(self.tr("Total Time:"), self)
|
||||
lblITime = QLabel(self.tr("Idle Time:"), self)
|
||||
lblFTime = QLabel(self.tr("Filtered Time:"), self)
|
||||
lblNvCount = QLabel(self.tr("Novel Word Count:"), self)
|
||||
lblNtCount = QLabel(self.tr("Notes Word Count:"), self)
|
||||
lblTtCount = QLabel(self.tr("Total Word Count:"), self)
|
||||
|
||||
self.infoForm.addWidget(lblTTime, 0, 0)
|
||||
self.infoForm.addWidget(lblITime, 1, 0)
|
||||
@@ -235,12 +235,12 @@ class GuiWritingStats(QDialog):
|
||||
)
|
||||
self.showIdleTime.clicked.connect(self._updateListBox)
|
||||
|
||||
self.filterForm.addWidget(QLabel(self.tr("Count novel files")), 0, 0)
|
||||
self.filterForm.addWidget(QLabel(self.tr("Count note files")), 1, 0)
|
||||
self.filterForm.addWidget(QLabel(self.tr("Hide zero word count")), 2, 0)
|
||||
self.filterForm.addWidget(QLabel(self.tr("Hide negative word count")), 3, 0)
|
||||
self.filterForm.addWidget(QLabel(self.tr("Group entries by day")), 4, 0)
|
||||
self.filterForm.addWidget(QLabel(self.tr("Show idle time")), 5, 0)
|
||||
self.filterForm.addWidget(QLabel(self.tr("Count novel files"), self), 0, 0)
|
||||
self.filterForm.addWidget(QLabel(self.tr("Count note files"), self), 1, 0)
|
||||
self.filterForm.addWidget(QLabel(self.tr("Hide zero word count"), self), 2, 0)
|
||||
self.filterForm.addWidget(QLabel(self.tr("Hide negative word count"), self), 3, 0)
|
||||
self.filterForm.addWidget(QLabel(self.tr("Group entries by day"), self), 4, 0)
|
||||
self.filterForm.addWidget(QLabel(self.tr("Show idle time"), self), 5, 0)
|
||||
self.filterForm.addWidget(self.incNovel, 0, 1)
|
||||
self.filterForm.addWidget(self.incNotes, 1, 1)
|
||||
self.filterForm.addWidget(self.hideZeros, 2, 1)
|
||||
@@ -261,7 +261,7 @@ class GuiWritingStats(QDialog):
|
||||
|
||||
self.optsBox = QHBoxLayout()
|
||||
self.optsBox.addStretch(1)
|
||||
self.optsBox.addWidget(QLabel(self.tr("Word count cap for the histogram")), 0)
|
||||
self.optsBox.addWidget(QLabel(self.tr("Word count cap for the histogram"), self), 0)
|
||||
self.optsBox.addWidget(self.histMax, 0)
|
||||
|
||||
# Buttons
|
||||
|
||||
Reference in New Issue
Block a user