OSDN Git Service

Add automatic upgrade checking.
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / Global.java
index 829bdea..0ed7d20 100644 (file)
@@ -1337,6 +1337,35 @@ public class Global {
                settings.endGroup();    \r
     }\r
 \r
+    //*******************\r
+    // Check version information\r
+    //*******************\r
+    public static boolean checkVersionUpgrade() {\r
+               settings.beginGroup("Upgrade");\r
+               String text = (String)settings.value("checkForUpdates", "true");\r
+               settings.endGroup();\r
+               if (text.equalsIgnoreCase("true"))\r
+                       return true;\r
+               else\r
+                       return false;   \r
+    }\r
+    public static void setCheckVersionUpgrade(boolean value) {\r
+               settings.beginGroup("Upgrade");\r
+               settings.setValue("checkForUpdates", value);\r
+               settings.endGroup();    \r
+    }\r
+    public static String getUpdatesAvailableUrl() {\r
+               settings.beginGroup("Upgrade");\r
+               String text = (String)settings.value("avialableUrl", "http://nevernote.sourceforge.net/versions.txt");\r
+               settings.endGroup();    \r
+               return text;\r
+    }\r
+    public static String getUpdateAnnounceUrl() {\r
+               settings.beginGroup("Upgrade");\r
+               String text = (String)settings.value("announceUrl", "http://nevernote.sourceforge.net/upgrade.html");\r
+               settings.endGroup();    \r
+               return text;\r
+    }\r
     \r
     //*******************\r
     // Index attachments\r