OSDN Git Service

StartupPanelに対する設定値の設定・取得を LoadConfing/SaveConfig メソッドに移動
authorKimura Youichi <kim.upsilon@bucyou.net>
Sat, 26 Jul 2014 15:54:50 +0000 (00:54 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Thu, 31 Jul 2014 16:16:35 +0000 (01:16 +0900)
OpenTween/AppendSettingDialog.cs
OpenTween/Setting/Panel/StartupPanel.cs
OpenTween/Setting/SettingCommon.cs
OpenTween/Tween.cs

index ed183be..8f02d39 100644 (file)
@@ -78,11 +78,13 @@ namespace OpenTween
         public void LoadConfig(SettingCommon settingCommon, SettingLocal settingLocal)
         {
             this.GetPeriodPanel.LoadConfig(settingCommon);
+            this.StartupPanel.LoadConfig(settingCommon);
         }
 
         public void SaveConfig(SettingCommon settingCommon, SettingLocal settingLocal)
         {
             this.GetPeriodPanel.SaveConfig(settingCommon);
+            this.StartupPanel.SaveConfig(settingCommon);
         }
 
         private void TreeViewSetting_BeforeSelect(object sender, TreeViewCancelEventArgs e)
@@ -208,7 +210,6 @@ namespace OpenTween
 #endif
             try
             {
-                Readed = this.StartupPanel.StartupReaded.Checked;
                 switch (this.TweetPrvPanel.IconSize.SelectedIndex)
                 {
                     case 0:
@@ -335,8 +336,6 @@ namespace OpenTween
                 ProxyPort = int.Parse(this.ProxyPanel.TextProxyPort.Text.Trim());
                 ProxyUser = this.ProxyPanel.TextProxyUser.Text.Trim();
                 ProxyPassword = this.ProxyPanel.TextProxyPassword.Text.Trim();
-                StartupVersion = this.StartupPanel.CheckStartupVersion.Checked;
-                StartupFollowers = this.StartupPanel.CheckStartupFollowers.Checked;
                 RestrictFavCheck = this.ActionPanel.CheckFavRestrict.Checked;
                 AlwaysTop = this.PreviewPanel.CheckAlwaysTop.Checked;
                 UrlConvertAuto = this.ShortUrlPanel.CheckAutoConvertUrl.Checked;
@@ -357,7 +356,6 @@ namespace OpenTween
                 AutoShortUrlFirst = (MyCommon.UrlConverter)this.ShortUrlPanel.ComboBoxAutoShortUrlFirst.SelectedIndex;
                 TabIconDisp = this.PreviewPanel.chkTabIconDisp.Checked;
                 ReadOwnPost = this.ActionPanel.chkReadOwnPost.Checked;
-                GetFav = this.StartupPanel.chkGetFav.Checked;
                 IsMonospace = this.PreviewPanel.CheckMonospace.Checked;
                 ReadOldPosts = this.ActionPanel.CheckReadOldPosts.Checked;
                 BitlyUser = this.ShortUrlPanel.TextBitlyId.Text;
@@ -534,7 +532,6 @@ namespace OpenTween
                 }
             }
 
-            this.StartupPanel.StartupReaded.Checked = Readed;
             switch (IconSz)
             {
                 case MyCommon.IconSizes.IconNone:
@@ -555,14 +552,6 @@ namespace OpenTween
             }
             this.TweetActPanel.StatusText.Text = Status;
             this.ActionPanel.UReadMng.Checked = UnreadManage;
-            if (UnreadManage == false)
-            {
-                this.StartupPanel.StartupReaded.Enabled = false;
-            }
-            else
-            {
-                this.StartupPanel.StartupReaded.Enabled = true;
-            }
             this.ActionPanel.PlaySnd.Checked = PlaySound;
             this.TweetPrvPanel.OneWayLv.Checked = OneWayLove;
 
@@ -678,10 +667,6 @@ namespace OpenTween
             this.ProxyPanel.TextProxyUser.Text = ProxyUser;
             this.ProxyPanel.TextProxyPassword.Text = ProxyPassword;
 
-            this.StartupPanel.CheckStartupVersion.Checked = StartupVersion;
-            if (ApplicationSettings.VersionInfoUrl == null)
-                this.StartupPanel.CheckStartupVersion.Enabled = false; // 更新チェック無効化
-            this.StartupPanel.CheckStartupFollowers.Checked = StartupFollowers;
             this.ActionPanel.CheckFavRestrict.Checked = RestrictFavCheck;
             this.PreviewPanel.CheckAlwaysTop.Checked = AlwaysTop;
             this.ShortUrlPanel.CheckAutoConvertUrl.Checked = UrlConvertAuto;
@@ -703,7 +688,6 @@ namespace OpenTween
             this.ShortUrlPanel.ComboBoxAutoShortUrlFirst.SelectedIndex = (int)AutoShortUrlFirst;
             this.PreviewPanel.chkTabIconDisp.Checked = TabIconDisp;
             this.ActionPanel.chkReadOwnPost.Checked = ReadOwnPost;
-            this.StartupPanel.chkGetFav.Checked = GetFav;
             this.PreviewPanel.CheckMonospace.Checked = IsMonospace;
             this.ActionPanel.CheckReadOldPosts.Checked = ReadOldPosts;
             this.ShortUrlPanel.TextBitlyId.Text = BitlyUser;
@@ -1012,7 +996,6 @@ namespace OpenTween
             }
         }
 
