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) 2014 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;
36 namespace OpenTween.Setting.Panel
38 public partial class PreviewPanel : SettingPanelBase
41 => this.InitializeComponent();
43 public void LoadConfig(SettingCommon settingCommon)
45 switch (settingCommon.NameBalloon)
47 case MyCommon.NameBalloonEnum.None:
48 this.cmbNameBalloon.SelectedIndex = 0;
50 case MyCommon.NameBalloonEnum.UserID:
51 this.cmbNameBalloon.SelectedIndex = 1;
53 case MyCommon.NameBalloonEnum.NickName:
54 this.cmbNameBalloon.SelectedIndex = 2;
58 this.CheckDispUsername.Checked = settingCommon.DispUsername;
60 switch (settingCommon.DispLatestPost)
62 case MyCommon.DispTitleEnum.None:
63 this.ComboDispTitle.SelectedIndex = 0;
65 case MyCommon.DispTitleEnum.Ver:
66 this.ComboDispTitle.SelectedIndex = 1;
68 case MyCommon.DispTitleEnum.Post:
69 this.ComboDispTitle.SelectedIndex = 2;
71 case MyCommon.DispTitleEnum.UnreadRepCount:
72 this.ComboDispTitle.SelectedIndex = 3;
74 case MyCommon.DispTitleEnum.UnreadAllCount:
75 this.ComboDispTitle.SelectedIndex = 4;
77 case MyCommon.DispTitleEnum.UnreadAllRepCount:
78 this.ComboDispTitle.SelectedIndex = 5;
80 case MyCommon.DispTitleEnum.UnreadCountAllCount:
81 this.ComboDispTitle.SelectedIndex = 6;
83 case MyCommon.DispTitleEnum.OwnStatus:
84 this.ComboDispTitle.SelectedIndex = 7;
88 this.CheckAlwaysTop.Checked = settingCommon.AlwaysTop;
89 this.CheckBalloonLimit.Checked = settingCommon.LimitBalloon;
90 this.chkTabIconDisp.Checked = settingCommon.TabIconDisp;
91 this.CheckMonospace.Checked = settingCommon.IsMonospace;
92 this.CheckPreviewEnable.Checked = settingCommon.PreviewEnable;
93 this.CheckStatusAreaAtBottom.Checked = settingCommon.StatusAreaAtBottom;
95 switch (settingCommon.ReplyIconState)
97 case MyCommon.REPLY_ICONSTATE.None:
98 this.ReplyIconStateCombo.SelectedIndex = 0;
100 case MyCommon.REPLY_ICONSTATE.StaticIcon:
101 this.ReplyIconStateCombo.SelectedIndex = 1;
103 case MyCommon.REPLY_ICONSTATE.BlinkIcon:
104 this.ReplyIconStateCombo.SelectedIndex = 2;
108 switch (settingCommon.Language)
111 this.LanguageCombo.SelectedIndex = 0;
114 this.LanguageCombo.SelectedIndex = 1;
117 this.LanguageCombo.SelectedIndex = 2;
120 this.LanguageCombo.SelectedIndex = 0;
124 this.ChkNewMentionsBlink.Checked = settingCommon.BlinkNewMentions;
125 this.IsNotifyUseGrowlCheckBox.Checked = settingCommon.IsUseNotifyGrowl;
126 this.IsNotifyUseGrowlCheckBox.Enabled = GrowlHelper.IsDllExists;
129 public void SaveConfig(SettingCommon settingCommon)
131 switch (this.cmbNameBalloon.SelectedIndex)
134 settingCommon.NameBalloon = MyCommon.NameBalloonEnum.None;
137 settingCommon.NameBalloon = MyCommon.NameBalloonEnum.UserID;
140 settingCommon.NameBalloon = MyCommon.NameBalloonEnum.NickName;
144 settingCommon.DispUsername = this.CheckDispUsername.Checked;
146 switch (this.ComboDispTitle.SelectedIndex)
149 settingCommon.DispLatestPost = MyCommon.DispTitleEnum.None;
152 settingCommon.DispLatestPost = MyCommon.DispTitleEnum.Ver;
155 settingCommon.DispLatestPost = MyCommon.DispTitleEnum.Post;
158 settingCommon.DispLatestPost = MyCommon.DispTitleEnum.UnreadRepCount;
161 settingCommon.DispLatestPost = MyCommon.DispTitleEnum.UnreadAllCount;
164 settingCommon.DispLatestPost = MyCommon.DispTitleEnum.UnreadAllRepCount;
166 case 6: // Unread/All
167 settingCommon.DispLatestPost = MyCommon.DispTitleEnum.UnreadCountAllCount;
169 case 7: // Count of Status/Follow/Follower
170 settingCommon.DispLatestPost = MyCommon.DispTitleEnum.OwnStatus;
174 settingCommon.AlwaysTop = this.CheckAlwaysTop.Checked;
175 settingCommon.LimitBalloon = this.CheckBalloonLimit.Checked;
176 settingCommon.TabIconDisp = this.chkTabIconDisp.Checked;
177 settingCommon.IsMonospace = this.CheckMonospace.Checked;
178 settingCommon.PreviewEnable = this.CheckPreviewEnable.Checked;
179 settingCommon.StatusAreaAtBottom = this.CheckStatusAreaAtBottom.Checked;
181 switch (this.ReplyIconStateCombo.SelectedIndex)
184 settingCommon.ReplyIconState = MyCommon.REPLY_ICONSTATE.None;
187 settingCommon.ReplyIconState = MyCommon.REPLY_ICONSTATE.StaticIcon;
190 settingCommon.ReplyIconState = MyCommon.REPLY_ICONSTATE.BlinkIcon;
194 switch (this.LanguageCombo.SelectedIndex)
197 settingCommon.Language = "OS";
200 settingCommon.Language = "ja";
203 settingCommon.Language = "en";
206 settingCommon.Language = "en";
210 settingCommon.BlinkNewMentions = this.ChkNewMentionsBlink.Checked;
211 settingCommon.IsUseNotifyGrowl = this.IsNotifyUseGrowlCheckBox.Checked;