mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-17 11:22:28 +12:00
Optimization in storyline view (wip)
This commit is contained in:
parent
3571ec3f16
commit
2cf7d99217
2
makefile
2
makefile
|
@ -16,7 +16,7 @@ lineprof:
|
||||||
kernprof -l -v manuskript/main.py
|
kernprof -l -v manuskript/main.py
|
||||||
|
|
||||||
profile:
|
profile:
|
||||||
python3 -m cProfile -s 'cumtime' manuskript/main.py | more
|
python3 -m cProfile -s 'cumtime' bin/manuskript | more
|
||||||
|
|
||||||
compile:
|
compile:
|
||||||
cd manuskript && python3 setup.py build_ext --inplace
|
cd manuskript && python3 setup.py build_ext --inplace
|
||||||
|
|
|
@ -5,6 +5,7 @@ from PyQt5.QtGui import QBrush, QPen, QFontMetrics, QFontMetricsF, QColor
|
||||||
from PyQt5.QtWidgets import QWidget, QGraphicsScene, QGraphicsSimpleTextItem, QMenu, QAction, QGraphicsRectItem, \
|
from PyQt5.QtWidgets import QWidget, QGraphicsScene, QGraphicsSimpleTextItem, QMenu, QAction, QGraphicsRectItem, \
|
||||||
QGraphicsLineItem, QGraphicsEllipseItem
|
QGraphicsLineItem, QGraphicsEllipseItem
|
||||||
|
|
||||||
|
from manuskript.enums import Outline
|
||||||
from manuskript.models import references
|
from manuskript.models import references
|
||||||
from manuskript.ui.views.storylineView_ui import Ui_storylineView
|
from manuskript.ui.views.storylineView_ui import Ui_storylineView
|
||||||
|
|
||||||
|
@ -50,11 +51,15 @@ class storylineView(QWidget, Ui_storylineView):
|
||||||
# self._mdlPlots.rowsInserted.connect(self.refresh)
|
# self._mdlPlots.rowsInserted.connect(self.refresh)
|
||||||
|
|
||||||
self._mdlOutline = mdlOutline
|
self._mdlOutline = mdlOutline
|
||||||
self._mdlOutline.dataChanged.connect(self.reloadTimer.start)
|
self._mdlOutline.dataChanged.connect(self.updateMaybe)
|
||||||
|
|
||||||
self._mdlCharacter = mdlCharacter
|
self._mdlCharacter = mdlCharacter
|
||||||
self._mdlCharacter.dataChanged.connect(self.reloadTimer.start)
|
self._mdlCharacter.dataChanged.connect(self.reloadTimer.start)
|
||||||
|
|
||||||
|
def updateMaybe(self, topLeft, bottomRight):
|
||||||
|
if topLeft.column() <= Outline.notes.value <= bottomRight.column():
|
||||||
|
self.reloadTimer.start
|
||||||
|
|
||||||
def plotReferences(self):
|
def plotReferences(self):
|
||||||
"Returns a list of plot references"
|
"Returns a list of plot references"
|
||||||
if not self._mdlPlots:
|
if not self._mdlPlots:
|
||||||
|
@ -85,7 +90,10 @@ class storylineView(QWidget, Ui_storylineView):
|
||||||
|
|
||||||
def refresh(self):
|
def refresh(self):
|
||||||
if not self._mdlPlots or not self._mdlOutline or not self._mdlCharacter:
|
if not self._mdlPlots or not self._mdlOutline or not self._mdlCharacter:
|
||||||
pass
|
return
|
||||||
|
|
||||||
|
if not self.isVisible():
|
||||||
|
return
|
||||||
|
|
||||||
LINE_HEIGHT = 18
|
LINE_HEIGHT = 18
|
||||||
SPACING = 3
|
SPACING = 3
|
||||||
|
|
Loading…
Reference in a new issue