-        public bool Readed { get; set; }
         public MyCommon.IconSizes IconSz { get; set; }
         public string Status { get; set; }
         public bool UnreadManage { get; set; }
@@ -1078,8 +1061,6 @@ namespace OpenTween
         public int ProxyPort { get; set; }
         public string ProxyUser { get; set; }
         public string ProxyPassword { get; set; }
-        public bool StartupVersion { get; set; }
-        public bool StartupFollowers { get; set; }
         public bool RestrictFavCheck { get; set; }
         public bool AlwaysTop { get; set; }
         public bool UrlConvertAuto { get; set; }
@@ -1093,7 +1074,6 @@ namespace OpenTween
         public bool TabIconDisp { get; set; }
         public MyCommon.REPLY_ICONSTATE ReplyIconState { get; set; }
         public bool ReadOwnPost { get; set; }
-        public bool GetFav { get; set; }
         public bool IsMonospace { get; set; }
         public bool ReadOldPosts { get; set; }
         public string BitlyUser { get; set; }
index acc2d23..f50abe8 100644 (file)
@@ -41,5 +41,26 @@ namespace OpenTween.Setting.Panel
         {
             InitializeComponent();
         }
+
+        public void LoadConfig(SettingCommon settingCommon)
+        {
+            this.StartupReaded.Checked = settingCommon.Read;
+            this.StartupReaded.Enabled = settingCommon.UnreadManage;
+
+            this.CheckStartupVersion.Checked = settingCommon.StartupVersion;
+            if (ApplicationSettings.VersionInfoUrl == null)
+                this.CheckStartupVersion.Enabled = false; // 更新チェック無効化
+
+            this.CheckStartupFollowers.Checked = settingCommon.StartupFollowers;
+            this.chkGetFav.Checked = settingCommon.GetFav;
+        }
+
+        public void SaveConfig(SettingCommon settingCommon)
+        {
+            settingCommon.Read = this.StartupReaded.Checked;
+            settingCommon.StartupVersion = this.CheckStartupVersion.Checked;
+            settingCommon.StartupFollowers = this.CheckStartupFollowers.Checked;
+            settingCommon.GetFav = this.chkGetFav.Checked;
+        }
     }
 }
index 5ebaa65..7af17b4 100644 (file)
@@ -116,7 +116,12 @@ namespace OpenTween
         public int DMPeriod = 600;
         public int PubSearchPeriod = 180;
         public int ListsPeriod = 180;
+
+        /// <summary>
+        /// 起動時読み込み分を既読にするか。trueなら既読として処理
+        /// </summary>
         public bool Read = true;
+
         public bool ListLock = false;
         public MyCommon.IconSizes IconSize = MyCommon.IconSizes.Icon16;
         public bool NewAllPop = true;
index 168fc6d..da04161 100644 (file)
@@ -763,8 +763,6 @@ namespace OpenTween
 
             SettingDialog.UserAccounts = _cfgCommon.UserAccounts;
 
-            //起動時読み込み分を既読にするか。trueなら既読として処理
-            SettingDialog.Readed = _cfgCommon.Read;
             //新着取得時のリストスクロールをするか。trueならスクロールしない
             ListLockMenuItem.Checked = _cfgCommon.ListLock;
             this.LockListFileMenuItem.Checked = _cfgCommon.ListLock;
@@ -828,8 +826,6 @@ namespace OpenTween
             SettingDialog.ProxyUser = _cfgLocal.ProxyUser;
             SettingDialog.ProxyPassword = _cfgLocal.ProxyPassword;
 
-            SettingDialog.StartupVersion = _cfgCommon.StartupVersion;
-            SettingDialog.StartupFollowers = _cfgCommon.StartupFollowers;
             SettingDialog.RestrictFavCheck = _cfgCommon.RestrictFavCheck;
             SettingDialog.AlwaysTop = _cfgCommon.AlwaysTop;
             SettingDialog.UrlConvertAuto = false;
@@ -857,7 +853,6 @@ namespace OpenTween
             SettingDialog.TabIconDisp = _cfgCommon.TabIconDisp;
             SettingDialog.ReplyIconState = _cfgCommon.ReplyIconState;
             SettingDialog.ReadOwnPost = _cfgCommon.ReadOwnPost;
