diff --git a/diylc/diylc-core/src/org/diylc/core/Project.java b/diylc/diylc-core/src/org/diylc/core/Project.java
index dabc54a2..0fa86a53 100644
--- a/diylc/diylc-core/src/org/diylc/core/Project.java
+++ b/diylc/diylc-core/src/org/diylc/core/Project.java
@@ -255,6 +255,31 @@ public class Project implements Serializable {
if (other.width != null)
return false;
} else if (!width.equals(other.width))
+ return false;
+ if (gridSpacing == null) {
+ if (other.gridSpacing != null)
+ return false;
+ } else if (!gridSpacing.equals(other.gridSpacing))
+ return false;
+ if (font == null) {
+ if (other.font != null)
+ return false;
+ } else if (!font.equals(other.font))
+ return false;
+ if (groups == null) {
+ if (other.groups != null)
+ return false;
+ } else if (!groups.equals(other.groups))
+ return false;
+ if (lockedLayers == null) {
+ if (other.lockedLayers != null)
+ return false;
+ } else if (!lockedLayers.equals(other.lockedLayers))
+ return false;
+ if (hiddenLayers == null) {
+ if (other.hiddenLayers != null)
+ return false;
+ } else if (!hiddenLayers.equals(other.hiddenLayers))
return false;
return true;
}
diff --git a/diylc/diylc-core/src/org/diylc/presenter/Presenter.java b/diylc/diylc-core/src/org/diylc/presenter/Presenter.java
index 20f2d9d4..cf6fabd6 100644
--- a/diylc/diylc-core/src/org/diylc/presenter/Presenter.java
+++ b/diylc/diylc-core/src/org/diylc/presenter/Presenter.java
@@ -1592,6 +1592,7 @@ public class Presenter implements IPlugInPort {
@Override
public void setLayerLocked(int layerZOrder, boolean locked) {
LOG.info(String.format("setLayerLocked(%s, %s)", layerZOrder, locked));
+ Project oldProject = currentProject.clone();
if (locked) {
currentProject.getLockedLayers().add(layerZOrder);
} else {
@@ -1600,11 +1601,16 @@ public class Presenter implements IPlugInPort {
updateSelection(EMPTY_SELECTION);
messageDispatcher.dispatchMessage(EventType.REPAINT);
messageDispatcher.dispatchMessage(EventType.LAYER_STATE_CHANGED, currentProject.getLockedLayers());
+ if (!oldProject.equals(currentProject)) {
+ messageDispatcher.dispatchMessage(EventType.PROJECT_MODIFIED, oldProject, currentProject.clone(), locked ? "Lock Layer" : "Unlock Layer");
+ projectFileManager.notifyFileChange();
+ }
}
@Override
public void setLayerVisibility(int layerZOrder, boolean visible) {
LOG.info(String.format("setLayerVisibility(%s, %s)", layerZOrder, visible));
+ Project oldProject = currentProject.clone();
if (visible) {
currentProject.getHiddenLayers().remove(layerZOrder);
} else {
@@ -1613,6 +1619,10 @@ public class Presenter implements IPlugInPort {
updateSelection(EMPTY_SELECTION);
messageDispatcher.dispatchMessage(EventType.REPAINT);
messageDispatcher.dispatchMessage(EventType.LAYER_VISIBILITY_CHANGED, currentProject.getHiddenLayers());
+ if (!oldProject.equals(currentProject)) {
+ messageDispatcher.dispatchMessage(EventType.PROJECT_MODIFIED, oldProject, currentProject.clone(), visible ? "Show Layer" : "Hide Layer");
+ projectFileManager.notifyFileChange();
+ }
}
@SuppressWarnings("unchecked")
diff --git a/diylc/diylc-swing/update.xml b/diylc/diylc-swing/update.xml
index 3f7f2df9..e6c5a6a6 100644
--- a/diylc/diylc-swing/update.xml
+++ b/diylc/diylc-swing/update.xml
@@ -2140,7 +2140,7 @@
NEW_FEATURE
- Added "Label Orientation" property to leaded components that can be used to force labels to be rendered horizontally instead of following component placement direction
+ Added "Label Orientation" property to leaded components that can be used to force component labels to be rendered horizontally instead of following component placement direction
NEW_FEATURE
@@ -2169,10 +2169,14 @@
BUG_FIX
Project font gets reverted to "Square721 BT" on Undo
-
+
BUG_FIX
- When loaded from an existing file "Potentiometer Symbol" doesn't retain the specified orientation
+ Some actions do not register with Undo/Redo mechanism: project font, layer settings, group/ungroup
+
+
+ BUG_FIX
+ When loaded from an existing file, "Potentiometer Symbol" doesn't retain the specified orientation
https://github.com/bancika/diy-layout-creator/releases