Emit warning and abort insert if the selected node is not connected.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 15 Nov 2008 01:49:19 +0000 (02:49 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 15 Nov 2008 01:49:19 +0000 (02:49 +0100)
src/net/pterodactylus/jsite/gui/SwingInterface.java

index 437cce9..3df6402 100644 (file)
@@ -809,6 +809,10 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
                        targetNode = nodeList.get(selectedNodeIndex);
                }
                logger.log(Level.INFO, "Inserting project “" + project.getName() + "” to node “" + targetNode.getName() + "”...");
+               if (!core.isNodeConnected(targetNode)) {
+                       JOptionPane.showMessageDialog(mainWindow, I18n.get("mainWindow.error.nodeNotConnected.message", targetNode.getName()), I18n.get("mainWindow.error.nodeNotConnected.title", targetNode.getName()), JOptionPane.ERROR_MESSAGE);
+                       return;
+               }
                core.insertProject(targetNode, project);
        }