aboutsummaryrefslogtreecommitdiff
path: root/src/component.py
diff options
context:
space:
mode:
authortassaron2017-08-20 18:36:43 -0400
committertassaron2017-08-20 18:36:43 -0400
commit6bf8a553d6170e0ca6e7d2002e46ae327a6e5e81 (patch)
treeb97c9c2d334772fff1c38c5a6a2a4a5b3e6863e4 /src/component.py
parentbe9eb9077b2234e6d91c78d70bb8e1d8347b03aa (diff)
don't merge undos when setting text with a button
plus changes to life.py for pep8 compliance
Diffstat (limited to 'src/component.py')
-rw-r--r--src/component.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/component.py b/src/component.py
index 0ff2fbd..1f55a19 100644
--- a/src/component.py
+++ b/src/component.py
@@ -285,6 +285,7 @@ class Component(QtCore.QObject, metaclass=ComponentMetaclass):
# LOCKING VARIABLES
self.openingPreset = False
+ self.mergeUndo = True
self._lockedProperties = None
self._lockedError = None
self._lockedSize = None
@@ -587,10 +588,12 @@ class Component(QtCore.QObject, metaclass=ComponentMetaclass):
if kwarg == 'colorWidgets':
def makeColorFunc(attr):
def pickColor_():
+ self.mergeUndo = False
self.pickColor(
self._trackedWidgets[attr],
self._colorWidgets[attr]
)
+ self.mergeUndo = True
return pickColor_
self._colorFuncs = {
attr: makeColorFunc(attr) for attr in kwargs[kwarg]
@@ -850,7 +853,7 @@ class ComponentUpdate(QtWidgets.QUndoCommand):
# Determine if this update is mergeable
self.id_ = -1
- if len(self.modifiedVals) == 1:
+ if len(self.modifiedVals) == 1 and self.parent.mergeUndo:
attr, val = self.modifiedVals.popitem()
self.id_ = sum([ord(letter) for letter in attr[-14:]])
self.modifiedVals[attr] = val