Skip to content
Snippets Groups Projects
Commit 6140dc92 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

Fixed #129 - add changelog to ui

parent 515383ed
Branches
Tags
No related merge requests found
...@@ -15,7 +15,6 @@ import de.deadlocker8.budgetmaster.logic.updater.VersionInformation; ...@@ -15,7 +15,6 @@ import de.deadlocker8.budgetmaster.logic.updater.VersionInformation;
public class Updater public class Updater
{ {
private VersionInformation latestVersion; private VersionInformation latestVersion;
private JsonObject changelogJSON;
private static final String LATEST_VERSION_INFO_URL = "https://raw.githubusercontent.com/deadlocker8/BudgetMaster/master/src/de/deadlocker8/budgetmaster/resources/languages/_de.properties"; private static final String LATEST_VERSION_INFO_URL = "https://raw.githubusercontent.com/deadlocker8/BudgetMaster/master/src/de/deadlocker8/budgetmaster/resources/languages/_de.properties";
private static final String CHANGELOG_URL = "https://raw.githubusercontent.com/deadlocker8/BudgetMaster/master/src/de/deadlocker8/budgetmaster/resources/changelog.json"; private static final String CHANGELOG_URL = "https://raw.githubusercontent.com/deadlocker8/BudgetMaster/master/src/de/deadlocker8/budgetmaster/resources/changelog.json";
...@@ -76,7 +75,7 @@ public class Updater ...@@ -76,7 +75,7 @@ public class Updater
return latestVersion; return latestVersion;
} }
public void getChangelogFromURL() throws IOException public JsonObject getChangelogFromURL() throws IOException
{ {
URL webseite = new URL(CHANGELOG_URL); URL webseite = new URL(CHANGELOG_URL);
URLConnection connection = webseite.openConnection(); URLConnection connection = webseite.openConnection();
...@@ -90,11 +89,13 @@ public class Updater ...@@ -90,11 +89,13 @@ public class Updater
} }
JsonParser parser = new JsonParser(); JsonParser parser = new JsonParser();
this.changelogJSON = parser.parse(data.toString()).getAsJsonObject(); return parser.parse(data.toString()).getAsJsonObject();
} }
public String getChangelog(int versionCode) public String getChangelog(int versionCode) throws IOException
{ {
JsonObject changelogJSON = getChangelogFromURL();
if(changelogJSON != null) if(changelogJSON != null)
{ {
return changelogJSON.get(String.valueOf(versionCode)).getAsString(); return changelogJSON.get(String.valueOf(versionCode)).getAsString();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment