Make sure all code lines are within a 100 characters
This commit is contained in:
@@ -82,9 +82,24 @@ class GuiDocEditor(QTextEdit):
|
||||
self.setAcceptRichText(False)
|
||||
|
||||
# Custom Shortcuts
|
||||
QShortcut(QKeySequence("Ctrl+."), self, context=Qt.WidgetShortcut, activated=self._openSpellContext)
|
||||
QShortcut(Qt.Key_Return | Qt.ControlModifier, self, context=Qt.WidgetShortcut, activated=self._followTag)
|
||||
QShortcut(Qt.Key_Enter | Qt.ControlModifier, self, context=Qt.WidgetShortcut, activated=self._followTag)
|
||||
QShortcut(
|
||||
QKeySequence("Ctrl+."),
|
||||
self,
|
||||
context = Qt.WidgetShortcut,
|
||||
activated = self._openSpellContext
|
||||
)
|
||||
QShortcut(
|
||||
Qt.Key_Return | Qt.ControlModifier,
|
||||
self,
|
||||
context = Qt.WidgetShortcut,
|
||||
activated = self._followTag
|
||||
)
|
||||
QShortcut(
|
||||
Qt.Key_Enter | Qt.ControlModifier,
|
||||
self,
|
||||
context = Qt.WidgetShortcut,
|
||||
activated = self._followTag
|
||||
)
|
||||
|
||||
# Set Up Word Count Thread and Timer
|
||||
self.wcInterval = self.mainConf.wordCountTimer
|
||||
@@ -459,7 +474,9 @@ class GuiDocEditor(QTextEdit):
|
||||
if len(theSuggest) > 0:
|
||||
for aWord in theSuggest:
|
||||
mnuWord = QAction(aWord, mnuSuggest)
|
||||
mnuWord.triggered.connect(lambda thePos, aWord=aWord : self._correctWord(theCursor, aWord))
|
||||
mnuWord.triggered.connect(
|
||||
lambda thePos, aWord=aWord : self._correctWord(theCursor, aWord)
|
||||
)
|
||||
mnuSuggest.addAction(mnuWord)
|
||||
mnuSuggest.addSeparator()
|
||||
mnuAdd = QAction("Add Word to Dictionary", mnuSuggest)
|
||||
|
||||
@@ -18,8 +18,8 @@ from PyQt5.QtGui import QIcon, QFont, QColor
|
||||
from PyQt5.QtWidgets import QTreeWidget, QTreeWidgetItem, QAbstractItemView, QApplication
|
||||
|
||||
from nw.project.item import NWItem
|
||||
from nw.enum import nwItemType, nwItemClass, nwItemLayout, nwAlert
|
||||
from nw.constants import nwLabels
|
||||
from nw.enum import nwItemType, nwItemClass, nwItemLayout, nwAlert
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -145,11 +145,15 @@ class GuiDocTree(QTreeWidget):
|
||||
|
||||
# If we again has no home, give up
|
||||
if pHandle is None:
|
||||
self.makeAlert("Did not find anywhere to add the file or folder!", nwAlert.ERROR)
|
||||
self.makeAlert(
|
||||
"Did not find anywhere to add the file or folder!", nwAlert.ERROR
|
||||
)
|
||||
return False
|
||||
|
||||
if pHandle == self.theProject.trashRoot:
|
||||
self.makeAlert("Cannot add new files or folders to the trash folder.", nwAlert.ERROR)
|
||||
self.makeAlert(
|
||||
"Cannot add new files or folders to the trash folder.", nwAlert.ERROR
|
||||
)
|
||||
return False
|
||||
|
||||
# If we're still here, add the file or folder
|
||||
@@ -295,10 +299,10 @@ class GuiDocTree(QTreeWidget):
|
||||
tStatus += "."+nwLabels.LAYOUT_FLAG[nwItem.itemLayout]
|
||||
iStatus = nwItem.itemStatus
|
||||
if tClass == nwItemClass.NOVEL:
|
||||
iStatus = self.theProject.statusItems.checkEntry(iStatus) # Make sure it's a valid index
|
||||
iStatus = self.theProject.statusItems.checkEntry(iStatus) # Make sure it's valid
|
||||
flagIcon = self.theParent.statusIcons[iStatus]
|
||||
else:
|
||||
iStatus = self.theProject.importItems.checkEntry(iStatus) # Make sure it's a valid index
|
||||
iStatus = self.theProject.importItems.checkEntry(iStatus) # Make sure it's valid
|
||||
flagIcon = self.theParent.importIcons[iStatus]
|
||||
|
||||
trItem.setText(self.C_NAME, tName)
|
||||
|
||||
@@ -205,24 +205,24 @@ class GuiDocViewer(QTextBrowser):
|
||||
).format(
|
||||
textSize = self.mainConf.textSize,
|
||||
preSize = self.mainConf.textSize*0.9,
|
||||
tColR = self.theTheme.colText[0],
|
||||
tColG = self.theTheme.colText[1],
|
||||
tColB = self.theTheme.colText[2],
|
||||
hColR = self.theTheme.colHead[0],
|
||||
hColG = self.theTheme.colHead[1],
|
||||
hColB = self.theTheme.colHead[2],
|
||||
cColR = self.theTheme.colComm[0],
|
||||
cColG = self.theTheme.colComm[1],
|
||||
cColB = self.theTheme.colComm[2],
|
||||
eColR = self.theTheme.colEmph[0],
|
||||
eColG = self.theTheme.colEmph[1],
|
||||
eColB = self.theTheme.colEmph[2],
|
||||
aColR = self.theTheme.colVal[0],
|
||||
aColG = self.theTheme.colVal[1],
|
||||
aColB = self.theTheme.colVal[2],
|
||||
kColR = self.theTheme.colKey[0],
|
||||
kColG = self.theTheme.colKey[1],
|
||||
kColB = self.theTheme.colKey[2],
|
||||
tColR = self.theTheme.colText[0],
|
||||
tColG = self.theTheme.colText[1],
|
||||
tColB = self.theTheme.colText[2],
|
||||
hColR = self.theTheme.colHead[0],
|
||||
hColG = self.theTheme.colHead[1],
|
||||
hColB = self.theTheme.colHead[2],
|
||||
cColR = self.theTheme.colComm[0],
|
||||
cColG = self.theTheme.colComm[1],
|
||||
cColB = self.theTheme.colComm[2],
|
||||
eColR = self.theTheme.colEmph[0],
|
||||
eColG = self.theTheme.colEmph[1],
|
||||
eColB = self.theTheme.colEmph[2],
|
||||
aColR = self.theTheme.colVal[0],
|
||||
aColG = self.theTheme.colVal[1],
|
||||
aColB = self.theTheme.colVal[2],
|
||||
kColR = self.theTheme.colKey[0],
|
||||
kColG = self.theTheme.colKey[1],
|
||||
kColB = self.theTheme.colKey[2],
|
||||
)
|
||||
self.qDocument.setDefaultStyleSheet(styleSheet)
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtGui import QIcon
|
||||
from PyQt5.QtWidgets import QFrame, QGridLayout, QLabel, QLineEdit, QPushButton, QApplication
|
||||
|
||||
from nw.enum import nwDocAction
|
||||
from nw.enum import nwDocAction
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user