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 StartupVersion = CheckStartupVersion.Checked;
394 StartupFollowers = CheckStartupFollowers.Checked;
395 RestrictFavCheck = CheckFavRestrict.Checked;
396 AlwaysTop = CheckAlwaysTop.Checked;
397 UrlConvertAuto = CheckAutoConvertUrl.Checked;
398 ShortenTco = ShortenTcoCheck.Checked;
399 OutputzEnabled = CheckOutputz.Checked;
400 OutputzKey = TextBoxOutputzKey.Text.Trim();
402 switch (ComboBoxOutputzUrlmode.SelectedIndex)
405 OutputzUrlmode = MyCommon.OutputzUrlmode.twittercom;
408 OutputzUrlmode = MyCommon.OutputzUrlmode.twittercomWithUsername;
412 Nicoms = CheckNicoms.Checked;
413 UseUnreadStyle = chkUnreadStyle.Checked;
414 DateTimeFormat = CmbDateTimeFormat.Text;
415 DefaultTimeOut = int.Parse(ConnectionTimeOut.Text);
416 RetweetNoConfirm = CheckRetweetNoConfirm.Checked;
417 LimitBalloon = CheckBalloonLimit.Checked;
418 EventNotifyEnabled = CheckEventNotify.Checked;
419 GetEventNotifyFlag(ref _MyEventNotifyFlag, ref _isMyEventNotifyFlag);
420 ForceEventNotify = CheckForceEventNotify.Checked;
421 FavEventUnread = CheckFavEventUnread.Checked;
422 TranslateLanguage = (new Bing()).GetLanguageEnumFromIndex(ComboBoxTranslateLanguage.SelectedIndex);
423 EventSoundFile = (string)ComboBoxEventNotifySound.SelectedItem;
424 AutoShortUrlFirst = (MyCommon.UrlConverter)ComboBoxAutoShortUrlFirst.SelectedIndex;
425 TabIconDisp = chkTabIconDisp.Checked;
426 ReadOwnPost = chkReadOwnPost.Checked;
427 GetFav = chkGetFav.Checked;
428 IsMonospace = CheckMonospace.Checked;
429 ReadOldPosts = CheckReadOldPosts.Checked;
430 UseSsl = CheckUseSsl.Checked;
431 BitlyUser = TextBitlyId.Text;
432 BitlyPwd = TextBitlyPw.Text;
433 ShowGrid = CheckShowGrid.Checked;
434 UseAtIdSupplement = CheckAtIdSupple.Checked;
435 UseHashSupplement = CheckHashSupple.Checked;
436 PreviewEnable = CheckPreviewEnable.Checked;
437 TwitterApiUrl = TwitterAPIText.Text.Trim();
438 switch (ReplyIconStateCombo.SelectedIndex)
441 ReplyIconState = MyCommon.REPLY_ICONSTATE.None;
444 ReplyIconState = MyCommon.REPLY_ICONSTATE.StaticIcon;
447 ReplyIconState = MyCommon.REPLY_ICONSTATE.BlinkIcon;
450 switch (LanguageCombo.SelectedIndex)
468 HotkeyEnabled = this.HotkeyCheck.Checked;
469 HotkeyMod = Keys.None;
470 if (this.HotkeyAlt.Checked) HotkeyMod = HotkeyMod | Keys.Alt;
471 if (this.HotkeyShift.Checked) HotkeyMod = HotkeyMod | Keys.Shift;
472 if (this.HotkeyCtrl.Checked) HotkeyMod = HotkeyMod | Keys.Control;
473 if (this.HotkeyWin.Checked) HotkeyMod = HotkeyMod | Keys.LWin;
474 int.TryParse(HotkeyCode.Text, out HotkeyValue);
475 HotkeyKey = (Keys)HotkeyText.Tag;
476 BlinkNewMentions = ChkNewMentionsBlink.Checked;
477 UseAdditionalCount = UseChangeGetCount.Checked;
478 MoreCountApi = int.Parse(GetMoreTextCountApi.Text);
479 FirstCountApi = int.Parse(FirstTextCountApi.Text);
480 SearchCountApi = int.Parse(SearchTextCountApi.Text);
481 FavoritesCountApi = int.Parse(FavoritesTextCountApi.Text);
482 UserTimelineCountApi = int.Parse(UserTimelineTextCountApi.Text);
483 ListCountApi = int.Parse(ListTextCountApi.Text);
484 OpenUserTimeline = CheckOpenUserTimeline.Checked;
485 ListDoubleClickAction = ListDoubleClickActionComboBox.SelectedIndex;
486 UserAppointUrl = UserAppointUrlText.Text;
487 this.HideDuplicatedRetweets = this.HideDuplicatedRetweetsCheck.Checked;
488 this.IsPreviewFoursquare = this.IsPreviewFoursquareCheckBox.Checked;
489 this.MapThumbnailProvider = (MapProvider)this.MapThumbnailProviderComboBox.SelectedIndex;
490 this.MapThumbnailHeight = int.Parse(this.MapThumbnailHeightTextBox.Text);
491 this.MapThumbnailWidth = int.Parse(this.MapThumbnailWidthTextBox.Text);
492 this.MapThumbnailZoom = int.Parse(this.MapThumbnailZoomTextBox.Text);
493 this.IsListStatusesIncludeRts = this.IsListsIncludeRtsCheckBox.Checked;
494 this.TabMouseLock = this.TabMouseLockCheck.Checked;
495 this.IsRemoveSameEvent = this.IsRemoveSameFavEventCheckBox.Checked;
496 this.IsNotifyUseGrowl = this.IsNotifyUseGrowlCheckBox.Checked;
500 MessageBox.Show(Properties.Resources.Save_ClickText3);
501 this.DialogResult = DialogResult.Cancel;
506 private void Setting_FormClosing(object sender, FormClosingEventArgs e)
508 if (MyCommon._endingFlag) return;
510 if (this.DialogResult == DialogResult.Cancel)
512 //キャンセル時は画面表示時のアカウントに戻す
513 //キャンセル時でも認証済みアカウント情報は保存する
514 this.UserAccounts.Clear();
515 foreach (object u in this.AuthUserCombo.Items)
517 this.UserAccounts.Add((UserAccount)u);
519 //アクティブユーザーを起動時のアカウントに戻す(起動時アカウントなければ何もしない)
520 bool userSet = false;
521 if (this.InitialUserId != null)
523 foreach (UserAccount u in this.UserAccounts)
525 if (u.UserId == this.InitialUserId)
527 tw.Initialize(u.Token, u.TokenSecret, u.Username, u.UserId);
533 //認証済みアカウントが削除されていた場合、もしくは起動時アカウントがなかった場合は、
538 tw.Initialize("", "", "", 0);
542 if (tw != null && string.IsNullOrEmpty(tw.Username) && e.CloseReason == CloseReason.None)
544 if (MessageBox.Show(Properties.Resources.Setting_FormClosing1, "Confirm", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
549 if (_ValidationError)
553 if (e.Cancel == false && TreeViewSetting.SelectedNode != null)
555 Panel curPanel = (Panel)TreeViewSetting.SelectedNode.Tag;
556 curPanel.Visible = false;
557 curPanel.Enabled = false;
561 private void Setting_Load(object sender, EventArgs e)
564 this.FollowCheckBox.Text = string.Format(this.FollowCheckBox.Text, ApplicationSettings.FeedbackTwitterName);
565 this.GroupBox2.Visible = true;
567 this.GroupBox2.Visible = false;
569 tw = ((TweenMain)this.Owner).TwitterInstance;
570 string uname = tw.Username;
571 string pw = tw.Password;
572 string tk = tw.AccessToken;
573 string tks = tw.AccessTokenSecret;
574 //this.AuthStateLabel.Enabled = true;
575 //this.AuthUserLabel.Enabled = true;
576 this.AuthClearButton.Enabled = true;
578 //if (tw.Username == "")
580 // //this.AuthStateLabel.Text = Properties.Resources.AuthorizeButton_Click4
581 // //this.AuthUserLabel.Text = ""
582 // //this.Save.Enabled = false
586 // //this.AuthStateLabel.Text = Properties.Resources.AuthorizeButton_Click3;
587 // //if (TwitterApiInfo.AccessLevel == ApiAccessLevel.ReadWrite)
589 // // this.AuthStateLabel.Text += "(xAuth)";
591 // //else if (TwitterApiInfo.AccessLevel == ApiAccessLevel.ReadWriteAndDirectMessage)
593 // // this.AuthStateLabel.Text += "(OAuth)";
595 // //this.AuthUserLabel.Text = tw.Username;
598 this.AuthUserCombo.Items.Clear();
599 if (this.UserAccounts.Count > 0)
601 this.AuthUserCombo.Items.AddRange(this.UserAccounts.ToArray());
602 foreach (UserAccount u in this.UserAccounts)
604 if (u.UserId == tw.UserId)
606 this.AuthUserCombo.SelectedItem = u;
607 this.InitialUserId = u.UserId;
613 this.StartupUserstreamCheck.Checked = UserstreamStartup;
614 UserstreamPeriod.Text = UserstreamPeriodInt.ToString();
615 TimelinePeriod.Text = TimelinePeriodInt.ToString();
616 ReplyPeriod.Text = ReplyPeriodInt.ToString();
617 DMPeriod.Text = DMPeriodInt.ToString();
618 PubSearchPeriod.Text = PubSearchPeriodInt.ToString();
619 ListsPeriod.Text = ListsPeriodInt.ToString();
620 UserTimelinePeriod.Text = UserTimelinePeriodInt.ToString();
622 StartupReaded.Checked = Readed;
625 case MyCommon.IconSizes.IconNone:
626 IconSize.SelectedIndex = 0;
628 case MyCommon.IconSizes.Icon16:
629 IconSize.SelectedIndex = 1;
631 case MyCommon.IconSizes.Icon24:
632 IconSize.SelectedIndex = 2;
634 case MyCommon.IconSizes.Icon48:
635 IconSize.SelectedIndex = 3;
637 case MyCommon.IconSizes.Icon48_2:
638 IconSize.SelectedIndex = 4;
641 StatusText.Text = Status;
642 UReadMng.Checked = UnreadManage;
643 if (UnreadManage == false)
645 StartupReaded.Enabled = false;
649 StartupReaded.Enabled = true;
651 PlaySnd.Checked = PlaySound;
652 OneWayLv.Checked = OneWayLove;
654 lblListFont.Font = FontReaded;
655 lblUnread.Font = FontUnread;
656 lblUnread.ForeColor = ColorUnread;
657 lblListFont.ForeColor = ColorReaded;
658 lblFav.ForeColor = ColorFav;
659 lblOWL.ForeColor = ColorOWL;
660 lblRetweet.ForeColor = ColorRetweet;
661 lblDetail.Font = FontDetail;
662 lblSelf.BackColor = ColorSelf;
663 lblAtSelf.BackColor = ColorAtSelf;
664 lblTarget.BackColor = ColorTarget;
665 lblAtTarget.BackColor = ColorAtTarget;
666 lblAtFromTarget.BackColor = ColorAtFromTarget;
667 lblAtTo.BackColor = ColorAtTo;
668 lblInputBackcolor.BackColor = ColorInputBackcolor;
669 lblInputFont.ForeColor = ColorInputFont;
670 lblInputFont.Font = FontInputFont;
671 lblListBackcolor.BackColor = ColorListBackcolor;
672 lblDetailBackcolor.BackColor = ColorDetailBackcolor;
673 lblDetail.ForeColor = ColorDetail;
674 lblDetailLink.ForeColor = ColorDetailLink;
678 case MyCommon.NameBalloonEnum.None:
679 cmbNameBalloon.SelectedIndex = 0;
681 case MyCommon.NameBalloonEnum.UserID:
682 cmbNameBalloon.SelectedIndex = 1;
684 case MyCommon.NameBalloonEnum.NickName:
685 cmbNameBalloon.SelectedIndex = 2;
691 ComboBoxPostKeySelect.SelectedIndex = 1;
693 else if (PostShiftEnter)
695 ComboBoxPostKeySelect.SelectedIndex = 2;
699 ComboBoxPostKeySelect.SelectedIndex = 0;
702 TextCountApi.Text = CountApi.ToString();
703 TextCountApiReply.Text = CountApiReply.ToString();
704 BrowserPathText.Text = BrowserPath;
705 CheckPostAndGet.Checked = PostAndGet;
706 CheckUseRecommendStatus.Checked = UseRecommendStatus;
707 CheckDispUsername.Checked = DispUsername;
708 CheckCloseToExit.Checked = CloseToExit;
709 CheckMinimizeToTray.Checked = MinimizeToTray;
710 switch (DispLatestPost)
712 case MyCommon.DispTitleEnum.None:
713 ComboDispTitle.SelectedIndex = 0;
715 case MyCommon.DispTitleEnum.Ver:
716 ComboDispTitle.SelectedIndex = 1;
718 case MyCommon.DispTitleEnum.Post:
719 ComboDispTitle.SelectedIndex = 2;
721 case MyCommon.DispTitleEnum.UnreadRepCount:
722 ComboDispTitle.SelectedIndex = 3;
724 case MyCommon.DispTitleEnum.UnreadAllCount:
725 ComboDispTitle.SelectedIndex = 4;
727 case MyCommon.DispTitleEnum.UnreadAllRepCount:
728 ComboDispTitle.SelectedIndex = 5;
730 case MyCommon.DispTitleEnum.UnreadCountAllCount:
731 ComboDispTitle.SelectedIndex = 6;
733 case MyCommon.DispTitleEnum.OwnStatus:
734 ComboDispTitle.SelectedIndex = 7;
737 CheckSortOrderLock.Checked = SortOrderLock;
738 CheckViewTabBottom.Checked = ViewTabBottom;
739 CheckTinyURL.Checked = TinyUrlResolve;
740 CheckForceResolve.Checked = ShortUrlForceResolve;
741 switch (_MyProxyType)
743 case HttpConnection.ProxyType.None:
744 RadioProxyNone.Checked = true;
746 case HttpConnection.ProxyType.IE:
747 RadioProxyIE.Checked = true;
750 RadioProxySpecified.Checked = true;
753 bool chk = RadioProxySpecified.Checked;
754 LabelProxyAddress.Enabled = chk;
755 TextProxyAddress.Enabled = chk;
756 LabelProxyPort.Enabled = chk;
757 TextProxyPort.Enabled = chk;
758 LabelProxyUser.Enabled = chk;
759 TextProxyUser.Enabled = chk;
760 LabelProxyPassword.Enabled = chk;
761 TextProxyPassword.Enabled = chk;
763 TextProxyAddress.Text = ProxyAddress;
764 TextProxyPort.Text = ProxyPort.ToString();
765 TextProxyUser.Text = ProxyUser;
766 TextProxyPassword.Text = ProxyPassword;
768 CheckStartupVersion.Checked = StartupVersion;
769 if (ApplicationSettings.VersionInfoUrl == null)
770 CheckStartupVersion.Enabled = false; // 更新チェック無効化
771 CheckStartupFollowers.Checked = StartupFollowers;
772 CheckFavRestrict.Checked = RestrictFavCheck;
773 CheckAlwaysTop.Checked = AlwaysTop;
774 CheckAutoConvertUrl.Checked = UrlConvertAuto;
775 ShortenTcoCheck.Checked = ShortenTco;
776 ShortenTcoCheck.Enabled = CheckAutoConvertUrl.Checked;
777 CheckOutputz.Checked = OutputzEnabled;
778 TextBoxOutputzKey.Text = OutputzKey;
780 switch (OutputzUrlmode)
782 case MyCommon.OutputzUrlmode.twittercom:
783 ComboBoxOutputzUrlmode.SelectedIndex = 0;
785 case MyCommon.OutputzUrlmode.twittercomWithUsername:
786 ComboBoxOutputzUrlmode.SelectedIndex = 1;
790 CheckNicoms.Checked = Nicoms;
791 chkUnreadStyle.Checked = UseUnreadStyle;
792 CmbDateTimeFormat.Text = DateTimeFormat;
793 ConnectionTimeOut.Text = DefaultTimeOut.ToString();
794 CheckRetweetNoConfirm.Checked = RetweetNoConfirm;
795 CheckBalloonLimit.Checked = LimitBalloon;
797 ApplyEventNotifyFlag(EventNotifyEnabled, EventNotifyFlag, IsMyEventNotifyFlag);
798 CheckForceEventNotify.Checked = ForceEventNotify;
799 CheckFavEventUnread.Checked = FavEventUnread;
800 ComboBoxTranslateLanguage.SelectedIndex = (new Bing()).GetIndexFromLanguageEnum(TranslateLanguage);
802 ComboBoxAutoShortUrlFirst.SelectedIndex = (int)AutoShortUrlFirst;
803 chkTabIconDisp.Checked = TabIconDisp;
804 chkReadOwnPost.Checked = ReadOwnPost;
805 chkGetFav.Checked = GetFav;
806 CheckMonospace.Checked = IsMonospace;
807 CheckReadOldPosts.Checked = ReadOldPosts;
808 CheckUseSsl.Checked = UseSsl;
809 TextBitlyId.Text = BitlyUser;
810 TextBitlyPw.Text = BitlyPwd;
811 TextBitlyId.Modified = false;
812 TextBitlyPw.Modified = false;
813 CheckShowGrid.Checked = ShowGrid;
814 CheckAtIdSupple.Checked = UseAtIdSupplement;
815 CheckHashSupple.Checked = UseHashSupplement;
816 CheckPreviewEnable.Checked = PreviewEnable;
817 TwitterAPIText.Text = TwitterApiUrl;
818 switch (ReplyIconState)
820 case MyCommon.REPLY_ICONSTATE.None:
821 ReplyIconStateCombo.SelectedIndex = 0;
823 case MyCommon.REPLY_ICONSTATE.StaticIcon:
824 ReplyIconStateCombo.SelectedIndex = 1;
826 case MyCommon.REPLY_ICONSTATE.BlinkIcon:
827 ReplyIconStateCombo.SelectedIndex = 2;
833 LanguageCombo.SelectedIndex = 0;
836 LanguageCombo.SelectedIndex = 1;
839 LanguageCombo.SelectedIndex = 2;
842 LanguageCombo.SelectedIndex = 3;
845 LanguageCombo.SelectedIndex = 0;
848 HotkeyCheck.Checked = HotkeyEnabled;
849 HotkeyAlt.Checked = ((HotkeyMod & Keys.Alt) == Keys.Alt);
850 HotkeyCtrl.Checked = ((HotkeyMod & Keys.Control) == Keys.Control);
851 HotkeyShift.Checked = ((HotkeyMod & Keys.Shift) == Keys.Shift);
852 HotkeyWin.Checked = ((HotkeyMod & Keys.LWin) == Keys.LWin);
853 HotkeyCode.Text = HotkeyValue.ToString();
854 HotkeyText.Text = HotkeyKey.ToString();
855 HotkeyText.Tag = HotkeyKey;
856 HotkeyAlt.Enabled = HotkeyEnabled;
857 HotkeyShift.Enabled = HotkeyEnabled;
858 HotkeyCtrl.Enabled = HotkeyEnabled;
859 HotkeyWin.Enabled = HotkeyEnabled;
860 HotkeyText.Enabled = HotkeyEnabled;
861 HotkeyCode.Enabled = HotkeyEnabled;
862 ChkNewMentionsBlink.Checked = BlinkNewMentions;
864 CheckOutputz_CheckedChanged(sender, e);
866 GetMoreTextCountApi.Text = MoreCountApi.ToString();
867 FirstTextCountApi.Text = FirstCountApi.ToString();
868 SearchTextCountApi.Text = SearchCountApi.ToString();
869 FavoritesTextCountApi.Text = FavoritesCountApi.ToString();
870 UserTimelineTextCountApi.Text = UserTimelineCountApi.ToString();
871 ListTextCountApi.Text = ListCountApi.ToString();
872 UseChangeGetCount.Checked = UseAdditionalCount;
873 Label28.Enabled = UseChangeGetCount.Checked;
874 Label30.Enabled = UseChangeGetCount.Checked;
875 Label53.Enabled = UseChangeGetCount.Checked;
876 Label66.Enabled = UseChangeGetCount.Checked;
877 Label17.Enabled = UseChangeGetCount.Checked;
878 Label25.Enabled = UseChangeGetCount.Checked;
879 GetMoreTextCountApi.Enabled = UseChangeGetCount.Checked;
880 FirstTextCountApi.Enabled = UseChangeGetCount.Checked;
881 SearchTextCountApi.Enabled = UseChangeGetCount.Checked;
882 FavoritesTextCountApi.Enabled = UseChangeGetCount.Checked;
883 UserTimelineTextCountApi.Enabled = UseChangeGetCount.Checked;
884 ListTextCountApi.Enabled = UseChangeGetCount.Checked;
885 CheckOpenUserTimeline.Checked = OpenUserTimeline;
886 ListDoubleClickActionComboBox.SelectedIndex = ListDoubleClickAction;
887 UserAppointUrlText.Text = UserAppointUrl;
888 this.HideDuplicatedRetweetsCheck.Checked = this.HideDuplicatedRetweets;
889 this.IsPreviewFoursquareCheckBox.Checked = this.IsPreviewFoursquare;
890 this.MapThumbnailProviderComboBox.SelectedIndex = (int)this.MapThumbnailProvider;
891 this.MapThumbnailHeightTextBox.Text = this.MapThumbnailHeight.ToString();
892 this.MapThumbnailWidthTextBox.Text = this.MapThumbnailWidth.ToString();
893 this.MapThumbnailZoomTextBox.Text = this.MapThumbnailZoom.ToString();
894 this.IsListsIncludeRtsCheckBox.Checked = this.IsListStatusesIncludeRts;
895 this.TabMouseLockCheck.Checked = this.TabMouseLock;
896 this.IsRemoveSameFavEventCheckBox.Checked = this.IsRemoveSameEvent;
897 this.IsNotifyUseGrowlCheckBox.Checked = this.IsNotifyUseGrowl;
899 if (GrowlHelper.IsDllExists)
901 IsNotifyUseGrowlCheckBox.Enabled = true;
905 IsNotifyUseGrowlCheckBox.Enabled = false;
908 this.TreeViewSetting.Nodes["BasedNode"].Tag = BasedPanel;
909 this.TreeViewSetting.Nodes["BasedNode"].Nodes["PeriodNode"].Tag = GetPeriodPanel;
910 this.TreeViewSetting.Nodes["BasedNode"].Nodes["StartUpNode"].Tag = StartupPanel;
911 this.TreeViewSetting.Nodes["BasedNode"].Nodes["GetCountNode"].Tag = GetCountPanel;
912 //this.TreeViewSetting.Nodes["BasedNode"].Nodes["UserStreamNode"].Tag = UserStreamPanel;
913 this.TreeViewSetting.Nodes["ActionNode"].Tag = ActionPanel;
914 this.TreeViewSetting.Nodes["ActionNode"].Nodes["TweetActNode"].Tag = TweetActPanel;
915 this.TreeViewSetting.Nodes["PreviewNode"].Tag = PreviewPanel;
916 this.TreeViewSetting.Nodes["PreviewNode"].Nodes["TweetPrvNode"].Tag = TweetPrvPanel;
917 this.TreeViewSetting.Nodes["PreviewNode"].Nodes["NotifyNode"].Tag = NotifyPanel;
918 this.TreeViewSetting.Nodes["FontNode"].Tag = FontPanel;
919 this.TreeViewSetting.Nodes["FontNode"].Nodes["FontNode2"].Tag = FontPanel2;
920 this.TreeViewSetting.Nodes["ConnectionNode"].Tag = ConnectionPanel;
921 this.TreeViewSetting.Nodes["ConnectionNode"].Nodes["ProxyNode"].Tag = ProxyPanel;
922 this.TreeViewSetting.Nodes["ConnectionNode"].Nodes["CooperateNode"].Tag = CooperatePanel;
923 this.TreeViewSetting.Nodes["ConnectionNode"].Nodes["ShortUrlNode"].Tag = ShortUrlPanel;
925 this.TreeViewSetting.SelectedNode = this.TreeViewSetting.Nodes[0];
926 this.TreeViewSetting.ExpandAll();
928 //TreeViewSetting.SelectedNode = TreeViewSetting.TopNode;
929 ActiveControl = StartAuthButton;
932 private void UserstreamPeriod_Validating(object sender, CancelEventArgs e)
937 prd = int.Parse(UserstreamPeriod.Text);
941 MessageBox.Show(Properties.Resources.UserstreamPeriod_ValidatingText1);
946 if (prd < 0 || prd > 60)
948 MessageBox.Show(Properties.Resources.UserstreamPeriod_ValidatingText1);
954 private void TimelinePeriod_Validating(object sender, CancelEventArgs e)
959 prd = int.Parse(TimelinePeriod.Text);
963 MessageBox.Show(Properties.Resources.TimelinePeriod_ValidatingText1);
968 if (prd != 0 && (prd < 15 || prd > 6000))
970 MessageBox.Show(Properties.Resources.TimelinePeriod_ValidatingText2);
976 private void ReplyPeriod_Validating(object sender, CancelEventArgs e)
981 prd = int.Parse(ReplyPeriod.Text);
985 MessageBox.Show(Properties.Resources.TimelinePeriod_ValidatingText1);
990 if (prd != 0 && (prd < 15 || prd > 6000))
992 MessageBox.Show(Properties.Resources.TimelinePeriod_ValidatingText2);
998 private void DMPeriod_Validating(object sender, CancelEventArgs e)
1003 prd = int.Parse(DMPeriod.Text);
1007 MessageBox.Show(Properties.Resources.DMPeriod_ValidatingText1);
1012 if (prd != 0 && (prd < 15 || prd > 6000))
1014 MessageBox.Show(Properties.Resources.DMPeriod_ValidatingText2);
1020 private void PubSearchPeriod_Validating(object sender, CancelEventArgs e)
1025 prd = int.Parse(PubSearchPeriod.Text);
1029 MessageBox.Show(Properties.Resources.PubSearchPeriod_ValidatingText1);
1034 if (prd != 0 && (prd < 30 || prd > 6000))
1036 MessageBox.Show(Properties.Resources.PubSearchPeriod_ValidatingText2);
1041 private void ListsPeriod_Validating(object sender, CancelEventArgs e)
1046 prd = int.Parse(ListsPeriod.Text);
1050 MessageBox.Show(Properties.Resources.DMPeriod_ValidatingText1);
1055 if (prd != 0 && (prd < 15 || prd > 6000))
1057 MessageBox.Show(Properties.Resources.DMPeriod_ValidatingText2);
1063 private void UserTimeline_Validating(object sender, CancelEventArgs e)
1068 prd = int.Parse(UserTimelinePeriod.Text);
1072 MessageBox.Show(Properties.Resources.DMPeriod_ValidatingText1);
1077 if (prd != 0 && (prd < 15 || prd > 6000))
1079 MessageBox.Show(Properties.Resources.DMPeriod_ValidatingText2);
1085 private void UReadMng_CheckedChanged(object sender, EventArgs e)
1087 if (UReadMng.Checked == true)
1089 StartupReaded.Enabled = true;
1093 StartupReaded.Enabled = false;
1097 private void btnFontAndColor_Click(object sender, EventArgs e) // Handles btnUnread.Click, btnDetail.Click, btnListFont.Click, btnInputFont.Click
1099 Button Btn = (Button) sender;
1102 FontDialog1.AllowVerticalFonts = false;
1103 FontDialog1.AllowScriptChange = true;
1104 FontDialog1.AllowSimulations = true;
1105 FontDialog1.AllowVectorFonts = true;
1106 FontDialog1.FixedPitchOnly = false;
1107 FontDialog1.FontMustExist = true;
1108 FontDialog1.ScriptsOnly = false;
1109 FontDialog1.ShowApply = false;
1110 FontDialog1.ShowEffects = true;
1111 FontDialog1.ShowColor = true;
1116 FontDialog1.Color = lblUnread.ForeColor;
1117 FontDialog1.Font = lblUnread.Font;
1120 FontDialog1.Color = lblDetail.ForeColor;
1121 FontDialog1.Font = lblDetail.Font;
1124 FontDialog1.Color = lblListFont.ForeColor;
1125 FontDialog1.Font = lblListFont.Font;
1127 case "btnInputFont":
1128 FontDialog1.Color = lblInputFont.ForeColor;
1129 FontDialog1.Font = lblInputFont.Font;
1135 rtn = FontDialog1.ShowDialog();
1137 catch(ArgumentException ex)
1139 MessageBox.Show(ex.Message);
1143 if (rtn == DialogResult.Cancel) return;
1148 lblUnread.ForeColor = FontDialog1.Color;
1149 lblUnread.Font = FontDialog1.Font;
1152 lblDetail.ForeColor = FontDialog1.Color;
1153 lblDetail.Font = FontDialog1.Font;
1156 lblListFont.ForeColor = FontDialog1.Color;
1157 lblListFont.Font = FontDialog1.Font;
1159 case "btnInputFont":
1160 lblInputFont.ForeColor = FontDialog1.Color;
1161 lblInputFont.Font = FontDialog1.Font;
1167 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
1169 Button Btn = (Button)sender;
1172 ColorDialog1.AllowFullOpen = true;
1173 ColorDialog1.AnyColor = true;
1174 ColorDialog1.FullOpen = false;
1175 ColorDialog1.SolidColorOnly = false;
1180 ColorDialog1.Color = lblSelf.BackColor;
1183 ColorDialog1.Color = lblAtSelf.BackColor;
1186 ColorDialog1.Color = lblTarget.BackColor;
1189 ColorDialog1.Color = lblAtTarget.BackColor;
1191 case "btnAtFromTarget":
1192 ColorDialog1.Color = lblAtFromTarget.BackColor;
1195 ColorDialog1.Color = lblFav.ForeColor;
1198 ColorDialog1.Color = lblOWL.ForeColor;
1201 ColorDialog1.Color = lblRetweet.ForeColor;
1203 case "btnInputBackcolor":
1204 ColorDialog1.Color = lblInputBackcolor.BackColor;
1207 ColorDialog1.Color = lblAtTo.BackColor;
1210 ColorDialog1.Color = lblListBackcolor.BackColor;
1212 case "btnDetailBack":
1213 ColorDialog1.Color = lblDetailBackcolor.BackColor;
1215 case "btnDetailLink":
1216 ColorDialog1.Color = lblDetailLink.ForeColor;
1220 rtn = ColorDialog1.ShowDialog();
1222 if (rtn == DialogResult.Cancel) return;
1227 lblSelf.BackColor = ColorDialog1.Color;
1230 lblAtSelf.BackColor = ColorDialog1.Color;
1233 lblTarget.BackColor = ColorDialog1.Color;
1236 lblAtTarget.BackColor = ColorDialog1.Color;
1238 case "btnAtFromTarget":
1239 lblAtFromTarget.BackColor = ColorDialog1.Color;
1242 lblFav.ForeColor = ColorDialog1.Color;
1245 lblOWL.ForeColor = ColorDialog1.Color;
1248 lblRetweet.ForeColor = ColorDialog1.Color;
1250 case "btnInputBackcolor":
1251 lblInputBackcolor.BackColor = ColorDialog1.Color;
1254 lblAtTo.BackColor = ColorDialog1.Color;
1257 lblListBackcolor.BackColor = ColorDialog1.Color;
1259 case "btnDetailBack":
1260 lblDetailBackcolor.BackColor = ColorDialog1.Color;
1262 case "btnDetailLink":
1263 lblDetailLink.ForeColor = ColorDialog1.Color;
1268 public int UserstreamPeriodInt { get; set; }
1269 public bool UserstreamStartup { get; set; }
1270 public int TimelinePeriodInt { get; set; }
1271 public int ReplyPeriodInt { get; set; }
1272 public int DMPeriodInt { get; set; }
1273 public int PubSearchPeriodInt { get; set; }
1274 public int ListsPeriodInt { get; set; }
1275 public int UserTimelinePeriodInt { get; set; }
1276 public bool Readed { get; set; }
1277 public MyCommon.IconSizes IconSz { get; set; }
1278 public string Status { get; set; }
1279 public bool UnreadManage { get; set; }
1280 public bool PlaySound { get; set; }
1281 public bool OneWayLove { get; set; }
1282 public Font FontUnread { get; set; } /////未使用
1283 public Color ColorUnread { get; set; }
1284 public Font FontReaded { get; set; } /////リストフォントとして使用
1285 public Color ColorReaded { get; set; }
1286 public Color ColorFav { get; set; }
1287 public Color ColorOWL { get; set; }
1288 public Color ColorRetweet { get; set; }
1289 public Font FontDetail { get; set; }
1290 public Color ColorDetail { get; set; }
1291 public Color ColorDetailLink { get; set; }
1292 public Color ColorSelf { get; set; }
1293 public Color ColorAtSelf { get; set; }
1294 public Color ColorTarget { get; set; }
1295 public Color ColorAtTarget { get; set; }
1296 public Color ColorAtFromTarget { get; set; }
1297 public Color ColorAtTo { get; set; }
1298 public Color ColorInputBackcolor { get; set; }
1299 public Color ColorInputFont { get; set; }
1300 public Font FontInputFont { get; set; }
1301 public Color ColorListBackcolor { get; set; }
1302 public Color ColorDetailBackcolor { get; set; }
1303 public MyCommon.NameBalloonEnum NameBalloon { get; set; }
1304 public bool PostCtrlEnter { get; set; }
1305 public bool PostShiftEnter { get; set; }
1306 public int CountApi { get; set; }
1307 public int CountApiReply { get; set; }
1308 public int MoreCountApi { get; set; }
1309 public int FirstCountApi { get; set; }
1310 public int SearchCountApi { get; set; }
1311 public int FavoritesCountApi { get; set; }
1312 public int UserTimelineCountApi { get; set; }
1313 public int ListCountApi { get; set; }
1314 public bool PostAndGet { get; set; }
1315 public bool UseRecommendStatus { get; set; }
1316 public string RecommendStatusText { get; set; }
1317 public bool DispUsername { get; set; }
1318 public bool CloseToExit { get; set; }
1319 public bool MinimizeToTray { get; set; }
1320 public MyCommon.DispTitleEnum DispLatestPost { get; set; }
1321 public string BrowserPath { get; set; }
1322 public bool TinyUrlResolve { get; set; }
1323 public bool ShortUrlForceResolve { get; set; }
1325 private void CheckUseRecommendStatus_CheckedChanged(object sender, EventArgs e)
1327 if (CheckUseRecommendStatus.Checked == true)
1329 StatusText.Enabled = false;
1333 StatusText.Enabled = true;
1337 public bool SortOrderLock { get; set; }
1338 public HttpConnection.ProxyType SelectedProxyType
1341 return _MyProxyType;
1344 _MyProxyType = value;
1348 /// タブを下部に表示するかどうかを取得または設定する
1350 public bool ViewTabBottom { get; set; }
1352 public string ProxyAddress { get; set; }
1353 public int ProxyPort { get; set; }
1354 public string ProxyUser { get; set; }
1355 public string ProxyPassword { get; set; }
1356 public bool StartupVersion { get; set; }
1357 public bool StartupFollowers { get; set; }
1358 public bool RestrictFavCheck { get; set; }
1359 public bool AlwaysTop { get; set; }
1360 public bool UrlConvertAuto { get; set; }
1361 public bool ShortenTco { get; set; }
1362 public bool OutputzEnabled { get; set; }
1363 public string OutputzKey { get; set; }
1364 public MyCommon.OutputzUrlmode OutputzUrlmode { get; set; }
1365 public bool Nicoms { get; set; }
1366 public MyCommon.UrlConverter AutoShortUrlFirst { get; set; }
1367 public bool UseUnreadStyle { get; set; }
1368 public string DateTimeFormat { get; set; }
1369 public int DefaultTimeOut { get; set; }
1370 public bool RetweetNoConfirm { get; set; }
1371 public bool TabIconDisp { get; set; }
1372 public MyCommon.REPLY_ICONSTATE ReplyIconState { get; set; }
1373 public bool ReadOwnPost { get; set; }
1374 public bool GetFav { get; set; }
1375 public bool IsMonospace { get; set; }
1376 public bool ReadOldPosts { get; set; }
1377 public bool UseSsl { get; set; }
1378 public string BitlyUser { get; set; }
1379 public string BitlyPwd { get; set; }
1380 public bool ShowGrid { get; set; }
1381 public bool UseAtIdSupplement { get; set; }
1382 public bool UseHashSupplement { get; set; }
1383 public bool PreviewEnable { get; set; }
1384 public bool UseAdditionalCount { get; set; }
1385 public bool OpenUserTimeline { get; set; }
1386 public string TwitterApiUrl { get; set; }
1387 public string Language { get; set; }
1389 private void Button3_Click(object sender, EventArgs e)
1391 using (OpenFileDialog filedlg = new OpenFileDialog())
1393 filedlg.Filter = Properties.Resources.Button3_ClickText1;
1394 filedlg.FilterIndex = 1;
1395 filedlg.Title = Properties.Resources.Button3_ClickText2;
1396 filedlg.RestoreDirectory = true;
1398 if (filedlg.ShowDialog() == DialogResult.OK)
1400 BrowserPathText.Text = filedlg.FileName;
1405 private void RadioProxySpecified_CheckedChanged(object sender, EventArgs e)
1407 bool chk = RadioProxySpecified.Checked;
1408 LabelProxyAddress.Enabled = chk;
1409 TextProxyAddress.Enabled = chk;
1410 LabelProxyPort.Enabled = chk;
1411 TextProxyPort.Enabled = chk;
1412 LabelProxyUser.Enabled = chk;
1413 TextProxyUser.Enabled = chk;
1414 LabelProxyPassword.Enabled = chk;
1415 TextProxyPassword.Enabled = chk;
1418 private void TextProxyPort_Validating(object sender, CancelEventArgs e)
1421 if (string.IsNullOrWhiteSpace(TextProxyPort.Text)) TextProxyPort.Text = "0";
1422 if (int.TryParse(TextProxyPort.Text.Trim(), out port) == false)
1424 MessageBox.Show(Properties.Resources.TextProxyPort_ValidatingText1);
1428 if (port < 0 || port > 65535)
1430 MessageBox.Show(Properties.Resources.TextProxyPort_ValidatingText2);
1436 private void CheckOutputz_CheckedChanged(object sender, EventArgs e)
1438 if (CheckOutputz.Checked == true)
1440 Label59.Enabled = true;
1441 Label60.Enabled = true;
1442 TextBoxOutputzKey.Enabled = true;
1443 ComboBoxOutputzUrlmode.Enabled = true;
1447 Label59.Enabled = false;
1448 Label60.Enabled = false;
1449 TextBoxOutputzKey.Enabled = false;
1450 ComboBoxOutputzUrlmode.Enabled = false;
1454 private void TextBoxOutputzKey_Validating(object sender, CancelEventArgs e)
1456 if (CheckOutputz.Checked)
1458 TextBoxOutputzKey.Text = TextBoxOutputzKey.Text.Trim();
1459 if (TextBoxOutputzKey.Text.Length == 0)
1461 MessageBox.Show(Properties.Resources.TextBoxOutputzKey_Validating);
1468 private bool CreateDateTimeFormatSample()
1472 LabelDateTimeFormatApplied.Text = DateTime.Now.ToString(CmbDateTimeFormat.Text);
1474 catch(FormatException)
1476 LabelDateTimeFormatApplied.Text = Properties.Resources.CreateDateTimeFormatSampleText1;
1482 private void CmbDateTimeFormat_TextUpdate(object sender, EventArgs e)
1484 CreateDateTimeFormatSample();
1487 private void CmbDateTimeFormat_SelectedIndexChanged(object sender, EventArgs e)
1489 CreateDateTimeFormatSample();
1492 private void CmbDateTimeFormat_Validating(object sender, CancelEventArgs e)
1494 if (!CreateDateTimeFormatSample())
1496 MessageBox.Show(Properties.Resources.CmbDateTimeFormat_Validating);
1501 private void ConnectionTimeOut_Validating(object sender, CancelEventArgs e)
1506 tm = int.Parse(ConnectionTimeOut.Text);
1510 MessageBox.Show(Properties.Resources.ConnectionTimeOut_ValidatingText1);
1515 if (tm < (int)MyCommon.HttpTimeOut.MinValue || tm > (int)MyCommon.HttpTimeOut.MaxValue)
1517 MessageBox.Show(Properties.Resources.ConnectionTimeOut_ValidatingText1);
1522 private void LabelDateTimeFormatApplied_VisibleChanged(object sender, EventArgs e)
1524 CreateDateTimeFormatSample();
1527 private void TextCountApi_Validating(object sender, CancelEventArgs e)
1532 cnt = int.Parse(TextCountApi.Text);
1536 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1541 if (cnt < 20 || cnt > 200)
1543 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1549 private void TextCountApiReply_Validating(object sender, CancelEventArgs e)
1554 cnt = int.Parse(TextCountApiReply.Text);
1558 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1563 if (cnt < 20 || cnt > 200)
1565 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1571 public bool LimitBalloon { get; set; }
1572 public bool EventNotifyEnabled { get; set; }
1574 public MyCommon.EVENTTYPE EventNotifyFlag
1578 return _MyEventNotifyFlag;
1582 _MyEventNotifyFlag = value;
1586 public MyCommon.EVENTTYPE IsMyEventNotifyFlag
1590 return _isMyEventNotifyFlag;
1594 _isMyEventNotifyFlag = value;
1598 public bool ForceEventNotify { get; set; }
1599 public bool FavEventUnread { get; set; }
1601 public string TranslateLanguage
1605 return _MyTranslateLanguage;
1609 _MyTranslateLanguage = value;
1610 ComboBoxTranslateLanguage.SelectedIndex = (new Bing()).GetIndexFromLanguageEnum(value);
1614 public string EventSoundFile { get; set; }
1615 public int ListDoubleClickAction { get; set; }
1616 public string UserAppointUrl { get; set; }
1618 private void ComboBoxAutoShortUrlFirst_SelectedIndexChanged(object sender, EventArgs e)
1620 if (ComboBoxAutoShortUrlFirst.SelectedIndex == (int)MyCommon.UrlConverter.Bitly ||
1621 ComboBoxAutoShortUrlFirst.SelectedIndex == (int)MyCommon.UrlConverter.Jmp)
1623 Label76.Enabled = true;
1624 Label77.Enabled = true;
1625 TextBitlyId.Enabled = true;
1626 TextBitlyPw.Enabled = true;
1630 Label76.Enabled = false;
1631 Label77.Enabled = false;
1632 TextBitlyId.Enabled = false;
1633 TextBitlyPw.Enabled = false;
1637 private void ButtonBackToDefaultFontColor_Click(object sender, EventArgs e) //Handles ButtonBackToDefaultFontColor.Click, ButtonBackToDefaultFontColor2.Click
1639 lblUnread.ForeColor = SystemColors.ControlText;
1640 lblUnread.Font = new Font(SystemFonts.DefaultFont, FontStyle.Bold | FontStyle.Underline);
1642 lblListFont.ForeColor = System.Drawing.SystemColors.ControlText;
1643 lblListFont.Font = System.Drawing.SystemFonts.DefaultFont;
1645 lblDetail.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.ControlText);
1646 lblDetail.Font = System.Drawing.SystemFonts.DefaultFont;
1648 lblInputFont.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.ControlText);
1649 lblInputFont.Font = System.Drawing.SystemFonts.DefaultFont;
1651 lblSelf.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.AliceBlue);
1653 lblAtSelf.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.AntiqueWhite);
1655 lblTarget.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.LemonChiffon);
1657 lblAtTarget.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.LavenderBlush);
1659 lblAtFromTarget.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Honeydew);
1661 lblFav.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.Red);
1663 lblOWL.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.Blue);
1665 lblInputBackcolor.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.LemonChiffon);
1667 lblAtTo.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Pink);
1669 lblListBackcolor.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Window);
1671 lblDetailBackcolor.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Window);
1673 lblDetailLink.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.Blue);
1675 lblRetweet.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.Green);
1678 private bool StartAuth()
1681 HttpConnection.ProxyType ptype;
1682 if (RadioProxyNone.Checked)
1684 ptype = HttpConnection.ProxyType.None;
1686 else if (RadioProxyIE.Checked)
1688 ptype = HttpConnection.ProxyType.IE;
1692 ptype = HttpConnection.ProxyType.Specified;
1694 string padr = TextProxyAddress.Text.Trim();
1695 int pport = int.Parse(TextProxyPort.Text.Trim());
1696 string pusr = TextProxyUser.Text.Trim();
1697 string ppw = TextProxyPassword.Text.Trim();
1700 HttpConnection.InitializeConnection(20, ptype, padr, pport, pusr, ppw);
1701 HttpTwitter.TwitterUrl = TwitterAPIText.Text.Trim();
1702 tw.Initialize("", "", "", 0);
1703 //this.AuthStateLabel.Text = Properties.Resources.AuthorizeButton_Click4;
1704 //this.AuthUserLabel.Text = "";
1705 string pinPageUrl = "";
1706 string rslt = tw.StartAuthentication(ref pinPageUrl);
1707 if (string.IsNullOrEmpty(rslt))
1709 string pin = AuthDialog.DoAuth(this, pinPageUrl);
1710 if (!string.IsNullOrEmpty(pin))
1722 MessageBox.Show(Properties.Resources.AuthorizeButton_Click2 + Environment.NewLine + rslt, "Authenticate", MessageBoxButtons.OK);
1727 private bool PinAuth()
1729 string pin = this._pin; //PIN Code
1731 string rslt = tw.Authenticate(pin);
1732 if (string.IsNullOrEmpty(rslt))
1734 MessageBox.Show(Properties.Resources.AuthorizeButton_Click1, "Authenticate", MessageBoxButtons.OK);
1735 //this.AuthStateLabel.Text = Properties.Resources.AuthorizeButton_Click3;
1736 //this.AuthUserLabel.Text = tw.Username;
1738 UserAccount user = new UserAccount();
1739 user.Username = tw.Username;
1740 user.UserId = tw.UserId;
1741 user.Token = tw.AccessToken;
1742 user.TokenSecret = tw.AccessTokenSecret;
1744 foreach (object u in this.AuthUserCombo.Items)
1746 if (((UserAccount)u).Username.ToLower() == tw.Username.ToLower())
1748 idx = this.AuthUserCombo.Items.IndexOf(u);
1754 this.AuthUserCombo.Items.RemoveAt(idx);
1755 this.AuthUserCombo.Items.Insert(idx, user);
1756 this.AuthUserCombo.SelectedIndex = idx;
1760 this.AuthUserCombo.SelectedIndex = this.AuthUserCombo.Items.Add(user);
1762 //if (TwitterApiInfo.AccessLevel = ApiAccessLevel.ReadWrite)
1764 // this.AuthStateLabel.Text += "(xAuth)";
1766 //else if (TwitterApiInfo.AccessLevel == ApiAccessLevel.ReadWriteAndDirectMessage)
1768 // this.AuthStateLabel.Text += "(OAuth)";
1774 MessageBox.Show(Properties.Resources.AuthorizeButton_Click2 + Environment.NewLine + rslt, "Authenticate", MessageBoxButtons.OK);
1775 //this.AuthStateLabel.Text = Properties.Resources.AuthorizeButton_Click4;
1776 //this.AuthUserLabel.Text = "";
1781 private void StartAuthButton_Click(object sender, EventArgs e)
1783 //this.Save.Enabled = false;
1788 //this.Save.Enabled = true;
1793 private void AuthClearButton_Click(object sender, EventArgs e)
1795 //tw.ClearAuthInfo();
1796 //this.AuthStateLabel.Text = Properties.Resources.AuthorizeButton_Click4;
1797 //this.AuthUserLabel.Text = "";
1798 if (this.AuthUserCombo.SelectedIndex > -1)
1800 this.AuthUserCombo.Items.RemoveAt(this.AuthUserCombo.SelectedIndex);
1801 if (this.AuthUserCombo.Items.Count > 0)
1803 this.AuthUserCombo.SelectedIndex = 0;
1807 this.AuthUserCombo.SelectedIndex = -1;
1810 //this.Save.Enabled = false;
1813 private void CheckPostAndGet_CheckedChanged(object sender, EventArgs e)
1815 LabelPostAndGet.Visible = CheckPostAndGet.Checked && !tw.UserStreamEnabled;
1818 private void Setting_Shown(object sender, EventArgs e)
1823 if (this.Disposing || this.IsDisposed) return;
1824 } while (!this.IsHandleCreated);
1825 this.TopMost = this.AlwaysTop;
1827 LabelPostAndGet.Visible = CheckPostAndGet.Checked && !tw.UserStreamEnabled;
1828 LabelUserStreamActive.Visible = tw.UserStreamEnabled;
1831 public static AppendSettingDialog Instance
1833 get { return _instance; }
1836 private bool BitlyValidation(string id, string apikey)
1838 if (string.IsNullOrEmpty(id) || string.IsNullOrEmpty(apikey))
1843 string req = "http://api.bit.ly/v3/validate";
1844 string content = "";
1845 Dictionary<string, string> param = new Dictionary<string, string>();
1847 param.Add("login", ApplicationSettings.BitlyLoginId);
1848 param.Add("apiKey", ApplicationSettings.BitlyApiKey);
1849 param.Add("x_login", id);
1850 param.Add("x_apiKey", apikey);
1851 param.Add("format", "txt");
1853 if (!(new HttpVarious()).PostData(req, param, out content))
1855 return true; // 通信エラーの場合はとりあえずチェックを通ったことにする
1857 else if (content.Trim() == "1")
1859 return true; // 検証成功
1861 else if (content.Trim() == "0")
1863 return false; // 検証失敗 APIキーとIDの組み合わせが違う
1867 return true; // 規定外応答:通信エラーの可能性があるためとりあえずチェックを通ったことにする
1871 private void Cancel_Click(object sender, EventArgs e)
1873 _ValidationError = false;
1876 public bool HotkeyEnabled;
1877 public Keys HotkeyKey;
1878 public int HotkeyValue;
1879 public Keys HotkeyMod;
1881 private void HotkeyText_KeyDown(object sender, KeyEventArgs e)
1885 HotkeyText.Text = e.KeyCode.ToString();
1886 HotkeyCode.Text = e.KeyValue.ToString();
1887 HotkeyText.Tag = e.KeyCode;
1889 e.SuppressKeyPress = true;
1892 private void HotkeyCheck_CheckedChanged(object sender, EventArgs e)
1894 HotkeyCtrl.Enabled = HotkeyCheck.Checked;
1895 HotkeyAlt.Enabled = HotkeyCheck.Checked;
1896 HotkeyShift.Enabled = HotkeyCheck.Checked;
1897 HotkeyWin.Enabled = HotkeyCheck.Checked;
1898 HotkeyText.Enabled = HotkeyCheck.Checked;
1899 HotkeyCode.Enabled = HotkeyCheck.Checked;
1902 public bool BlinkNewMentions;
1904 private void GetMoreTextCountApi_Validating(object sender, CancelEventArgs e)
1909 cnt = int.Parse(GetMoreTextCountApi.Text);
1913 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1918 if (cnt != 0 && (cnt < 20 || cnt > 200))
1920 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1926 private void UseChangeGetCount_CheckedChanged(object sender, EventArgs e)
1928 GetMoreTextCountApi.Enabled = UseChangeGetCount.Checked;
1929 FirstTextCountApi.Enabled = UseChangeGetCount.Checked;
1930 Label28.Enabled = UseChangeGetCount.Checked;
1931 Label30.Enabled = UseChangeGetCount.Checked;
1932 Label53.Enabled = UseChangeGetCount.Checked;
1933 Label66.Enabled = UseChangeGetCount.Checked;
1934 Label17.Enabled = UseChangeGetCount.Checked;
1935 Label25.Enabled = UseChangeGetCount.Checked;
1936 SearchTextCountApi.Enabled = UseChangeGetCount.Checked;
1937 FavoritesTextCountApi.Enabled = UseChangeGetCount.Checked;
1938 UserTimelineTextCountApi.Enabled = UseChangeGetCount.Checked;
1939 ListTextCountApi.Enabled = UseChangeGetCount.Checked;
1942 private void FirstTextCountApi_Validating(object sender, CancelEventArgs e)
1947 cnt = int.Parse(FirstTextCountApi.Text);
1951 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1956 if (cnt != 0 && (cnt < 20 || cnt > 200))
1958 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
1964 private void SearchTextCountApi_Validating(object sender, CancelEventArgs e)
1969 cnt = int.Parse(SearchTextCountApi.Text);
1973 MessageBox.Show(Properties.Resources.TextSearchCountApi_Validating1);
1978 if (cnt != 0 && (cnt < 20 || cnt > 100))
1980 MessageBox.Show(Properties.Resources.TextSearchCountApi_Validating1);
1986 private void FavoritesTextCountApi_Validating(object sender, CancelEventArgs e)
1991 cnt = int.Parse(FavoritesTextCountApi.Text);
1995 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2000 if (cnt != 0 && (cnt < 20 || cnt > 200))
2002 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2008 private void UserTimelineTextCountApi_Validating(object sender, CancelEventArgs e)
2013 cnt = int.Parse(UserTimelineTextCountApi.Text);
2017 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2022 if (cnt != 0 && (cnt < 20 || cnt > 200))
2024 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2030 private void ListTextCountApi_Validating(object sender, CancelEventArgs e)
2035 cnt = int.Parse(ListTextCountApi.Text);
2039 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2044 if (cnt != 0 && (cnt < 20 || cnt > 200))
2046 MessageBox.Show(Properties.Resources.TextCountApi_Validating1);
2052 //private void CheckEventNotify_CheckedChanged(object sender, EventArgs e)
2053 // Handles CheckEventNotify.CheckedChanged, CheckFavoritesEvent.CheckStateChanged,
2054 // CheckUnfavoritesEvent.CheckStateChanged, CheckFollowEvent.CheckStateChanged,
2055 // CheckListMemberAddedEvent.CheckStateChanged, CheckListMemberRemovedEvent.CheckStateChanged,
2056 // CheckListCreatedEvent.CheckStateChanged, CheckUserUpdateEvent.CheckStateChanged
2058 // EventNotifyEnabled = CheckEventNotify.Checked;
2059 // GetEventNotifyFlag(EventNotifyFlag, IsMyEventNotifyFlag);
2060 // ApplyEventNotifyFlag(EventNotifyEnabled, EventNotifyFlag, IsMyEventNotifyFlag);
2063 private class EventCheckboxTblElement
2065 public CheckBox CheckBox;
2066 public MyCommon.EVENTTYPE Type;
2069 private EventCheckboxTblElement[] GetEventCheckboxTable()
2071 EventCheckboxTblElement[] _eventCheckboxTable = new EventCheckboxTblElement[8];
2073 _eventCheckboxTable[0] = new EventCheckboxTblElement();
2074 _eventCheckboxTable[0].CheckBox = CheckFavoritesEvent;
2075 _eventCheckboxTable[0].Type = MyCommon.EVENTTYPE.Favorite;
2077 _eventCheckboxTable[1] = new EventCheckboxTblElement();
2078 _eventCheckboxTable[1].CheckBox = CheckUnfavoritesEvent;
2079 _eventCheckboxTable[1].Type = MyCommon.EVENTTYPE.Unfavorite;
2081 _eventCheckboxTable[2] = new EventCheckboxTblElement();
2082 _eventCheckboxTable[2].CheckBox = CheckFollowEvent;
2083 _eventCheckboxTable[2].Type = MyCommon.EVENTTYPE.Follow;
2085 _eventCheckboxTable[3] = new EventCheckboxTblElement();
2086 _eventCheckboxTable[3].CheckBox = CheckListMemberAddedEvent;
2087 _eventCheckboxTable[3].Type = MyCommon.EVENTTYPE.ListMemberAdded;
2089 _eventCheckboxTable[4] = new EventCheckboxTblElement();
2090 _eventCheckboxTable[4].CheckBox = CheckListMemberRemovedEvent;
2091 _eventCheckboxTable[4].Type = MyCommon.EVENTTYPE.ListMemberRemoved;
2093 _eventCheckboxTable[5] = new EventCheckboxTblElement();
2094 _eventCheckboxTable[5].CheckBox = CheckBlockEvent;
2095 _eventCheckboxTable[5].Type = MyCommon.EVENTTYPE.Block;
2097 _eventCheckboxTable[6] = new EventCheckboxTblElement();
2098 _eventCheckboxTable[6].CheckBox = CheckUserUpdateEvent;
2099 _eventCheckboxTable[6].Type = MyCommon.EVENTTYPE.UserUpdate;
2101 _eventCheckboxTable[7] = new EventCheckboxTblElement();
2102 _eventCheckboxTable[7].CheckBox = CheckListCreatedEvent;
2103 _eventCheckboxTable[7].Type = MyCommon.EVENTTYPE.ListCreated;
2105 return _eventCheckboxTable;
2108 private void GetEventNotifyFlag(ref MyCommon.EVENTTYPE eventnotifyflag, ref MyCommon.EVENTTYPE isMyeventnotifyflag)
2110 MyCommon.EVENTTYPE evt = MyCommon.EVENTTYPE.None;
2111 MyCommon.EVENTTYPE myevt = MyCommon.EVENTTYPE.None;
2113 foreach (EventCheckboxTblElement tbl in GetEventCheckboxTable())
2115 switch (tbl.CheckBox.CheckState)
2117 case CheckState.Checked:
2118 evt = evt | tbl.Type;
2119 myevt = myevt | tbl.Type;
2121 case CheckState.Indeterminate:
2122 evt = evt | tbl.Type;
2124 case CheckState.Unchecked:
2128 eventnotifyflag = evt;
2129 isMyeventnotifyflag = myevt;
2132 private void ApplyEventNotifyFlag(bool rootEnabled, MyCommon.EVENTTYPE eventnotifyflag, MyCommon.EVENTTYPE isMyeventnotifyflag)
2134 MyCommon.EVENTTYPE evt = eventnotifyflag;
2135 MyCommon.EVENTTYPE myevt = isMyeventnotifyflag;
2137 CheckEventNotify.Checked = rootEnabled;
2139 foreach (EventCheckboxTblElement tbl in GetEventCheckboxTable())
2141 if ((evt & tbl.Type) != 0)
2143 if ((myevt & tbl.Type) != 0)
2145 tbl.CheckBox.CheckState = CheckState.Checked;
2149 tbl.CheckBox.CheckState = CheckState.Indeterminate;
2154 tbl.CheckBox.CheckState = CheckState.Unchecked;
2156 tbl.CheckBox.Enabled = rootEnabled;
2161 private void CheckEventNotify_CheckedChanged(object sender, EventArgs e)
2163 foreach (EventCheckboxTblElement tbl in GetEventCheckboxTable())
2165 tbl.CheckBox.Enabled = CheckEventNotify.Checked;
2169 //private void CheckForceEventNotify_CheckedChanged(object sender, EventArgs e)
2171 // _MyForceEventNotify = CheckEventNotify.Checked;
2174 //private void CheckFavEventUnread_CheckedChanged(object sender, EventArgs e)
2176 // _MyFavEventUnread = CheckFavEventUnread.Checked;
2179 //private void ComboBoxTranslateLanguage_SelectedIndexChanged(object sender, EventArgs e)
2181 // _MyTranslateLanguage = (new Google()).GetLanguageEnumFromIndex(ComboBoxTranslateLanguage.SelectedIndex);
2184 private void SoundFileListup()
2186 if (EventSoundFile == null) EventSoundFile = "";
2187 ComboBoxEventNotifySound.Items.Clear();
2188 ComboBoxEventNotifySound.Items.Add("");
2189 DirectoryInfo oDir = new DirectoryInfo(Application.StartupPath + Path.DirectorySeparatorChar);
2190 if (Directory.Exists(Path.Combine(Application.StartupPath, "Sounds")))
2192 oDir = oDir.GetDirectories("Sounds")[0];
2194 foreach (FileInfo oFile in oDir.GetFiles("*.wav"))
2196 ComboBoxEventNotifySound.Items.Add(oFile.Name);
2198 int idx = ComboBoxEventNotifySound.Items.IndexOf(EventSoundFile);
2199 if (idx == -1) idx = 0;
2200 ComboBoxEventNotifySound.SelectedIndex = idx;
2203 //private void ComboBoxEventNotifySound_VisibleChanged(object sender, EventArgs e)
2205 // SoundFileListup();
2208 //private void ComboBoxEventNotifySound_SelectedIndexChanged(object sender, EventArgs e)
2210 // if (_soundfileListup) return;
2212 // _MyEventSoundFile = (string)ComboBoxEventNotifySound.SelectedItem;
2215 private void UserAppointUrlText_Validating(object sender, CancelEventArgs e)
2217 if (!UserAppointUrlText.Text.StartsWith("http") && !string.IsNullOrEmpty(UserAppointUrlText.Text))
2219 MessageBox.Show("Text Error:正しいURLではありません");
2223 private void OpenUrl(string url)
2225 string myPath = url;
2226 string path = this.BrowserPathText.Text;
2229 if (!string.IsNullOrEmpty(BrowserPath))
2231 if (path.StartsWith("\"") && path.Length > 2 && path.IndexOf("\"", 2) > -1)
2233 int sep = path.IndexOf("\"", 2);
2234 string browserPath = path.Substring(1, sep - 1);
2236 if (sep < path.Length - 1)
2238 arg = path.Substring(sep + 1);
2240 myPath = arg + " " + myPath;
2241 System.Diagnostics.Process.Start(browserPath, myPath);
2245 System.Diagnostics.Process.Start(path, myPath);
2250 System.Diagnostics.Process.Start(myPath);
2255 // MessageBox.Show("ブラウザの起動に失敗、またはタイムアウトしました。" + ex.ToString());
2259 private void CreateAccountButton_Click(object sender, EventArgs e)
2261 this.OpenUrl("https://twitter.com/signup");
2264 private void CheckAutoConvertUrl_CheckedChanged(object sender, EventArgs e)
2266 ShortenTcoCheck.Enabled = CheckAutoConvertUrl.Checked;
2269 public AppendSettingDialog()
2271 InitializeComponent();
2273 this.Icon = Properties.Resources.MIcon;