projects
/
jSite2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix log handler level
[jSite2.git]
/
src
/
net
/
pterodactylus
/
jsite
/
gui
/
MainWindow.java
diff --git
a/src/net/pterodactylus/jsite/gui/MainWindow.java
b/src/net/pterodactylus/jsite/gui/MainWindow.java
index
3d61638
..
fc9986a
100644
(file)
--- 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);
}
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);
}
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);
nodeMenu.add(connectMenu);
nodeMenu.add(disconnectMenuItem = new FixedJMenuItem(swingInterface.getNodeDisconnectAction()));
nodeMenu.add(disconnectMenu);
+ refreshNodeMenuItems();
languageMenu = new I18nMenu("mainWindow.menu.language");
menuBar.add(languageMenu);
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());
}
for (int componentIndex = 0; componentIndex < projectPane.getTabCount(); componentIndex++) {
projectPane.setTitleAt(componentIndex, projectPane.getComponentAt(componentIndex).getName());
}
+ refreshNodeMenuItems();
SwingUtils.repackCentered(this);
}
SwingUtils.repackCentered(this);
}