Revision: 3904
Author: [email protected]
Date: Thu Aug 19 11:10:37 2010
Log: The session now checks to see if it is headless before prompting the user to save changes.
http://code.google.com/p/power-architect/source/detail?r=3904

Modified:
/trunk/src/main/java/ca/sqlpower/architect/swingui/ArchitectSwingSessionImpl.java

=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/swingui/ArchitectSwingSessionImpl.java Thu Aug 5 12:36:09 2010 +++ /trunk/src/main/java/ca/sqlpower/architect/swingui/ArchitectSwingSessionImpl.java Thu Aug 19 11:10:37 2010
@@ -567,7 +567,7 @@
* @return True if the project can be closed; false if the project should remain open.
      */
     protected boolean promptForUnsavedModifications() {
-        if (getProjectLoader().isModified()) {
+        if (getProjectLoader().isModified() && frame != null) {
             int response = JOptionPane.showOptionDialog(frame,
Messages.getString("ArchitectSwingSessionImpl.projectHasUnsavedChanges"), Messages.getString("ArchitectSwingSessionImpl.unsavedChangesDialogTitle"), //$NON-NLS-1$ //$NON-NLS-2$ JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null,
@@ -659,9 +659,11 @@
             // Only prompt to save if it is not an enterprise session
             if (getProjectLoader().isSaveInProgress()) {
                 // project save is in progress, don't allow exit
-                JOptionPane.showMessageDialog(frame,
- Messages.getString("ArchitectSwingSessionImpl.cannotExitWhileSaving"), //$NON-NLS-1$ - Messages.getString("ArchitectSwingSessionImpl.cannotExitWhileSavingDialogTitle"), JOptionPane.WARNING_MESSAGE); //$NON-NLS-1$
+                if (frame != null) {
+                    JOptionPane.showMessageDialog(frame,
+ Messages.getString("ArchitectSwingSessionImpl.cannotExitWhileSaving"), //$NON-NLS-1$ + Messages.getString("ArchitectSwingSessionImpl.cannotExitWhileSavingDialogTitle"), JOptionPane.WARNING_MESSAGE); //$NON-NLS-1$
+                }
                 return false;
             }

Reply via email to