* make sure all data is externed into .properties files

This commit is contained in:
Reinhard Pointner 2015-05-11 17:41:37 +00:00
parent 5e4dfcf680
commit 56ad657a00
3 changed files with 29 additions and 12 deletions

View File

@ -385,7 +385,7 @@ public class Main {
pane.createDialog(null, "Please Donate").setVisible(true); pane.createDialog(null, "Please Donate").setVisible(true);
if (pane.getValue() == actions[0]) { if (pane.getValue() == actions[0]) {
try { try {
Desktop.getDesktop().browse(URI.create(getApplicationProperty("donate.url"))); Desktop.getDesktop().browse(getApplicationLink("donate.url"));
} catch (Exception e) { } catch (Exception e) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, "Failed to browse URI", e); Logger.getLogger(Main.class.getName()).log(Level.SEVERE, "Failed to browse URI", e);
} finally { } finally {

View File

@ -199,27 +199,32 @@ public final class Settings {
public static URI getAppStoreURI() { public static URI getAppStoreURI() {
if (isMacApp()) if (isMacApp())
return URI.create("macappstore://itunes.apple.com/app/id905384638"); return getApplicationLink("link.mas");
if (isUbuntuApp()) if (isUbuntuApp())
return URI.create("apt://filebot"); return getApplicationLink("link.usc");
return null; return null;
} }
public static URI getEmbeddedHelpURI() { public static String getEmbeddedHelpURI() {
return URI.create("http://www.filebot.net/getting-started/embed.html#" + getApplicationDeployment()); // add #hash so we can dynamically adjust the slides for the various platforms via JavaScript
return getApplicationProperty("link.app.help") + '#' + getApplicationDeployment();
} }
public static Map<String, URI> getHelpURIs() { public static Map<String, URI> getHelpURIs() {
Map<String, URI> links = new LinkedHashMap<String, URI>(); Map<String, URI> links = new LinkedHashMap<String, URI>();
links.put("Getting Started", URI.create("http://www.filebot.net/getting-started/")); links.put("Getting Started", getApplicationLink("link.intro"));
links.put("FAQ", URI.create("https://www.filebot.net/forums/viewtopic.php?f=3&t=7")); links.put("FAQ", getApplicationLink("link.faq"));
links.put("Forums", URI.create("https://www.filebot.net/forums/")); links.put("Forums", getApplicationLink("link.forums"));
links.put("Twitter", URI.create("https://twitter.com/filebot_renamer")); links.put("Twitter", getApplicationLink("link.twitter"));
links.put("Request Help", URI.create(isMacApp() ? "https://www.filebot.net/forums/viewforum.php?f=12" : "https://www.filebot.net/forums/viewforum.php?f=8")); links.put("Request Help", getApplicationLink(isMacApp() && isAppStore() ? "link.help.mas" : "link.help"));
return links; return links;
} }
public static URI getApplicationLink(String key) {
return URI.create(getApplicationProperty(key));
}
public static Settings forPackage(Class<?> type) { public static Settings forPackage(Class<?> type) {
return new Settings(Preferences.userNodeForPackage(type)); return new Settings(Preferences.userNodeForPackage(type));
} }

View File

@ -11,8 +11,20 @@ donate.url: https://www.filebot.net/donate.html
script.fn: https://raw.githubusercontent.com/filebot/scripts/m1/%s.groovy script.fn: https://raw.githubusercontent.com/filebot/scripts/m1/%s.groovy
script.dev: https://raw.githubusercontent.com/filebot/scripts/devel/%s.groovy script.dev: https://raw.githubusercontent.com/filebot/scripts/devel/%s.groovy
# google analytics # native links
analytics.WebPropertyID: UA-25379256-3 link.mas: macappstore://itunes.apple.com/app/id905384638
link.usc: apt://filebot
# application help
link.app.help: http://app.filebot.net/getting-started/embed.html
# online help
link.intro: http://www.filebot.net/getting-started/
link.faq: https://www.filebot.net/forums/viewtopic.php?f=3&t=7
link.forums: https://www.filebot.net/forums/
link.twitter: https://twitter.com/filebot_renamer
link.help: https://www.filebot.net/forums/viewforum.php?f=8
link.help.mas: https://www.filebot.net/forums/viewforum.php?f=12
# api keys for webservices # api keys for webservices
apikey.fanart.tv: 780b986b22c35e6f7a134a2f392c2deb apikey.fanart.tv: 780b986b22c35e6f7a134a2f392c2deb