mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-29 16:01:19 -04:00
fixed a bug: undo sets the correct modified state if all modifications are undone.
This commit is contained in:
parent
dd4a4eb2a9
commit
cf93a019ae
@ -661,7 +661,10 @@ public class Circuit {
|
||||
listeners.remove(listener);
|
||||
}
|
||||
|
||||
private void fireChangedEvent() {
|
||||
/**
|
||||
* notifies listeners about circuit changes
|
||||
*/
|
||||
public void fireChangedEvent() {
|
||||
if (listeners != null)
|
||||
for (ChangedListener l : listeners)
|
||||
l.circuitHasChanged();
|
||||
|
@ -1114,7 +1114,7 @@ public final class Main extends JFrame implements ClosingWindowListener.ConfirmS
|
||||
@Override
|
||||
public void circuitHasChanged() {
|
||||
ensureModelIsStopped();
|
||||
if (!modifiedPrefixVisible)
|
||||
if (modifiedPrefixVisible != circuitComponent.getCircuit().isModified())
|
||||
setFilename(filename, false);
|
||||
}
|
||||
|
||||
|
@ -381,7 +381,7 @@ public class CircuitComponent extends JComponent implements Circuit.ChangedListe
|
||||
redoAction.setEnabled(true);
|
||||
if (undoPosition == 0)
|
||||
undoAction.setEnabled(false);
|
||||
circuit.modified();
|
||||
circuit.fireChangedEvent();
|
||||
repaintNeeded();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user