Update usages of OpenInNativeExplorer to use ShowFileInNativeExplorer

Also updates WrappedStorage to override ShowFileInNativeExplorer.
This commit is contained in:
Susko3 2021-10-17 12:17:38 +02:00
parent e925c416cb
commit 25f172fae8
4 changed files with 10 additions and 4 deletions

View File

@ -462,10 +462,12 @@ namespace osu.Game.Database
if (retrievedItem == null)
throw new ArgumentException(@"Specified model could not be found", nameof(item));
using (var outputStream = exportStorage.GetStream($"{getValidFilename(item.ToString())}{HandledExtensions.First()}", FileAccess.Write, FileMode.Create))
var filename = $"{getValidFilename(item.ToString())}{HandledExtensions.First()}";
using (var outputStream = exportStorage.GetStream(filename, FileAccess.Write, FileMode.Create))
ExportModelTo(retrievedItem, outputStream);
exportStorage.OpenInNativeExplorer();
exportStorage.ShowFileInNativeExplorer(filename);
}
/// <summary>

View File

@ -135,7 +135,7 @@ namespace osu.Game.Graphics
Text = $"{fileName} saved!",
Activated = () =>
{
storage.OpenInNativeExplorer();
storage.ShowFileInNativeExplorer(fileName);
return true;
}
});

View File

@ -72,6 +72,8 @@ namespace osu.Game.IO
public override void OpenPathInNativeExplorer(string path) => UnderlyingStorage.OpenPathInNativeExplorer(MutatePath(path));
public override void ShowFileInNativeExplorer(string filename) => UnderlyingStorage.ShowFileInNativeExplorer(MutatePath(filename));
public override Storage GetStorageForDirectory(string path)
{
if (string.IsNullOrEmpty(path))

View File

@ -913,13 +913,15 @@ namespace osu.Game
}
else if (recentLogCount == short_term_display_limit)
{
var logFile = $@"{entry.Target.ToString().ToLowerInvariant()}.log";
Schedule(() => Notifications.Post(new SimpleNotification
{
Icon = FontAwesome.Solid.EllipsisH,
Text = "Subsequent messages have been logged. Click to view log files.",
Activated = () =>
{
Storage.GetStorageForDirectory("logs").OpenInNativeExplorer();
Storage.GetStorageForDirectory(@"logs").ShowFileInNativeExplorer(logFile);
return true;
}
}));