OSDN Git Service

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

index a26a662..3b55d22 100644 (file)
             // 
             resources.ApplyResources(this.GetPeriodPanel, "GetPeriodPanel");
             this.GetPeriodPanel.Name = "GetPeriodPanel";
+            this.GetPeriodPanel.IntervalChanged += new System.EventHandler<OpenTween.IntervalChangedEventArgs>(this.GetPeriodPanel_IntervalChanged);
             this.ToolTip1.SetToolTip(this.GetPeriodPanel, resources.GetString("GetPeriodPanel.ToolTip"));
             // 
             // ActionPanel
index ea8874d..ed183be 100644 (file)
@@ -73,18 +73,17 @@ namespace OpenTween
 
         private string _pin;
 
-        public class IntervalChangedEventArgs : EventArgs
+        public event EventHandler<IntervalChangedEventArgs> IntervalChanged;
+
+        public void LoadConfig(SettingCommon settingCommon, SettingLocal settingLocal)
         {
-            public bool UserStream;
-            public bool Timeline;
-            public bool Reply;
-            public bool DirectMessage;
-            public bool PublicSearch;
-            public bool Lists;
-            public bool UserTimeline;
+            this.GetPeriodPanel.LoadConfig(settingCommon);
         }
 
-        public event EventHandler<IntervalChangedEventArgs> IntervalChanged;
+        public void SaveConfig(SettingCommon settingCommon, SettingLocal settingLocal)
+        {
+            this.GetPeriodPanel.SaveConfig(settingCommon);
+        }
 
         private void TreeViewSetting_BeforeSelect(object sender, TreeViewCancelEventArgs e)
         {
@@ -207,62 +206,8 @@ namespace OpenTween
                 string ret = tw.PostFollowCommand(ApplicationSettings.FeedbackTwitterName);
             }
 #endif
-            IntervalChangedEventArgs arg = new IntervalChangedEventArgs();
-            bool isIntervalChanged = false;
-
             try
             {
-                UserstreamStartup = this.GetPeriodPanel.StartupUserstreamCheck.Checked;
-
-                if (UserstreamPeriodInt != int.Parse(this.GetPeriodPanel.UserstreamPeriod.Text))
-                {
-                    UserstreamPeriodInt = int.Parse(this.GetPeriodPanel.UserstreamPeriod.Text);
-                    arg.UserStream = true;
-                    isIntervalChanged = true;
-                }
-                if (TimelinePeriodInt != int.Parse(this.GetPeriodPanel.TimelinePeriod.Text))
-                {
-                    TimelinePeriodInt = int.Parse(this.GetPeriodPanel.TimelinePeriod.Text);
-                    arg.Timeline = true;
-                    isIntervalChanged = true;
-                }
-                if (DMPeriodInt != int.Parse(this.GetPeriodPanel.DMPeriod.Text))
-                {
-                    DMPeriodInt = int.Parse(this.GetPeriodPanel.DMPeriod.Text);
-                    arg.DirectMessage = true;
-                    isIntervalChanged = true;
-                }
-                if (PubSearchPeriodInt != int.Parse(this.GetPeriodPanel.PubSearchPeriod.Text))
-                {
-                    PubSearchPeriodInt = int.Parse(this.GetPeriodPanel.PubSearchPeriod.Text);
-                    arg.PublicSearch = true;
-                    isIntervalChanged = true;
-                }
-
-                if (ListsPeriodInt != int.Parse(this.GetPeriodPanel.ListsPeriod.Text))
-                {
-                    ListsPeriodInt = int.Parse(this.GetPeriodPanel.ListsPeriod.Text);
-                    arg.Lists = true;
-                    isIntervalChanged = true;
-                }
-                if (ReplyPeriodInt != int.Parse(this.GetPeriodPanel.ReplyPeriod.Text))
-                {
-                    ReplyPeriodInt = int.Parse(this.GetPeriodPanel.ReplyPeriod.Text);
-                    arg.Reply = true;
-                    isIntervalChanged = true;
-                }
-                if (UserTimelinePeriodInt != int.Parse(this.GetPeriodPanel.UserTimelinePeriod.Text))
-                {
-                    UserTimelinePeriodInt = int.Parse(this.GetPeriodPanel.UserTimelinePeriod.Text);
-                    arg.UserTimeline = true;
-                    isIntervalChanged = true;
-                }
-
-                if (isIntervalChanged && IntervalChanged != null)
-                {
-                    IntervalChanged(this, arg);
-                }
-
                 Readed = this.StartupPanel.StartupReaded.Checked;
                 switch (this.TweetPrvPanel.IconSize.SelectedIndex)
                 {
@@ -339,7 +284,6 @@ namespace OpenTween
                 CountApi = int.Parse(this.GetCountPanel.TextCountApi.Text);
                 CountApiReply = int.Parse(this.GetCountPanel.TextCountApiReply.Text);
                 BrowserPath = this.ActionPanel.BrowserPathText.Text.Trim();
-                PostAndGet = this.GetPeriodPanel.CheckPostAndGet.Checked;
                 UseRecommendStatus = this.TweetActPanel.CheckUseRecommendStatus.Checked;
                 DispUsername = this.PreviewPanel.CheckDispUsername.Checked;
                 CloseToExit = this.ActionPanel.CheckCloseToExit.Checked;
@@ -590,15 +534,6 @@ namespace OpenTween
                 }
             }
 
