From 5f17b28e05869c0217c6218f524fd7a05a61b07e Mon Sep 17 00:00:00 2001
From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com>
Date: Wed, 13 Jan 2021 23:51:24 +0100
Subject: [PATCH] Remove old details panel in Project Settings
---
nw/gui/projsettings.py | 101 ++---------------------------------------
1 file changed, 3 insertions(+), 98 deletions(-)
diff --git a/nw/gui/projsettings.py b/nw/gui/projsettings.py
index 52df0589..23426cb5 100644
--- a/nw/gui/projsettings.py
+++ b/nw/gui/projsettings.py
@@ -31,9 +31,9 @@ import logging
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QIcon, QPixmap, QColor, QBrush
from PyQt5.QtWidgets import (
- QHBoxLayout, QVBoxLayout, QGridLayout, QLineEdit, QPlainTextEdit, QLabel,
- QWidget, QDialogButtonBox, QListWidget, QPushButton, QListWidgetItem,
- QColorDialog, QAbstractItemView, QTreeWidget, QTreeWidgetItem, QComboBox
+ QHBoxLayout, QVBoxLayout, QLineEdit, QPlainTextEdit, QLabel, QWidget,
+ QDialogButtonBox, QListWidget, QPushButton, QListWidgetItem, QColorDialog,
+ QAbstractItemView, QTreeWidget, QTreeWidgetItem, QComboBox
)
from nw.constants import nwAlert
@@ -68,13 +68,11 @@ class GuiProjectSettings(PagedDialog):
)
self.tabMain = GuiProjectEditMain(self.theParent, self.theProject)
- self.tabMeta = GuiProjectEditMeta(self.theParent, self.theProject)
self.tabStatus = GuiProjectEditStatus(self.theParent, self.theProject, True)
self.tabImport = GuiProjectEditStatus(self.theParent, self.theProject, False)
self.tabReplace = GuiProjectEditReplace(self.theParent, self.theProject)
self.addTab(self.tabMain, "Settings")
- self.addTab(self.tabMeta, "Details")
self.addTab(self.tabStatus, "Status")
self.addTab(self.tabImport, "Importance")
self.addTab(self.tabReplace, "Auto-Replace")
@@ -238,94 +236,6 @@ class GuiProjectEditMain(QWidget):
# END Class GuiProjectEditMain
-class GuiProjectEditMeta(QWidget):
-
- def __init__(self, theParent, theProject):
- QWidget.__init__(self, theParent)
-
- self.mainConf = nw.CONFIG
- self.theParent = theParent
- self.theProject = theProject
-
- xInd = self.mainConf.pxInt(8)
-
- # The Form
- self.mainForm = QGridLayout()
- self.setLayout(self.mainForm)
-
- self.headLabel = QLabel("Project Details")
-
- self.nameLabel = QLabel("Working title:")
- self.nameLabel.setIndent(xInd)
- self.nameValue = QLabel(self.theProject.projName)
- self.nameValue.setWordWrap(True)
-
- self.pathLabel = QLabel("Project path:")
- self.pathLabel.setIndent(xInd)
- self.pathValue = QLabel(self.theProject.projPath)
- self.pathValue.setWordWrap(True)
- self.pathValue.setTextInteractionFlags(Qt.TextSelectableByMouse)
- self.pathValue.setCursor(Qt.IBeamCursor)
-
- self.revLabel = QLabel("Revision count:")
- self.revLabel.setIndent(xInd)
- self.revValue = QLabel(f"{self.theProject.saveCount:n}")
-
- editHours = self.theProject.editTime/3600
- self.editLabel = QLabel("Edit time:")
- self.editLabel.setIndent(xInd)
- self.editValue = QLabel(f"{editHours:.2f} hours")
-
- self.statsLabel = QLabel("Project Stats")
-
- nR, nD, nF = self.theProject.projTree.countTypes()
-
- self.nRootLabel = QLabel("Root folders:")
- self.nRootLabel.setIndent(xInd)
- self.nRootValue = QLabel(f"{nR:n}")
-
- self.nDirLabel = QLabel("Folders:")
- self.nDirLabel.setIndent(xInd)
- self.nDirValue = QLabel(f"{nD:n}")
-
- self.nFileLabel = QLabel("Documents:")
- self.nFileLabel.setIndent(xInd)
- self.nFileValue = QLabel(f"{nF:n}")
-
- self.wordsLabel = QLabel("Word count:")
- self.wordsLabel.setIndent(xInd)
- self.wordsValue = QLabel(f"{self.theProject.currWCount:n}")
-
- self.mainForm.addWidget(self.headLabel, 0, 0, 1, 2, Qt.AlignTop)
- self.mainForm.addWidget(self.nameLabel, 1, 0, 1, 1, Qt.AlignTop)
- self.mainForm.addWidget(self.nameValue, 1, 1, 1, 1, Qt.AlignTop)
- self.mainForm.addWidget(self.pathLabel, 2, 0, 1, 1, Qt.AlignTop)
- self.mainForm.addWidget(self.pathValue, 2, 1, 1, 1, Qt.AlignTop)
- self.mainForm.addWidget(self.revLabel, 3, 0, 1, 1, Qt.AlignTop)
- self.mainForm.addWidget(self.revValue, 3, 1, 1, 1, Qt.AlignTop)
- self.mainForm.addWidget(self.editLabel, 4, 0, 1, 1, Qt.AlignTop)
- self.mainForm.addWidget(self.editValue, 4, 1, 1, 1, Qt.AlignTop)
-
- self.mainForm.addWidget(self.statsLabel, 5, 0, 1, 2, Qt.AlignTop)
- self.mainForm.addWidget(self.nRootLabel, 6, 0, 1, 1, Qt.AlignTop)
- self.mainForm.addWidget(self.nRootValue, 6, 1, 1, 1, Qt.AlignTop)
- self.mainForm.addWidget(self.nDirLabel, 7, 0, 1, 1, Qt.AlignTop)
- self.mainForm.addWidget(self.nDirValue, 7, 1, 1, 1, Qt.AlignTop)
- self.mainForm.addWidget(self.nFileLabel, 8, 0, 1, 1, Qt.AlignTop)
- self.mainForm.addWidget(self.nFileValue, 8, 1, 1, 1, Qt.AlignTop)
- self.mainForm.addWidget(self.wordsLabel, 9, 0, 1, 1, Qt.AlignTop)
- self.mainForm.addWidget(self.wordsValue, 9, 1, 1, 1, Qt.AlignTop)
-
- self.mainForm.setVerticalSpacing(self.mainConf.pxInt(6))
- self.mainForm.setHorizontalSpacing(self.mainConf.pxInt(12))
- self.mainForm.setColumnStretch(0, 0)
- self.mainForm.setColumnStretch(1, 1)
- self.mainForm.setRowStretch(10, 1)
-
- return
-
-# END Class GuiProjectEditMeta
-
class GuiProjectEditStatus(QWidget):
def __init__(self, theParent, theProject, isStatus):
@@ -414,7 +324,6 @@ class GuiProjectEditStatus(QWidget):
def _selectColour(self):
"""Open a dialog to select the status icon colour.
"""
- logger.verbose("Item colour button clicked")
if self.selColour is not None:
newCol = QColorDialog.getColor(
self.selColour, self, "Select Colour", QColorDialog.DontUseNativeDialog
@@ -430,7 +339,6 @@ class GuiProjectEditStatus(QWidget):
def _newItem(self):
"""Create a new status item.
"""
- logger.verbose("New item button clicked")
newItem = self._addItem("New Item", (0, 0, 0), None, 0)
newItem.setBackground(QBrush(QColor(0, 255, 0, 80)))
self.colChanged = True
@@ -439,7 +347,6 @@ class GuiProjectEditStatus(QWidget):
def _delItem(self):
"""Delete a status item.
"""
- logger.verbose("Delete item button clicked")
selItem = self._getSelectedItem()
if selItem is not None:
iRow = self.listBox.row(selItem)
@@ -456,7 +363,6 @@ class GuiProjectEditStatus(QWidget):
def _saveItem(self):
"""Save changes made to a status item.
"""
- logger.verbose("Save item button clicked")
selItem = self._getSelectedItem()
if selItem is not None:
selIdx = selItem.data(Qt.UserRole)
@@ -491,7 +397,6 @@ class GuiProjectEditStatus(QWidget):
"""Extract the info of a selected item and populate the settings
boxes and button.
"""
- logger.verbose("Item selected")
selItem = self._getSelectedItem()
if selItem is not None:
selIdx = selItem.data(Qt.UserRole)