diff options
| author | tassaron | 2017-06-13 22:47:18 -0400 |
|---|---|---|
| committer | tassaron | 2017-06-13 22:47:18 -0400 |
| commit | 2ad14b7d6ca9216bcdc72c5e13937fcbccc887a3 (patch) | |
| tree | 489dfd5ef2c125040fbf04415ba139fb5798c56b /components | |
| parent | 307d499f9ae2729c790fe9258d88aca72331cdf6 (diff) | |
asterisk next to modified preset is more accurate
hopefully
Diffstat (limited to 'components')
| -rw-r--r-- | components/__base__.py | 9 | ||||
| -rw-r--r-- | components/color.py | 4 | ||||
| -rw-r--r-- | components/image.py | 4 | ||||
| -rw-r--r-- | components/original.py | 4 | ||||
| -rw-r--r-- | components/text.py | 4 | ||||
| -rw-r--r-- | components/video.py | 4 |
6 files changed, 15 insertions, 14 deletions
diff --git a/components/__base__.py b/components/__base__.py index b32c120..bc6644b 100644 --- a/components/__base__.py +++ b/components/__base__.py @@ -1,5 +1,6 @@ from PyQt4 import QtGui, QtCore + class Component(QtCore.QObject): '''A base class for components to inherit from''' @@ -26,8 +27,8 @@ class Component(QtCore.QObject): self.canceled = False def update(self): - self.modified.emit(self.compPos, True) - # use super().update() then read your widget values here + self.modified.emit(self.compPos, self.savePreset()) + # read your widget values, then call super().update() def loadPreset(self, presetDict, presetName): '''Children should take (presetDict, presetName=None) as args''' @@ -36,10 +37,10 @@ class Component(QtCore.QObject): # Then update your widgets using the preset dict self.currentPreset = presetName \ if presetName != None else presetDict['preset'] - + ''' def savePreset(self): return {} - + ''' def preFrameRender(self, **kwargs): for var, value in kwargs.items(): exec('self.%s = value' % var) diff --git a/components/color.py b/components/color.py index b6105c8..5912bfa 100644 --- a/components/color.py +++ b/components/color.py @@ -8,7 +8,7 @@ from . import __base__ class Component(__base__.Component): '''Color''' - modified = QtCore.pyqtSignal(int, bool) + modified = QtCore.pyqtSignal(int, dict) def widget(self, parent): self.parent = parent @@ -48,12 +48,12 @@ class Component(__base__.Component): return page def update(self): - super().update() self.color1 = self.RGBFromString(self.page.lineEdit_color1.text()) self.color2 = self.RGBFromString(self.page.lineEdit_color2.text()) self.x = self.page.spinBox_x.value() self.y = self.page.spinBox_y.value() self.parent.drawPreview() + super().update() def previewRender(self, previewWorker): width = int(previewWorker.core.settings.value('outputWidth')) diff --git a/components/image.py b/components/image.py index ed5f243..cdf10c7 100644 --- a/components/image.py +++ b/components/image.py @@ -7,7 +7,7 @@ from . import __base__ class Component(__base__.Component): '''Image''' - modified = QtCore.pyqtSignal(int, bool) + modified = QtCore.pyqtSignal(int, dict) def widget(self, parent): self.parent = parent @@ -25,9 +25,9 @@ class Component(__base__.Component): return page def update(self): - super().update() self.imagePath = self.page.lineEdit_image.text() self.parent.drawPreview() + super().update() def previewRender(self, previewWorker): width = int(previewWorker.core.settings.value('outputWidth')) diff --git a/components/original.py b/components/original.py index f3f578d..9df2815 100644 --- a/components/original.py +++ b/components/original.py @@ -11,7 +11,7 @@ from copy import copy class Component(__base__.Component): '''Original Audio Visualization''' - modified = QtCore.pyqtSignal(int, bool) + modified = QtCore.pyqtSignal(int, dict) def widget(self, parent): self.parent = parent @@ -35,10 +35,10 @@ class Component(__base__.Component): return page def update(self): - super().update() self.layout = self.page.comboBox_visLayout.currentIndex() self.visColor = self.RGBFromString(self.page.lineEdit_visColor.text()) self.parent.drawPreview() + super().update() def loadPreset(self, pr, presetName=None): super().loadPreset(pr, presetName) diff --git a/components/text.py b/components/text.py index a40e2a9..165a093 100644 --- a/components/text.py +++ b/components/text.py @@ -10,7 +10,7 @@ from . import __base__ class Component(__base__.Component): '''Title Text''' - modified = QtCore.pyqtSignal(int, bool) + modified = QtCore.pyqtSignal(int, dict) def __init__(self, *args): super().__init__(*args) @@ -56,7 +56,6 @@ class Component(__base__.Component): return page def update(self): - super().update() self.title = self.page.lineEdit_title.text() self.alignment = self.page.comboBox_textAlign.currentIndex() self.titleFont = self.page.fontComboBox_titleFont.currentFont() @@ -66,6 +65,7 @@ class Component(__base__.Component): self.textColor = self.RGBFromString( self.page.lineEdit_textColor.text()) self.parent.drawPreview() + super().update() def getXY(self): '''Returns true x, y after considering alignment settings''' diff --git a/components/video.py b/components/video.py index ff06329..841f77b 100644 --- a/components/video.py +++ b/components/video.py @@ -87,7 +87,7 @@ class Video: class Component(__base__.Component): '''Video''' - modified = QtCore.pyqtSignal(int, bool) + modified = QtCore.pyqtSignal(int, dict) def widget(self, parent): self.parent = parent @@ -109,10 +109,10 @@ class Component(__base__.Component): return page def update(self): - super().update() self.videoPath = self.page.lineEdit_video.text() self.loopVideo = self.page.checkBox_loop.isChecked() self.parent.drawPreview() + super().update() def previewRender(self, previewWorker): width = int(previewWorker.core.settings.value('outputWidth')) |