-            this.GetPeriodPanel.StartupUserstreamCheck.Checked = UserstreamStartup;
-            this.GetPeriodPanel.UserstreamPeriod.Text = UserstreamPeriodInt.ToString();
-            this.GetPeriodPanel.TimelinePeriod.Text = TimelinePeriodInt.ToString();
-            this.GetPeriodPanel.ReplyPeriod.Text = ReplyPeriodInt.ToString();
-            this.GetPeriodPanel.DMPeriod.Text = DMPeriodInt.ToString();
-            this.GetPeriodPanel.PubSearchPeriod.Text = PubSearchPeriodInt.ToString();
-            this.GetPeriodPanel.ListsPeriod.Text = ListsPeriodInt.ToString();
-            this.GetPeriodPanel.UserTimelinePeriod.Text = UserTimelinePeriodInt.ToString();
-
             this.StartupPanel.StartupReaded.Checked = Readed;
             switch (IconSz)
             {
@@ -682,7 +617,6 @@ namespace OpenTween
             this.GetCountPanel.TextCountApi.Text = CountApi.ToString();
             this.GetCountPanel.TextCountApiReply.Text = CountApiReply.ToString();
             this.ActionPanel.BrowserPathText.Text = BrowserPath;
-            this.GetPeriodPanel.CheckPostAndGet.Checked = PostAndGet;
             this.TweetActPanel.CheckUseRecommendStatus.Checked = UseRecommendStatus;
             this.PreviewPanel.CheckDispUsername.Checked = DispUsername;
             this.ActionPanel.CheckCloseToExit.Checked = CloseToExit;
@@ -1078,14 +1012,6 @@ namespace OpenTween
             }
         }
 
-        public int UserstreamPeriodInt { get; set; }
-        public bool UserstreamStartup { get; set; }
-        public int TimelinePeriodInt { get; set; }
-        public int ReplyPeriodInt { get; set; }
-        public int DMPeriodInt { get; set; }
-        public int PubSearchPeriodInt { get; set; }
-        public int ListsPeriodInt { get; set; }
-        public int UserTimelinePeriodInt { get; set; }
         public bool Readed { get; set; }
         public MyCommon.IconSizes IconSz { get; set; }
         public string Status { get; set; }
@@ -1124,7 +1050,6 @@ namespace OpenTween
         public int FavoritesCountApi { get; set; }
         public int UserTimelineCountApi { get; set; }
         public int ListCountApi { get; set; }
-        public bool PostAndGet { get; set; }
         public bool UseRecommendStatus { get; set; }
         public string RecommendStatusText { get; set; }
         public bool DispUsername { get; set; }
@@ -1649,5 +1574,22 @@ namespace OpenTween
 
             this.Icon = Properties.Resources.MIcon;
         }
