Skip to content

Commit

Permalink
Display branch names
Browse files Browse the repository at this point in the history
  • Loading branch information
yaira2 committed May 10, 2023
1 parent bf211e0 commit 5683756
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 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 @@ -241,7 +241,7 @@ public static DynamicDialog GetFor_GitCheckoutConflicts()
dialog = new DynamicDialog(new DynamicDialogViewModel()
{
TitleText = "SwitchBranch".GetLocalizedResource(),
PrimaryButtonText = "OK".GetLocalizedResource(),
PrimaryButtonText = "Switch".GetLocalizedResource(),
CloseButtonText = "Cancel".GetLocalizedResource(),
SubtitleText = "UncommittedChanges".GetLocalizedResource(),
DisplayControl = new Grid()
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
7 changes: 5 additions & 2 deletions src/Files.App/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -3263,13 +3263,13 @@
<value>Unable to display permissions.</value>
</data>
<data name="StashChanges" xml:space="preserve">
<value>Leave my changes on</value>
<value>Leave my changes on '{0}'</value>
</data>
<data name="DiscardChanges" xml:space="preserve">
<value>Discard my changes</value>
</data>
<data name="BringChanges" xml:space="preserve">
<value>Bring my changes to</value>
<value>Bring my changes to '{0}'</value>
</data>
<data name="UncommittedChanges" xml:space="preserve">
<value>You have uncommitted changes on this branch. What would you like to do with them?</value>
Expand All @@ -3280,4 +3280,7 @@
<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 5683756

Please sign in to comment.