OSDN Git Service

ApplicationSettings.cs の記述により更新チェック機能を無効化できるように修正
authorKimura Youichi <kim.upsilon@bucyou.net>
Fri, 10 May 2013 20:02:21 +0000 (05:02 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Fri, 10 May 2013 20:21:07 +0000 (05:21 +0900)
派生ソフトウェアの開発者は、ApplicationSettings.VersionInfoUrl の値を null にセット
することによって更新チェック機能を無効化することが可能です。

OpenTween/AppendSettingDialog.cs
OpenTween/ApplicationSettings.cs
OpenTween/Tween.cs

index 12aea91..fb5d3cd 100644 (file)
@@ -769,6 +769,8 @@ namespace OpenTween
 
             CheckPeriodAdjust.Checked = PeriodAdjust;
             CheckStartupVersion.Checked = StartupVersion;
+            if (ApplicationSettings.VersionInfoUrl == null)
+                CheckStartupVersion.Enabled = false; // 更新チェック無効化
             CheckStartupFollowers.Checked = StartupFollowers;
             CheckFavRestrict.Checked = RestrictFavCheck;
             CheckAlwaysTop.Checked = AlwaysTop;
index 695f3b3..0c92551 100644 (file)
@@ -72,8 +72,9 @@ namespace OpenTween
         /// </summary>
         /// <remarks>
         /// version.txt のフォーマットについては http://sourceforge.jp/projects/opentween/wiki/VersionTxt を参照。
+        /// 派生プロジェクトなどでこの機能を無効にする場合は null をセットして下さい。
         /// </remarks>
-        public const string VersionInfoUrl = "http://www.opentween.org/status/version.txt";
+        public static readonly string VersionInfoUrl = "http://www.opentween.org/status/version.txt";
 
         //=====================================================================
         // Twitter
index c4055eb..101cf84 100644 (file)
@@ -5993,6 +5993,9 @@ namespace OpenTween
 
         private void CheckNewVersion(bool startup = false)
         {
+            if (ApplicationSettings.VersionInfoUrl == null)
+                return; // 更新チェック無効化
+
             if (string.IsNullOrEmpty(MyCommon.fileVersion))
             {
                 return;
@@ -10793,9 +10796,19 @@ namespace OpenTween
 
                 if (MyCommon._endingFlag) return;
 
-                //バージョンチェック(引数:起動時チェックの場合はtrue・・・チェック結果のメッセージを表示しない)
-                if (SettingDialog.StartupVersion)
-                    CheckNewVersion(true);
+                if (ApplicationSettings.VersionInfoUrl != null)
+                {
+                    //バージョンチェック(引数:起動時チェックの場合はtrue・・・チェック結果のメッセージを表示しない)
+                    if (SettingDialog.StartupVersion)
+                        CheckNewVersion(true);
+                }
+                else
+                {
+                    // ApplicationSetting.cs の設定により更新チェックが無効化されている場合
+                    this.VerUpMenuItem.Enabled = false;
+                    this.VerUpMenuItem.Available = false;
+                    this.ToolStripSeparator16.Available = false; // VerUpMenuItem の一つ上にあるセパレータ
+                }
 
                 // 取得失敗の場合は再試行する
                 if (!tw.GetFollowersSuccess && SettingDialog.StartupFollowers)