aboutsummaryrefslogtreecommitdiff
path: root/src/toolkit
diff options
context:
space:
mode:
authortassaron2017-08-15 22:20:25 -0400
committertassaron2017-08-15 22:20:25 -0400
commita1d7cbb984f2a6c2ea976daa8914a2c9845ee21c (patch)
treed1129d435b0548f4538bf0099cd82013c2fc1f7d /src/toolkit
parent733c005eeaf5d3ff15e0f60d320f5c03472bad60 (diff)
undoable edits for normal component settings; TODO: merge small edits
Diffstat (limited to 'src/toolkit')
-rw-r--r--src/toolkit/common.py12
-rw-r--r--src/toolkit/frame.py2
2 files changed, 13 insertions, 1 deletions
diff --git a/src/toolkit/common.py b/src/toolkit/common.py
index eba57d9..51ad023 100644
--- a/src/toolkit/common.py
+++ b/src/toolkit/common.py
@@ -9,6 +9,18 @@ import subprocess
from collections import OrderedDict
+class blockSignals:
+ '''A context manager to temporarily block a Qt widget from updating'''
+ def __init__(self, widget):
+ self.widget = widget
+
+ def __enter__(self):
+ self.widget.blockSignals(True)
+
+ def __exit__(self, *args):
+ self.widget.blockSignals(False)
+
+
def badName(name):
'''Returns whether a name contains non-alphanumeric chars'''
return any([letter in string.punctuation for letter in name])
diff --git a/src/toolkit/frame.py b/src/toolkit/frame.py
index ad8537c..2104978 100644
--- a/src/toolkit/frame.py
+++ b/src/toolkit/frame.py
@@ -98,7 +98,7 @@ def Checkerboard(width, height):
log.debug('Creating new %s*%s checkerboard' % (width, height))
image = FloodFrame(1920, 1080, (0, 0, 0, 0))
image.paste(Image.open(
- os.path.join(core.Core.wd, "background.png")),
+ os.path.join(core.Core.wd, 'gui', "background.png")),
(0, 0)
)
image = image.resize((width, height))