Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commit Form: Display current branch name #4189

Merged
merged 1 commit into from Dec 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 25 additions & 2 deletions GitUI/CommandsDialogs/FormCommit.Designer.cs

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

16 changes: 10 additions & 6 deletions GitUI/CommandsDialogs/FormCommit.cs
Expand Up @@ -125,7 +125,6 @@ public sealed partial class FormCommit : GitModuleForm //, IHotkeyable
private readonly TranslationString _assumeUnchangedToolTip = new TranslationString("Tell git to not check the status of this file for performance benefits."
+ Environment.NewLine + "Use this feature when a file is big and never change."
+ Environment.NewLine + "Git will never check if the file has changed that will improve status check performance.");

#endregion

private readonly ICommitTemplateManager _commitTemplateManager;
Expand Down Expand Up @@ -659,10 +658,15 @@ private void EnableStageButtons(bool enable)
ResetUnStaged.Enabled = Unstaged.AllItems.Any();
}

private void SetDialogTitle()
private void UpdateBranchNameDisplay()
{
Task.Run(() => string.Format(_formTitle.Text, Module.GetSelectedBranch(), Module.WorkingDir))
.ContinueWith(task => Text = task.Result, _taskScheduler);
Task.Run(() => Module.GetSelectedBranch())
.ContinueWith(task =>
{
var currentBranchName = task.Result;
branchNameLabel.Text = currentBranchName;
Text = string.Format(_formTitle.Text, currentBranchName, Module.WorkingDir);
}, _taskScheduler);
}

private bool _initialized;
Expand All @@ -671,7 +675,7 @@ private void Initialize(bool loadUnstaged)
{
_initialized = true;

SetDialogTitle();
UpdateBranchNameDisplay();
Cursor.Current = Cursors.WaitCursor;

if (loadUnstaged)
Expand Down Expand Up @@ -2775,7 +2779,7 @@ private void createBranchToolStripButton_Click(object sender, EventArgs e)
{
return;
}
SetDialogTitle();
UpdateBranchNameDisplay();
}

private void Message_Enter(object sender, EventArgs e)
Expand Down
1 change: 1 addition & 0 deletions GitUI/GitUI.csproj
Expand Up @@ -1941,6 +1941,7 @@
<Content Include="Resources\Icons\HelpPullMerge.png" />
<Content Include="Resources\Icons\HelpPullRebase.png" />
<Content Include="Resources\Icons\IconArchiveRevision.png" />
<Content Include="Resources\Icons\IconBranch.png" />
<Content Include="Resources\Icons\IconBranchCheckout.png" />
<Content Include="Resources\Icons\IconBranchCreate.png" />
<Content Include="Resources\Icons\IconBrowseFileExplorer.png" />
Expand Down
16 changes: 14 additions & 2 deletions GitUI/Properties/Resources.Designer.cs

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

3 changes: 3 additions & 0 deletions GitUI/Properties/Resources.resx
Expand Up @@ -430,6 +430,9 @@
<data name="Delete" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>../Resources/Icons/Delete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="IconBranch" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>../Resources/Icons/IconBranch.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="IconBranchCheckout" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>../Resources/Icons/BranchCheckout.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand Down
Binary file added GitUI/Resources/Icons/IconBranch.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.