+
+        private void GetPeriodPanel_IntervalChanged(object sender, IntervalChangedEventArgs e)
+        {
+            if (this.IntervalChanged != null)
+                this.IntervalChanged(sender, e);
+        }
+    }
+
+    public class IntervalChangedEventArgs : EventArgs
+    {
+        public bool UserStream;
+        public bool Timeline;
+        public bool Reply;
+        public bool DirectMessage;
+        public bool PublicSearch;
+        public bool Lists;
+        public bool UserTimeline;
     }
 }
index 6bf45f4..7552465 100644 (file)
@@ -37,11 +37,94 @@ namespace OpenTween.Setting.Panel
 {
     public partial class GetPeriodPanel : SettingPanelBase
     {
+        public event EventHandler<IntervalChangedEventArgs> IntervalChanged;
+
         public GetPeriodPanel()
         {
             InitializeComponent();
         }
 
+        public void LoadConfig(SettingCommon settingCommon)
+        {
+            this.StartupUserstreamCheck.Checked = settingCommon.UserstreamStartup;
+            this.CheckPostAndGet.Checked = settingCommon.PostAndGet;
+            this.UserstreamPeriod.Text = settingCommon.UserstreamPeriod.ToString();
+            this.TimelinePeriod.Text = settingCommon.TimelinePeriod.ToString();
+            this.ReplyPeriod.Text = settingCommon.ReplyPeriod.ToString();
+            this.DMPeriod.Text = settingCommon.DMPeriod.ToString();
+            this.PubSearchPeriod.Text = settingCommon.PubSearchPeriod.ToString();
+            this.ListsPeriod.Text = settingCommon.ListsPeriod.ToString();
+            this.UserTimelinePeriod.Text = settingCommon.UserTimelinePeriod.ToString();
+        }
+
+        public void SaveConfig(SettingCommon settingCommon)
+        {
+            settingCommon.UserstreamStartup = this.StartupUserstreamCheck.Checked;
+            settingCommon.PostAndGet = this.CheckPostAndGet.Checked;
+
+            var arg = new IntervalChangedEventArgs();
+            var isIntervalChanged = false;
+
+            var userstreamPeriod = int.Parse(this.UserstreamPeriod.Text);
+            if (settingCommon.UserstreamPeriod != userstreamPeriod)
+            {
+                settingCommon.UserstreamPeriod = userstreamPeriod;
+                arg.UserStream = true;
+                isIntervalChanged = true;
+            }
+
+            var timelinePeriod = int.Parse(this.TimelinePeriod.Text);
+            if (settingCommon.TimelinePeriod != timelinePeriod)
+            {
+                settingCommon.TimelinePeriod = timelinePeriod;
+                arg.Timeline = true;
+                isIntervalChanged = true;
+            }
+
+            var dmPeriod = int.Parse(this.DMPeriod.Text);
+            if (settingCommon.DMPeriod != dmPeriod)
+            {
+                settingCommon.DMPeriod = dmPeriod;
+                arg.DirectMessage = true;
+                isIntervalChanged = true;
+            }
+
+            var pubSearchPeriod = int.Parse(this.PubSearchPeriod.Text);
+            if (settingCommon.PubSearchPeriod != pubSearchPeriod)
+            {
+                settingCommon.PubSearchPeriod = pubSearchPeriod;
+                arg.PublicSearch = true;
+                isIntervalChanged = true;
+            }
+
+            var listsPeriod = int.Parse(this.ListsPeriod.Text);
+            if (settingCommon.ListsPeriod != listsPeriod)
+            {
+                settingCommon.ListsPeriod = listsPeriod;
+                arg.Lists = true;
+                isIntervalChanged = true;
+            }
+
+            var replyPeriod = int.Parse(this.ReplyPeriod.Text);
+            if (settingCommon.ReplyPeriod != replyPeriod)
+            {
+                settingCommon.ReplyPeriod = replyPeriod;
+                arg.Reply = true;
+                isIntervalChanged = true;
+            }
+
+            var userTimelinePeriod = int.Parse(this.UserTimelinePeriod.Text);
+            if (settingCommon.UserTimelinePeriod != userTimelinePeriod)
+            {
+                settingCommon.UserTimelinePeriod = userTimelinePeriod;
+                arg.UserTimeline = true;
+                isIntervalChanged = true;
+            }
+
+            if (isIntervalChanged && IntervalChanged != null)
+                this.IntervalChanged(this, arg);
+        }
+
         private void UserstreamPeriod_Validating(object sender, CancelEventArgs e)
         {
             int prd;
index 6021108..168fc6d 100644 (file)
@@ -730,7 +730,30 @@ namespace OpenTween
             sfTab.Alignment = StringAlignment.Center;
             sfTab.LineAlignment = StringAlignment.Center;
 
+            //不正値チェック
+            if (!MyApplication.StartupOptions.ContainsKey("nolimit"))
+            {
+                if (this._cfgCommon.TimelinePeriod < 15 && this._cfgCommon.TimelinePeriod > 0)
+                    this._cfgCommon.TimelinePeriod = 15;
+
+                if (this._cfgCommon.ReplyPeriod < 15 && this._cfgCommon.ReplyPeriod > 0)
+                    this._cfgCommon.ReplyPeriod = 15;
+
+                if (this._cfgCommon.DMPeriod < 15 && this._cfgCommon.DMPeriod > 0)
+                    this._cfgCommon.DMPeriod = 15;
+
+                if (this._cfgCommon.PubSearchPeriod < 30 && this._cfgCommon.PubSearchPeriod > 0)
+                    this._cfgCommon.PubSearchPeriod = 30;
+
+                if (this._cfgCommon.UserTimelinePeriod < 15 && this._cfgCommon.UserTimelinePeriod > 0)
+                    this._cfgCommon.UserTimelinePeriod = 15;
+
+                if (this._cfgCommon.ListsPeriod < 15 && this._cfgCommon.ListsPeriod > 0)
+                    this._cfgCommon.ListsPeriod = 15;
+            }
+
             //設定画面への反映
+            this.SettingDialog.LoadConfig(this._cfgCommon, this._cfgLocal);
             HttpTwitter.TwitterUrl = _cfgCommon.TwitterUrl;
             SettingDialog.TwitterApiUrl = _cfgCommon.TwitterUrl;
 
@@ -740,23 +763,6 @@ namespace OpenTween
 
             SettingDialog.UserAccounts = _cfgCommon.UserAccounts;
 
-            SettingDialog.TimelinePeriodInt = _cfgCommon.TimelinePeriod;
-            SettingDialog.ReplyPeriodInt = _cfgCommon.ReplyPeriod;
-            SettingDialog.DMPeriodInt = _cfgCommon.DMPeriod;
-            SettingDialog.PubSearchPeriodInt = _cfgCommon.PubSearchPeriod;
-            SettingDialog.UserTimelinePeriodInt = _cfgCommon.UserTimelinePeriod;
-            SettingDialog.ListsPeriodInt = _cfgCommon.ListsPeriod;
-            //不正値チェック
-            if (!MyApplication.StartupOptions.ContainsKey("nolimit"))
-            {
-                if (SettingDialog.TimelinePeriodInt < 15 && SettingDialog.TimelinePeriodInt > 0) SettingDialog.TimelinePeriodInt = 15;
-                if (SettingDialog.ReplyPeriodInt < 15 && SettingDialog.ReplyPeriodInt > 0) SettingDialog.ReplyPeriodInt = 15;
-                if (SettingDialog.DMPeriodInt < 15 && SettingDialog.DMPeriodInt > 0) SettingDialog.DMPeriodInt = 15;
-                if (SettingDialog.PubSearchPeriodInt < 30 && SettingDialog.PubSearchPeriodInt > 0) SettingDialog.PubSearchPeriodInt = 30;
-                if (SettingDialog.UserTimelinePeriodInt < 15 && SettingDialog.UserTimelinePeriodInt > 0) SettingDialog.UserTimelinePeriodInt = 15;
-                if (SettingDialog.ListsPeriodInt < 15 && SettingDialog.ListsPeriodInt > 0) SettingDialog.ListsPeriodInt = 15;
-            }
-
             //起動時読み込み分を既読にするか。trueなら既読として処理
             SettingDialog.Readed = _cfgCommon.Read;
             //新着取得時のリストスクロールをするか。trueならスクロールしない
@@ -903,8 +909,6 @@ namespace OpenTween
             SettingDialog.UserTimelineCountApi = _cfgCommon.UserTimelineCountApi;
             SettingDialog.ListCountApi = _cfgCommon.ListCountApi;
 
-            SettingDialog.UserstreamStartup = _cfgCommon.UserstreamStartup;
-            SettingDialog.UserstreamPeriodInt = _cfgCommon.UserstreamPeriod;
             SettingDialog.OpenUserTimeline = _cfgCommon.OpenUserTimeline;
             SettingDialog.ListDoubleClickAction = _cfgCommon.ListDoubleClickAction;
             SettingDialog.UserAppointUrl = _cfgCommon.UserAppointUrl;
@@ -1365,13 +1369,13 @@ namespace OpenTween
             }
         }
 
-        private void TimerInterval_Changed(object sender, AppendSettingDialog.IntervalChangedEventArgs e) //Handles SettingDialog.IntervalChanged
+        private void TimerInterval_Changed(object sender, IntervalChangedEventArgs e) //Handles SettingDialog.IntervalChanged
         {
             if (!TimerTimeline.Enabled) return;
             ResetTimers = e;
         }
 
-        private AppendSettingDialog.IntervalChangedEventArgs ResetTimers = new AppendSettingDialog.IntervalChangedEventArgs();
+        private IntervalChangedEventArgs ResetTimers = new IntervalChangedEventArgs();
 
         private static int homeCounter = 0;
         private static int mentionCounter = 0;
@@ -1395,45 +1399,45 @@ namespace OpenTween
             Interlocked.Increment(ref refreshFollowers);
 
             ////タイマー初期化
-            if (ResetTimers.Timeline || homeCounter <= 0 && SettingDialog.TimelinePeriodInt > 0)
+            if (ResetTimers.Timeline || homeCounter <= 0 && this._cfgCommon.TimelinePeriod > 0)
             {
-                Interlocked.Exchange(ref homeCounter, SettingDialog.TimelinePeriodInt);
+                Interlocked.Exchange(ref homeCounter, this._cfgCommon.TimelinePeriod);
                 if (!tw.IsUserstreamDataReceived && !ResetTimers.Timeline) GetTimeline(MyCommon.WORKERTYPE.Timeline, 1, "");
                 ResetTimers.Timeline = false;
             }
-            if (ResetTimers.Reply || mentionCounter <= 0 && SettingDialog.ReplyPeriodInt > 0)
+            if (ResetTimers.Reply || mentionCounter <= 0 && this._cfgCommon.ReplyPeriod > 0)
             {
-                Interlocked.Exchange(ref mentionCounter, SettingDialog.ReplyPeriodInt);
+                Interlocked.Exchange(ref mentionCounter, this._cfgCommon.ReplyPeriod);
                 if (!tw.IsUserstreamDataReceived && !ResetTimers.Reply) GetTimeline(MyCommon.WORKERTYPE.Reply, 1, "");
                 ResetTimers.Reply = false;
             }
-            if (ResetTimers.DirectMessage || dmCounter <= 0 && SettingDialog.DMPeriodInt > 0)
+            if (ResetTimers.DirectMessage || dmCounter <= 0 && this._cfgCommon.DMPeriod > 0)
             {
-                Interlocked.Exchange(ref dmCounter, SettingDialog.DMPeriodInt);
+                Interlocked.Exchange(ref dmCounter, this._cfgCommon.DMPeriod);
                 if (!tw.IsUserstreamDataReceived && !ResetTimers.DirectMessage) GetTimeline(MyCommon.WORKERTYPE.DirectMessegeRcv, 1, "");
                 ResetTimers.DirectMessage = false;
             }
-            if (ResetTimers.PublicSearch || pubSearchCounter <= 0 && SettingDialog.PubSearchPeriodInt > 0)
+            if (ResetTimers.PublicSearch || pubSearchCounter <= 0 && this._cfgCommon.PubSearchPeriod > 0)
             {
-                Interlocked.Exchange(ref pubSearchCounter, SettingDialog.PubSearchPeriodInt);
+                Interlocked.Exchange(ref pubSearchCounter, this._cfgCommon.PubSearchPeriod);
                 if (!ResetTimers.PublicSearch) GetTimeline(MyCommon.WORKERTYPE.PublicSearch, 1, "");
                 ResetTimers.PublicSearch = false;
             }
-            if (ResetTimers.UserTimeline || userTimelineCounter <= 0 && SettingDialog.UserTimelinePeriodInt > 0)
+            if (ResetTimers.UserTimeline || userTimelineCounter <= 0 && this._cfgCommon.UserTimelinePeriod > 0)
             {
-                Interlocked.Exchange(ref userTimelineCounter, SettingDialog.UserTimelinePeriodInt);
+                Interlocked.Exchange(ref userTimelineCounter, this._cfgCommon.UserTimelinePeriod);
                 if (!ResetTimers.UserTimeline) GetTimeline(MyCommon.WORKERTYPE.UserTimeline, 1, "");
                 ResetTimers.UserTimeline = false;
             }
-            if (ResetTimers.Lists || listsCounter <= 0 && SettingDialog.ListsPeriodInt > 0)
+            if (ResetTimers.Lists || listsCounter <= 0 && this._cfgCommon.ListsPeriod > 0)
             {
-                Interlocked.Exchange(ref listsCounter, SettingDialog.ListsPeriodInt);
+                Interlocked.Exchange(ref listsCounter, this._cfgCommon.ListsPeriod);
                 if (!ResetTimers.Lists) GetTimeline(MyCommon.WORKERTYPE.List, 1, "");
                 ResetTimers.Lists = false;
             }
-            if (ResetTimers.UserStream || usCounter <= 0 && SettingDialog.UserstreamPeriodInt > 0)
+            if (ResetTimers.UserStream || usCounter <= 0 && this._cfgCommon.UserstreamPeriod > 0)
             {
-                Interlocked.Exchange(ref usCounter, SettingDialog.UserstreamPeriodInt);
+                Interlocked.Exchange(ref usCounter, this._cfgCommon.UserstreamPeriod);
                 if (this._isActiveUserstream) RefreshTimeline(true);
                 ResetTimers.UserStream = false;
             }
@@ -3032,7 +3036,7 @@ namespace OpenTween
                             }
                         }
                     }
