示例#1
0
 private void configureMessageTypesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (var Dialog = new ConfigureMessageSettingsDialog())
         if (Dialog.ShowDialog() == DialogResult.OK)
         {
             this.MessageConfig = MessageSettings.LoadFromConfig();
         }
 }
示例#2
0
 private void ConfigureMessageSettingsDialog_Load(object sender, EventArgs e)
 {
     this.Config = MessageSettings.LoadFromConfig();
     foreach (var Setting in Config.Where(c => c.MessageType != LogMessageType.Unknown && c.MessageType != LogMessageType.Status && c.MessageType != LogMessageType.Disconnect))
     {
         lstMessageTypes.Items.Add(Setting);
     }
 }
示例#3
0
        public Main()
        {
            InitializeComponent();
            NotificationIcon.Icon = this.Icon;

            // Have to initialize in the ctor in order to handle Load with Minimize to Tray.
            this.MessageConfig                  = MessageSettings.LoadFromConfig();
            NotificationIcon.Visible            = Settings.Default.TrayNotifications || Settings.Default.MinimizeToTray;
            NotificationIcon.BalloonTipClicked += NotificationIconClick;
            NotificationIcon.DoubleClick       += NotificationIconClick;
            txtLogPath.TextChanged             += txtLogPath_TextChanged;
            txtLogPath.Click += txtLogPath_Click;
            txtLogPath.Text   = Settings.Default.LogPath;
            // TODO: Most of these could be easily replaced with a method to map the toolstrip to the setting.
            tsmNotifyMinimizedOnly.Checked     = Settings.Default.NotifyMinimizedOnly;
            tsmEnableTrayNotifications.Checked = Settings.Default.TrayNotifications;
            tsmEnableSMTPNotifications.Checked = Settings.Default.EnableSmtpNotifications;
            tsmEnablePushBullet.Checked        = Settings.Default.EnablePushbullet;
            tsmEnableSound.Checked             = Settings.Default.EnableSound;
            tsmMinimizeToTray.Checked          = Settings.Default.MinimizeToTray;
            tsmStartMinimized.Checked          = Settings.Default.StartMinimized;
            RestoreSize();
            this.Resize += Main_Resize;
            if (!LogMonitor.IsValidLogPath(txtLogPath.Text))
            {
                if (LogMonitor.TryGetDefaultLogPath(out string DefaultLogPath))
                {
                    txtLogPath.Text = DefaultLogPath;
                }
                else
                {
                    LogMessage("Unable to figure out client.txt location. You will have to manually set the path.", null, LogMessageType.Status);
                }
            }
            this.ResizeEnd += OnResizeEnd;
        }
示例#4
0
 private void cmdSave_Click(object sender, EventArgs e)
 {
     MessageSettings.SaveToConfig(this.Config);
     this.DialogResult = DialogResult.OK;
 }