Handler for File → Quit. @return false if canceled, true otherwise.
()
| 1546 | * @return false if canceled, true otherwise. |
| 1547 | */ |
| 1548 | public boolean handleQuit() { |
| 1549 | // If quit is canceled, this will be replaced anyway |
| 1550 | // by a later handleQuit() that is not canceled. |
| 1551 | // storeSketches(); |
| 1552 | |
| 1553 | if (handleQuitEach()) { |
| 1554 | // make sure running sketches close before quitting |
| 1555 | for (Editor editor : editors) { |
| 1556 | editor.internalCloseRunner(); |
| 1557 | } |
| 1558 | // Save out the current prefs state |
| 1559 | Preferences.save(); |
| 1560 | |
| 1561 | // Finished with this guy |
| 1562 | Console.shutdown(); |
| 1563 | |
| 1564 | if (!Platform.isMacOS()) { |
| 1565 | // If this was fired from the menu or an AppleEvent (the Finder), |
| 1566 | // then Mac OS X will send the terminate signal itself. |
| 1567 | System.exit(0); |
| 1568 | } |
| 1569 | return true; |
| 1570 | } |
| 1571 | return false; |
| 1572 | } |
| 1573 | |
| 1574 | |
| 1575 | /** |
no test coverage detected