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 /presetmanager.py | |
| parent | 307d499f9ae2729c790fe9258d88aca72331cdf6 (diff) | |
asterisk next to modified preset is more accurate
hopefully
Diffstat (limited to 'presetmanager.py')
| -rw-r--r-- | presetmanager.py | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/presetmanager.py b/presetmanager.py index 4300ce1..2083483 100644 --- a/presetmanager.py +++ b/presetmanager.py @@ -14,6 +14,7 @@ class PresetManager(QtGui.QDialog): self.presetDir = self.core.presetDir self.findPresets() + # window self.lastFilter = '*' self.presetRows = [] # list of (comp, vers, name) tuples self.window = window @@ -126,6 +127,7 @@ class PresetManager(QtGui.QDialog): continue if newName: if index != -1: + selectedComponents[index].currentPreset = newName saveValueStore = \ selectedComponents[index].savePreset() componentName = str(selectedComponents[index]).strip() @@ -133,10 +135,7 @@ class PresetManager(QtGui.QDialog): self.createNewPreset( componentName, vers, newName, saveValueStore, window=self.parent.window) - selectedComponents[index].currentPreset = newName - #self.findPresets() - #self.drawPresetList() - self.parent.updateComponentTitle(index) + self.openPreset(newName) break def createNewPreset( @@ -173,16 +172,8 @@ class PresetManager(QtGui.QDialog): version = selectedComponents[index].version() dirname = os.path.join(self.presetDir, componentName, str(version)) filepath = os.path.join(dirname, presetName) - if not os.path.exists(filepath): - return - with open(filepath, 'r') as f: - for line in f: - saveValueStore = core.Core.presetFromString(line.strip()) - break - selectedComponents[index].loadPreset( - saveValueStore, - presetName - ) + self.core.openPreset(filepath, index, presetName) + self.parent.updateComponentTitle(index) self.parent.drawPreview() |
