Skip to content

Commit

Permalink
Merge pull request #4189 from pmiossec/display_current_branch_name
Browse files Browse the repository at this point in the history
Commit Form: Display current branch name
  • Loading branch information
RussKie committed Dec 18, 2017
2 parents b7fc3f9 + 8b43bd3 commit ee6cafa
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 10 deletions.
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.

0 comments on commit ee6cafa

Please sign in to comment.