Merge pull request #420 from sdburns1998/config-enable-disable
Config enable disable
This commit is contained in:
@@ -54,4 +54,8 @@ public @interface ConfigItem
|
|||||||
String hide() default "";
|
String hide() default "";
|
||||||
|
|
||||||
String parent() default "";
|
String parent() default "";
|
||||||
|
|
||||||
|
String enabledBy() default "";
|
||||||
|
|
||||||
|
String disabledBy() default "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -850,10 +850,8 @@ public class ConfigPanel extends PluginPanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
configManager.setConfiguration(cd.getGroup().value(), cig.getGroup() + "_collapse", collapse);
|
configManager.setConfiguration(cd.getGroup().value(), cig.getGroup() + "_collapse", collapse);
|
||||||
|
|
||||||
int scrollBarPosition = scrollPane.getVerticalScrollBar().getValue();
|
reloadPluginlist(listItem, config, cd);
|
||||||
openGroupConfigPanel(listItem, config, cd);
|
|
||||||
scrollPane.getVerticalScrollBar().setValue(scrollBarPosition);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -891,10 +889,22 @@ public class ConfigPanel extends PluginPanel
|
|||||||
|
|
||||||
if (itemHide.contains(cid.getItem().keyName()))
|
if (itemHide.contains(cid.getItem().keyName()))
|
||||||
{ // If another options visibility changes depending on the value of this checkbox, then render the entire menu again
|
{ // If another options visibility changes depending on the value of this checkbox, then render the entire menu again
|
||||||
int scrollBarPosition = scrollPane.getVerticalScrollBar().getValue();
|
|
||||||
openGroupConfigPanel(listItem, config, cd);
|
reloadPluginlist(listItem, config, cd);
|
||||||
scrollPane.getVerticalScrollBar().setValue(scrollBarPosition);
|
}
|
||||||
return;
|
}
|
||||||
|
|
||||||
|
if (checkbox.isSelected())
|
||||||
|
{
|
||||||
|
if (cid2.getItem().enabledBy().contains(cid.getItem().keyName()))
|
||||||
|
{
|
||||||
|
configManager.setConfiguration(cd.getGroup().value(), cid2.getItem().keyName(), "true");
|
||||||
|
reloadPluginlist(listItem, config, cd);
|
||||||
|
}
|
||||||
|
else if (cid2.getItem().disabledBy().contains(cid.getItem().keyName()))
|
||||||
|
{
|
||||||
|
configManager.setConfiguration(cd.getGroup().value(), cid2.getItem().keyName(), "false");
|
||||||
|
reloadPluginlist(listItem, config, cd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1029,4 +1039,11 @@ public class ConfigPanel extends PluginPanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void reloadPluginlist(PluginListItem listItem, Config config, ConfigDescriptor cd)
|
||||||
|
{
|
||||||
|
int scrollBarPosition = scrollPane.getVerticalScrollBar().getValue();
|
||||||
|
openGroupConfigPanel(listItem, config, cd);
|
||||||
|
scrollPane.getVerticalScrollBar().setValue(scrollBarPosition);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user