-                    if (rslt.retMsg.Length == 0 && SettingDialog.PostAndGet)
+                    if (rslt.retMsg.Length == 0 && this._cfgCommon.PostAndGet)
                     {
                         if (_isActiveUserstream)
                         {
@@ -3056,7 +3060,7 @@ namespace OpenTween
                                 _postTimestamps.RemoveAt(i);
                             }
                         }
-                        if (!_isActiveUserstream && SettingDialog.PostAndGet) GetTimeline(MyCommon.WORKERTYPE.Timeline, 1, "");
+                        if (!_isActiveUserstream && this._cfgCommon.PostAndGet) GetTimeline(MyCommon.WORKERTYPE.Timeline, 1, "");
                     }
                     break;
                 case MyCommon.WORKERTYPE.Follower:
@@ -3915,6 +3919,8 @@ namespace OpenTween
             {
                 lock (_syncObject)
                 {
+                    this.SettingDialog.SaveConfig(this._cfgCommon, this._cfgLocal);
+
                     tw.RestrictFavCheck = SettingDialog.RestrictFavCheck;
                     tw.ReadOwnPost = SettingDialog.ReadOwnPost;
                     ShortUrl.Instance.DisableExpanding = !SettingDialog.TinyUrlResolve;
@@ -7754,14 +7760,6 @@ namespace OpenTween
                 _cfgCommon.Token = tw.AccessToken;
                 _cfgCommon.TokenSecret = tw.AccessTokenSecret;
                 _cfgCommon.UserAccounts = SettingDialog.UserAccounts;
-                _cfgCommon.UserstreamStartup = SettingDialog.UserstreamStartup;
-                _cfgCommon.UserstreamPeriod = SettingDialog.UserstreamPeriodInt;
-                _cfgCommon.TimelinePeriod = SettingDialog.TimelinePeriodInt;
-                _cfgCommon.ReplyPeriod = SettingDialog.ReplyPeriodInt;
-                _cfgCommon.DMPeriod = SettingDialog.DMPeriodInt;
-                _cfgCommon.PubSearchPeriod = SettingDialog.PubSearchPeriodInt;
-                _cfgCommon.ListsPeriod = SettingDialog.ListsPeriodInt;
-                _cfgCommon.UserTimelinePeriod = SettingDialog.UserTimelinePeriodInt;
                 _cfgCommon.Read = SettingDialog.Readed;
                 _cfgCommon.IconSize = SettingDialog.IconSz;
                 _cfgCommon.UnreadManage = SettingDialog.UnreadManage;
@@ -7773,7 +7771,6 @@ namespace OpenTween
                 _cfgCommon.PostShiftEnter = SettingDialog.PostShiftEnter;
                 _cfgCommon.CountApi = SettingDialog.CountApi;
                 _cfgCommon.CountApiReply = SettingDialog.CountApiReply;
-                _cfgCommon.PostAndGet = SettingDialog.PostAndGet;
                 _cfgCommon.DispUsername = SettingDialog.DispUsername;
                 _cfgCommon.MinimizeToTray = SettingDialog.MinimizeToTray;
                 _cfgCommon.CloseToExit = SettingDialog.CloseToExit;
@@ -9424,13 +9421,13 @@ namespace OpenTween
             UnreadAtCounter = urat;
 
             slbl.AppendFormat(Properties.Resources.SetStatusLabelText1, tur, tal, ur, al, urat, _postTimestamps.Count, _favTimestamps.Count, _tlCount);
-            if (SettingDialog.TimelinePeriodInt == 0)
+            if (this._cfgCommon.TimelinePeriod == 0)
             {
                 slbl.Append(Properties.Resources.SetStatusLabelText2);
             }
             else
             {
-                slbl.Append(SettingDialog.TimelinePeriodInt.ToString() + Properties.Resources.SetStatusLabelText3);
+                slbl.Append(this._cfgCommon.TimelinePeriod + Properties.Resources.SetStatusLabelText3);
             }
             return slbl.ToString();
         }
@@ -10810,7 +10807,7 @@ namespace OpenTween
             MenuItemUserStream.Enabled = true;
             StopToolStripMenuItem.Text = "&Start";
             StopToolStripMenuItem.Enabled = true;
-            if (SettingDialog.UserstreamStartup) tw.StartUserStream();
+            if (this._cfgCommon.UserstreamStartup) tw.StartUserStream();
         }
 
         private async void TweenMain_Shown(object sender, EventArgs e)
