Re-organised the Preferences dialog as some pages were growing quite long
This commit is contained in:
+9
-3
@@ -143,15 +143,15 @@ class GuiDocEditor(QTextEdit):
|
||||
)
|
||||
|
||||
# Set Up Word Counter
|
||||
self.wcInterval = self.mainConf.wordCountTimer
|
||||
self.wcTimer = QTimer()
|
||||
self.wcTimer.setInterval(int(self.wcInterval*1000))
|
||||
self.wcTimer.timeout.connect(self._runCounter)
|
||||
|
||||
self.wCounter = BackgroundWordCounter(self)
|
||||
self.wCounter.setAutoDelete(False)
|
||||
self.wCounter.signals.countsReady.connect(self._updateCounts)
|
||||
|
||||
self.wcInterval = self.mainConf.wordCountTimer
|
||||
|
||||
self.initEditor()
|
||||
|
||||
logger.debug("GuiDocEditor initialisation complete")
|
||||
@@ -258,6 +258,10 @@ class GuiDocEditor(QTextEdit):
|
||||
# Initialise the syntax highlighter
|
||||
self.hLight.initHighlighter()
|
||||
|
||||
# Configure word count timer
|
||||
self.wcInterval = self.mainConf.wordCountTimer
|
||||
self.wcTimer.setInterval(int(self.wcInterval*1000))
|
||||
|
||||
# If we have a document open, we should reload it in case the
|
||||
# font changed, otherwise we just clear the editor entirely,
|
||||
# which makes it read only.
|
||||
@@ -1721,7 +1725,9 @@ class BackgroundWordCounter(QRunnable):
|
||||
## END Class BackgroundWordCounter
|
||||
|
||||
class BackgroundWordCounterSignals(QObject):
|
||||
|
||||
"""The QRunnable cannot emit a signal, so we need a simple QObject
|
||||
to hold the word counter signal.
|
||||
"""
|
||||
countsReady = pyqtSignal(int, int, int)
|
||||
|
||||
# END Class BackgroundWordCounterSignals
|
||||
|
||||
Reference in New Issue
Block a user