From: David ‘Bombe’ Roden Date: Sat, 15 Nov 2008 01:49:19 +0000 (+0100) Subject: Emit warning and abort insert if the selected node is not connected. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=2c2e370f0d6c24654a39e8d5657cb6c216ec9651;p=jSite2.git Emit warning and abort insert if the selected node is not connected. --- diff --git a/src/net/pterodactylus/jsite/gui/SwingInterface.java b/src/net/pterodactylus/jsite/gui/SwingInterface.java index 437cce9..3df6402 100644 --- a/src/net/pterodactylus/jsite/gui/SwingInterface.java +++ b/src/net/pterodactylus/jsite/gui/SwingInterface.java @@ -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); }