mirror of
https://github.com/DanilaFe/abacus
synced 2024-12-22 07:20:09 -08:00
Load definitions after Abacus finishes loading.
This commit is contained in:
parent
4188c83a66
commit
0b6798e28d
|
@ -330,8 +330,10 @@ public class AbacusController implements PluginListener {
|
|||
}
|
||||
} catch (AbacusException abacusError) {
|
||||
outputText.setText(ERR_DEFINITION + " (" + abacusError.getMessage() + ")");
|
||||
abacusError.printStackTrace();
|
||||
} catch (RuntimeException runtime) {
|
||||
outputText.setText(ERR_DEFINITION + " (" + ERR_EXCEPTION + ")");
|
||||
runtime.printStackTrace();
|
||||
} catch (FileNotFoundException ignored) {}
|
||||
}
|
||||
|
||||
|
@ -345,13 +347,13 @@ public class AbacusController implements PluginListener {
|
|||
} catch (IOException | ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
abacus.reload();
|
||||
reloadAbacus();
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void performReload() {
|
||||
alertIfApplyNeeded(true);
|
||||
abacus.reload();
|
||||
reloadAbacus();
|
||||
}
|
||||
|
||||
@FXML
|
||||
|
@ -391,6 +393,13 @@ public class AbacusController implements PluginListener {
|
|||
changesMade = true;
|
||||
}
|
||||
|
||||
private void reloadAbacus(){
|
||||
abacus.reload();
|
||||
for(String file : definitionFiles){
|
||||
loadDefinitionFile(file);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad(PluginManager manager) {
|
||||
ExtendedConfiguration configuration = (ExtendedConfiguration) abacus.getConfiguration();
|
||||
|
@ -420,9 +429,6 @@ public class AbacusController implements PluginListener {
|
|||
}).collect(Collectors.toCollection(ArrayList::new)));
|
||||
functionList.sort(Comparator.comparing(Documentation::getCodeName));
|
||||
definitionFiles.addAll(configuration.getDefinitionFiles());
|
||||
for(String file : definitionFiles){
|
||||
loadDefinitionFile(file);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue
Block a user