Skip to content

Commit

Permalink
fix saving of last opened project state (#1590)
Browse files Browse the repository at this point in the history
Serialization errors prevented the saving of currently
opened project state and prevented the app to remember
if some gcode was open when app was closed.

NotSerializable error that occurs can be tested with following steps
1) start the ugs-platform with command: mvn nbm:run-platform -pl ugs-platform/application
2) open gcode file
3) closes the ugs-platform
4) Errors in console were shown from the serialization errors
5) restart ugs-platform and previously opened gcode should open automatically

Fixes: #1589

Signed-off-by: Mika Laitio <[email protected]>

Co-authored-by: Mika Laitio <[email protected]>
  • Loading branch information
lamikr and lamikr authored Apr 28, 2021
1 parent a006182 commit f9d1abc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ This file is part of Universal Gcode Sender (UGS).
import org.openide.filesystems.FileChangeListener;
import org.openide.filesystems.FileEvent;
import org.openide.filesystems.FileRenameEvent;
import java.io.Serializable;

/**
* Listens to external file change events and updates it on the controller
*/
public class GcodeFileListener implements FileChangeListener {
public class GcodeFileListener implements FileChangeListener, Serializable {
private static final long serialVersionUID = 7255903502190131123L;

@Override
public void fileFolderCreated(FileEvent fe) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ This file is part of Universal Gcode Sender (UGS).
position = 1000
)
public class SourceMultiviewElement extends MultiViewEditorElement {

private static final long serialVersionUID = 7255236202190135442L;
private static EditorListener editorListener = new EditorListener();
private final GcodeDataObject obj;
private final GcodeFileListener fileListener;
Expand Down

0 comments on commit f9d1abc

Please sign in to comment.