X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjsite%2Fgui%2FMainWindow.java;h=fc9986a45b32b9d84a5158e2dcc7a8689c86463d;hb=439bd54002fcdfa9f88d7f21236d4d8b3fadd6b0;hp=3d61638e4d5e4980bcdd849e67d34944406353df;hpb=2bd90a148fe17a4f091d148586d67eb69f4122f6;p=jSite2.git diff --git a/src/net/pterodactylus/jsite/gui/MainWindow.java b/src/net/pterodactylus/jsite/gui/MainWindow.java index 3d61638..fc9986a 100644 --- a/src/net/pterodactylus/jsite/gui/MainWindow.java +++ b/src/net/pterodactylus/jsite/gui/MainWindow.java @@ -169,10 +169,20 @@ public class MainWindow extends JFrame implements I18nable { for (Action nodeConnectAction: swingInterface.getNodeConnectActions()) { connectMenu.add(nodeConnectAction); } + if (connectMenu.getMenuComponentCount() == 0) { + JMenuItem noNodeAvailableItem = new JMenuItem(I18n.get("mainWindow.menu.connectNoNodeAvailable.name")); + noNodeAvailableItem.setEnabled(false); + connectMenu.add(noNodeAvailableItem); + } disconnectMenu.removeAll(); for (Action nodeDisconnectAction: swingInterface.getNodeDisconnectActions()) { disconnectMenu.add(nodeDisconnectAction); } + if (disconnectMenu.getMenuComponentCount() == 0) { + JMenuItem noNodeAvailableItem = new JMenuItem(I18n.get("mainWindow.menu.disconnectNoNodeAvailable.name")); + noNodeAvailableItem.setEnabled(false); + disconnectMenu.add(noNodeAvailableItem); + } } // @@ -206,6 +216,7 @@ public class MainWindow extends JFrame implements I18nable { nodeMenu.add(connectMenu); nodeMenu.add(disconnectMenuItem = new FixedJMenuItem(swingInterface.getNodeDisconnectAction())); nodeMenu.add(disconnectMenu); + refreshNodeMenuItems(); languageMenu = new I18nMenu("mainWindow.menu.language"); menuBar.add(languageMenu); @@ -314,6 +325,7 @@ public class MainWindow extends JFrame implements I18nable { for (int componentIndex = 0; componentIndex < projectPane.getTabCount(); componentIndex++) { projectPane.setTitleAt(componentIndex, projectPane.getComponentAt(componentIndex).getName()); } + refreshNodeMenuItems(); SwingUtils.repackCentered(this); }