Skip to content

Commit

Permalink
file browser select button now opens directories
Browse files Browse the repository at this point in the history
Fixes #275
  • Loading branch information
Yuki-Codes committed Apr 24, 2021
1 parent 18479ef commit 5f83f35
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Anamnesis/Files/FileBrowserView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,15 @@ public EntryWrapper? Selected
this.FileName = this.selected?.Name ?? string.Empty;
}

if (this.selected != null && this.selected.Entry is IDirectory)
{
this.SelectButton.Text = LocalizationService.GetString("Common_OpenDir");
}
else
{
this.SelectButton.Text = this.mode == Modes.Load ? LocalizationService.GetString("Common_OpenFile") : LocalizationService.GetString("Common_SaveFile");
}

// show the options panel for the selected file type
if (this.selected != null && this.selected.Entry is IFile file)
{
Expand Down Expand Up @@ -466,6 +475,12 @@ private async void OnSelectClicked(object? sender, RoutedEventArgs? e)
}
}

if (this.Selected != null && this.Selected.Entry is IDirectory dir)
{
this.CurrentDir = dir;
return;
}

this.CloseDrawer();
}

Expand Down
1 change: 1 addition & 0 deletions Anamnesis/Languages/en.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"Common_OpenFile": "Load",
"Common_SaveFile": "Save",
"Common_OpenDir": "Open",
"Common_Enable": "Enable",
"Common_Disable": "Disable",
"Common_None": "None",
Expand Down

0 comments on commit 5f83f35

Please sign in to comment.