Permalink
Browse files

bugfixes: CVCenter: prevent errors if no preferences exist. CVCenterP…

…references: classvar removeResponders belongs to CVWidget, not CVCenter. CVWidget: set removeResponders to true by default
  • Loading branch information...
nuss committed Aug 24, 2013
1 parent a336d70 commit 550a29de8f9ad6a514008b9b343ce78794dd8f71
Showing with 33 additions and 27 deletions.
  1. +31 −25 CVCenter/CVCenter.sc
  2. +1 −1 CVCenter/CVCenterPreferences.sc
  3. +1 −1 CVCenter/CVWidget.sc
View
@@ -412,29 +412,31 @@ CVCenter {
)
});
tabProperties.do(_.nextPos_(0@0));
- if(prefs[\saveGuiProperties] == 1, {
- newPrefs = CVCenterPreferences.readPreferences;
- if(newPrefs[\saveGuiProperties] == 1, {
- this.guix_(prefs[\guiProperties].left)
- .guiy_(prefs[\guiProperties].top)
- .guiwidth_(prefs[\guiProperties].width)
- .guiheight_(prefs[\guiProperties].height)
- ;
- newPrefs.put(\guiProperties, prefs[\guiProperties]);
- CVCenterPreferences.writePreferences(
- newPrefs[\saveGuiProperties],
- prefs[\guiProperties],
- newPrefs[\saveClassVars],
- newPrefs[\midiMode],
- newPrefs[\midiResolution],
- newPrefs[\midiMean],
- newPrefs[\softWithin],
- newPrefs[\ctrlButtonBank],
- newPrefs[\removeResponders],
- "Your CVCenter-preferences have successfully been written to disk."
- )
- });
- })
+ prefs !? {
+ if(prefs[\saveGuiProperties] == 1, {
+ newPrefs = CVCenterPreferences.readPreferences;
+ if(newPrefs[\saveGuiProperties] == 1, {
+ this.guix_(prefs[\guiProperties].left)
+ .guiy_(prefs[\guiProperties].top)
+ .guiwidth_(prefs[\guiProperties].width)
+ .guiheight_(prefs[\guiProperties].height)
+ ;
+ newPrefs.put(\guiProperties, prefs[\guiProperties]);
+ CVCenterPreferences.writePreferences(
+ newPrefs[\saveGuiProperties],
+ prefs[\guiProperties],
+ newPrefs[\saveClassVars],
+ newPrefs[\midiMode],
+ newPrefs[\midiResolution],
+ newPrefs[\midiMean],
+ newPrefs[\softWithin],
+ newPrefs[\ctrlButtonBank],
+ newPrefs[\removeResponders],
+ "Your CVCenter-preferences have successfully been written to disk."
+ )
+ });
+ })
+ }
});
thisNextPos = 0@0;
@@ -640,12 +642,16 @@ CVCenter {
this.prRegroupWidgets(tabs.activeTab);
});
if(window.bounds != lastUpdateBounds, {
- if(prefs[\saveGuiProperties] == 1, { prefs[\guiProperties] = window.bounds });
+ prefs !? {
+ if(prefs[\saveGuiProperties] == 1, { prefs[\guiProperties] = window.bounds });
+ };
// prefs[\guiProperties].postln;
})
};
lastUpdateBounds = window.bounds;
- if(prefs[\saveGuiProperties] == 1, { boundsOnShutDown = lastUpdateBounds });
+ prefs !? {
+ if(prefs[\saveGuiProperties] == 1, { boundsOnShutDown = lastUpdateBounds });
+ };
lastSetUp = this.setup;
}, 0.5, { window.isClosed }, "CVCenter-Updater");
});
@@ -360,7 +360,7 @@ CVCenterPreferences {
if(prefs.notNil and:{ prefs[\removeResponders].notNil }, {
removeResponders = buildCheckbox.(prefs[\removeResponders])
}, {
- removeResponders = buildCheckbox.(CVCenter.removeResponders)
+ removeResponders = buildCheckbox.(CVWidget.removeResponders)
});
flow.shift(5, 1);
View
@@ -17,7 +17,7 @@
CVWidget {
- classvar <>removeResponders;
+ classvar <>removeResponders = true;
classvar <>debug = false;
var <window, <guiEnv;
var <widgetCV, prDefaultAction, <>wdgtActions, <>bgColor, <alwaysPositive = 0.1;

0 comments on commit 550a29d

Please sign in to comment.