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 : OTBaseForm
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 var pnl = (Control)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 var pnl = (Control)e.Node.Tag;
99 if (pnl == null) return;
103 if (pnl.Name == "PreviewPanel")
105 if (GrowlHelper.IsDllExists)
107 this.PreviewPanel.IsNotifyUseGrowlCheckBox.Enabled = true;
111 this.PreviewPanel.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 = this.StartupPanel.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 (this.PreviewPanel.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 = this.PreviewPanel.CheckDispUsername.Checked;
342 CloseToExit = CheckCloseToExit.Checked;
343 MinimizeToTray = CheckMinimizeToTray.Checked;
344 switch (this.PreviewPanel.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 ShortUrl.IsResolve = TinyUrlResolve;
375 if (RadioProxyNone.Checked)
377 _MyProxyType = HttpConnection.ProxyType.None;
379 else if (RadioProxyIE.Checked)
381 _MyProxyType = HttpConnection.ProxyType.IE;
385 _MyProxyType = HttpConnection.ProxyType.Specified;
387 ProxyAddress = TextProxyAddress.Text.Trim();
388 ProxyPort = int.Parse(TextProxyPort.Text.Trim());
389 ProxyUser = TextProxyUser.Text.Trim();
390 ProxyPassword = TextProxyPassword.Text.Trim();
391 StartupVersion = this.StartupPanel.CheckStartupVersion.Checked;
392 StartupFollowers = this.StartupPanel.CheckStartupFollowers.Checked;
393 RestrictFavCheck = CheckFavRestrict.Checked;
394 AlwaysTop = this.PreviewPanel.CheckAlwaysTop.Checked;
395 UrlConvertAuto = CheckAutoConvertUrl.Checked;
396 ShortenTco = ShortenTcoCheck.Checked;
397 OutputzEnabled = CheckOutputz.Checked;
398 OutputzKey = TextBoxOutputzKey.Text.Trim();
400 switch (ComboBoxOutputzUrlmode.SelectedIndex)
403 OutputzUrlmode = MyCommon.OutputzUrlmode.twittercom;
406 OutputzUrlmode = MyCommon.OutputzUrlmode.twittercomWithUsername;
410 Nicoms = CheckNicoms.Checked;
411 UseUnreadStyle = chkUnreadStyle.Checked;
412 DateTimeFormat = CmbDateTimeFormat.Text;
413 DefaultTimeOut = int.Parse(ConnectionTimeOut.Text);
414 RetweetNoConfirm = CheckRetweetNoConfirm.Checked;
415 LimitBalloon = this.PreviewPanel.CheckBalloonLimit.Checked;
416 EventNotifyEnabled = CheckEventNotify.Checked;
417 GetEventNotifyFlag(ref _MyEventNotifyFlag, ref _isMyEventNotifyFlag);
418 ForceEventNotify = CheckForceEventNotify.Checked;
419 FavEventUnread = CheckFavEventUnread.Checked;
420 TranslateLanguage = (new Bing()).GetLanguageEnumFromIndex(ComboBoxTranslateLanguage.SelectedIndex);
421 EventSoundFile = (string)ComboBoxEventNotifySound.SelectedItem;
422 AutoShortUrlFirst = (MyCommon.UrlConverter)ComboBoxAutoShortUrlFirst.SelectedIndex;
423 TabIconDisp = this.PreviewPanel.chkTabIconDisp.Checked;
424 ReadOwnPost = chkReadOwnPost.Checked;
425 GetFav = this.StartupPanel.chkGetFav.Checked;
426 IsMonospace = this.PreviewPanel.CheckMonospace.Checked;
427 ReadOldPosts = CheckReadOldPosts.Checked;
428 UseSsl = CheckUseSsl.Checked;
429 BitlyUser = TextBitlyId.Text;
430 BitlyPwd = TextBitlyPw.Text;
431 ShowGrid = CheckShowGrid.Checked;
432 UseAtIdSupplement = CheckAtIdSupple.Checked;
433 UseHashSupplement = CheckHashSupple.Checked;
434 PreviewEnable = this.PreviewPanel.CheckPreviewEnable.Checked;
435 TwitterApiUrl = TwitterAPIText.Text.Trim();
436 switch (this.PreviewPanel.ReplyIconStateCombo.SelectedIndex)
439 ReplyIconState = MyCommon.REPLY_ICONSTATE.None;
442 ReplyIconState = MyCommon.REPLY_ICONSTATE.StaticIcon;
445 ReplyIconState = MyCommon.REPLY_ICONSTATE.BlinkIcon;
448 switch (this.PreviewPanel.LanguageCombo.SelectedIndex)
466 HotkeyEnabled = this.HotkeyCheck.Checked;
467 HotkeyMod = Keys.None;
468 if (this.HotkeyAlt.Checked) HotkeyMod = HotkeyMod | Keys.Alt;
469 if (this.HotkeyShift.Checked) HotkeyMod = HotkeyMod | Keys.Shift;
470 if (this.HotkeyCtrl.Checked) HotkeyMod = HotkeyMod | Keys.Control;
471 if (this.HotkeyWin.Checked) HotkeyMod = HotkeyMod | Keys.LWin;
472 int.TryParse(HotkeyCode.Text, out HotkeyValue);
473 HotkeyKey = (Keys)HotkeyText.Tag;
474 BlinkNewMentions = this.PreviewPanel.ChkNewMentionsBlink.Checked;
475 UseAdditionalCount = UseChangeGetCount.Checked;
476 MoreCountApi = int.Parse(GetMoreTextCountApi.Text);
477 FirstCountApi = int.Parse(FirstTextCountApi.Text);
478 SearchCountApi = int.Parse(SearchTextCountApi.Text);
479 FavoritesCountApi = int.Parse(FavoritesTextCountApi.Text);
480 UserTimelineCountApi = int.Parse(UserTimelineTextCountApi.Text);
481 ListCountApi = int.Parse(ListTextCountApi.Text);
482 OpenUserTimeline = CheckOpenUserTimeline.Checked;
483 ListDoubleClickAction = ListDoubleClickActionComboBox.SelectedIndex;
484 UserAppointUrl = UserAppointUrlText.Text;
485 this.HideDuplicatedRetweets = this.HideDuplicatedRetweetsCheck.Checked;
486 this.IsPreviewFoursquare = this.IsPreviewFoursquareCheckBox.Checked;
487 this.MapThumbnailProvider = (MapProvider)this.MapThumbnailProviderComboBox.SelectedIndex;
488 this.MapThumbnailHeight = int.Parse(this.MapThumbnailHeightTextBox.Text);
489 this.MapThumbnailWidth = int.Parse(this.MapThumbnailWidthTextBox.Text);
490 this.MapThumbnailZoom = int.Parse(this.MapThumbnailZoomTextBox.Text);
491 this.IsListStatusesIncludeRts = this.IsListsIncludeRtsCheckBox.Checked;
492 this.TabMouseLock = this.TabMouseLockCheck.Checked;
493 this.IsRemoveSameEvent = this.IsRemoveSameFavEventCheckBox.Checked;
494 this.IsNotifyUseGrowl = this.PreviewPanel.IsNotifyUseGrowlCheckBox.Checked;
498 MessageBox.Show(Properties.Resources.Save_ClickText3);
499 this.DialogResult = DialogResult.Cancel;
504 private void Setting_FormClosing(object sender, FormClosingEventArgs e)
506 if (MyCommon._endingFlag) return;
508 if (this.DialogResult == DialogResult.Cancel)
510 //キャンセル時は画面表示時のアカウントに戻す
511 //キャンセル時でも認証済みアカウント情報は保存する
512 this.UserAccounts.Clear();
513 foreach (object u in this.AuthUserCombo.Items)
515 this.UserAccounts.Add((UserAccount)u);
517 //アクティブユーザーを起動時のアカウントに戻す(起動時アカウントなければ何もしない)
518 bool userSet = false;
519 if (this.InitialUserId != null)
521 foreach (UserAccount u in this.UserAccounts)
523 if (u.UserId == this.InitialUserId)
525 tw.Initialize(u.Token, u.TokenSecret, u.Username, u.UserId);
531 //認証済みアカウントが削除されていた場合、もしくは起動時アカウントがなかった場合は、
536 tw.Initialize("", "", "", 0);
540 if (tw != null && string.IsNullOrEmpty(tw.Username) && e.CloseReason == CloseReason.None)
542 if (MessageBox.Show(Properties.Resources.Setting_FormClosing1, "Confirm", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
547 if (_ValidationError)
551 if (e.Cancel == false && TreeViewSetting.SelectedNode != null)
553 var curPanel = (Control)TreeViewSetting.SelectedNode.Tag;
554 curPanel.Visible = false;
555 curPanel.Enabled = false;
559 private void Setting_Load(object sender, EventArgs e)
562 this.FollowCheckBox.Text = string.Format(this.FollowCheckBox.Text, ApplicationSettings.FeedbackTwitterName);
563 this.GroupBox2.Visible = true;
565 this.GroupBox2.Visible = false;
567 tw = ((TweenMain)this.Owner).TwitterInstance;
568 string uname = tw.Username;
569 string pw = tw.Password;
570 string tk = tw.AccessToken;
571 string tks = tw.AccessTokenSecret;
572 //this.AuthStateLabel.Enabled = true;
573 //this.AuthUserLabel.Enabled = true;
574 this.AuthClearButton.Enabled = true;
576 //if (tw.Username == "")
578 // //this.AuthStateLabel.Text = Properties.Resources.AuthorizeButton_Click4
579 // //this.AuthUserLabel.Text = ""
580 // //this.Save.Enabled = false
584 // //this.AuthStateLabel.Text = Properties.Resources.AuthorizeButton_Click3;
585 // //if (TwitterApiInfo.AccessLevel == ApiAccessLevel.ReadWrite)
587 // // this.AuthStateLabel.Text += "(xAuth)";
589 // //else if (TwitterApiInfo.AccessLevel == ApiAccessLevel.ReadWriteAndDirectMessage)
591 // // this.AuthStateLabel.Text += "(OAuth)";
593 // //this.AuthUserLabel.Text = tw.Username;
596 this.AuthUserCombo.Items.Clear();
597 if (this.UserAccounts.Count > 0)
599 this.AuthUserCombo.Items.AddRange(this.UserAccounts.ToArray());
600 foreach (UserAccount u in this.UserAccounts)
602 if (u.UserId == tw.UserId)
604 this.AuthUserCombo.SelectedItem = u;
605 this.InitialUserId = u.UserId;
611 this.StartupUserstreamCheck.Checked = UserstreamStartup;
612 UserstreamPeriod.Text = UserstreamPeriodInt.ToString();
613 TimelinePeriod.Text = TimelinePeriodInt.ToString();
614 ReplyPeriod.Text = ReplyPeriodInt.ToString();
615 DMPeriod.Text = DMPeriodInt.ToString();
616 PubSearchPeriod.Text = PubSearchPeriodInt.ToString();
617 ListsPeriod.Text = ListsPeriodInt.ToString();
618 UserTimelinePeriod.Text = UserTimelinePeriodInt.ToString();
620 this.StartupPanel.StartupReaded.Checked = Readed;
623 case MyCommon.IconSizes.IconNone:
624 IconSize.SelectedIndex = 0;
626 case MyCommon.IconSizes.Icon16:
627 IconSize.SelectedIndex = 1;
629 case MyCommon.IconSizes.Icon24:
630 IconSize.SelectedIndex = 2;
632 case MyCommon.IconSizes.Icon48:
633 IconSize.SelectedIndex = 3;
635 case MyCommon.IconSizes.Icon48_2:
636 IconSize.SelectedIndex = 4;
639 StatusText.Text = Status;
640 UReadMng.Checked = UnreadManage;
641 if (UnreadManage == false)
643 this.StartupPanel.StartupReaded.Enabled = false;
647 this.StartupPanel.StartupReaded.Enabled = true;
649 PlaySnd.Checked = PlaySound;
650 OneWayLv.Checked = OneWayLove;
652 lblListFont.Font = FontReaded;
653 lblUnread.Font = FontUnread;
654 lblUnread.ForeColor = ColorUnread;
655 lblListFont.ForeColor = ColorReaded;
656 lblFav.ForeColor = ColorFav;
657 lblOWL.ForeColor = ColorOWL;
658 lblRetweet.ForeColor = ColorRetweet;
659 lblDetail.Font = FontDetail;
660 lblSelf.BackColor = ColorSelf;
661 lblAtSelf.BackColor = ColorAtSelf;
662 lblTarget.BackColor = ColorTarget;
663 lblAtTarget.BackColor = ColorAtTarget;
664 lblAtFromTarget.BackColor = ColorAtFromTarget;
665 lblAtTo.BackColor = ColorAtTo;
666 lblInputBackcolor.BackColor = ColorInputBackcolor;
667 lblInputFont.ForeColor = ColorInputFont;
668 lblInputFont.Font = FontInputFont;
669 lblListBackcolor.BackColor = ColorListBackcolor;
670 lblDetailBackcolor.BackColor = ColorDetailBackcolor;
671 lblDetail.ForeColor = ColorDetail;
672 lblDetailLink.ForeColor = ColorDetailLink;
676 case MyCommon.NameBalloonEnum.None:
677 this.PreviewPanel.cmbNameBalloon.SelectedIndex = 0;
679 case MyCommon.NameBalloonEnum.UserID:
680 this.PreviewPanel.cmbNameBalloon.SelectedIndex = 1;
682 case MyCommon.NameBalloonEnum.NickName:
683 this.PreviewPanel.cmbNameBalloon.SelectedIndex = 2;
689 ComboBoxPostKeySelect.SelectedIndex = 1;
691 else if (PostShiftEnter)
693 ComboBoxPostKeySelect.SelectedIndex = 2;
697 ComboBoxPostKeySelect.SelectedIndex = 0;
700 TextCountApi.Text = CountApi.ToString();
701 TextCountApiReply.Text = CountApiReply.ToString();
702 BrowserPathText.Text = BrowserPath;
703 CheckPostAndGet.Checked = PostAndGet;
704 CheckUseRecommendStatus.Checked = UseRecommendStatus;
705 this.PreviewPanel.CheckDispUsername.Checked = DispUsername;
706 CheckCloseToExit.Checked = CloseToExit;
707 CheckMinimizeToTray.Checked = MinimizeToTray;
708 switch (DispLatestPost)
710 case MyCommon.DispTitleEnum.None:
711 this.PreviewPanel.ComboDispTitle.SelectedIndex = 0;
713 case MyCommon.DispTitleEnum.Ver:
714 this.PreviewPanel.ComboDispTitle.SelectedIndex = 1;
716 case MyCommon.DispTitleEnum.Post:
717 this.PreviewPanel.ComboDispTitle.SelectedIndex = 2;
719 case MyCommon.DispTitleEnum.UnreadRepCount:
720 this.PreviewPanel.ComboDispTitle.SelectedIndex = 3;
722 case MyCommon.DispTitleEnum.UnreadAllCount:
723 this.PreviewPanel.ComboDispTitle.SelectedIndex = 4;
725 case MyCommon.DispTitleEnum.UnreadAllRepCount:
726 this.PreviewPanel.ComboDispTitle.SelectedIndex = 5;
728 case MyCommon.DispTitleEnum.UnreadCountAllCount:
729 this.PreviewPanel.ComboDispTitle.SelectedIndex = 6;
731 case MyCommon.DispTitleEnum.OwnStatus:
732 this.PreviewPanel.ComboDispTitle.SelectedIndex = 7;
735 CheckSortOrderLock.Checked = SortOrderLock;
736 CheckViewTabBottom.Checked = ViewTabBottom;
737 CheckTinyURL.Checked = TinyUrlResolve;
738 switch (_MyProxyType)
740 case HttpConnection.ProxyType.None:
741 RadioProxyNone.Checked = true;
743 case HttpConnection.ProxyType.IE:
744 RadioProxyIE.Checked = true;
747 RadioProxySpecified.Checked = true;
750 bool chk = RadioProxySpecified.Checked;
751 LabelProxyAddress.Enabled = chk;
752 TextProxyAddress.Enabled = chk;
753 LabelProxyPort.Enabled = chk;
754 TextProxyPort.Enabled = chk;
755 LabelProxyUser.Enabled = chk;
756 TextProxyUser.Enabled = chk;
757 LabelProxyPassword.Enabled = chk;
758 TextProxyPassword.Enabled = chk;
760 TextProxyAddress.Text = ProxyAddress;
761 TextProxyPort.Text = ProxyPort.ToString();
762 TextProxyUser.Text = ProxyUser;
763 TextProxyPassword.Text = ProxyPassword;
765 this.StartupPanel.CheckStartupVersion.Checked = StartupVersion;
766 if (ApplicationSettings.VersionInfoUrl == null)
767 this.StartupPanel.CheckStartupVersion.Enabled = false; // 更新チェック無効化
768 this.StartupPanel.CheckStartupFollowers.Checked = StartupFollowers;
769 CheckFavRestrict.Checked = RestrictFavCheck;
770 this.PreviewPanel.CheckAlwaysTop.Checked = AlwaysTop;
771 CheckAutoConvertUrl.Checked = UrlConvertAuto;
772 ShortenTcoCheck.Checked = ShortenTco;
773 ShortenTcoCheck.Enabled = CheckAutoConvertUrl.Checked;
774 CheckOutputz.Checked = OutputzEnabled;
775 TextBoxOutputzKey.Text = OutputzKey;
777 switch (OutputzUrlmode)
779 case MyCommon.OutputzUrlmode.twittercom:
780 ComboBoxOutputzUrlmode.SelectedIndex = 0;
782 case MyCommon.OutputzUrlmode.twittercomWithUsername:
783 ComboBoxOutputzUrlmode.SelectedIndex = 1;
787 CheckNicoms.Checked = Nicoms;
788 chkUnreadStyle.Checked = UseUnreadStyle;
789 CmbDateTimeFormat.Text = DateTimeFormat;
790 ConnectionTimeOut.Text = DefaultTimeOut.ToString();
791 CheckRetweetNoConfirm.Checked = RetweetNoConfirm;
792 this.PreviewPanel.CheckBalloonLimit.Checked = LimitBalloon;
794 ApplyEventNotifyFlag(EventNotifyEnabled, EventNotifyFlag, IsMyEventNotifyFlag);
795 CheckForceEventNotify.Checked = ForceEventNotify;
796 CheckFavEventUnread.Checked = FavEventUnread;
797 ComboBoxTranslateLanguage.SelectedIndex = (new Bing()).GetIndexFromLanguageEnum(TranslateLanguage);
799 ComboBoxAutoShortUrlFirst.SelectedIndex = (int)AutoShortUrlFirst;
800 this.PreviewPanel.chkTabIconDisp.Checked = TabIconDisp;
801 chkReadOwnPost.Checked = ReadOwnPost;
802 this.StartupPanel.chkGetFav.Checked = GetFav;
803 this.PreviewPanel.CheckMonospace.Checked = IsMonospace;
804 CheckReadOldPosts.Checked = ReadOldPosts;
805 CheckUseSsl.Checked = UseSsl;
806 TextBitlyId.Text = BitlyUser;
807 TextBitlyPw.Text = BitlyPwd;
808 TextBitlyId.Modified = false;
809 TextBitlyPw.Modified = false;
810 CheckShowGrid.Checked = ShowGrid;
811 CheckAtIdSupple.Checked = UseAtIdSupplement;
812 CheckHashSupple.Checked = UseHashSupplement;
813 this.PreviewPanel.CheckPreviewEnable.Checked = PreviewEnable;
814 TwitterAPIText.Text = TwitterApiUrl;
815 switch (ReplyIconState)
817 case MyCommon.REPLY_ICONSTATE.None:
818 this.PreviewPanel.ReplyIconStateCombo.SelectedIndex = 0;
820 case MyCommon.REPLY_ICONSTATE.StaticIcon:
821 this.PreviewPanel.ReplyIconStateCombo.SelectedIndex = 1;
823 case MyCommon.REPLY_ICONSTATE.BlinkIcon:
824 this.PreviewPanel.ReplyIconStateCombo.SelectedIndex = 2;
830 this.PreviewPanel.LanguageCombo.SelectedIndex = 0;
833 this.PreviewPanel.LanguageCombo.SelectedIndex = 1;
836 this.PreviewPanel.LanguageCombo.SelectedIndex = 2;
839 this.PreviewPanel.LanguageCombo.SelectedIndex = 3;
842 this.PreviewPanel.LanguageCombo.SelectedIndex = 0;
845 HotkeyCheck.Checked = HotkeyEnabled;
846 HotkeyAlt.Checked = ((HotkeyMod & Keys.Alt) == Keys.Alt);
847 HotkeyCtrl.Checked = ((HotkeyMod & Keys.Control) == Keys.Control);
848 HotkeyShift.Checked = ((HotkeyMod & Keys.Shift) == Keys.Shift);
849 HotkeyWin.Checked = ((HotkeyMod & Keys.LWin) == Keys.LWin);
850 HotkeyCode.Text = HotkeyValue.ToString();
851 HotkeyText.Text = HotkeyKey.ToString();
852 HotkeyText.Tag = HotkeyKey;
853 HotkeyAlt.Enabled = HotkeyEnabled;
854 HotkeyShift.Enabled = HotkeyEnabled;
855 HotkeyCtrl.Enabled = HotkeyEnabled;
856 HotkeyWin.Enabled = HotkeyEnabled;
857 HotkeyText.Enabled = HotkeyEnabled;
858 HotkeyCode.Enabled = HotkeyEnabled;
859 this.PreviewPanel.ChkNewMentionsBlink.Checked = BlinkNewMentions;
861 CheckOutputz_CheckedChanged(sender, e);
863 GetMoreTextCountApi.Text = MoreCountApi.ToString();
864 FirstTextCountApi.Text = FirstCountApi.ToString();
865 SearchTextCountApi.Text = SearchCountApi.ToString();
866 FavoritesTextCountApi.Text = FavoritesCountApi.ToString();
867 UserTimelineTextCountApi.Text = UserTimelineCountApi.ToString();
868 ListTextCountApi.Text = ListCountApi.ToString();
869 UseChangeGetCount.Checked = UseAdditionalCount;
870 Label28.Enabled = UseChangeGetCount.Checked;
871 Label30.Enabled = UseChangeGetCount.Checked;
872 Label53.Enabled = UseChangeGetCount.Checked;
873 Label66.Enabled = UseChangeGetCount.Checked;
874 Label17.Enabled = UseChangeGetCount.Checked;
875 Label25.Enabled = UseChangeGetCount.Checked;
876 GetMoreTextCountApi.Enabled = UseChangeGetCount.Checked;
877 FirstTextCountApi.Enabled = UseChangeGetCount.Checked;
878 SearchTextCountApi.Enabled = UseChangeGetCount.Checked;
879 FavoritesTextCountApi.Enabled = UseChangeGetCount.Checked;
880 UserTimelineTextCountApi.Enabled = UseChangeGetCount.Checked;
881 ListTextCountApi.Enabled = UseChangeGetCount.Checked;
882 CheckOpenUserTimeline.Checked = OpenUserTimeline;
883 ListDoubleClickActionComboBox.SelectedIndex = ListDoubleClickAction;
884 UserAppointUrlText.Text = UserAppointUrl;
885 this.HideDuplicatedRetweetsCheck.Checked = this.HideDuplicatedRetweets;
886 this.IsPreviewFoursquareCheckBox.Checked = this.IsPreviewFoursquare;
887 this.MapThumbnailProviderComboBox.SelectedIndex = (int)this.MapThumbnailProvider;
888 this.MapThumbnailHeightTextBox.Text = this.MapThumbnailHeight.ToString();
889 this.MapThumbnailWidthTextBox.Text = this.MapThumbnailWidth.ToString();
890 this.MapThumbnailZoomTextBox.Text = this.MapThumbnailZoom.ToString();
891 this.IsListsIncludeRtsCheckBox.Checked = this.IsListStatusesIncludeRts;
892 this.TabMouseLockCheck.Checked = this.TabMouseLock;
893 this.IsRemoveSameFavEventCheckBox.Checked = this.IsRemoveSameEvent;
894 this.PreviewPanel.IsNotifyUseGrowlCheckBox.Checked = this.IsNotifyUseGrowl;
896 if (GrowlHelper.IsDllExists)
898 this.PreviewPanel.IsNotifyUseGrowlCheckBox.Enabled = true;
902 this.PreviewPanel.IsNotifyUseGrowlCheckBox.Enabled = false;
905 this.TreeViewSetting.Nodes["BasedNode"].Tag = BasedPanel;
906 this.TreeViewSetting.Nodes["BasedNode"].Nodes["PeriodNode"].Tag = GetPeriodPanel;
907 this.TreeViewSetting.Nodes["BasedNode"].Nodes["StartUpNode"].Tag = StartupPanel;
908 this.TreeViewSetting.Nodes["BasedNode"].Nodes["GetCountNode"].Tag = GetCountPanel;
909 //this.TreeViewSetting.Nodes["BasedNode"].Nodes["UserStreamNode"].Tag = UserStreamPanel;
910 this.TreeViewSetting.Nodes["ActionNode"].Tag = ActionPanel;
911 this.TreeViewSetting.Nodes["ActionNode"].Nodes["TweetActNode"].Tag = TweetActPanel;
912 this.TreeViewSetting.Nodes["PreviewNode"].Tag = PreviewPanel;
913 this.TreeViewSetting.Nodes["PreviewNode"].Nodes["TweetPrvNode"].Tag = TweetPrvPanel;
914 this.TreeViewSetting.Nodes["PreviewNode"].Nodes["NotifyNode"].Tag = NotifyPanel;
915 this.TreeViewSetting.Nodes["FontNode"].Tag = FontPanel;
916 this.TreeViewSetting.Nodes["FontNode"].Nodes["FontNode2"].Tag = FontPanel2;
917 this.TreeViewSetting.Nodes["ConnectionNode"].Tag = ConnectionPanel;
918 this.TreeViewSetting.Nodes["ConnectionNode"].Nodes["ProxyNode"].Tag = ProxyPanel;
919 this.TreeViewSetting.Nodes["ConnectionNode"].Nodes["CooperateNode"].Tag = CooperatePanel;
920 this.TreeViewSetting.Nodes["ConnectionNode"].Nodes["ShortUrlNode"].Tag = ShortUrlPanel;
922 this.TreeViewSetting.SelectedNode = this.TreeViewSetting.Nodes[0];
923 this.TreeViewSetting.ExpandAll();
925 //TreeViewSetting.SelectedNode = TreeViewSetting.TopNode;
926 ActiveControl = StartAuthButton;
929 private void UserstreamPeriod_Validating(object sender, CancelEventArgs e)
934 prd = int.Parse(UserstreamPeriod.Text);
938 MessageBox.Show(Properties.Resources.UserstreamPeriod_ValidatingText1);
943 if (prd < 0 || prd > 60)
945 MessageBox.Show(Properties.Resources.UserstreamPeriod_ValidatingText1);
951 private void TimelinePeriod_Validating(object sender, CancelEventArgs e)
956 prd = int.Parse(TimelinePeriod.Text);
960 MessageBox.Show(Properties.Resources.TimelinePeriod_ValidatingText1);
965 if (prd != 0 && (prd < 15 || prd > 6000))
967 MessageBox.Show(Properties.Resources.TimelinePeriod_ValidatingText2);
973 private void ReplyPeriod_Validating(object sender, CancelEventArgs e)
978 prd = int.Parse(ReplyPeriod.Text);
982 MessageBox.Show(Properties.Resources.TimelinePeriod_ValidatingText1);
987 if (prd != 0 && (prd < 15 || prd > 6000))
989 MessageBox.Show(Properties.Resources.TimelinePeriod_ValidatingText2);
995 private void DMPeriod_Validating(object sender, CancelEventArgs e)
1000 prd = int.Parse(DMPeriod.Text);
1004 MessageBox.Show(Properties.Resources.DMPeriod_ValidatingText1);
1009 if (prd != 0 && (prd < 15 || prd > 6000))
1011 MessageBox.Show(Properties.Resources.DMPeriod_ValidatingText2);
1017 private void PubSearchPeriod_Validating(object sender, CancelEventArgs e)
1022 prd = int.Parse(PubSearchPeriod.Text);
1026 MessageBox.Show(Properties.Resources.PubSearchPeriod_ValidatingText1);
1031 if (prd != 0 && (prd < 30 || prd > 6000))
1033 MessageBox.Show(Properties.Resources.PubSearchPeriod_ValidatingText2);
1038 private void ListsPeriod_Validating(object sender, CancelEventArgs e)
1043 prd = int.Parse(ListsPeriod.Text);
1047 MessageBox.Show(Properties.Resources.DMPeriod_ValidatingText1);
1052 if (prd != 0 && (prd < 15 || prd > 6000))
1054 MessageBox.Show(Properties.Resources.DMPeriod_ValidatingText2);
1060 private void UserTimeline_Validating(object sender, CancelEventArgs e)
1065 prd = int.Parse(UserTimelinePeriod.Text);
1069 MessageBox.Show(Properties.Resources.DMPeriod_ValidatingText1);
1074 if (prd != 0 && (prd < 15 || prd > 6000))
1076 MessageBox.Show(Properties.Resources.DMPeriod_ValidatingText2);
1082 private void UReadMng_CheckedChanged(object sender, EventArgs e)
1084 if (UReadMng.Checked == true)
1086 this.StartupPanel.StartupReaded.Enabled = true;
1090 this.StartupPanel.StartupReaded.Enabled = false;
1094 private void btnFontAndColor_Click(object sender, EventArgs e) // Handles btnUnread.Click, btnDetail.Click, btnListFont.Click, btnInputFont.Click
1096 Button Btn = (Button) sender;
1099 FontDialog1.AllowVerticalFonts = false;
1100 FontDialog1.AllowScriptChange = true;
1101 FontDialog1.AllowSimulations = true;
1102 FontDialog1.AllowVectorFonts = true;
1103 FontDialog1.FixedPitchOnly = false;
1104 FontDialog1.FontMustExist = true;
1105 FontDialog1.ScriptsOnly = false;
1106 FontDialog1.ShowApply = false;
1107 FontDialog1.ShowEffects = true;
1108 FontDialog1.ShowColor = true;
1113 FontDialog1.Color = lblUnread.ForeColor;
1114 FontDialog1.Font = lblUnread.Font;
1117 FontDialog1.Color = lblDetail.ForeColor;
1118 FontDialog1.Font = lblDetail.Font;
1121 FontDialog1.Color = lblListFont.ForeColor;
1122 FontDialog1.Font = lblListFont.Font;
1124 case "btnInputFont":
1125 FontDialog1.Color = lblInputFont.ForeColor;
1126 FontDialog1.Font = lblInputFont.Font;
1132 rtn = FontDialog1.ShowDialog();
1134 catch(ArgumentException ex)
1136 MessageBox.Show(ex.Message);
1140 if (rtn == DialogResult.Cancel) return;
1145 lblUnread.ForeColor = FontDialog1.Color;
1146 lblUnread.Font = FontDialog1.Font;
1149 lblDetail.ForeColor = FontDialog1.Color;
1150 lblDetail.Font = FontDialog1.Font;
1153 lblListFont.ForeColor = FontDialog1.Color;
1154 lblListFont.Font = FontDialog1.Font;
1156 case "btnInputFont":
1157 lblInputFont.ForeColor = FontDialog1.Color;
1158 lblInputFont.Font = FontDialog1.Font;
1164 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
1166 Button Btn = (Button)sender;
1169 ColorDialog1.AllowFullOpen = true;
1170 ColorDialog1.AnyColor = true;
1171 ColorDialog1.FullOpen = false;
1172 ColorDialog1.SolidColorOnly = false;
1177 ColorDialog1.Color = lblSelf.BackColor;
1180 ColorDialog1.Color = lblAtSelf.BackColor;
1183 ColorDialog1.Color = lblTarget.BackColor;
1186 ColorDialog1.Color = lblAtTarget.BackColor;
1188 case "btnAtFromTarget":
1189 ColorDialog1.Color = lblAtFromTarget.BackColor;
1192 ColorDialog1.Color = lblFav.ForeColor;
1195 ColorDialog1.Color = lblOWL.ForeColor;
1198 ColorDialog1.Color = lblRetweet.ForeColor;
1200 case "btnInputBackcolor":
1201 ColorDialog1.Color = lblInputBackcolor.BackColor;
1204 ColorDialog1.Color = lblAtTo.BackColor;
1207 ColorDialog1.Color = lblListBackcolor.BackColor;
1209 case "btnDetailBack":
1210 ColorDialog1.Color = lblDetailBackcolor.BackColor;
1212 case "btnDetailLink":
1213 ColorDialog1.Color = lblDetailLink.ForeColor;
1217 rtn = ColorDialog1.ShowDialog();
1219 if (rtn == DialogResult.Cancel) return;
1224 lblSelf.BackColor = ColorDialog1.Color;
1227 lblAtSelf.BackColor = ColorDialog1.Color;
1230 lblTarget.BackColor = ColorDialog1.Color;
1233 lblAtTarget.BackColor = ColorDialog1.Color;
1235 case "btnAtFromTarget":
1236 lblAtFromTarget.BackColor = ColorDialog1.Color;
1239 lblFav.ForeColor = ColorDialog1.Color;
1242 lblOWL.ForeColor = ColorDialog1.Color;
1245 lblRetweet.ForeColor = ColorDialog1.Color;
1247 case "btnInputBackcolor":
1248 lblInputBackcolor.BackColor = ColorDialog1.Color;
1251 lblAtTo.BackColor = ColorDialog1.Color;
1254 lblListBackcolor.BackColor = ColorDialog1.Color;
1256 case "btnDetailBack":
1257 lblDetailBackcolor.BackColor = ColorDialog1.Color;
1259 case "btnDetailLink":
1260 lblDetailLink.ForeColor = ColorDialog1.Color;
1265 public int UserstreamPeriodInt { get; set; }
1266 public bool UserstreamStartup { get; set; }
1267 public int TimelinePeriodInt { get; set; }
1268 public int ReplyPeriodInt { get; set; }
1269 public int DMPeriodInt { get; set; }
1270 public int PubSearchPeriodInt { get; set; }
1271 public int ListsPeriodInt { get; set; }
1272 public int UserTimelinePeriodInt { get; set; }
1273 public bool Readed { get; set; }
1274 public MyCommon.IconSizes IconSz { get; set; }
1275 public string Status { get; set; }
1276 public bool UnreadManage { get; set; }
1277 public bool PlaySound { get; set; }
1278 public bool OneWayLove { get; set; }
1279 public Font FontUnread { get; set; } /////未使用
1280 public Color ColorUnread { get; set; }
1281 public Font FontReaded { get; set; } /////リストフォントとして使用
1282 public Color ColorReaded { get; set; }
1283 public Color ColorFav { get; set; }
1284 public Color ColorOWL { get; set; }
1285 public Color ColorRetweet { get; set; }
1286 public Font FontDetail { get; set; }
1287 public Color ColorDetail { get; set; }
1288 public Color ColorDetailLink { get; set; }
1289 public Color ColorSelf { get; set; }
1290 public Color ColorAtSelf { get; set; }
1291 public Color ColorTarget { get; set; }
1292 public Color ColorAtTarget { get; set; }
1293 public Color ColorAtFromTarget { get; set; }
1294 public Color ColorAtTo { get; set; }
1295 public Color ColorInputBackcolor { get; set; }
1296 public Color ColorInputFont { get; set; }
1297 public Font FontInputFont { get; set; }
1298 public Color ColorListBackcolor { get; set; }
1299 public Color ColorDetailBackcolor { get; set; }
1300 public MyCommon.NameBalloonEnum NameBalloon { get; set; }
1301 public bool PostCtrlEnter { get; set; }
1302 public bool PostShiftEnter { get; set; }
1303 public int CountApi { get; set; }
1304 public int CountApiReply { get; set; }
1305 public int MoreCountApi { get; set; }
1306 public int FirstCountApi { get; set; }
1307 public int SearchCountApi { get; set; }
1308 public int FavoritesCountApi { get; set; }
1309 public int UserTimelineCountApi { get; set; }
1310 public int ListCountApi { get; set; }
1311 public bool PostAndGet { get; set; }
1312 public bool UseRecommendStatus { get; set; }
1313 public string RecommendStatusText { get; set; }
1314 public bool DispUsername { get; set; }
1315 public bool CloseToExit { get; set; }
1316 public bool MinimizeToTray { get; set; }
1317 public MyCommon.DispTitleEnum DispLatestPost { get; set; }
1318 public string BrowserPath { get; set; }
1319 public bool TinyUrlResolve { get; set; }
1321 private void CheckUseRecommendStatus_CheckedChanged(object sender, EventArgs e)
1323 if (CheckUseRecommendStatus.Checked == true)
1325 StatusText.Enabled = false;
1329 StatusText.Enabled = true;
1333 public bool SortOrderLock { get; set; }
1334 public HttpConnection.ProxyType SelectedProxyType
1337 return _MyProxyType;
1340 _MyProxyType = value;
1344 /// タブを下部に表示するかどうかを取得または設定する
1346 public bool ViewTabBottom { get; set; }
1348 public string ProxyAddress { get; set; }
1349 public int ProxyPort { get; set; }
1350 public string ProxyUser { get; set; }
1351 public string ProxyPassword { get; set; }
1352 public bool StartupVersion { get; set; }
1353 public bool StartupFollowers { get; set; }
1354 public bool RestrictFavCheck { get; set; }
1355 public bool AlwaysTop { get; set; }
1356 public bool UrlConvertAuto { get; set; }
1357 public bool ShortenTco { get; set; }
1358 public bool OutputzEnabled { get; set; }
1359 public string OutputzKey { get; set; }
1360 public MyCommon.OutputzUrlmode OutputzUrlmode { get; set; }
1361 public bool Nicoms { get; set; }
1362 public MyCommon.UrlConverter AutoShortUrlFirst { get; set; }
1363 public bool UseUnreadStyle { get; set; }
1364 public string DateTimeFormat { get; set; }
1365 public int DefaultTimeOut { get; set; }
1366 public bool RetweetNoConfirm { get; set; }
1367 public bool TabIconDisp { get; set; }
1368 public MyCommon.REPLY_ICONSTATE ReplyIconState { get; set; }
1369 public bool ReadOwnPost { get; set; }
1370 public bool GetFav { get; set; }
1371 public bool IsMonospace { get; set; }
1372 public bool ReadOldPosts { get; set; }
1373 public bool UseSsl { get; set; }
1374 public string BitlyUser { get; set; }
1375 public string BitlyPwd { get; set; }
1376 public bool ShowGrid { get; set; }
1377 public bool UseAtIdSupplement { get; set; }
1378 public bool UseHashSupplement { get; set; }
1379 public bool PreviewEnable { get; set; }
1380 public bool UseAdditionalCount { get; set; }
1381 public bool OpenUserTimeline { get; set; }
1382 public string TwitterApiUrl { get; set; }
1383 public string Language { get; set; }
1385 private void Button3_Click(object sender, EventArgs e)
1387 using (OpenFileDialog filedlg = new OpenFileDialog())
1389 filedlg.Filter = Properties.Resources.Button3_ClickText1;
1390 filedlg.FilterIndex = 1;
1391 filedlg.Title = Properties.Resources.Button3_ClickText2;
1392 filedlg.RestoreDirectory = true;
1394 if (filedlg.ShowDialog() == DialogResult.OK)
1396 BrowserPathText.Text = filedlg.FileName;
1401 private void RadioProxySpecified_CheckedChanged(object sender, EventArgs e)
1403 bool chk = RadioProxySpecified.Checked;
1404 LabelProxyAddress.Enabled = chk;
1405 TextProxyAddress.Enabled = chk;
1406 LabelProxyPort.Enabled = chk;
1407 TextProxyPort.Enabled = chk;
1408 LabelProxyUser.Enabled = chk;
1409 TextProxyUser.Enabled = chk;
1410 LabelProxyPassword.Enabled = chk;
1411 TextProxyPassword.Enabled = chk;
1414 private void TextProxyPort_Validating(object sender, CancelEventArgs e)
1417 if (string.IsNullOrWhiteSpace(TextProxyPort.Text)) TextProxyPort.Text = "0";
1418 if (int.TryParse(TextProxyPort.Text.Trim(), out port) == false)
1420 MessageBox.Show(Properties.Resources.TextProxyPort_ValidatingText1);
1424 if (port < 0 || port > 65535)
1426 MessageBox.Show(Properties.Resources.TextProxyPort_ValidatingText2);
1432 private void CheckOutputz_CheckedChanged(object sender, EventArgs e)
1434 if (CheckOutputz.Checked == true)
1436 Label59.Enabled = true;
1437 Label60.Enabled = true;
1438 TextBoxOutputzKey.Enabled = true;
1439 ComboBoxOutputzUrlmode.Enabled = true;
1443 Label59.Enabled = false;
1444 Label60.Enabled = false;
1445 TextBoxOutputzKey.Enabled = false;
1446 ComboBoxOutputzUrlmode.Enabled = false;
1450 private void TextBoxOutputzKey_Validating(object sender, CancelEventArgs e)
1452 if (CheckOutputz.Checked)
1454 TextBoxOutputzKey.Text = TextBoxOutputzKey.Text.Trim();
1455 if (TextBoxOutputzKey.Text.Length == 0)
1457 MessageBox.Show(Properties.Resources.TextBoxOutputzKey_Validating);
1464 private bool CreateDateTimeFormatSample()
1468 LabelDateTimeFormatApplied.Text = DateTime.Now.ToString(CmbDateTimeFormat.Text);
1470 catch(FormatException)
1472 LabelDateTimeFormatApplied.Text = Properties.Resources.CreateDateTimeFormatSampleText1;
1478 private void CmbDateTimeFormat_TextUpdate(object sender, EventArgs e)
1480 CreateDateTimeFormatSample();
1483 private void CmbDateTimeFormat_SelectedIndexChanged(object sender, EventArgs e)
1485 CreateDateTimeFormatSample();
1488 private void CmbDateTimeFormat_Validating(object sender, CancelEventArgs e)
1490 if (!CreateDateTimeFormatSample())
1492 MessageBox.Show(Properties.Resources.CmbDateTimeFormat_Validating);
1497 private void ConnectionTimeOut_Validating(object sender, CancelEventArgs e)
1502 tm = int.Parse(ConnectionTimeOut.Text);
1506 MessageBox.Show(Properties.Resources.ConnectionTimeOut_ValidatingText1);
1511 if (tm < (int)MyCommon.HttpTimeOut.MinValue || tm > (int)MyCommon.HttpTimeOut.MaxValue)
1513 MessageBox.Show(Properties.Resources.ConnectionTimeOut_ValidatingText1);
1518 private void LabelDateTimeFormatApplied_VisibleChanged(object sender, EventArgs e)
1520 CreateDateTimeFormatSample();
1523 private void TextCountApi_Validating(object sender, CancelEventArgs e)
1528 cnt = int.Parse(TextCountApi.Text);
1532 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1537 if (cnt < 20 || cnt > 200)
1539 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1545 private void TextCountApiReply_Validating(object sender, CancelEventArgs e)
1550 cnt = int.Parse(TextCountApiReply.Text);
1554 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1559 if (cnt < 20 || cnt > 200)
1561 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1567 public bool LimitBalloon { get; set; }
1568 public bool EventNotifyEnabled { get; set; }
1570 public MyCommon.EVENTTYPE EventNotifyFlag
1574 return _MyEventNotifyFlag;
1578 _MyEventNotifyFlag = value;
1582 public MyCommon.EVENTTYPE IsMyEventNotifyFlag
1586 return _isMyEventNotifyFlag;
1590 _isMyEventNotifyFlag = value;
1594 public bool ForceEventNotify { get; set; }
1595 public bool FavEventUnread { get; set; }
1597 public string TranslateLanguage
1601 return _MyTranslateLanguage;
1605 _MyTranslateLanguage = value;
1606 ComboBoxTranslateLanguage.SelectedIndex = (new Bing()).GetIndexFromLanguageEnum(value);
1610 public string EventSoundFile { get; set; }
1611 public int ListDoubleClickAction { get; set; }
1612 public string UserAppointUrl { get; set; }
1614 private void ComboBoxAutoShortUrlFirst_SelectedIndexChanged(object sender, EventArgs e)
1616 if (ComboBoxAutoShortUrlFirst.SelectedIndex == (int)MyCommon.UrlConverter.Bitly ||
1617 ComboBoxAutoShortUrlFirst.SelectedIndex == (int)MyCommon.UrlConverter.Jmp)
1619 Label76.Enabled = true;
1620 Label77.Enabled = true;
1621 TextBitlyId.Enabled = true;
1622 TextBitlyPw.Enabled = true;
1626 Label76.Enabled = false;
1627 Label77.Enabled = false;
1628 TextBitlyId.Enabled = false;
1629 TextBitlyPw.Enabled = false;
1633 private void ButtonBackToDefaultFontColor_Click(object sender, EventArgs e) //Handles ButtonBackToDefaultFontColor.Click, ButtonBackToDefaultFontColor2.Click
1635 lblUnread.ForeColor = SystemColors.ControlText;
1636 lblUnread.Font = new Font(SystemFonts.DefaultFont, FontStyle.Bold | FontStyle.Underline);
1638 lblListFont.ForeColor = System.Drawing.SystemColors.ControlText;
1639 lblListFont.Font = System.Drawing.SystemFonts.DefaultFont;
1641 lblDetail.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.ControlText);
1642 lblDetail.Font = System.Drawing.SystemFonts.DefaultFont;
1644 lblInputFont.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.ControlText);
1645 lblInputFont.Font = System.Drawing.SystemFonts.DefaultFont;
1647 lblSelf.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.AliceBlue);
1649 lblAtSelf.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.AntiqueWhite);
1651 lblTarget.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.LemonChiffon);
1653 lblAtTarget.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.LavenderBlush);
1655 lblAtFromTarget.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Honeydew);
1657 lblFav.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.Red);
1659 lblOWL.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.Blue);
1661 lblInputBackcolor.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.LemonChiffon);
1663 lblAtTo.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Pink);
1665 lblListBackcolor.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Window);
1667 lblDetailBackcolor.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Window);
1669 lblDetailLink.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.Blue);
1671 lblRetweet.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.Green);
1674 private bool StartAuth()
1677 HttpConnection.ProxyType ptype;
1678 if (RadioProxyNone.Checked)
1680 ptype = HttpConnection.ProxyType.None;
1682 else if (RadioProxyIE.Checked)
1684 ptype = HttpConnection.ProxyType.IE;
1688 ptype = HttpConnection.ProxyType.Specified;
1690 string padr = TextProxyAddress.Text.Trim();
1691 int pport = int.Parse(TextProxyPort.Text.Trim());
1692 string pusr = TextProxyUser.Text.Trim();
1693 string ppw = TextProxyPassword.Text.Trim();
1696 HttpConnection.InitializeConnection(20, ptype, padr, pport, pusr, ppw);
1697 HttpTwitter.TwitterUrl = TwitterAPIText.Text.Trim();
1698 tw.Initialize("", "", "", 0);
1699 //this.AuthStateLabel.Text = Properties.Resources.AuthorizeButton_Click4;
1700 //this.AuthUserLabel.Text = "";
1701 string pinPageUrl = "";
1702 string rslt = tw.StartAuthentication(ref pinPageUrl);
1703 if (string.IsNullOrEmpty(rslt))
1705 string pin = AuthDialog.DoAuth(this, pinPageUrl);
1706 if (!string.IsNullOrEmpty(pin))
1718 MessageBox.Show(Properties.Resources.AuthorizeButton_Click2 + Environment.NewLine + rslt, "Authenticate", MessageBoxButtons.OK);
1723 private bool PinAuth()
1725 string pin = this._pin; //PIN Code
1727 string rslt = tw.Authenticate(pin);
1728 if (string.IsNullOrEmpty(rslt))
1730 MessageBox.Show(Properties.Resources.AuthorizeButton_Click1, "Authenticate", MessageBoxButtons.OK);
1731 //this.AuthStateLabel.Text = Properties.Resources.AuthorizeButton_Click3;
1732 //this.AuthUserLabel.Text = tw.Username;
1734 UserAccount user = new UserAccount();
1735 user.Username = tw.Username;
1736 user.UserId = tw.UserId;
1737 user.Token = tw.AccessToken;
1738 user.TokenSecret = tw.AccessTokenSecret;
1740 foreach (object u in this.AuthUserCombo.Items)
1742 if (((UserAccount)u).Username.ToLower() == tw.Username.ToLower())
1744 idx = this.AuthUserCombo.Items.IndexOf(u);
1750 this.AuthUserCombo.Items.RemoveAt(idx);
1751 this.AuthUserCombo.Items.Insert(idx, user);
1752 this.AuthUserCombo.SelectedIndex = idx;
1756 this.AuthUserCombo.SelectedIndex = this.AuthUserCombo.Items.Add(user);
1758 //if (TwitterApiInfo.AccessLevel = ApiAccessLevel.ReadWrite)
1760 // this.AuthStateLabel.Text += "(xAuth)";
1762 //else if (TwitterApiInfo.AccessLevel == ApiAccessLevel.ReadWriteAndDirectMessage)
1764 // this.AuthStateLabel.Text += "(OAuth)";
1770 MessageBox.Show(Properties.Resources.AuthorizeButton_Click2 + Environment.NewLine + rslt, "Authenticate", MessageBoxButtons.OK);
1771 //this.AuthStateLabel.Text = Properties.Resources.AuthorizeButton_Click4;
1772 //this.AuthUserLabel.Text = "";
1777 private void StartAuthButton_Click(object sender, EventArgs e)
1779 //this.Save.Enabled = false;
1784 //this.Save.Enabled = true;
1789 private void AuthClearButton_Click(object sender, EventArgs e)
1791 //tw.ClearAuthInfo();
1792 //this.AuthStateLabel.Text = Properties.Resources.AuthorizeButton_Click4;
1793 //this.AuthUserLabel.Text = "";
1794 if (this.AuthUserCombo.SelectedIndex > -1)
1796 this.AuthUserCombo.Items.RemoveAt(this.AuthUserCombo.SelectedIndex);
1797 if (this.AuthUserCombo.Items.Count > 0)
1799 this.AuthUserCombo.SelectedIndex = 0;
1803 this.AuthUserCombo.SelectedIndex = -1;
1806 //this.Save.Enabled = false;
1809 private void CheckPostAndGet_CheckedChanged(object sender, EventArgs e)
1811 LabelPostAndGet.Visible = CheckPostAndGet.Checked && !tw.UserStreamEnabled;
1814 private void Setting_Shown(object sender, EventArgs e)
1819 if (this.Disposing || this.IsDisposed) return;
1820 } while (!this.IsHandleCreated);
1821 this.TopMost = this.AlwaysTop;
1823 LabelPostAndGet.Visible = CheckPostAndGet.Checked && !tw.UserStreamEnabled;
1824 LabelUserStreamActive.Visible = tw.UserStreamEnabled;
1827 public static AppendSettingDialog Instance
1829 get { return _instance; }
1832 private bool BitlyValidation(string id, string apikey)
1834 if (string.IsNullOrEmpty(id) || string.IsNullOrEmpty(apikey))
1839 string req = "http://api.bit.ly/v3/validate";
1840 string content = "";
1841 Dictionary<string, string> param = new Dictionary<string, string>();
1843 param.Add("login", ApplicationSettings.BitlyLoginId);
1844 param.Add("apiKey", ApplicationSettings.BitlyApiKey);
1845 param.Add("x_login", id);
1846 param.Add("x_apiKey", apikey);
1847 param.Add("format", "txt");
1849 if (!(new HttpVarious()).PostData(req, param, out content))
1851 return true; // 通信エラーの場合はとりあえずチェックを通ったことにする
1853 else if (content.Trim() == "1")
1855 return true; // 検証成功
1857 else if (content.Trim() == "0")
1859 return false; // 検証失敗 APIキーとIDの組み合わせが違う
1863 return true; // 規定外応答:通信エラーの可能性があるためとりあえずチェックを通ったことにする
1867 private void Cancel_Click(object sender, EventArgs e)
1869 _ValidationError = false;
1872 public bool HotkeyEnabled;
1873 public Keys HotkeyKey;
1874 public int HotkeyValue;
1875 public Keys HotkeyMod;
1877 private void HotkeyText_KeyDown(object sender, KeyEventArgs e)
1881 HotkeyText.Text = e.KeyCode.ToString();
1882 HotkeyCode.Text = e.KeyValue.ToString();
1883 HotkeyText.Tag = e.KeyCode;
1885 e.SuppressKeyPress = true;
1888 private void HotkeyCheck_CheckedChanged(object sender, EventArgs e)
1890 HotkeyCtrl.Enabled = HotkeyCheck.Checked;
1891 HotkeyAlt.Enabled = HotkeyCheck.Checked;
1892 HotkeyShift.Enabled = HotkeyCheck.Checked;
1893 HotkeyWin.Enabled = HotkeyCheck.Checked;
1894 HotkeyText.Enabled = HotkeyCheck.Checked;
1895 HotkeyCode.Enabled = HotkeyCheck.Checked;
1898 public bool BlinkNewMentions;
1900 private void GetMoreTextCountApi_Validating(object sender, CancelEventArgs e)
1905 cnt = int.Parse(GetMoreTextCountApi.Text);
1909 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1914 if (cnt != 0 && (cnt < 20 || cnt > 200))
1916 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1922 private void UseChangeGetCount_CheckedChanged(object sender, EventArgs e)
1924 GetMoreTextCountApi.Enabled = UseChangeGetCount.Checked;
1925 FirstTextCountApi.Enabled = UseChangeGetCount.Checked;
1926 Label28.Enabled = UseChangeGetCount.Checked;
1927 Label30.Enabled = UseChangeGetCount.Checked;
1928 Label53.Enabled = UseChangeGetCount.Checked;
1929 Label66.Enabled = UseChangeGetCount.Checked;
1930 Label17.Enabled = UseChangeGetCount.Checked;
1931 Label25.Enabled = UseChangeGetCount.Checked;
1932 SearchTextCountApi.Enabled = UseChangeGetCount.Checked;
1933 FavoritesTextCountApi.Enabled = UseChangeGetCount.Checked;
1934 UserTimelineTextCountApi.Enabled = UseChangeGetCount.Checked;
1935 ListTextCountApi.Enabled = UseChangeGetCount.Checked;
1938 private void FirstTextCountApi_Validating(object sender, CancelEventArgs e)
1943 cnt = int.Parse(FirstTextCountApi.Text);
1947 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1952 if (cnt != 0 && (cnt < 20 || cnt > 200))
1954 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1960 private void SearchTextCountApi_Validating(object sender, CancelEventArgs e)
1965 cnt = int.Parse(SearchTextCountApi.Text);
1969 MessageBox.Show(Properties.Resources.TextSearchCountApi_Validating1);
1974 if (cnt != 0 && (cnt < 20 || cnt > 100))
1976 MessageBox.Show(Properties.Resources.TextSearchCountApi_Validating1);
1982 private void FavoritesTextCountApi_Validating(object sender, CancelEventArgs e)
1987 cnt = int.Parse(FavoritesTextCountApi.Text);
1991 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1996 if (cnt != 0 && (cnt < 20 || cnt > 200))
1998 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2004 private void UserTimelineTextCountApi_Validating(object sender, CancelEventArgs e)
2009 cnt = int.Parse(UserTimelineTextCountApi.Text);
2013 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2018 if (cnt != 0 && (cnt < 20 || cnt > 200))
2020 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2026 private void ListTextCountApi_Validating(object sender, CancelEventArgs e)
2031 cnt = int.Parse(ListTextCountApi.Text);
2035 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2040 if (cnt != 0 && (cnt < 20 || cnt > 200))
2042 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2048 //private void CheckEventNotify_CheckedChanged(object sender, EventArgs e)
2049 // Handles CheckEventNotify.CheckedChanged, CheckFavoritesEvent.CheckStateChanged,
2050 // CheckUnfavoritesEvent.CheckStateChanged, CheckFollowEvent.CheckStateChanged,
2051 // CheckListMemberAddedEvent.CheckStateChanged, CheckListMemberRemovedEvent.CheckStateChanged,
2052 // CheckListCreatedEvent.CheckStateChanged, CheckUserUpdateEvent.CheckStateChanged
2054 // EventNotifyEnabled = CheckEventNotify.Checked;
2055 // GetEventNotifyFlag(EventNotifyFlag, IsMyEventNotifyFlag);
2056 // ApplyEventNotifyFlag(EventNotifyEnabled, EventNotifyFlag, IsMyEventNotifyFlag);
2059 private class EventCheckboxTblElement
2061 public CheckBox CheckBox;
2062 public MyCommon.EVENTTYPE Type;
2065 private EventCheckboxTblElement[] GetEventCheckboxTable()
2067 EventCheckboxTblElement[] _eventCheckboxTable = new EventCheckboxTblElement[8];
2069 _eventCheckboxTable[0] = new EventCheckboxTblElement();
2070 _eventCheckboxTable[0].CheckBox = CheckFavoritesEvent;
2071 _eventCheckboxTable[0].Type = MyCommon.EVENTTYPE.Favorite;
2073 _eventCheckboxTable[1] = new EventCheckboxTblElement();
2074 _eventCheckboxTable[1].CheckBox = CheckUnfavoritesEvent;
2075 _eventCheckboxTable[1].Type = MyCommon.EVENTTYPE.Unfavorite;
2077 _eventCheckboxTable[2] = new EventCheckboxTblElement();
2078 _eventCheckboxTable[2].CheckBox = CheckFollowEvent;
2079 _eventCheckboxTable[2].Type = MyCommon.EVENTTYPE.Follow;
2081 _eventCheckboxTable[3] = new EventCheckboxTblElement();
2082 _eventCheckboxTable[3].CheckBox = CheckListMemberAddedEvent;
2083 _eventCheckboxTable[3].Type = MyCommon.EVENTTYPE.ListMemberAdded;
2085 _eventCheckboxTable[4] = new EventCheckboxTblElement();
2086 _eventCheckboxTable[4].CheckBox = CheckListMemberRemovedEvent;
2087 _eventCheckboxTable[4].Type = MyCommon.EVENTTYPE.ListMemberRemoved;
2089 _eventCheckboxTable[5] = new EventCheckboxTblElement();
2090 _eventCheckboxTable[5].CheckBox = CheckBlockEvent;
2091 _eventCheckboxTable[5].Type = MyCommon.EVENTTYPE.Block;
2093 _eventCheckboxTable[6] = new EventCheckboxTblElement();
2094 _eventCheckboxTable[6].CheckBox = CheckUserUpdateEvent;
2095 _eventCheckboxTable[6].Type = MyCommon.EVENTTYPE.UserUpdate;
2097 _eventCheckboxTable[7] = new EventCheckboxTblElement();
2098 _eventCheckboxTable[7].CheckBox = CheckListCreatedEvent;
2099 _eventCheckboxTable[7].Type = MyCommon.EVENTTYPE.ListCreated;
2101 return _eventCheckboxTable;
2104 private void GetEventNotifyFlag(ref MyCommon.EVENTTYPE eventnotifyflag, ref MyCommon.EVENTTYPE isMyeventnotifyflag)
2106 MyCommon.EVENTTYPE evt = MyCommon.EVENTTYPE.None;
2107 MyCommon.EVENTTYPE myevt = MyCommon.EVENTTYPE.None;
2109 foreach (EventCheckboxTblElement tbl in GetEventCheckboxTable())
2111 switch (tbl.CheckBox.CheckState)
2113 case CheckState.Checked:
2114 evt = evt | tbl.Type;
2115 myevt = myevt | tbl.Type;
2117 case CheckState.Indeterminate:
2118 evt = evt | tbl.Type;
2120 case CheckState.Unchecked:
2124 eventnotifyflag = evt;
2125 isMyeventnotifyflag = myevt;
2128 private void ApplyEventNotifyFlag(bool rootEnabled, MyCommon.EVENTTYPE eventnotifyflag, MyCommon.EVENTTYPE isMyeventnotifyflag)
2130 MyCommon.EVENTTYPE evt = eventnotifyflag;
2131 MyCommon.EVENTTYPE myevt = isMyeventnotifyflag;
2133 CheckEventNotify.Checked = rootEnabled;
2135 foreach (EventCheckboxTblElement tbl in GetEventCheckboxTable())
2137 if ((evt & tbl.Type) != 0)
2139 if ((myevt & tbl.Type) != 0)
2141 tbl.CheckBox.CheckState = CheckState.Checked;
2145 tbl.CheckBox.CheckState = CheckState.Indeterminate;
2150 tbl.CheckBox.CheckState = CheckState.Unchecked;
2152 tbl.CheckBox.Enabled = rootEnabled;
2157 private void CheckEventNotify_CheckedChanged(object sender, EventArgs e)
2159 foreach (EventCheckboxTblElement tbl in GetEventCheckboxTable())
2161 tbl.CheckBox.Enabled = CheckEventNotify.Checked;
2165 //private void CheckForceEventNotify_CheckedChanged(object sender, EventArgs e)
2167 // _MyForceEventNotify = CheckEventNotify.Checked;
2170 //private void CheckFavEventUnread_CheckedChanged(object sender, EventArgs e)
2172 // _MyFavEventUnread = CheckFavEventUnread.Checked;
2175 //private void ComboBoxTranslateLanguage_SelectedIndexChanged(object sender, EventArgs e)
2177 // _MyTranslateLanguage = (new Google()).GetLanguageEnumFromIndex(ComboBoxTranslateLanguage.SelectedIndex);
2180 private void SoundFileListup()
2182 if (EventSoundFile == null) EventSoundFile = "";
2183 ComboBoxEventNotifySound.Items.Clear();
2184 ComboBoxEventNotifySound.Items.Add("");
2185 DirectoryInfo oDir = new DirectoryInfo(Application.StartupPath + Path.DirectorySeparatorChar);
2186 if (Directory.Exists(Path.Combine(Application.StartupPath, "Sounds")))
2188 oDir = oDir.GetDirectories("Sounds")[0];
2190 foreach (FileInfo oFile in oDir.GetFiles("*.wav"))
2192 ComboBoxEventNotifySound.Items.Add(oFile.Name);
2194 int idx = ComboBoxEventNotifySound.Items.IndexOf(EventSoundFile);
2195 if (idx == -1) idx = 0;
2196 ComboBoxEventNotifySound.SelectedIndex = idx;
2199 //private void ComboBoxEventNotifySound_VisibleChanged(object sender, EventArgs e)
2201 // SoundFileListup();
2204 //private void ComboBoxEventNotifySound_SelectedIndexChanged(object sender, EventArgs e)
2206 // if (_soundfileListup) return;
2208 // _MyEventSoundFile = (string)ComboBoxEventNotifySound.SelectedItem;
2211 private void UserAppointUrlText_Validating(object sender, CancelEventArgs e)
2213 if (!UserAppointUrlText.Text.StartsWith("http") && !string.IsNullOrEmpty(UserAppointUrlText.Text))
2215 MessageBox.Show("Text Error:正しいURLではありません");
2219 private void OpenUrl(string url)
2221 string myPath = url;
2222 string path = this.BrowserPathText.Text;
2225 if (!string.IsNullOrEmpty(BrowserPath))
2227 if (path.StartsWith("\"") && path.Length > 2 && path.IndexOf("\"", 2) > -1)
2229 int sep = path.IndexOf("\"", 2);
2230 string browserPath = path.Substring(1, sep - 1);
2232 if (sep < path.Length - 1)
2234 arg = path.Substring(sep + 1);
2236 myPath = arg + " " + myPath;
2237 System.Diagnostics.Process.Start(browserPath, myPath);
2241 System.Diagnostics.Process.Start(path, myPath);
2246 System.Diagnostics.Process.Start(myPath);
2251 // MessageBox.Show("ブラウザの起動に失敗、またはタイムアウトしました。" + ex.ToString());
2255 private void CreateAccountButton_Click(object sender, EventArgs e)
2257 this.OpenUrl("https://twitter.com/signup");
2260 private void CheckAutoConvertUrl_CheckedChanged(object sender, EventArgs e)
2262 ShortenTcoCheck.Enabled = CheckAutoConvertUrl.Checked;
2265 public AppendSettingDialog()
2267 InitializeComponent();
2269 this.Icon = Properties.Resources.MIcon;