1 // OpenTween - Client of Twitter
2 // Copyright (c) 2007-2011 kiri_feather (@kiri_feather) <kiri.feather@gmail.com>
3 // (c) 2008-2011 Moz (@syo68k)
4 // (c) 2008-2011 takeshik (@takeshik) <http://www.takeshik.org/>
5 // (c) 2010-2011 anis774 (@anis774) <http://d.hatena.ne.jp/anis774/>
6 // (c) 2010-2011 fantasticswallow (@f_swallow) <http://twitter.com/f_swallow>
7 // (c) 2011 kim_upsilon (@kim_upsilon) <https://upsilo.net/~upsilon/>
8 // All rights reserved.
10 // This file is part of OpenTween.
12 // This program is free software; you can redistribute it and/or modify it
13 // under the terms of the GNU General Public License as published by the Free
14 // Software Foundation; either version 3 of the License, or (at your option)
17 // This program is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 // You should have received a copy of the GNU General Public License along
23 // with this program. If not, see <http://www.gnu.org/licenses/>, or write to
24 // the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
25 // Boston, MA 02110-1301, USA.
28 using System.Collections.Generic;
29 using System.ComponentModel;
34 using System.Windows.Forms;
35 using System.Threading;
37 using System.Resources;
38 using OpenTween.Thumbnail;
39 using System.Threading.Tasks;
43 public partial class AppendSettingDialog : Form
45 private static AppendSettingDialog _instance = new AppendSettingDialog();
47 private HttpConnection.ProxyType _MyProxyType;
49 private bool _ValidationError = false;
50 private MyCommon.EVENTTYPE _MyEventNotifyFlag;
51 private MyCommon.EVENTTYPE _isMyEventNotifyFlag;
52 private string _MyTranslateLanguage;
54 public bool HideDuplicatedRetweets;
56 public bool IsPreviewFoursquare;
57 public MapProvider MapThumbnailProvider;
58 public int MapThumbnailHeight;
59 public int MapThumbnailWidth;
60 public int MapThumbnailZoom;
61 public bool IsListStatusesIncludeRts;
62 public List<UserAccount> UserAccounts;
63 private long InitialUserId;
64 public bool TabMouseLock;
65 public bool IsRemoveSameEvent;
66 public bool IsNotifyUseGrowl;
68 public TwitterDataModel.Configuration TwitterConfiguration = new TwitterDataModel.Configuration();
72 public class IntervalChangedEventArgs : EventArgs
74 public bool UserStream;
77 public bool DirectMessage;
78 public bool PublicSearch;
80 public bool UserTimeline;
83 public delegate void IntervalChangedEventHandler(object sender, IntervalChangedEventArgs e);
84 public event IntervalChangedEventHandler IntervalChanged;
86 private void TreeViewSetting_BeforeSelect(object sender, TreeViewCancelEventArgs e)
88 if (this.TreeViewSetting.SelectedNode == null) return;
89 Panel pnl = (Panel)this.TreeViewSetting.SelectedNode.Tag;
90 if (pnl == null) return;
95 private void TreeViewSetting_AfterSelect(object sender, TreeViewEventArgs e)
97 if (e.Node == null) return;
98 Panel pnl = (Panel)e.Node.Tag;
99 if (pnl == null) return;
103 if (pnl.Name == "PreviewPanel")
105 if (GrowlHelper.IsDllExists)
107 IsNotifyUseGrowlCheckBox.Enabled = true;
111 IsNotifyUseGrowlCheckBox.Enabled = false;
116 private void Save_Click(object sender, EventArgs e)
118 if (MyCommon.IsNetworkAvailable() &&
119 (ComboBoxAutoShortUrlFirst.SelectedIndex == (int)MyCommon.UrlConverter.Bitly || ComboBoxAutoShortUrlFirst.SelectedIndex == (int)MyCommon.UrlConverter.Jmp))
121 // bit.ly 短縮機能実装のプライバシー問題の暫定対応
122 // bit.ly 使用時はログインIDとAPIキーの指定を必須とする
123 // 参照: http://sourceforge.jp/projects/opentween/lists/archive/dev/2012-January/000020.html
124 if (string.IsNullOrEmpty(TextBitlyId.Text) || string.IsNullOrEmpty(TextBitlyPw.Text))
126 MessageBox.Show("bit.ly のログイン名とAPIキーの指定は必須項目です。", Application.ProductName);
127 _ValidationError = true;
128 TreeViewSetting.SelectedNode = TreeViewSetting.Nodes["ConnectionNode"].Nodes["ShortUrlNode"]; // 動作タブを選択
129 TreeViewSetting.Select();
134 if (!BitlyValidation(TextBitlyId.Text, TextBitlyPw.Text))
136 MessageBox.Show(Properties.Resources.SettingSave_ClickText1);
137 _ValidationError = true;
138 TreeViewSetting.SelectedNode = TreeViewSetting.Nodes["ConnectionNode"].Nodes["ShortUrlNode"]; // 動作タブを選択
139 TreeViewSetting.Select();
145 _ValidationError = false;
150 _ValidationError = false;
153 this.UserAccounts.Clear();
154 foreach (object u in this.AuthUserCombo.Items)
156 this.UserAccounts.Add((UserAccount)u);
158 if (this.AuthUserCombo.SelectedIndex > -1)
160 foreach (UserAccount u in this.UserAccounts)
162 if (u.Username.ToLower() == ((UserAccount)this.AuthUserCombo.SelectedItem).Username.ToLower())
164 tw.Initialize(u.Token, u.TokenSecret, u.Username, u.UserId);
167 tw.VerifyCredentials();
168 u.UserId = tw.UserId;
177 tw.Initialize("", "", "", 0);
182 if (this.FollowCheckBox.Checked)
185 HttpConnection.ProxyType ptype;
186 if (RadioProxyNone.Checked)
188 ptype = HttpConnection.ProxyType.None;
190 else if (RadioProxyIE.Checked)
192 ptype = HttpConnection.ProxyType.IE;
196 ptype = HttpConnection.ProxyType.Specified;
198 string padr = TextProxyAddress.Text.Trim();
199 int pport = int.Parse(TextProxyPort.Text.Trim());
200 string pusr = TextProxyUser.Text.Trim();
201 string ppw = TextProxyPassword.Text.Trim();
202 HttpConnection.InitializeConnection(20, ptype, padr, pport, pusr, ppw);
204 string ret = tw.PostFollowCommand(ApplicationSettings.FeedbackTwitterName);
207 IntervalChangedEventArgs arg = new IntervalChangedEventArgs();
208 bool isIntervalChanged = false;
212 UserstreamStartup = this.StartupUserstreamCheck.Checked;
214 if (UserstreamPeriodInt != int.Parse(UserstreamPeriod.Text))
216 UserstreamPeriodInt = int.Parse(UserstreamPeriod.Text);
217 arg.UserStream = true;
218 isIntervalChanged = true;
220 if (TimelinePeriodInt != int.Parse(TimelinePeriod.Text))
222 TimelinePeriodInt = int.Parse(TimelinePeriod.Text);
224 isIntervalChanged = true;
226 if (DMPeriodInt != int.Parse(DMPeriod.Text))
228 DMPeriodInt = int.Parse(DMPeriod.Text);
229 arg.DirectMessage = true;
230 isIntervalChanged = true;
232 if (PubSearchPeriodInt != int.Parse(PubSearchPeriod.Text))
234 PubSearchPeriodInt = int.Parse(PubSearchPeriod.Text);
235 arg.PublicSearch = true;
236 isIntervalChanged = true;
239 if (ListsPeriodInt != int.Parse(ListsPeriod.Text))
241 ListsPeriodInt = int.Parse(ListsPeriod.Text);
243 isIntervalChanged = true;
245 if (ReplyPeriodInt != int.Parse(ReplyPeriod.Text))
247 ReplyPeriodInt = int.Parse(ReplyPeriod.Text);
249 isIntervalChanged = true;
251 if (UserTimelinePeriodInt != int.Parse(UserTimelinePeriod.Text))
253 UserTimelinePeriodInt = int.Parse(UserTimelinePeriod.Text);
254 arg.UserTimeline = true;
255 isIntervalChanged = true;
258 if (isIntervalChanged && IntervalChanged != null)
260 IntervalChanged(this, arg);
263 Readed = StartupReaded.Checked;
264 switch (IconSize.SelectedIndex)
267 IconSz = MyCommon.IconSizes.IconNone;
270 IconSz = MyCommon.IconSizes.Icon16;
273 IconSz = MyCommon.IconSizes.Icon24;
276 IconSz = MyCommon.IconSizes.Icon48;
279 IconSz = MyCommon.IconSizes.Icon48_2;
282 Status = StatusText.Text;
283 PlaySound = PlaySnd.Checked;
284 UnreadManage = UReadMng.Checked;
285 OneWayLove = OneWayLv.Checked;
287 FontUnread = lblUnread.Font; //未使用
288 ColorUnread = lblUnread.ForeColor;
289 FontReaded = lblListFont.Font; //リストフォントとして使用
290 ColorReaded = lblListFont.ForeColor;
291 ColorFav = lblFav.ForeColor;
292 ColorOWL = lblOWL.ForeColor;
293 ColorRetweet = lblRetweet.ForeColor;
294 FontDetail = lblDetail.Font;
295 ColorSelf = lblSelf.BackColor;
296 ColorAtSelf = lblAtSelf.BackColor;
297 ColorTarget = lblTarget.BackColor;
298 ColorAtTarget = lblAtTarget.BackColor;
299 ColorAtFromTarget = lblAtFromTarget.BackColor;
300 ColorAtTo = lblAtTo.BackColor;
301 ColorInputBackcolor = lblInputBackcolor.BackColor;
302 ColorInputFont = lblInputFont.ForeColor;
303 ColorListBackcolor = lblListBackcolor.BackColor;
304 ColorDetailBackcolor = lblDetailBackcolor.BackColor;
305 ColorDetail = lblDetail.ForeColor;
306 ColorDetailLink = lblDetailLink.ForeColor;
307 FontInputFont = lblInputFont.Font;
308 switch (cmbNameBalloon.SelectedIndex)
311 NameBalloon = MyCommon.NameBalloonEnum.None;
314 NameBalloon = MyCommon.NameBalloonEnum.UserID;
317 NameBalloon = MyCommon.NameBalloonEnum.NickName;
321 switch (ComboBoxPostKeySelect.SelectedIndex)
324 PostShiftEnter = true;
325 PostCtrlEnter = false;
328 PostCtrlEnter = true;
329 PostShiftEnter = false;
332 PostCtrlEnter = false;
333 PostShiftEnter = false;
336 CountApi = int.Parse(TextCountApi.Text);
337 CountApiReply = int.Parse(TextCountApiReply.Text);
338 BrowserPath = BrowserPathText.Text.Trim();
339 PostAndGet = CheckPostAndGet.Checked;
340 UseRecommendStatus = CheckUseRecommendStatus.Checked;
341 DispUsername = CheckDispUsername.Checked;
342 CloseToExit = CheckCloseToExit.Checked;
343 MinimizeToTray = CheckMinimizeToTray.Checked;
344 switch (ComboDispTitle.SelectedIndex)
347 DispLatestPost = MyCommon.DispTitleEnum.None;
350 DispLatestPost = MyCommon.DispTitleEnum.Ver;
353 DispLatestPost = MyCommon.DispTitleEnum.Post;
356 DispLatestPost = MyCommon.DispTitleEnum.UnreadRepCount;
359 DispLatestPost = MyCommon.DispTitleEnum.UnreadAllCount;
362 DispLatestPost = MyCommon.DispTitleEnum.UnreadAllRepCount;
365 DispLatestPost = MyCommon.DispTitleEnum.UnreadCountAllCount;
367 case 7: //Count of Status/Follow/Follower
368 DispLatestPost = MyCommon.DispTitleEnum.OwnStatus;
371 SortOrderLock = CheckSortOrderLock.Checked;
372 ViewTabBottom = CheckViewTabBottom.Checked;
373 TinyUrlResolve = CheckTinyURL.Checked;
374 ShortUrlForceResolve = CheckForceResolve.Checked;
375 ShortUrl.IsResolve = TinyUrlResolve;
376 ShortUrl.IsForceResolve = ShortUrlForceResolve;
377 if (RadioProxyNone.Checked)
379 _MyProxyType = HttpConnection.ProxyType.None;
381 else if (RadioProxyIE.Checked)
383 _MyProxyType = HttpConnection.ProxyType.IE;
387 _MyProxyType = HttpConnection.ProxyType.Specified;
389 ProxyAddress = TextProxyAddress.Text.Trim();
390 ProxyPort = int.Parse(TextProxyPort.Text.Trim());
391 ProxyUser = TextProxyUser.Text.Trim();
392 ProxyPassword = TextProxyPassword.Text.Trim();
393 PeriodAdjust = CheckPeriodAdjust.Checked;
394 StartupVersion = CheckStartupVersion.Checked;
395 StartupFollowers = CheckStartupFollowers.Checked;
396 RestrictFavCheck = CheckFavRestrict.Checked;
397 AlwaysTop = CheckAlwaysTop.Checked;
398 UrlConvertAuto = CheckAutoConvertUrl.Checked;
399 ShortenTco = ShortenTcoCheck.Checked;
400 OutputzEnabled = CheckOutputz.Checked;
401 OutputzKey = TextBoxOutputzKey.Text.Trim();
403 switch (ComboBoxOutputzUrlmode.SelectedIndex)
406 OutputzUrlmode = MyCommon.OutputzUrlmode.twittercom;
409 OutputzUrlmode = MyCommon.OutputzUrlmode.twittercomWithUsername;
413 Nicoms = CheckNicoms.Checked;
414 UseUnreadStyle = chkUnreadStyle.Checked;
415 DateTimeFormat = CmbDateTimeFormat.Text;
416 DefaultTimeOut = int.Parse(ConnectionTimeOut.Text);
417 RetweetNoConfirm = CheckRetweetNoConfirm.Checked;
418 LimitBalloon = CheckBalloonLimit.Checked;
419 EventNotifyEnabled = CheckEventNotify.Checked;
420 GetEventNotifyFlag(ref _MyEventNotifyFlag, ref _isMyEventNotifyFlag);
421 ForceEventNotify = CheckForceEventNotify.Checked;
422 FavEventUnread = CheckFavEventUnread.Checked;
423 TranslateLanguage = (new Bing()).GetLanguageEnumFromIndex(ComboBoxTranslateLanguage.SelectedIndex);
424 EventSoundFile = (string)ComboBoxEventNotifySound.SelectedItem;
425 AutoShortUrlFirst = (MyCommon.UrlConverter)ComboBoxAutoShortUrlFirst.SelectedIndex;
426 TabIconDisp = chkTabIconDisp.Checked;
427 ReadOwnPost = chkReadOwnPost.Checked;
428 GetFav = chkGetFav.Checked;
429 IsMonospace = CheckMonospace.Checked;
430 ReadOldPosts = CheckReadOldPosts.Checked;
431 UseSsl = CheckUseSsl.Checked;
432 BitlyUser = TextBitlyId.Text;
433 BitlyPwd = TextBitlyPw.Text;
434 ShowGrid = CheckShowGrid.Checked;
435 UseAtIdSupplement = CheckAtIdSupple.Checked;
436 UseHashSupplement = CheckHashSupple.Checked;
437 PreviewEnable = CheckPreviewEnable.Checked;
438 TwitterApiUrl = TwitterAPIText.Text.Trim();
439 TwitterSearchApiUrl = TwitterSearchAPIText.Text.Trim();
440 switch (ReplyIconStateCombo.SelectedIndex)
443 ReplyIconState = MyCommon.REPLY_ICONSTATE.None;
446 ReplyIconState = MyCommon.REPLY_ICONSTATE.StaticIcon;
449 ReplyIconState = MyCommon.REPLY_ICONSTATE.BlinkIcon;
452 switch (LanguageCombo.SelectedIndex)
470 HotkeyEnabled = this.HotkeyCheck.Checked;
471 HotkeyMod = Keys.None;
472 if (this.HotkeyAlt.Checked) HotkeyMod = HotkeyMod | Keys.Alt;
473 if (this.HotkeyShift.Checked) HotkeyMod = HotkeyMod | Keys.Shift;
474 if (this.HotkeyCtrl.Checked) HotkeyMod = HotkeyMod | Keys.Control;
475 if (this.HotkeyWin.Checked) HotkeyMod = HotkeyMod | Keys.LWin;
476 int.TryParse(HotkeyCode.Text, out HotkeyValue);
477 HotkeyKey = (Keys)HotkeyText.Tag;
478 BlinkNewMentions = ChkNewMentionsBlink.Checked;
479 UseAdditionalCount = UseChangeGetCount.Checked;
480 MoreCountApi = int.Parse(GetMoreTextCountApi.Text);
481 FirstCountApi = int.Parse(FirstTextCountApi.Text);
482 SearchCountApi = int.Parse(SearchTextCountApi.Text);
483 FavoritesCountApi = int.Parse(FavoritesTextCountApi.Text);
484 UserTimelineCountApi = int.Parse(UserTimelineTextCountApi.Text);
485 ListCountApi = int.Parse(ListTextCountApi.Text);
486 OpenUserTimeline = CheckOpenUserTimeline.Checked;
487 ListDoubleClickAction = ListDoubleClickActionComboBox.SelectedIndex;
488 UserAppointUrl = UserAppointUrlText.Text;
489 this.HideDuplicatedRetweets = this.HideDuplicatedRetweetsCheck.Checked;
490 this.IsPreviewFoursquare = this.IsPreviewFoursquareCheckBox.Checked;
491 this.MapThumbnailProvider = (MapProvider)this.MapThumbnailProviderComboBox.SelectedIndex;
492 this.MapThumbnailHeight = int.Parse(this.MapThumbnailHeightTextBox.Text);
493 this.MapThumbnailWidth = int.Parse(this.MapThumbnailWidthTextBox.Text);
494 this.MapThumbnailZoom = int.Parse(this.MapThumbnailZoomTextBox.Text);
495 this.IsListStatusesIncludeRts = this.IsListsIncludeRtsCheckBox.Checked;
496 this.TabMouseLock = this.TabMouseLockCheck.Checked;
497 this.IsRemoveSameEvent = this.IsRemoveSameFavEventCheckBox.Checked;
498 this.IsNotifyUseGrowl = this.IsNotifyUseGrowlCheckBox.Checked;
502 MessageBox.Show(Properties.Resources.Save_ClickText3);
503 this.DialogResult = DialogResult.Cancel;
508 private void Setting_FormClosing(object sender, FormClosingEventArgs e)
510 if (MyCommon._endingFlag) return;
512 if (this.DialogResult == DialogResult.Cancel)
514 //キャンセル時は画面表示時のアカウントに戻す
515 //キャンセル時でも認証済みアカウント情報は保存する
516 this.UserAccounts.Clear();
517 foreach (object u in this.AuthUserCombo.Items)
519 this.UserAccounts.Add((UserAccount)u);
521 //アクティブユーザーを起動時のアカウントに戻す(起動時アカウントなければ何もしない)
522 bool userSet = false;
523 if (this.InitialUserId > 0)
525 foreach (UserAccount u in this.UserAccounts)
527 if (u.UserId == this.InitialUserId)
529 tw.Initialize(u.Token, u.TokenSecret, u.Username, u.UserId);
535 //認証済みアカウントが削除されていた場合、もしくは起動時アカウントがなかった場合は、
540 tw.Initialize("", "", "", 0);
544 if (tw != null && string.IsNullOrEmpty(tw.Username) && e.CloseReason == CloseReason.None)
546 if (MessageBox.Show(Properties.Resources.Setting_FormClosing1, "Confirm", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
551 if (_ValidationError)
555 if (e.Cancel == false && TreeViewSetting.SelectedNode != null)
557 Panel curPanel = (Panel)TreeViewSetting.SelectedNode.Tag;
558 curPanel.Visible = false;
559 curPanel.Enabled = false;
563 private void Setting_Load(object sender, EventArgs e)
566 this.FollowCheckBox.Text = string.Format(this.FollowCheckBox.Text, ApplicationSettings.FeedbackTwitterName);
567 this.GroupBox2.Visible = true;
569 this.GroupBox2.Visible = false;
571 tw = ((TweenMain)this.Owner).TwitterInstance;
572 string uname = tw.Username;
573 string pw = tw.Password;
574 string tk = tw.AccessToken;
575 string tks = tw.AccessTokenSecret;
576 //this.AuthStateLabel.Enabled = true;
577 //this.AuthUserLabel.Enabled = true;
578 this.AuthClearButton.Enabled = true;
580 //if (tw.Username == "")
582 // //this.AuthStateLabel.Text = Properties.Resources.AuthorizeButton_Click4
583 // //this.AuthUserLabel.Text = ""
584 // //this.Save.Enabled = false
588 // //this.AuthStateLabel.Text = Properties.Resources.AuthorizeButton_Click3;
589 // //if (TwitterApiInfo.AccessLevel == ApiAccessLevel.ReadWrite)
591 // // this.AuthStateLabel.Text += "(xAuth)";
593 // //else if (TwitterApiInfo.AccessLevel == ApiAccessLevel.ReadWriteAndDirectMessage)
595 // // this.AuthStateLabel.Text += "(OAuth)";
597 // //this.AuthUserLabel.Text = tw.Username;
600 this.AuthUserCombo.Items.Clear();
601 if (this.UserAccounts.Count > 0)
603 this.AuthUserCombo.Items.AddRange(this.UserAccounts.ToArray());
604 foreach (UserAccount u in this.UserAccounts)
606 if (u.UserId == tw.UserId)
608 this.AuthUserCombo.SelectedItem = u;
609 this.InitialUserId = u.UserId;
615 this.StartupUserstreamCheck.Checked = UserstreamStartup;
616 UserstreamPeriod.Text = UserstreamPeriodInt.ToString();
617 TimelinePeriod.Text = TimelinePeriodInt.ToString();
618 ReplyPeriod.Text = ReplyPeriodInt.ToString();
619 DMPeriod.Text = DMPeriodInt.ToString();
620 PubSearchPeriod.Text = PubSearchPeriodInt.ToString();
621 ListsPeriod.Text = ListsPeriodInt.ToString();
622 UserTimelinePeriod.Text = UserTimelinePeriodInt.ToString();
624 StartupReaded.Checked = Readed;
627 case MyCommon.IconSizes.IconNone:
628 IconSize.SelectedIndex = 0;
630 case MyCommon.IconSizes.Icon16:
631 IconSize.SelectedIndex = 1;
633 case MyCommon.IconSizes.Icon24:
634 IconSize.SelectedIndex = 2;
636 case MyCommon.IconSizes.Icon48:
637 IconSize.SelectedIndex = 3;
639 case MyCommon.IconSizes.Icon48_2:
640 IconSize.SelectedIndex = 4;
643 StatusText.Text = Status;
644 UReadMng.Checked = UnreadManage;
645 if (UnreadManage == false)
647 StartupReaded.Enabled = false;
651 StartupReaded.Enabled = true;
653 PlaySnd.Checked = PlaySound;
654 OneWayLv.Checked = OneWayLove;
656 lblListFont.Font = FontReaded;
657 lblUnread.Font = FontUnread;
658 lblUnread.ForeColor = ColorUnread;
659 lblListFont.ForeColor = ColorReaded;
660 lblFav.ForeColor = ColorFav;
661 lblOWL.ForeColor = ColorOWL;
662 lblRetweet.ForeColor = ColorRetweet;
663 lblDetail.Font = FontDetail;
664 lblSelf.BackColor = ColorSelf;
665 lblAtSelf.BackColor = ColorAtSelf;
666 lblTarget.BackColor = ColorTarget;
667 lblAtTarget.BackColor = ColorAtTarget;
668 lblAtFromTarget.BackColor = ColorAtFromTarget;
669 lblAtTo.BackColor = ColorAtTo;
670 lblInputBackcolor.BackColor = ColorInputBackcolor;
671 lblInputFont.ForeColor = ColorInputFont;
672 lblInputFont.Font = FontInputFont;
673 lblListBackcolor.BackColor = ColorListBackcolor;
674 lblDetailBackcolor.BackColor = ColorDetailBackcolor;
675 lblDetail.ForeColor = ColorDetail;
676 lblDetailLink.ForeColor = ColorDetailLink;
680 case MyCommon.NameBalloonEnum.None:
681 cmbNameBalloon.SelectedIndex = 0;
683 case MyCommon.NameBalloonEnum.UserID:
684 cmbNameBalloon.SelectedIndex = 1;
686 case MyCommon.NameBalloonEnum.NickName:
687 cmbNameBalloon.SelectedIndex = 2;
693 ComboBoxPostKeySelect.SelectedIndex = 1;
695 else if (PostShiftEnter)
697 ComboBoxPostKeySelect.SelectedIndex = 2;
701 ComboBoxPostKeySelect.SelectedIndex = 0;
704 TextCountApi.Text = CountApi.ToString();
705 TextCountApiReply.Text = CountApiReply.ToString();
706 BrowserPathText.Text = BrowserPath;
707 CheckPostAndGet.Checked = PostAndGet;
708 CheckUseRecommendStatus.Checked = UseRecommendStatus;
709 CheckDispUsername.Checked = DispUsername;
710 CheckCloseToExit.Checked = CloseToExit;
711 CheckMinimizeToTray.Checked = MinimizeToTray;
712 switch (DispLatestPost)
714 case MyCommon.DispTitleEnum.None:
715 ComboDispTitle.SelectedIndex = 0;
717 case MyCommon.DispTitleEnum.Ver:
718 ComboDispTitle.SelectedIndex = 1;
720 case MyCommon.DispTitleEnum.Post:
721 ComboDispTitle.SelectedIndex = 2;
723 case MyCommon.DispTitleEnum.UnreadRepCount:
724 ComboDispTitle.SelectedIndex = 3;
726 case MyCommon.DispTitleEnum.UnreadAllCount:
727 ComboDispTitle.SelectedIndex = 4;
729 case MyCommon.DispTitleEnum.UnreadAllRepCount:
730 ComboDispTitle.SelectedIndex = 5;
732 case MyCommon.DispTitleEnum.UnreadCountAllCount:
733 ComboDispTitle.SelectedIndex = 6;
735 case MyCommon.DispTitleEnum.OwnStatus:
736 ComboDispTitle.SelectedIndex = 7;
739 CheckSortOrderLock.Checked = SortOrderLock;
740 CheckViewTabBottom.Checked = ViewTabBottom;
741 CheckTinyURL.Checked = TinyUrlResolve;
742 CheckForceResolve.Checked = ShortUrlForceResolve;
743 switch (_MyProxyType)
745 case HttpConnection.ProxyType.None:
746 RadioProxyNone.Checked = true;
748 case HttpConnection.ProxyType.IE:
749 RadioProxyIE.Checked = true;
752 RadioProxySpecified.Checked = true;
755 bool chk = RadioProxySpecified.Checked;
756 LabelProxyAddress.Enabled = chk;
757 TextProxyAddress.Enabled = chk;
758 LabelProxyPort.Enabled = chk;
759 TextProxyPort.Enabled = chk;
760 LabelProxyUser.Enabled = chk;
761 TextProxyUser.Enabled = chk;
762 LabelProxyPassword.Enabled = chk;
763 TextProxyPassword.Enabled = chk;
765 TextProxyAddress.Text = ProxyAddress;
766 TextProxyPort.Text = ProxyPort.ToString();
767 TextProxyUser.Text = ProxyUser;
768 TextProxyPassword.Text = ProxyPassword;
770 CheckPeriodAdjust.Checked = PeriodAdjust;
771 CheckStartupVersion.Checked = StartupVersion;
772 CheckStartupFollowers.Checked = StartupFollowers;
773 CheckFavRestrict.Checked = RestrictFavCheck;
774 CheckAlwaysTop.Checked = AlwaysTop;
775 CheckAutoConvertUrl.Checked = UrlConvertAuto;
776 ShortenTcoCheck.Checked = ShortenTco;
777 ShortenTcoCheck.Enabled = CheckAutoConvertUrl.Checked;
778 CheckOutputz.Checked = OutputzEnabled;
779 TextBoxOutputzKey.Text = OutputzKey;
781 switch (OutputzUrlmode)
783 case MyCommon.OutputzUrlmode.twittercom:
784 ComboBoxOutputzUrlmode.SelectedIndex = 0;
786 case MyCommon.OutputzUrlmode.twittercomWithUsername:
787 ComboBoxOutputzUrlmode.SelectedIndex = 1;
791 CheckNicoms.Checked = Nicoms;
792 chkUnreadStyle.Checked = UseUnreadStyle;
793 CmbDateTimeFormat.Text = DateTimeFormat;
794 ConnectionTimeOut.Text = DefaultTimeOut.ToString();
795 CheckRetweetNoConfirm.Checked = RetweetNoConfirm;
796 CheckBalloonLimit.Checked = LimitBalloon;
798 ApplyEventNotifyFlag(EventNotifyEnabled, EventNotifyFlag, IsMyEventNotifyFlag);
799 CheckForceEventNotify.Checked = ForceEventNotify;
800 CheckFavEventUnread.Checked = FavEventUnread;
801 ComboBoxTranslateLanguage.SelectedIndex = (new Bing()).GetIndexFromLanguageEnum(TranslateLanguage);
803 ComboBoxAutoShortUrlFirst.SelectedIndex = (int)AutoShortUrlFirst;
804 chkTabIconDisp.Checked = TabIconDisp;
805 chkReadOwnPost.Checked = ReadOwnPost;
806 chkGetFav.Checked = GetFav;
807 CheckMonospace.Checked = IsMonospace;
808 CheckReadOldPosts.Checked = ReadOldPosts;
809 CheckUseSsl.Checked = UseSsl;
810 TextBitlyId.Text = BitlyUser;
811 TextBitlyPw.Text = BitlyPwd;
812 TextBitlyId.Modified = false;
813 TextBitlyPw.Modified = false;
814 CheckShowGrid.Checked = ShowGrid;
815 CheckAtIdSupple.Checked = UseAtIdSupplement;
816 CheckHashSupple.Checked = UseHashSupplement;
817 CheckPreviewEnable.Checked = PreviewEnable;
818 TwitterAPIText.Text = TwitterApiUrl;
819 TwitterSearchAPIText.Text = TwitterSearchApiUrl;
820 switch (ReplyIconState)
822 case MyCommon.REPLY_ICONSTATE.None:
823 ReplyIconStateCombo.SelectedIndex = 0;
825 case MyCommon.REPLY_ICONSTATE.StaticIcon:
826 ReplyIconStateCombo.SelectedIndex = 1;
828 case MyCommon.REPLY_ICONSTATE.BlinkIcon:
829 ReplyIconStateCombo.SelectedIndex = 2;
835 LanguageCombo.SelectedIndex = 0;
838 LanguageCombo.SelectedIndex = 1;
841 LanguageCombo.SelectedIndex = 2;
844 LanguageCombo.SelectedIndex = 3;
847 LanguageCombo.SelectedIndex = 0;
850 HotkeyCheck.Checked = HotkeyEnabled;
851 HotkeyAlt.Checked = ((HotkeyMod & Keys.Alt) == Keys.Alt);
852 HotkeyCtrl.Checked = ((HotkeyMod & Keys.Control) == Keys.Control);
853 HotkeyShift.Checked = ((HotkeyMod & Keys.Shift) == Keys.Shift);
854 HotkeyWin.Checked = ((HotkeyMod & Keys.LWin) == Keys.LWin);
855 HotkeyCode.Text = HotkeyValue.ToString();
856 HotkeyText.Text = HotkeyKey.ToString();
857 HotkeyText.Tag = HotkeyKey;
858 HotkeyAlt.Enabled = HotkeyEnabled;
859 HotkeyShift.Enabled = HotkeyEnabled;
860 HotkeyCtrl.Enabled = HotkeyEnabled;
861 HotkeyWin.Enabled = HotkeyEnabled;
862 HotkeyText.Enabled = HotkeyEnabled;
863 HotkeyCode.Enabled = HotkeyEnabled;
864 ChkNewMentionsBlink.Checked = BlinkNewMentions;
866 CheckOutputz_CheckedChanged(sender, e);
868 GetMoreTextCountApi.Text = MoreCountApi.ToString();
869 FirstTextCountApi.Text = FirstCountApi.ToString();
870 SearchTextCountApi.Text = SearchCountApi.ToString();
871 FavoritesTextCountApi.Text = FavoritesCountApi.ToString();
872 UserTimelineTextCountApi.Text = UserTimelineCountApi.ToString();
873 ListTextCountApi.Text = ListCountApi.ToString();
874 UseChangeGetCount.Checked = UseAdditionalCount;
875 Label28.Enabled = UseChangeGetCount.Checked;
876 Label30.Enabled = UseChangeGetCount.Checked;
877 Label53.Enabled = UseChangeGetCount.Checked;
878 Label66.Enabled = UseChangeGetCount.Checked;
879 Label17.Enabled = UseChangeGetCount.Checked;
880 Label25.Enabled = UseChangeGetCount.Checked;
881 GetMoreTextCountApi.Enabled = UseChangeGetCount.Checked;
882 FirstTextCountApi.Enabled = UseChangeGetCount.Checked;
883 SearchTextCountApi.Enabled = UseChangeGetCount.Checked;
884 FavoritesTextCountApi.Enabled = UseChangeGetCount.Checked;
885 UserTimelineTextCountApi.Enabled = UseChangeGetCount.Checked;
886 ListTextCountApi.Enabled = UseChangeGetCount.Checked;
887 CheckOpenUserTimeline.Checked = OpenUserTimeline;
888 ListDoubleClickActionComboBox.SelectedIndex = ListDoubleClickAction;
889 UserAppointUrlText.Text = UserAppointUrl;
890 this.HideDuplicatedRetweetsCheck.Checked = this.HideDuplicatedRetweets;
891 this.IsPreviewFoursquareCheckBox.Checked = this.IsPreviewFoursquare;
892 this.MapThumbnailProviderComboBox.SelectedIndex = (int)this.MapThumbnailProvider;
893 this.MapThumbnailHeightTextBox.Text = this.MapThumbnailHeight.ToString();
894 this.MapThumbnailWidthTextBox.Text = this.MapThumbnailWidth.ToString();
895 this.MapThumbnailZoomTextBox.Text = this.MapThumbnailZoom.ToString();
896 this.IsListsIncludeRtsCheckBox.Checked = this.IsListStatusesIncludeRts;
897 this.TabMouseLockCheck.Checked = this.TabMouseLock;
898 this.IsRemoveSameFavEventCheckBox.Checked = this.IsRemoveSameEvent;
899 this.IsNotifyUseGrowlCheckBox.Checked = this.IsNotifyUseGrowl;
901 if (GrowlHelper.IsDllExists)
903 IsNotifyUseGrowlCheckBox.Enabled = true;
907 IsNotifyUseGrowlCheckBox.Enabled = false;
910 this.TreeViewSetting.Nodes["BasedNode"].Tag = BasedPanel;
911 this.TreeViewSetting.Nodes["BasedNode"].Nodes["PeriodNode"].Tag = GetPeriodPanel;
912 this.TreeViewSetting.Nodes["BasedNode"].Nodes["StartUpNode"].Tag = StartupPanel;
913 this.TreeViewSetting.Nodes["BasedNode"].Nodes["GetCountNode"].Tag = GetCountPanel;
914 //this.TreeViewSetting.Nodes["BasedNode"].Nodes["UserStreamNode"].Tag = UserStreamPanel;
915 this.TreeViewSetting.Nodes["ActionNode"].Tag = ActionPanel;
916 this.TreeViewSetting.Nodes["ActionNode"].Nodes["TweetActNode"].Tag = TweetActPanel;
917 this.TreeViewSetting.Nodes["PreviewNode"].Tag = PreviewPanel;
918 this.TreeViewSetting.Nodes["PreviewNode"].Nodes["TweetPrvNode"].Tag = TweetPrvPanel;
919 this.TreeViewSetting.Nodes["PreviewNode"].Nodes["NotifyNode"].Tag = NotifyPanel;
920 this.TreeViewSetting.Nodes["FontNode"].Tag = FontPanel;
921 this.TreeViewSetting.Nodes["FontNode"].Nodes["FontNode2"].Tag = FontPanel2;
922 this.TreeViewSetting.Nodes["ConnectionNode"].Tag = ConnectionPanel;
923 this.TreeViewSetting.Nodes["ConnectionNode"].Nodes["ProxyNode"].Tag = ProxyPanel;
924 this.TreeViewSetting.Nodes["ConnectionNode"].Nodes["CooperateNode"].Tag = CooperatePanel;
925 this.TreeViewSetting.Nodes["ConnectionNode"].Nodes["ShortUrlNode"].Tag = ShortUrlPanel;
927 this.TreeViewSetting.SelectedNode = this.TreeViewSetting.Nodes[0];
928 this.TreeViewSetting.ExpandAll();
930 //TreeViewSetting.SelectedNode = TreeViewSetting.TopNode;
931 ActiveControl = StartAuthButton;
934 private void UserstreamPeriod_Validating(object sender, CancelEventArgs e)
939 prd = int.Parse(UserstreamPeriod.Text);
943 MessageBox.Show(Properties.Resources.UserstreamPeriod_ValidatingText1);
948 if (prd < 0 || prd > 60)
950 MessageBox.Show(Properties.Resources.UserstreamPeriod_ValidatingText1);
957 private void TimelinePeriod_Validating(object sender, CancelEventArgs e)
962 prd = int.Parse(TimelinePeriod.Text);
966 MessageBox.Show(Properties.Resources.TimelinePeriod_ValidatingText1);
971 if (prd != 0 && (prd < 15 || prd > 6000))
973 MessageBox.Show(Properties.Resources.TimelinePeriod_ValidatingText2);
980 private void ReplyPeriod_Validating(object sender, CancelEventArgs e)
985 prd = int.Parse(ReplyPeriod.Text);
989 MessageBox.Show(Properties.Resources.TimelinePeriod_ValidatingText1);
994 if (prd != 0 && (prd < 15 || prd > 6000))
996 MessageBox.Show(Properties.Resources.TimelinePeriod_ValidatingText2);
1003 private void DMPeriod_Validating(object sender, CancelEventArgs e)
1008 prd = int.Parse(DMPeriod.Text);
1012 MessageBox.Show(Properties.Resources.DMPeriod_ValidatingText1);
1017 if (prd != 0 && (prd < 15 || prd > 6000))
1019 MessageBox.Show(Properties.Resources.DMPeriod_ValidatingText2);
1026 private void PubSearchPeriod_Validating(object sender, CancelEventArgs e)
1031 prd = int.Parse(PubSearchPeriod.Text);
1035 MessageBox.Show(Properties.Resources.PubSearchPeriod_ValidatingText1);
1040 if (prd != 0 && (prd < 30 || prd > 6000))
1042 MessageBox.Show(Properties.Resources.PubSearchPeriod_ValidatingText2);
1047 private void ListsPeriod_Validating(object sender, CancelEventArgs e)
1052 prd = int.Parse(ListsPeriod.Text);
1056 MessageBox.Show(Properties.Resources.DMPeriod_ValidatingText1);
1061 if (prd != 0 && (prd < 15 || prd > 6000))
1063 MessageBox.Show(Properties.Resources.DMPeriod_ValidatingText2);
1070 private void UserTimeline_Validating(object sender, CancelEventArgs e)
1075 prd = int.Parse(UserTimelinePeriod.Text);
1079 MessageBox.Show(Properties.Resources.DMPeriod_ValidatingText1);
1084 if (prd != 0 && (prd < 15 || prd > 6000))
1086 MessageBox.Show(Properties.Resources.DMPeriod_ValidatingText2);
1093 private void UReadMng_CheckedChanged(object sender, EventArgs e)
1095 if (UReadMng.Checked == true)
1097 StartupReaded.Enabled = true;
1101 StartupReaded.Enabled = false;
1105 private void btnFontAndColor_Click(object sender, EventArgs e) // Handles btnUnread.Click, btnDetail.Click, btnListFont.Click, btnInputFont.Click
1107 Button Btn = (Button) sender;
1110 FontDialog1.AllowVerticalFonts = false;
1111 FontDialog1.AllowScriptChange = true;
1112 FontDialog1.AllowSimulations = true;
1113 FontDialog1.AllowVectorFonts = true;
1114 FontDialog1.FixedPitchOnly = false;
1115 FontDialog1.FontMustExist = true;
1116 FontDialog1.ScriptsOnly = false;
1117 FontDialog1.ShowApply = false;
1118 FontDialog1.ShowEffects = true;
1119 FontDialog1.ShowColor = true;
1124 FontDialog1.Color = lblUnread.ForeColor;
1125 FontDialog1.Font = lblUnread.Font;
1128 FontDialog1.Color = lblDetail.ForeColor;
1129 FontDialog1.Font = lblDetail.Font;
1132 FontDialog1.Color = lblListFont.ForeColor;
1133 FontDialog1.Font = lblListFont.Font;
1135 case "btnInputFont":
1136 FontDialog1.Color = lblInputFont.ForeColor;
1137 FontDialog1.Font = lblInputFont.Font;
1143 rtn = FontDialog1.ShowDialog();
1145 catch(ArgumentException ex)
1147 MessageBox.Show(ex.Message);
1151 if (rtn == DialogResult.Cancel) return;
1156 lblUnread.ForeColor = FontDialog1.Color;
1157 lblUnread.Font = FontDialog1.Font;
1160 lblDetail.ForeColor = FontDialog1.Color;
1161 lblDetail.Font = FontDialog1.Font;
1164 lblListFont.ForeColor = FontDialog1.Color;
1165 lblListFont.Font = FontDialog1.Font;
1167 case "btnInputFont":
1168 lblInputFont.ForeColor = FontDialog1.Color;
1169 lblInputFont.Font = FontDialog1.Font;
1175 private void btnColor_Click(object sender, EventArgs e) //Handles btnSelf.Click, btnAtSelf.Click, btnTarget.Click, btnAtTarget.Click, btnAtFromTarget.Click, btnFav.Click, btnOWL.Click, btnInputBackcolor.Click, btnAtTo.Click, btnListBack.Click, btnDetailBack.Click, btnDetailLink.Click, btnRetweet.Click
1177 Button Btn = (Button)sender;
1180 ColorDialog1.AllowFullOpen = true;
1181 ColorDialog1.AnyColor = true;
1182 ColorDialog1.FullOpen = false;
1183 ColorDialog1.SolidColorOnly = false;
1188 ColorDialog1.Color = lblSelf.BackColor;
1191 ColorDialog1.Color = lblAtSelf.BackColor;
1194 ColorDialog1.Color = lblTarget.BackColor;
1197 ColorDialog1.Color = lblAtTarget.BackColor;
1199 case "btnAtFromTarget":
1200 ColorDialog1.Color = lblAtFromTarget.BackColor;
1203 ColorDialog1.Color = lblFav.ForeColor;
1206 ColorDialog1.Color = lblOWL.ForeColor;
1209 ColorDialog1.Color = lblRetweet.ForeColor;
1211 case "btnInputBackcolor":
1212 ColorDialog1.Color = lblInputBackcolor.BackColor;
1215 ColorDialog1.Color = lblAtTo.BackColor;
1218 ColorDialog1.Color = lblListBackcolor.BackColor;
1220 case "btnDetailBack":
1221 ColorDialog1.Color = lblDetailBackcolor.BackColor;
1223 case "btnDetailLink":
1224 ColorDialog1.Color = lblDetailLink.ForeColor;
1228 rtn = ColorDialog1.ShowDialog();
1230 if (rtn == DialogResult.Cancel) return;
1235 lblSelf.BackColor = ColorDialog1.Color;
1238 lblAtSelf.BackColor = ColorDialog1.Color;
1241 lblTarget.BackColor = ColorDialog1.Color;
1244 lblAtTarget.BackColor = ColorDialog1.Color;
1246 case "btnAtFromTarget":
1247 lblAtFromTarget.BackColor = ColorDialog1.Color;
1250 lblFav.ForeColor = ColorDialog1.Color;
1253 lblOWL.ForeColor = ColorDialog1.Color;
1256 lblRetweet.ForeColor = ColorDialog1.Color;
1258 case "btnInputBackcolor":
1259 lblInputBackcolor.BackColor = ColorDialog1.Color;
1262 lblAtTo.BackColor = ColorDialog1.Color;
1265 lblListBackcolor.BackColor = ColorDialog1.Color;
1267 case "btnDetailBack":
1268 lblDetailBackcolor.BackColor = ColorDialog1.Color;
1270 case "btnDetailLink":
1271 lblDetailLink.ForeColor = ColorDialog1.Color;
1276 public int UserstreamPeriodInt { get; set; }
1277 public bool UserstreamStartup { get; set; }
1278 public int TimelinePeriodInt { get; set; }
1279 public int ReplyPeriodInt { get; set; }
1280 public int DMPeriodInt { get; set; }
1281 public int PubSearchPeriodInt { get; set; }
1282 public int ListsPeriodInt { get; set; }
1283 public int UserTimelinePeriodInt { get; set; }
1284 public bool Readed { get; set; }
1285 public MyCommon.IconSizes IconSz { get; set; }
1286 public string Status { get; set; }
1287 public bool UnreadManage { get; set; }
1288 public bool PlaySound { get; set; }
1289 public bool OneWayLove { get; set; }
1290 public Font FontUnread { get; set; } /////未使用
1291 public Color ColorUnread { get; set; }
1292 public Font FontReaded { get; set; } /////リストフォントとして使用
1293 public Color ColorReaded { get; set; }
1294 public Color ColorFav { get; set; }
1295 public Color ColorOWL { get; set; }
1296 public Color ColorRetweet { get; set; }
1297 public Font FontDetail { get; set; }
1298 public Color ColorDetail { get; set; }
1299 public Color ColorDetailLink { get; set; }
1300 public Color ColorSelf { get; set; }
1301 public Color ColorAtSelf { get; set; }
1302 public Color ColorTarget { get; set; }
1303 public Color ColorAtTarget { get; set; }
1304 public Color ColorAtFromTarget { get; set; }
1305 public Color ColorAtTo { get; set; }
1306 public Color ColorInputBackcolor { get; set; }
1307 public Color ColorInputFont { get; set; }
1308 public Font FontInputFont { get; set; }
1309 public Color ColorListBackcolor { get; set; }
1310 public Color ColorDetailBackcolor { get; set; }
1311 public MyCommon.NameBalloonEnum NameBalloon { get; set; }
1312 public bool PostCtrlEnter { get; set; }
1313 public bool PostShiftEnter { get; set; }
1314 public int CountApi { get; set; }
1315 public int CountApiReply { get; set; }
1316 public int MoreCountApi { get; set; }
1317 public int FirstCountApi { get; set; }
1318 public int SearchCountApi { get; set; }
1319 public int FavoritesCountApi { get; set; }
1320 public int UserTimelineCountApi { get; set; }
1321 public int ListCountApi { get; set; }
1322 public bool PostAndGet { get; set; }
1323 public bool UseRecommendStatus { get; set; }
1324 public string RecommendStatusText { get; set; }
1325 public bool DispUsername { get; set; }
1326 public bool CloseToExit { get; set; }
1327 public bool MinimizeToTray { get; set; }
1328 public MyCommon.DispTitleEnum DispLatestPost { get; set; }
1329 public string BrowserPath { get; set; }
1330 public bool TinyUrlResolve { get; set; }
1331 public bool ShortUrlForceResolve { get; set; }
1333 private void CheckUseRecommendStatus_CheckedChanged(object sender, EventArgs e)
1335 if (CheckUseRecommendStatus.Checked == true)
1337 StatusText.Enabled = false;
1341 StatusText.Enabled = true;
1345 public bool SortOrderLock { get; set; }
1346 public HttpConnection.ProxyType SelectedProxyType
1349 return _MyProxyType;
1352 _MyProxyType = value;
1356 /// タブを下部に表示するかどうかを取得または設定する
1358 public bool ViewTabBottom { get; set; }
1360 public string ProxyAddress { get; set; }
1361 public int ProxyPort { get; set; }
1362 public string ProxyUser { get; set; }
1363 public string ProxyPassword { get; set; }
1364 public bool PeriodAdjust { get; set; }
1365 public bool StartupVersion { get; set; }
1366 public bool StartupFollowers { get; set; }
1367 public bool RestrictFavCheck { get; set; }
1368 public bool AlwaysTop { get; set; }
1369 public bool UrlConvertAuto { get; set; }
1370 public bool ShortenTco { get; set; }
1371 public bool OutputzEnabled { get; set; }
1372 public string OutputzKey { get; set; }
1373 public MyCommon.OutputzUrlmode OutputzUrlmode { get; set; }
1374 public bool Nicoms { get; set; }
1375 public MyCommon.UrlConverter AutoShortUrlFirst { get; set; }
1376 public bool UseUnreadStyle { get; set; }
1377 public string DateTimeFormat { get; set; }
1378 public int DefaultTimeOut { get; set; }
1379 public bool RetweetNoConfirm { get; set; }
1380 public bool TabIconDisp { get; set; }
1381 public MyCommon.REPLY_ICONSTATE ReplyIconState { get; set; }
1382 public bool ReadOwnPost { get; set; }
1383 public bool GetFav { get; set; }
1384 public bool IsMonospace { get; set; }
1385 public bool ReadOldPosts { get; set; }
1386 public bool UseSsl { get; set; }
1387 public string BitlyUser { get; set; }
1388 public string BitlyPwd { get; set; }
1389 public bool ShowGrid { get; set; }
1390 public bool UseAtIdSupplement { get; set; }
1391 public bool UseHashSupplement { get; set; }
1392 public bool PreviewEnable { get; set; }
1393 public bool UseAdditionalCount { get; set; }
1394 public bool OpenUserTimeline { get; set; }
1395 public string TwitterApiUrl { get; set; }
1396 public string TwitterSearchApiUrl { get; set; }
1397 public string Language { get; set; }
1399 private void Button3_Click(object sender, EventArgs e)
1401 using (OpenFileDialog filedlg = new OpenFileDialog())
1403 filedlg.Filter = Properties.Resources.Button3_ClickText1;
1404 filedlg.FilterIndex = 1;
1405 filedlg.Title = Properties.Resources.Button3_ClickText2;
1406 filedlg.RestoreDirectory = true;
1408 if (filedlg.ShowDialog() == DialogResult.OK)
1410 BrowserPathText.Text = filedlg.FileName;
1415 private void RadioProxySpecified_CheckedChanged(object sender, EventArgs e)
1417 bool chk = RadioProxySpecified.Checked;
1418 LabelProxyAddress.Enabled = chk;
1419 TextProxyAddress.Enabled = chk;
1420 LabelProxyPort.Enabled = chk;
1421 TextProxyPort.Enabled = chk;
1422 LabelProxyUser.Enabled = chk;
1423 TextProxyUser.Enabled = chk;
1424 LabelProxyPassword.Enabled = chk;
1425 TextProxyPassword.Enabled = chk;
1428 private void TextProxyPort_Validating(object sender, CancelEventArgs e)
1431 if (string.IsNullOrWhiteSpace(TextProxyPort.Text)) TextProxyPort.Text = "0";
1432 if (int.TryParse(TextProxyPort.Text.Trim(), out port) == false)
1434 MessageBox.Show(Properties.Resources.TextProxyPort_ValidatingText1);
1438 if (port < 0 || port > 65535)
1440 MessageBox.Show(Properties.Resources.TextProxyPort_ValidatingText2);
1446 private void CheckOutputz_CheckedChanged(object sender, EventArgs e)
1448 if (CheckOutputz.Checked == true)
1450 Label59.Enabled = true;
1451 Label60.Enabled = true;
1452 TextBoxOutputzKey.Enabled = true;
1453 ComboBoxOutputzUrlmode.Enabled = true;
1457 Label59.Enabled = false;
1458 Label60.Enabled = false;
1459 TextBoxOutputzKey.Enabled = false;
1460 ComboBoxOutputzUrlmode.Enabled = false;
1464 private void TextBoxOutputzKey_Validating(object sender, CancelEventArgs e)
1466 if (CheckOutputz.Checked)
1468 TextBoxOutputzKey.Text = TextBoxOutputzKey.Text.Trim();
1469 if (TextBoxOutputzKey.Text.Length == 0)
1471 MessageBox.Show(Properties.Resources.TextBoxOutputzKey_Validating);
1478 private bool CreateDateTimeFormatSample()
1482 LabelDateTimeFormatApplied.Text = DateTime.Now.ToString(CmbDateTimeFormat.Text);
1484 catch(FormatException)
1486 LabelDateTimeFormatApplied.Text = Properties.Resources.CreateDateTimeFormatSampleText1;
1492 private void CmbDateTimeFormat_TextUpdate(object sender, EventArgs e)
1494 CreateDateTimeFormatSample();
1497 private void CmbDateTimeFormat_SelectedIndexChanged(object sender, EventArgs e)
1499 CreateDateTimeFormatSample();
1502 private void CmbDateTimeFormat_Validating(object sender, CancelEventArgs e)
1504 if (!CreateDateTimeFormatSample())
1506 MessageBox.Show(Properties.Resources.CmbDateTimeFormat_Validating);
1511 private void ConnectionTimeOut_Validating(object sender, CancelEventArgs e)
1516 tm = int.Parse(ConnectionTimeOut.Text);
1520 MessageBox.Show(Properties.Resources.ConnectionTimeOut_ValidatingText1);
1525 if (tm < (int)MyCommon.HttpTimeOut.MinValue || tm > (int)MyCommon.HttpTimeOut.MaxValue)
1527 MessageBox.Show(Properties.Resources.ConnectionTimeOut_ValidatingText1);
1532 private void LabelDateTimeFormatApplied_VisibleChanged(object sender, EventArgs e)
1534 CreateDateTimeFormatSample();
1537 private void TextCountApi_Validating(object sender, CancelEventArgs e)
1542 cnt = int.Parse(TextCountApi.Text);
1546 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1551 if (cnt < 20 || cnt > 200)
1553 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1559 private void TextCountApiReply_Validating(object sender, CancelEventArgs e)
1564 cnt = int.Parse(TextCountApiReply.Text);
1568 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1573 if (cnt < 20 || cnt > 200)
1575 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1581 public bool LimitBalloon { get; set; }
1582 public bool EventNotifyEnabled { get; set; }
1584 public MyCommon.EVENTTYPE EventNotifyFlag
1588 return _MyEventNotifyFlag;
1592 _MyEventNotifyFlag = value;
1596 public MyCommon.EVENTTYPE IsMyEventNotifyFlag
1600 return _isMyEventNotifyFlag;
1604 _isMyEventNotifyFlag = value;
1608 public bool ForceEventNotify { get; set; }
1609 public bool FavEventUnread { get; set; }
1611 public string TranslateLanguage
1615 return _MyTranslateLanguage;
1619 _MyTranslateLanguage = value;
1620 ComboBoxTranslateLanguage.SelectedIndex = (new Bing()).GetIndexFromLanguageEnum(value);
1624 public string EventSoundFile { get; set; }
1625 public int ListDoubleClickAction { get; set; }
1626 public string UserAppointUrl { get; set; }
1628 private void ComboBoxAutoShortUrlFirst_SelectedIndexChanged(object sender, EventArgs e)
1630 if (ComboBoxAutoShortUrlFirst.SelectedIndex == (int)MyCommon.UrlConverter.Bitly ||
1631 ComboBoxAutoShortUrlFirst.SelectedIndex == (int)MyCommon.UrlConverter.Jmp)
1633 Label76.Enabled = true;
1634 Label77.Enabled = true;
1635 TextBitlyId.Enabled = true;
1636 TextBitlyPw.Enabled = true;
1640 Label76.Enabled = false;
1641 Label77.Enabled = false;
1642 TextBitlyId.Enabled = false;
1643 TextBitlyPw.Enabled = false;
1647 private void ButtonBackToDefaultFontColor_Click(object sender, EventArgs e) //Handles ButtonBackToDefaultFontColor.Click, ButtonBackToDefaultFontColor2.Click
1649 lblUnread.ForeColor = SystemColors.ControlText;
1650 lblUnread.Font = new Font(SystemFonts.DefaultFont, FontStyle.Bold | FontStyle.Underline);
1652 lblListFont.ForeColor = System.Drawing.SystemColors.ControlText;
1653 lblListFont.Font = System.Drawing.SystemFonts.DefaultFont;
1655 lblDetail.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.ControlText);
1656 lblDetail.Font = System.Drawing.SystemFonts.DefaultFont;
1658 lblInputFont.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.ControlText);
1659 lblInputFont.Font = System.Drawing.SystemFonts.DefaultFont;
1661 lblSelf.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.AliceBlue);
1663 lblAtSelf.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.AntiqueWhite);
1665 lblTarget.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.LemonChiffon);
1667 lblAtTarget.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.LavenderBlush);
1669 lblAtFromTarget.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Honeydew);
1671 lblFav.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.Red);
1673 lblOWL.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.Blue);
1675 lblInputBackcolor.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.LemonChiffon);
1677 lblAtTo.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Pink);
1679 lblListBackcolor.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Window);
1681 lblDetailBackcolor.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Window);
1683 lblDetailLink.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.Blue);
1685 lblRetweet.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.Green);
1688 private bool StartAuth()
1691 HttpConnection.ProxyType ptype;
1692 if (RadioProxyNone.Checked)
1694 ptype = HttpConnection.ProxyType.None;
1696 else if (RadioProxyIE.Checked)
1698 ptype = HttpConnection.ProxyType.IE;
1702 ptype = HttpConnection.ProxyType.Specified;
1704 string padr = TextProxyAddress.Text.Trim();
1705 int pport = int.Parse(TextProxyPort.Text.Trim());
1706 string pusr = TextProxyUser.Text.Trim();
1707 string ppw = TextProxyPassword.Text.Trim();
1710 HttpConnection.InitializeConnection(20, ptype, padr, pport, pusr, ppw);
1711 HttpTwitter.TwitterUrl = TwitterAPIText.Text.Trim();
1712 HttpTwitter.TwitterSearchUrl = TwitterSearchAPIText.Text.Trim();
1713 tw.Initialize("", "", "", 0);
1714 //this.AuthStateLabel.Text = Properties.Resources.AuthorizeButton_Click4;
1715 //this.AuthUserLabel.Text = "";
1716 string pinPageUrl = "";
1717 string rslt = tw.StartAuthentication(ref pinPageUrl);
1718 if (string.IsNullOrEmpty(rslt))
1720 string pin = AuthDialog.DoAuth(this, pinPageUrl);
1721 if (!string.IsNullOrEmpty(pin))
1733 MessageBox.Show(Properties.Resources.AuthorizeButton_Click2 + Environment.NewLine + rslt, "Authenticate", MessageBoxButtons.OK);
1738 private bool PinAuth()
1740 string pin = this._pin; //PIN Code
1742 string rslt = tw.Authenticate(pin);
1743 if (string.IsNullOrEmpty(rslt))
1745 MessageBox.Show(Properties.Resources.AuthorizeButton_Click1, "Authenticate", MessageBoxButtons.OK);
1746 //this.AuthStateLabel.Text = Properties.Resources.AuthorizeButton_Click3;
1747 //this.AuthUserLabel.Text = tw.Username;
1749 UserAccount user = new UserAccount();
1750 user.Username = tw.Username;
1751 user.UserId = tw.UserId;
1752 user.Token = tw.AccessToken;
1753 user.TokenSecret = tw.AccessTokenSecret;
1755 foreach (object u in this.AuthUserCombo.Items)
1757 if (((UserAccount)u).Username.ToLower() == tw.Username.ToLower())
1759 idx = this.AuthUserCombo.Items.IndexOf(u);
1765 this.AuthUserCombo.Items.RemoveAt(idx);
1766 this.AuthUserCombo.Items.Insert(idx, user);
1767 this.AuthUserCombo.SelectedIndex = idx;
1771 this.AuthUserCombo.SelectedIndex = this.AuthUserCombo.Items.Add(user);
1773 //if (TwitterApiInfo.AccessLevel = ApiAccessLevel.ReadWrite)
1775 // this.AuthStateLabel.Text += "(xAuth)";
1777 //else if (TwitterApiInfo.AccessLevel == ApiAccessLevel.ReadWriteAndDirectMessage)
1779 // this.AuthStateLabel.Text += "(OAuth)";
1785 MessageBox.Show(Properties.Resources.AuthorizeButton_Click2 + Environment.NewLine + rslt, "Authenticate", MessageBoxButtons.OK);
1786 //this.AuthStateLabel.Text = Properties.Resources.AuthorizeButton_Click4;
1787 //this.AuthUserLabel.Text = "";
1792 private void StartAuthButton_Click(object sender, EventArgs e)
1794 //this.Save.Enabled = false;
1800 //this.Save.Enabled = true;
1805 private void AuthClearButton_Click(object sender, EventArgs e)
1807 //tw.ClearAuthInfo();
1808 //this.AuthStateLabel.Text = Properties.Resources.AuthorizeButton_Click4;
1809 //this.AuthUserLabel.Text = "";
1810 if (this.AuthUserCombo.SelectedIndex > -1)
1812 this.AuthUserCombo.Items.RemoveAt(this.AuthUserCombo.SelectedIndex);
1813 if (this.AuthUserCombo.Items.Count > 0)
1815 this.AuthUserCombo.SelectedIndex = 0;
1819 this.AuthUserCombo.SelectedIndex = -1;
1822 //this.Save.Enabled = false;
1826 private void DisplayApiMaxCount()
1828 var limit = MyCommon.TwitterApiInfo.AccessLimit;
1831 LabelApiUsing.Text = string.Format(Properties.Resources.SettingAPIUse1, limit.AccessLimitCount - limit.AccessLimitRemain, limit.AccessLimitCount);
1835 LabelApiUsing.Text = string.Format(Properties.Resources.SettingAPIUse1, "???", "???");
1839 private void CalcApiUsing()
1843 int ListsTabNum = 0;
1844 int UserTimelineTabNum = 0;
1846 int ApiUserTimeline = 0;
1850 // 初回起動時などにnullの場合あり
1851 ListsTabNum = TabInformations.GetInstance().GetTabsByType(MyCommon.TabUsageType.Lists).Count;
1860 // 初回起動時などにnullの場合あり
1861 UserTimelineTabNum = TabInformations.GetInstance().GetTabsByType(MyCommon.TabUsageType.UserTimeline).Count;
1869 if (int.TryParse(TimelinePeriod.Text, out tmp))
1873 UsingApi += 3600 / tmp;
1878 if (int.TryParse(ReplyPeriod.Text, out tmp))
1882 UsingApi += 3600 / tmp;
1886 // DM計算 0は手動更新 送受信両方
1887 if (int.TryParse(DMPeriod.Text, out tmp))
1891 UsingApi += (3600 / tmp) * 2;
1896 if (int.TryParse(ListsPeriod.Text, out tmp))
1900 ApiLists = (3600 / tmp) * ListsTabNum;
1901 UsingApi += ApiLists;
1905 // UserTimelineタブ計算 0は手動更新
1906 if (int.TryParse(UserTimelinePeriod.Text, out tmp))
1910 ApiUserTimeline = (3600 / tmp) * UserTimelineTabNum;
1911 UsingApi += ApiUserTimeline;
1917 var limit = MyCommon.TwitterApiInfo.AccessLimit;
1920 if (Twitter.AccountState == MyCommon.ACCOUNT_STATE.Valid)
1922 Task.Factory.StartNew(() => tw.GetInfoApi10()) //取得エラー時はinfoCountは初期状態(値:-1)
1925 if (this.IsHandleCreated && !this.IsDisposed)
1927 this.DisplayApiMaxCount();
1929 }, TaskScheduler.FromCurrentSynchronizationContext());
1933 LabelApiUsing.Text = string.Format(Properties.Resources.SettingAPIUse1, UsingApi, "???");
1938 LabelApiUsing.Text = string.Format(Properties.Resources.SettingAPIUse1, UsingApi, limit.AccessLimitCount);
1943 LabelPostAndGet.Visible = CheckPostAndGet.Checked && !tw.UserStreamEnabled;
1944 LabelUserStreamActive.Visible = tw.UserStreamEnabled;
1946 LabelApiUsingUserStreamEnabled.Text = string.Format(Properties.Resources.SettingAPIUse2, (ApiLists + ApiUserTimeline).ToString());
1947 LabelApiUsingUserStreamEnabled.Visible = tw.UserStreamEnabled;
1950 private void CheckPostAndGet_CheckedChanged(object sender, EventArgs e)
1955 private void Setting_Shown(object sender, EventArgs e)
1960 if (this.Disposing || this.IsDisposed) return;
1961 } while (!this.IsHandleCreated);
1962 this.TopMost = this.AlwaysTop;
1966 private void ButtonApiCalc_Click(object sender, EventArgs e)
1971 public static AppendSettingDialog Instance
1973 get { return _instance; }
1976 private bool BitlyValidation(string id, string apikey)
1978 if (string.IsNullOrEmpty(id) || string.IsNullOrEmpty(apikey))
1983 string req = "http://api.bit.ly/v3/validate";
1984 string content = "";
1985 Dictionary<string, string> param = new Dictionary<string, string>();
1987 param.Add("login", ApplicationSettings.BitlyLoginId);
1988 param.Add("apiKey", ApplicationSettings.BitlyApiKey);
1989 param.Add("x_login", id);
1990 param.Add("x_apiKey", apikey);
1991 param.Add("format", "txt");
1993 if (!(new HttpVarious()).PostData(req, param, out content))
1995 return true; // 通信エラーの場合はとりあえずチェックを通ったことにする
1997 else if (content.Trim() == "1")
1999 return true; // 検証成功
2001 else if (content.Trim() == "0")
2003 return false; // 検証失敗 APIキーとIDの組み合わせが違う
2007 return true; // 規定外応答:通信エラーの可能性があるためとりあえずチェックを通ったことにする
2011 private void Cancel_Click(object sender, EventArgs e)
2013 _ValidationError = false;
2016 public bool HotkeyEnabled;
2017 public Keys HotkeyKey;
2018 public int HotkeyValue;
2019 public Keys HotkeyMod;
2021 private void HotkeyText_KeyDown(object sender, KeyEventArgs e)
2025 HotkeyText.Text = e.KeyCode.ToString();
2026 HotkeyCode.Text = e.KeyValue.ToString();
2027 HotkeyText.Tag = e.KeyCode;
2029 e.SuppressKeyPress = true;
2032 private void HotkeyCheck_CheckedChanged(object sender, EventArgs e)
2034 HotkeyCtrl.Enabled = HotkeyCheck.Checked;
2035 HotkeyAlt.Enabled = HotkeyCheck.Checked;
2036 HotkeyShift.Enabled = HotkeyCheck.Checked;
2037 HotkeyWin.Enabled = HotkeyCheck.Checked;
2038 HotkeyText.Enabled = HotkeyCheck.Checked;
2039 HotkeyCode.Enabled = HotkeyCheck.Checked;
2042 public bool BlinkNewMentions;
2044 private void GetMoreTextCountApi_Validating(object sender, CancelEventArgs e)
2049 cnt = int.Parse(GetMoreTextCountApi.Text);
2053 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2058 if (cnt != 0 && (cnt < 20 || cnt > 200))
2060 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2066 private void UseChangeGetCount_CheckedChanged(object sender, EventArgs e)
2068 GetMoreTextCountApi.Enabled = UseChangeGetCount.Checked;
2069 FirstTextCountApi.Enabled = UseChangeGetCount.Checked;
2070 Label28.Enabled = UseChangeGetCount.Checked;
2071 Label30.Enabled = UseChangeGetCount.Checked;
2072 Label53.Enabled = UseChangeGetCount.Checked;
2073 Label66.Enabled = UseChangeGetCount.Checked;
2074 Label17.Enabled = UseChangeGetCount.Checked;
2075 Label25.Enabled = UseChangeGetCount.Checked;
2076 SearchTextCountApi.Enabled = UseChangeGetCount.Checked;
2077 FavoritesTextCountApi.Enabled = UseChangeGetCount.Checked;
2078 UserTimelineTextCountApi.Enabled = UseChangeGetCount.Checked;
2079 ListTextCountApi.Enabled = UseChangeGetCount.Checked;
2082 private void FirstTextCountApi_Validating(object sender, CancelEventArgs e)
2087 cnt = int.Parse(FirstTextCountApi.Text);
2091 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2096 if (cnt != 0 && (cnt < 20 || cnt > 200))
2098 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2104 private void SearchTextCountApi_Validating(object sender, CancelEventArgs e)
2109 cnt = int.Parse(SearchTextCountApi.Text);
2113 MessageBox.Show(Properties.Resources.TextSearchCountApi_Validating1);
2118 if (cnt != 0 && (cnt < 20 || cnt > 100))
2120 MessageBox.Show(Properties.Resources.TextSearchCountApi_Validating1);
2126 private void FavoritesTextCountApi_Validating(object sender, CancelEventArgs e)
2131 cnt = int.Parse(FavoritesTextCountApi.Text);
2135 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2140 if (cnt != 0 && (cnt < 20 || cnt > 200))
2142 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2148 private void UserTimelineTextCountApi_Validating(object sender, CancelEventArgs e)
2153 cnt = int.Parse(UserTimelineTextCountApi.Text);
2157 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2162 if (cnt != 0 && (cnt < 20 || cnt > 200))
2164 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2170 private void ListTextCountApi_Validating(object sender, CancelEventArgs e)
2175 cnt = int.Parse(ListTextCountApi.Text);
2179 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2184 if (cnt != 0 && (cnt < 20 || cnt > 200))
2186 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2192 //private void CheckEventNotify_CheckedChanged(object sender, EventArgs e)
2193 // Handles CheckEventNotify.CheckedChanged, CheckFavoritesEvent.CheckStateChanged,
2194 // CheckUnfavoritesEvent.CheckStateChanged, CheckFollowEvent.CheckStateChanged,
2195 // CheckListMemberAddedEvent.CheckStateChanged, CheckListMemberRemovedEvent.CheckStateChanged,
2196 // CheckListCreatedEvent.CheckStateChanged, CheckUserUpdateEvent.CheckStateChanged
2198 // EventNotifyEnabled = CheckEventNotify.Checked;
2199 // GetEventNotifyFlag(EventNotifyFlag, IsMyEventNotifyFlag);
2200 // ApplyEventNotifyFlag(EventNotifyEnabled, EventNotifyFlag, IsMyEventNotifyFlag);
2203 private class EventCheckboxTblElement
2205 public CheckBox CheckBox;
2206 public MyCommon.EVENTTYPE Type;
2209 private EventCheckboxTblElement[] GetEventCheckboxTable()
2211 EventCheckboxTblElement[] _eventCheckboxTable = new EventCheckboxTblElement[8];
2213 _eventCheckboxTable[0] = new EventCheckboxTblElement();
2214 _eventCheckboxTable[0].CheckBox = CheckFavoritesEvent;
2215 _eventCheckboxTable[0].Type = MyCommon.EVENTTYPE.Favorite;
2217 _eventCheckboxTable[1] = new EventCheckboxTblElement();
2218 _eventCheckboxTable[1].CheckBox = CheckUnfavoritesEvent;
2219 _eventCheckboxTable[1].Type = MyCommon.EVENTTYPE.Unfavorite;
2221 _eventCheckboxTable[2] = new EventCheckboxTblElement();
2222 _eventCheckboxTable[2].CheckBox = CheckFollowEvent;
2223 _eventCheckboxTable[2].Type = MyCommon.EVENTTYPE.Follow;
2225 _eventCheckboxTable[3] = new EventCheckboxTblElement();
2226 _eventCheckboxTable[3].CheckBox = CheckListMemberAddedEvent;
2227 _eventCheckboxTable[3].Type = MyCommon.EVENTTYPE.ListMemberAdded;
2229 _eventCheckboxTable[4] = new EventCheckboxTblElement();
2230 _eventCheckboxTable[4].CheckBox = CheckListMemberRemovedEvent;
2231 _eventCheckboxTable[4].Type = MyCommon.EVENTTYPE.ListMemberRemoved;
2233 _eventCheckboxTable[5] = new EventCheckboxTblElement();
2234 _eventCheckboxTable[5].CheckBox = CheckBlockEvent;
2235 _eventCheckboxTable[5].Type = MyCommon.EVENTTYPE.Block;
2237 _eventCheckboxTable[6] = new EventCheckboxTblElement();
2238 _eventCheckboxTable[6].CheckBox = CheckUserUpdateEvent;
2239 _eventCheckboxTable[6].Type = MyCommon.EVENTTYPE.UserUpdate;
2241 _eventCheckboxTable[7] = new EventCheckboxTblElement();
2242 _eventCheckboxTable[7].CheckBox = CheckListCreatedEvent;
2243 _eventCheckboxTable[7].Type = MyCommon.EVENTTYPE.ListCreated;
2245 return _eventCheckboxTable;
2248 private void GetEventNotifyFlag(ref MyCommon.EVENTTYPE eventnotifyflag, ref MyCommon.EVENTTYPE isMyeventnotifyflag)
2250 MyCommon.EVENTTYPE evt = MyCommon.EVENTTYPE.None;
2251 MyCommon.EVENTTYPE myevt = MyCommon.EVENTTYPE.None;
2253 foreach (EventCheckboxTblElement tbl in GetEventCheckboxTable())
2255 switch (tbl.CheckBox.CheckState)
2257 case CheckState.Checked:
2258 evt = evt | tbl.Type;
2259 myevt = myevt | tbl.Type;
2261 case CheckState.Indeterminate:
2262 evt = evt | tbl.Type;
2264 case CheckState.Unchecked:
2268 eventnotifyflag = evt;
2269 isMyeventnotifyflag = myevt;
2272 private void ApplyEventNotifyFlag(bool rootEnabled, MyCommon.EVENTTYPE eventnotifyflag, MyCommon.EVENTTYPE isMyeventnotifyflag)
2274 MyCommon.EVENTTYPE evt = eventnotifyflag;
2275 MyCommon.EVENTTYPE myevt = isMyeventnotifyflag;
2277 CheckEventNotify.Checked = rootEnabled;
2279 foreach (EventCheckboxTblElement tbl in GetEventCheckboxTable())
2281 if ((evt & tbl.Type) != 0)
2283 if ((myevt & tbl.Type) != 0)
2285 tbl.CheckBox.CheckState = CheckState.Checked;
2289 tbl.CheckBox.CheckState = CheckState.Indeterminate;
2294 tbl.CheckBox.CheckState = CheckState.Unchecked;
2296 tbl.CheckBox.Enabled = rootEnabled;
2301 private void CheckEventNotify_CheckedChanged(object sender, EventArgs e)
2303 foreach (EventCheckboxTblElement tbl in GetEventCheckboxTable())
2305 tbl.CheckBox.Enabled = CheckEventNotify.Checked;
2309 //private void CheckForceEventNotify_CheckedChanged(object sender, EventArgs e)
2311 // _MyForceEventNotify = CheckEventNotify.Checked;
2314 //private void CheckFavEventUnread_CheckedChanged(object sender, EventArgs e)
2316 // _MyFavEventUnread = CheckFavEventUnread.Checked;
2319 //private void ComboBoxTranslateLanguage_SelectedIndexChanged(object sender, EventArgs e)
2321 // _MyTranslateLanguage = (new Google()).GetLanguageEnumFromIndex(ComboBoxTranslateLanguage.SelectedIndex);
2324 private void SoundFileListup()
2326 if (EventSoundFile == null) EventSoundFile = "";
2327 ComboBoxEventNotifySound.Items.Clear();
2328 ComboBoxEventNotifySound.Items.Add("");
2329 DirectoryInfo oDir = new DirectoryInfo(Application.StartupPath + Path.DirectorySeparatorChar);
2330 if (Directory.Exists(Path.Combine(Application.StartupPath, "Sounds")))
2332 oDir = oDir.GetDirectories("Sounds")[0];
2334 foreach (FileInfo oFile in oDir.GetFiles("*.wav"))
2336 ComboBoxEventNotifySound.Items.Add(oFile.Name);
2338 int idx = ComboBoxEventNotifySound.Items.IndexOf(EventSoundFile);
2339 if (idx == -1) idx = 0;
2340 ComboBoxEventNotifySound.SelectedIndex = idx;
2343 //private void ComboBoxEventNotifySound_VisibleChanged(object sender, EventArgs e)
2345 // SoundFileListup();
2348 //private void ComboBoxEventNotifySound_SelectedIndexChanged(object sender, EventArgs e)
2350 // if (_soundfileListup) return;
2352 // _MyEventSoundFile = (string)ComboBoxEventNotifySound.SelectedItem;
2355 private void UserAppointUrlText_Validating(object sender, CancelEventArgs e)
2357 if (!UserAppointUrlText.Text.StartsWith("http") && !string.IsNullOrEmpty(UserAppointUrlText.Text))
2359 MessageBox.Show("Text Error:正しいURLではありません");
2363 private void OpenUrl(string url)
2365 string myPath = url;
2366 string path = this.BrowserPathText.Text;
2369 if (!string.IsNullOrEmpty(BrowserPath))
2371 if (path.StartsWith("\"") && path.Length > 2 && path.IndexOf("\"", 2) > -1)
2373 int sep = path.IndexOf("\"", 2);
2374 string browserPath = path.Substring(1, sep - 1);
2376 if (sep < path.Length - 1)
2378 arg = path.Substring(sep + 1);
2380 myPath = arg + " " + myPath;
2381 System.Diagnostics.Process.Start(browserPath, myPath);
2385 System.Diagnostics.Process.Start(path, myPath);
2390 System.Diagnostics.Process.Start(myPath);
2395 // MessageBox.Show("ブラウザの起動に失敗、またはタイムアウトしました。" + ex.ToString());
2399 private void CreateAccountButton_Click(object sender, EventArgs e)
2401 this.OpenUrl("https://twitter.com/signup");
2404 private void CheckAutoConvertUrl_CheckedChanged(object sender, EventArgs e)
2406 ShortenTcoCheck.Enabled = CheckAutoConvertUrl.Checked;
2409 public AppendSettingDialog()
2411 InitializeComponent();
2413 this.Icon = Properties.Resources.MIcon;