Merge pull request #3901 from JakubValtar/eidtor-update-count-init

Set update count on Editor startup
This commit is contained in:
Ben Fry
2015-09-29 11:29:55 -04:00
+9
View File
@@ -523,7 +523,14 @@ public class Base {
}
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
private int updatesAvailable = 0;
public void setUpdatesAvailable(int n) {
updatesAvailable = n;
synchronized (editors) {
for (Editor e : editors) {
e.setUpdatesAvailable(n);
@@ -1229,6 +1236,8 @@ public class Base {
try {
Editor editor = nextMode.createEditor(this, path, state);
editor.setUpdatesAvailable(updatesAvailable);
// opened successfully, let's go to work
editor.getSketch().setUntitled(untitled);
editors.add(editor);