()
| 1506 | } |
| 1507 | |
| 1508 | @Override |
| 1509 | public void run() |
| 1510 | { |
| 1511 | worker.execute(); |
| 1512 | //wait until the worker finish and post any errors that occurred |
| 1513 | try |
| 1514 | { |
| 1515 | statusBar.setSourceLoadErrors(worker.get()); |
| 1516 | } catch (InterruptedException | ExecutionException e) |
| 1517 | { |
| 1518 | Logging.errorPrint("error when loading sources", e); |
| 1519 | } |
| 1520 | //now that the SourceFileLoader has finished |
| 1521 | //handle licenses and whatnot |
| 1522 | section15 = " " |
| 1523 | + readTextFromFile( |
| 1524 | ConfigurationSettings.getSystemsDir() + File.separator + "opengaminglicense.10a.txt") |
| 1525 | + loader.getOGL(); |
| 1526 | try |
| 1527 | { |
| 1528 | showLicenses(); |
| 1529 | } |
| 1530 | catch (Throwable e) |
| 1531 | { |
| 1532 | Logging.errorPrint("Failed to show licences.", e); |
| 1533 | } |
| 1534 | |
| 1535 | DataSetFacade data = loader.getDataSetFacade(); |
| 1536 | if (data != null) |
| 1537 | { |
| 1538 | currentSourceSelection.set(sources); |
| 1539 | |
| 1540 | StringBuilder sourceString = new StringBuilder(100); |
| 1541 | ListFacade<Campaign> campaigns = sources.getCampaigns(); |
| 1542 | for (int i = 0; i < campaigns.getSize(); i++) |
| 1543 | { |
| 1544 | if (i > 0) |
| 1545 | { |
| 1546 | sourceString.append('|'); |
| 1547 | } |
| 1548 | sourceString.append(campaigns.getElementAt(i)); |
| 1549 | } |
| 1550 | PCGenSettings.getInstance().setProperty(PCGenSettings.LAST_LOADED_GAME, |
| 1551 | sources.getGameMode().toString()); |
| 1552 | PCGenSettings.getInstance().setProperty(PCGenSettings.LAST_LOADED_SOURCES, sourceString.toString()); |
| 1553 | } |
| 1554 | else |
| 1555 | { |
| 1556 | currentSourceSelection.set(null); |
| 1557 | } |
| 1558 | currentDataSetRef.set(data); |
| 1559 | updateTitle(); |
| 1560 | } |
| 1561 | |
| 1562 | // TODO there are no examples with licenses. Either remove this or add a test. |
| 1563 | private void showLicenses() |
nothing calls this directly
no test coverage detected