Skip to content

Commit

Permalink
Merge pull request gitextensions#5434 from NikolayXHD/dashboard_categ…
Browse files Browse the repository at this point in the history
…ory_context_menu

Dashboard category context menu
  • Loading branch information
RussKie authored Oct 3, 2018
2 parents a8ac9e9 + 556d143 commit 7aad0f6
Show file tree
Hide file tree
Showing 9 changed files with 404 additions and 95 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public partial class FormDashboardCategoryTitle : GitExtensionsForm
{
private readonly TranslationString _categoryNameRequiredText = new TranslationString("Category name is required");
private readonly TranslationString _categoryNameExistsText = new TranslationString("Category name already exists");
private readonly TranslationString _renameCategoryText = new TranslationString("Rename category");
private readonly List<string> _existingCategories = new List<string>();

public FormDashboardCategoryTitle()
Expand All @@ -18,13 +19,21 @@ public FormDashboardCategoryTitle()
InitializeComplete();
}

public FormDashboardCategoryTitle(IEnumerable<string> existingCategories)
public FormDashboardCategoryTitle(IEnumerable<string> existingCategories, string originalName = null)
: this()
{
if (existingCategories != null)
{
_existingCategories.AddRange(existingCategories);
}

if (originalName != null)
{
Category = originalName;
txtCategoryName.Text = originalName;
txtCategoryName.SelectAll();
Text = _renameCategoryText.Text;
}
}

/// <summary>
Expand Down Expand Up @@ -54,5 +63,10 @@ private void btnCancel_Click(object sender, EventArgs e)
{
Close();
}

private void txtCategoryName_TextChanged(object sender, EventArgs e)
{
btnOk.Enabled = txtCategoryName.Text != Category;
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7aad0f6

Please sign in to comment.