-            SettingDialog.GetFav = _cfgCommon.GetFav;
             SettingDialog.ReadOldPosts = _cfgCommon.ReadOldPosts;
             SettingDialog.BitlyUser = _cfgCommon.BilyUser;
             SettingDialog.BitlyPwd = _cfgCommon.BitlyPwd;
@@ -2406,7 +2401,7 @@ namespace OpenTween
             GetWorkerResult rslt = new GetWorkerResult();
 
             bool read = !SettingDialog.UnreadManage;
-            if (_initial && SettingDialog.UnreadManage) read = SettingDialog.Readed;
+            if (_initial && SettingDialog.UnreadManage) read = this._cfgCommon.Read;
 
             GetWorkerArg args = (GetWorkerArg)e.Argument;
 
@@ -7760,7 +7755,6 @@ namespace OpenTween
                 _cfgCommon.Token = tw.AccessToken;
                 _cfgCommon.TokenSecret = tw.AccessTokenSecret;
                 _cfgCommon.UserAccounts = SettingDialog.UserAccounts;
-                _cfgCommon.Read = SettingDialog.Readed;
                 _cfgCommon.IconSize = SettingDialog.IconSz;
                 _cfgCommon.UnreadManage = SettingDialog.UnreadManage;
                 _cfgCommon.PlaySound = SettingDialog.PlaySound;
@@ -7778,8 +7772,6 @@ namespace OpenTween
                 _cfgCommon.SortOrderLock = SettingDialog.SortOrderLock;
                 _cfgCommon.ViewTabBottom = SettingDialog.ViewTabBottom;
                 _cfgCommon.TinyUrlResolve = SettingDialog.TinyUrlResolve;
-                _cfgCommon.StartupVersion = SettingDialog.StartupVersion;
-                _cfgCommon.StartupFollowers = SettingDialog.StartupFollowers;
                 _cfgCommon.RestrictFavCheck = SettingDialog.RestrictFavCheck;
                 _cfgCommon.AlwaysTop = SettingDialog.AlwaysTop;
                 _cfgCommon.UrlConvertAuto = SettingDialog.UrlConvertAuto;
@@ -7799,7 +7791,6 @@ namespace OpenTween
                 _cfgCommon.TabIconDisp = SettingDialog.TabIconDisp;
                 _cfgCommon.ReplyIconState = SettingDialog.ReplyIconState;
                 _cfgCommon.ReadOwnPost = SettingDialog.ReadOwnPost;
-                _cfgCommon.GetFav = SettingDialog.GetFav;
                 _cfgCommon.IsMonospace = SettingDialog.IsMonospace;
                 if (IdeographicSpaceToSpaceToolStripMenuItem != null &&
                    IdeographicSpaceToSpaceToolStripMenuItem.IsDisposed == false)
@@ -10828,7 +10819,7 @@ namespace OpenTween
                 this.RefreshMuteUserIdsAsync();
                 GetTimeline(MyCommon.WORKERTYPE.BlockIds, 0, "");
                 GetTimeline(MyCommon.WORKERTYPE.NoRetweetIds, 0, "");
-                if (SettingDialog.StartupFollowers)
+                if (this._cfgCommon.StartupFollowers)
                 {
                     GetTimeline(MyCommon.WORKERTYPE.Follower, 0, "");
                 }
@@ -10840,7 +10831,7 @@ namespace OpenTween
                 GetTimeline(MyCommon.WORKERTYPE.Reply, 1, "");
                 _waitDm = true;
                 GetTimeline(MyCommon.WORKERTYPE.DirectMessegeRcv, 1, "");
-                if (SettingDialog.GetFav)
+                if (this._cfgCommon.GetFav)
                 {
                     _waitFav = true;
                     GetTimeline(MyCommon.WORKERTYPE.Favorites, 1, "");
@@ -10869,7 +10860,7 @@ namespace OpenTween
                 if (ApplicationSettings.VersionInfoUrl != null)
                 {
                     //バージョンチェック(引数:起動時チェックの場合はtrue・・・チェック結果のメッセージを表示しない)
-                    if (SettingDialog.StartupVersion)
+                    if (this._cfgCommon.StartupVersion)
                         await this.CheckNewVersion(true);
                 }
                 else
@@ -10881,7 +10872,7 @@ namespace OpenTween
                 }
 
                 // 取得失敗の場合は再試行する
-                if (!tw.GetFollowersSuccess && SettingDialog.StartupFollowers)
+                if (!tw.GetFollowersSuccess && this._cfgCommon.StartupFollowers)
                     GetTimeline(MyCommon.WORKERTYPE.Follower, 0, "");
 
                 // 取得失敗の場合は再試行する