OSDN Git Service

Support the cloud favorites update intervals.
[nt2chview/stable.git] / NT2chView45 / NTUserPreference.cs
index b2fb2d1..2e590d6 100755 (executable)
@@ -58,6 +58,7 @@ namespace NT2chView
         //const string KEY_IMAGE_VIEW_HEIGHT = "imageview_height";\r
         const string KEY_FAVORITE_UPDATE_DURATION = "favorite_update_duration";\r
         public const int DEFAULT_FAVORITE_UPDATE_DURATION = 10;\r
+        const string KEY_FAVORITE_UPDATE_WITH_CLOUD = "favorite_update_with_cloud";\r
 \r
 \r
         public static bool DebugOption\r
@@ -92,6 +93,14 @@ namespace NT2chView
             set;\r
         }\r
 \r
+        private static bool mFavoriteUpdateWithCloud;\r
+        public static bool EnableCloudFavoriteUpdate\r
+        {\r
+            get { return (mFavoriteUpdateWithCloud && mNTCloudEnabled); }\r
+            set { mFavoriteUpdateWithCloud = value; }\r
+        }\r
+\r
+\r
         static bool mResViewTextSelMode;\r
         public static bool ResViewTextSelMode {\r
             get\r
@@ -473,6 +482,7 @@ namespace NT2chView
             ThreadtitleListViewFontSize = 14;\r
 \r
             FavoriteUpdateDuration = 10;\r
+            mFavoriteUpdateWithCloud = false;\r
 \r
 #if DOTNET45\r
             ResViewTextSelMode = false;\r
@@ -533,6 +543,12 @@ namespace NT2chView
                                 NTDebug.l(e.Message);\r
                             }\r
                             break;\r
+                        case KEY_FAVORITE_UPDATE_WITH_CLOUD:\r
+                            if (VALUE_STRING_TRUE.Equals(pair.Value))\r
+                                mFavoriteUpdateWithCloud = true;\r
+                            else\r
+                                mFavoriteUpdateWithCloud = false;\r
+                            break;\r
                         case KEY_P2ID:\r
                             P2ID = pair.Value;\r
                             break;\r
@@ -1017,6 +1033,9 @@ namespace NT2chView
             pair = new KeyValuePair<string, string>(\r
                  KEY_FAVORITE_UPDATE_DURATION, FavoriteUpdateDuration.ToString());\r
             list.Add(pair);\r
+            pair = new KeyValuePair<string, string>(\r
+                 KEY_FAVORITE_UPDATE_WITH_CLOUD, getBoolValueString(mFavoriteUpdateWithCloud));\r
+            list.Add(pair);\r
 \r
             pair = new KeyValuePair<string, string>(KEY_RESVIEW_TEXTSEL_MODE, getBoolValueString(ResViewTextSelMode));\r
             list.Add(pair);\r