Skip to content

Commit

Permalink
Do not warn on "New" if blocks are unchanged since opening
Browse files Browse the repository at this point in the history
Plus tidy some comments
  • Loading branch information
TonyCallear committed Oct 28, 2017
1 parent 314932d commit b3c92d1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/main/java/com/ardublock/ArduBlockTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public void init(Editor editor) {
// Don't just "close" Ardublock, see if there's something to save first.
// Note to self: Code here only affects behaviour when we're an Arduino Tool,
// not when run directly - See Main.java for that.
// Closing the Arduino IDE itself will still lose work!
//ArduBlockTool.openblocksFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
ArduBlockTool.openblocksFrame.addWindowListener( new WindowAdapter()
{
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/ardublock/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ private void startOpenblocksFrame() throws SAXException, IOException, ParserConf
// Don't just "close" Ardublock, see if there's something to save first.
// Note to self: This only affects behaviour when we're run directly,
// not when we're an Arduino Tool - See ArduBlockTool.java for that.
// Closing the Arduino IDE itself will still lose work!

//openblocksFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

Expand Down
9 changes: 9 additions & 0 deletions src/main/java/com/ardublock/ui/OpenblocksFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,15 @@ public void doNewArduBlockFile()
break;
}
}
else
{
// If workspace unchanged just start a new Ardublock
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
context.resetWorksapce();
context.setWorkspaceChanged(false);
this.setTitle(this.makeFrameTitle());
this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}

}

Expand Down

0 comments on commit b3c92d1

Please sign in to comment.