From 2c2e370f0d6c24654a39e8d5657cb6c216ec9651 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 15 Nov 2008 02:49:19 +0100 Subject: [PATCH] Emit warning and abort insert if the selected node is not connected. --- src/net/pterodactylus/jsite/gui/SwingInterface.java | 4 ++++ 1 file changed, 4 insertions(+) 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); } -- 2.7.4