reseno chovani kdy se pri otevreni mapy nezobrazilo nastaveni serveru, pred zobrazenim mapy fungovalo

verze3
Michal 2026-08-29 23:25:35 +02:00
parent b564d64ff9
commit e1c0578abc
1 changed files with 20 additions and 10 deletions

View File

@ -292,22 +292,32 @@ public class Window extends JFrame {
public static void showServerSettings(int tab) {
if (instance == null) {
System.err.println("instance is null");
return;
}
SwingUtilities.invokeLater(() -> {
if (currentServerSettingsPanel == null) {
// if (currentServerSettingsPanel == null) {
currentServerSettingsPanel = new ServerSettingsPanel();
JScrollPane scroll = new JScrollPane(currentServerSettingsPanel);
instance.splitPane.add(scroll, JSplitPane.RIGHT);
//JScrollPane scroll = new JScrollPane(currentServerSettingsPanel);
instance.splitPane.add(currentServerSettingsPanel, JSplitPane.RIGHT);
instance.splitPane.revalidate();
}
// }
currentServerSettingsPanel.setTable(tab);
if (tab == ServerSettingsPanel.TAB_DEVICE_TYPE) {
currentServerSettingsPanel.refreshDeviceTypes();
} else if (tab == ServerSettingsPanel.TAB_USERS) {
currentServerSettingsPanel.refreshUsers();
} else if (tab == ServerSettingsPanel.TAB_SNMP_PROFILE) {
// zatím neimplementováno
switch (tab) {
case ServerSettingsPanel.TAB_DEVICE_TYPE:
currentServerSettingsPanel.refreshDeviceTypes();
break;
case ServerSettingsPanel.TAB_USERS:
currentServerSettingsPanel.refreshUsers();
break;
case ServerSettingsPanel.TAB_SNMP_PROFILE:
currentServerSettingsPanel.refreshSnmpProfiles();
break;
case ServerSettingsPanel.TAB_SNMP_TEMPLATE:
currentServerSettingsPanel.refreshSnmpTemplate();
break;
default:
break;
}
});
}