Skip to content

Commit

Permalink
Display branch name
Browse files Browse the repository at this point in the history
  • Loading branch information
yaira2 committed May 10, 2023
1 parent 76e895f commit e6eec4f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
12 changes: 6 additions & 6 deletions src/Files.App/Helpers/DynamicDialogFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,16 +217,16 @@ public static DynamicDialog GetFor_CredentialEntryDialog(string path)
return dialog;
}

public static DynamicDialog GetFor_GitCheckoutConflicts()
public static DynamicDialog GetFor_GitCheckoutConflicts(string checkoutBranchName, string headBranchName)
{
DynamicDialog dialog = null!;

var optionsListView = new ListView()
{
ItemsSource = new string[]
{
"BringChanges".GetLocalizedResource(),
"StashChanges".GetLocalizedResource(),
string.Format("BringChanges".GetLocalizedResource(), checkoutBranchName),
string.Format("StashChanges".GetLocalizedResource(), headBranchName),
"DiscardChanges".GetLocalizedResource()
},
SelectionMode = ListViewSelectionMode.Single
Expand All @@ -240,10 +240,10 @@ public static DynamicDialog GetFor_GitCheckoutConflicts()

dialog = new DynamicDialog(new DynamicDialogViewModel()
{
TitleText = "UncommitedChanges".GetLocalizedResource(),
PrimaryButtonText = "OK".GetLocalizedResource(),
TitleText = "SwitchBranch".GetLocalizedResource(),
PrimaryButtonText = "Switch".GetLocalizedResource(),
CloseButtonText = "Cancel".GetLocalizedResource(),
SubtitleText = "UncommitedChangesMessage".GetLocalizedResource(),
SubtitleText = "UncommittedChanges".GetLocalizedResource(),
DisplayControl = new Grid()
{
MinWidth = 250d,
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Helpers/GitHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static async Task Checkout(string? repositoryPath, string? branch)

if (repository.RetrieveStatus().IsDirty)
{
var dialog = DynamicDialogFactory.GetFor_GitCheckoutConflicts();
var dialog = DynamicDialogFactory.GetFor_GitCheckoutConflicts(checkoutBranch.FriendlyName, repository.Head.FriendlyName);
await dialog.ShowAsync();

var resolveConflictOption = (GitCheckoutOptions)dialog.ViewModel.AdditionalData;
Expand Down
17 changes: 10 additions & 7 deletions src/Files.App/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -3263,21 +3263,24 @@
<value>Unable to display permissions.</value>
</data>
<data name="StashChanges" xml:space="preserve">
<value>Stash changes</value>
<value>Leave my changes on '{0}'</value>
</data>
<data name="DiscardChanges" xml:space="preserve">
<value>Discard changes</value>
<value>Discard my changes</value>
</data>
<data name="BringChanges" xml:space="preserve">
<value>Bring changes</value>
<value>Bring my changes to '{0}'</value>
</data>
<data name="UncommitedChanges" xml:space="preserve">
<value>There are uncommited changes on the local branch</value>
<data name="UncommittedChanges" xml:space="preserve">
<value>You have uncommitted changes on this branch. What would you like to do with them?</value>
</data>
<data name="UncommitedChangesMessage" xml:space="preserve">
<value>What do you want to do with them?</value>
<data name="SwitchBranch" xml:space="preserve">
<value>Switch Branch</value>
</data>
<data name="Branches" xml:space="preserve">
<value>Branches:</value>
</data>
<data name="Switch" xml:space="preserve">
<value>Switch</value>
</data>
</root>

0 comments on commit e6eec4f

Please sign in to comment.