From 56ad657a00ae2bc35c45c9abb51b55872d421ded Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Mon, 11 May 2015 17:41:37 +0000 Subject: [PATCH] * make sure all data is externed into .properties files --- source/net/filebot/Main.java | 2 +- source/net/filebot/Settings.java | 23 ++++++++++++++--------- source/net/filebot/Settings.properties | 16 ++++++++++++++-- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/source/net/filebot/Main.java b/source/net/filebot/Main.java index 0bd18481..04bc0afd 100644 --- a/source/net/filebot/Main.java +++ b/source/net/filebot/Main.java @@ -385,7 +385,7 @@ public class Main { pane.createDialog(null, "Please Donate").setVisible(true); if (pane.getValue() == actions[0]) { try { - Desktop.getDesktop().browse(URI.create(getApplicationProperty("donate.url"))); + Desktop.getDesktop().browse(getApplicationLink("donate.url")); } catch (Exception e) { Logger.getLogger(Main.class.getName()).log(Level.SEVERE, "Failed to browse URI", e); } finally { diff --git a/source/net/filebot/Settings.java b/source/net/filebot/Settings.java index fd29a3ec..0470a1b2 100644 --- a/source/net/filebot/Settings.java +++ b/source/net/filebot/Settings.java @@ -199,27 +199,32 @@ public final class Settings { public static URI getAppStoreURI() { if (isMacApp()) - return URI.create("macappstore://itunes.apple.com/app/id905384638"); + return getApplicationLink("link.mas"); if (isUbuntuApp()) - return URI.create("apt://filebot"); + return getApplicationLink("link.usc"); return null; } - public static URI getEmbeddedHelpURI() { - return URI.create("http://www.filebot.net/getting-started/embed.html#" + getApplicationDeployment()); + public static String getEmbeddedHelpURI() { + // add #hash so we can dynamically adjust the slides for the various platforms via JavaScript + return getApplicationProperty("link.app.help") + '#' + getApplicationDeployment(); } public static Map getHelpURIs() { Map links = new LinkedHashMap(); - links.put("Getting Started", URI.create("http://www.filebot.net/getting-started/")); - links.put("FAQ", URI.create("https://www.filebot.net/forums/viewtopic.php?f=3&t=7")); - links.put("Forums", URI.create("https://www.filebot.net/forums/")); - links.put("Twitter", URI.create("https://twitter.com/filebot_renamer")); - 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("Getting Started", getApplicationLink("link.intro")); + links.put("FAQ", getApplicationLink("link.faq")); + links.put("Forums", getApplicationLink("link.forums")); + links.put("Twitter", getApplicationLink("link.twitter")); + links.put("Request Help", getApplicationLink(isMacApp() && isAppStore() ? "link.help.mas" : "link.help")); return links; } + public static URI getApplicationLink(String key) { + return URI.create(getApplicationProperty(key)); + } + public static Settings forPackage(Class type) { return new Settings(Preferences.userNodeForPackage(type)); } diff --git a/source/net/filebot/Settings.properties b/source/net/filebot/Settings.properties index 2f061a34..88fc332b 100644 --- a/source/net/filebot/Settings.properties +++ b/source/net/filebot/Settings.properties @@ -11,8 +11,20 @@ donate.url: https://www.filebot.net/donate.html script.fn: https://raw.githubusercontent.com/filebot/scripts/m1/%s.groovy script.dev: https://raw.githubusercontent.com/filebot/scripts/devel/%s.groovy -# google analytics -analytics.WebPropertyID: UA-25379256-3 +# native links +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 apikey.fanart.tv: 780b986b22c35e6f7a134a2f392c2deb