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.
30 using System.Collections.Generic;
34 namespace OpenTween.Setting.Panel
36 public partial class NotifyPanel : SettingPanelBase
39 => this.InitializeComponent();
41 public void LoadConfig(SettingCommon settingCommon)
43 this.CheckBoxNotificationPopup.Checked = settingCommon.NewAllPop;
44 this.ComboBoxNameInPopup.SelectedIndex = settingCommon.NameBalloon switch
46 MyCommon.NameBalloonEnum.None => 0,
47 MyCommon.NameBalloonEnum.UserID => 1,
48 MyCommon.NameBalloonEnum.NickName => 2,
51 this.CheckBoxUseGrowlForNotification.Checked = settingCommon.IsUseNotifyGrowl;
52 this.CheckBoxUseGrowlForNotification.Enabled = GrowlHelper.IsDllExists;
53 this.CheckBoxEnableNotificationSound.Checked = settingCommon.PlaySound;
54 this.CheckBoxEnableBlinkOnReply.Checked = settingCommon.BlinkNewMentions;
57 public void SaveConfig(SettingCommon settingCommon)
59 settingCommon.NewAllPop = this.CheckBoxNotificationPopup.Checked;
60 settingCommon.NameBalloon = this.ComboBoxNameInPopup.SelectedIndex switch
62 0 => MyCommon.NameBalloonEnum.None,
63 1 => MyCommon.NameBalloonEnum.UserID,
64 2 => MyCommon.NameBalloonEnum.NickName,
65 _ => throw new IndexOutOfRangeException(),
67 settingCommon.IsUseNotifyGrowl = this.CheckBoxUseGrowlForNotification.Checked;
68 settingCommon.PlaySound = this.CheckBoxEnableNotificationSound.Checked;
69 settingCommon.BlinkNewMentions = this.CheckBoxEnableBlinkOnReply.Checked;