@@ -12660,7 +12657,7 @@ namespace OpenTween
                 //before = Now;
             }
 
-            if (SettingDialog.UserstreamPeriodInt > 0) return;
+            if (this._cfgCommon.UserstreamPeriod > 0) return;
 
             try
             {
index ca05c69..b8a71bf 100644 (file)
@@ -201,7 +201,7 @@ namespace OpenTween
             if (err != null) return err;
 
             _uname = username.ToLower();
-            if (AppendSettingDialog.Instance.UserstreamStartup) this.ReconnectUserStream();
+            if (SettingCommon.Instance.UserstreamStartup) this.ReconnectUserStream();
             return "";
         }
 
@@ -241,7 +241,7 @@ namespace OpenTween
             if (err != null) return err;
 
             _uname = Username.ToLower();
-            if (AppendSettingDialog.Instance.UserstreamStartup) this.ReconnectUserStream();
+            if (SettingCommon.Instance.UserstreamStartup) this.ReconnectUserStream();
             return "";
         }
 
@@ -291,7 +291,7 @@ namespace OpenTween
             this.ResetApiStatus();
             twCon.Initialize(token, tokenSecret, username, userId);
             _uname = username.ToLower();
-            if (AppendSettingDialog.Instance.UserstreamStartup) this.ReconnectUserStream();
+            if (SettingCommon.Instance.UserstreamStartup) this.ReconnectUserStream();
         }
 
         public string PreProcessUrl(string orgData)