Skip to content

Commit d39d8ca

Browse files
committed
fix action null error
1 parent 76359e5 commit d39d8ca

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/main/java/component/ConfigDialog.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ public ConfigDialog(Project project) throws IOException, InterruptedException {
9191
freqCombo.addItem(30.0);
9292
}
9393
}
94-
if (new File("config.json").exists()) {
95-
loadConfig();
96-
}
94+
Config config = new Config();
95+
config.loadFromJson();
96+
//load freq
97+
freqCombo.setSelectedItem(config.getSampleFreq());
98+
9799
}
98100

99101
private void loadConfig() {
@@ -153,7 +155,9 @@ public void updateActionGroup() {
153155
for (String label : labels) {
154156
AddLabelAction newLabel = new AddLabelAction();
155157
newLabel.setDescription(label);
156-
actionManager.registerAction("CodeGRITS.AddLabelAction.[" + label + "]", newLabel);
158+
String id = "CodeGRITS.AddLabelAction.[" + label + "]";
159+
if(actionManager.getAction(id) != null) actionManager.unregisterAction(id);
160+
actionManager.registerAction(id, newLabel);
157161
actionGroup.add(newLabel);
158162
}
159163
}

0 commit comments

Comments
 (0)