diff --git a/src/EVEMon/CharacterMonitoring/CharacterMonitorHeader.Designer.cs b/src/EVEMon/CharacterMonitoring/CharacterMonitorHeader.Designer.cs index 36d74bb65..91217ecba 100644 --- a/src/EVEMon/CharacterMonitoring/CharacterMonitorHeader.Designer.cs +++ b/src/EVEMon/CharacterMonitoring/CharacterMonitorHeader.Designer.cs @@ -56,6 +56,7 @@ private void InitializeComponent() this.DockedInfoLabel = new System.Windows.Forms.Label(); this.CharacterPortrait = new EVEMon.Common.Controls.CharacterPortrait(); this.SkillSummaryPanel = new System.Windows.Forms.Panel(); + this.CustomLabelLink = new System.Windows.Forms.LinkLabel(); this.RemapsCloneJumpSummaryLabel = new System.Windows.Forms.Label(); this.tlpAttributes = new System.Windows.Forms.TableLayoutPanel(); this.lblMEMAttribute = new System.Windows.Forms.Label(); @@ -392,6 +393,7 @@ private void InitializeComponent() // this.SkillSummaryPanel.AutoSize = true; this.MainTableLayoutPanel.SetColumnSpan(this.SkillSummaryPanel, 2); + this.SkillSummaryPanel.Controls.Add(this.CustomLabelLink); this.SkillSummaryPanel.Controls.Add(this.RemapsCloneJumpSummaryLabel); this.SkillSummaryPanel.Controls.Add(this.tlpAttributes); this.SkillSummaryPanel.Controls.Add(this.SkillSummaryLabel); @@ -405,6 +407,16 @@ private void InitializeComponent() this.SkillSummaryPanel.Size = new System.Drawing.Size(389, 73); this.SkillSummaryPanel.TabIndex = 4; // + // CustomLabelLink + // + this.CustomLabelLink.AutoSize = true; + this.CustomLabelLink.Location = new System.Drawing.Point(138, 50); + this.CustomLabelLink.Name = "CustomLabelLink"; + this.CustomLabelLink.Size = new System.Drawing.Size(0, 13); + this.CustomLabelLink.TabIndex = 7; + this.ToolTip.SetToolTip(this.CustomLabelLink, "Character label - click to edit"); + this.CustomLabelLink.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.CustomLabelLink_LinkClicked); + // // RemapsCloneJumpSummaryLabel // this.RemapsCloneJumpSummaryLabel.AutoSize = true; @@ -568,6 +580,7 @@ private void InitializeComponent() this.CustomLabelComboBox.Size = new System.Drawing.Size(130, 21); this.CustomLabelComboBox.TabIndex = 3; this.ToolTip.SetToolTip(this.CustomLabelComboBox, "Character label"); + this.CustomLabelComboBox.Visible = false; this.CustomLabelComboBox.SelectedIndexChanged += new System.EventHandler(this.CustomLabelComboBox_TextChanged); this.CustomLabelComboBox.KeyUp += new System.Windows.Forms.KeyEventHandler(this.CustomLabelComboBox_KeyUp); this.CustomLabelComboBox.Validated += new System.EventHandler(this.CustomLabelComboBox_TextChanged); @@ -662,5 +675,6 @@ private void InitializeComponent() private System.Windows.Forms.Label RemapsCloneJumpSummaryLabel; private System.Windows.Forms.ComboBox CustomLabelComboBox; private System.Windows.Forms.Label CharacterLabel; + private System.Windows.Forms.LinkLabel CustomLabelLink; } } diff --git a/src/EVEMon/CharacterMonitoring/CharacterMonitorHeader.cs b/src/EVEMon/CharacterMonitoring/CharacterMonitorHeader.cs index 0be803bf7..271224661 100644 --- a/src/EVEMon/CharacterMonitoring/CharacterMonitorHeader.cs +++ b/src/EVEMon/CharacterMonitoring/CharacterMonitorHeader.cs @@ -250,11 +250,16 @@ private void UpdateCharacterLabel(IEnumerable allLabels) m_updatingLabels = true; try { + string lbl = m_character.Label; // Update the character labels CustomLabelComboBox.Items.Clear(); foreach (string label in allLabels) CustomLabelComboBox.Items.Add(label); - CustomLabelComboBox.Text = m_character.Label; + CustomLabelComboBox.Text = lbl; + // Provide clickable text if the label is blank + if (lbl.IsEmptyOrUnknown()) + lbl = "Edit label"; + CustomLabelLink.Text = lbl; } finally { @@ -270,7 +275,7 @@ private void UpdateAccountStatusInfo() if (m_character == null) return; - CCPCharacter ccpCharacter = m_character as CCPCharacter; + var ccpCharacter = m_character as CCPCharacter; if (ccpCharacter == null) { AccountStatusTableLayoutPanel.Visible = false; @@ -695,7 +700,7 @@ private void EveMonClient_CharacterInfoUpdated(object sender, CharacterChangedEv /// The instance containing the event data. private void EveMonClient_ConquerableStationListUpdated(object sender, EventArgs e) { - + UpdateInfoControls(); } /// @@ -950,7 +955,17 @@ private void ChangeAPIKeyInfoMenuItem_Click(object sender, EventArgs e) } } + /// + /// Occurs when the user edits the character's custom label. + /// + /// The source of the event. + /// The instance containing the event data. + private void CustomLabelLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + CustomLabelLink.Visible = false; + CustomLabelComboBox.Visible = true; + } + #endregion - } }