mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-09 20:29:11 +00:00
fixed path history and the reload button
This commit is contained in:
parent
b5562f2014
commit
8282c7b6c6
3 changed files with 20 additions and 27 deletions
|
@ -191,26 +191,7 @@ namespace Ryujinx.UI.App.Common
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var fileInfo = new FileInfo(applicationPath);
|
long fileSize = new FileInfo(applicationPath).Length;
|
||||||
|
|
||||||
if ((fileInfo.Attributes & FileAttributes.Directory) == FileAttributes.Directory)
|
|
||||||
{
|
|
||||||
Console.WriteLine($"Found directory 2: {fileInfo.Name}");
|
|
||||||
ApplicationData folder = new()
|
|
||||||
{
|
|
||||||
TitleName = fileInfo.Name,
|
|
||||||
FileExtension = "Folder",
|
|
||||||
Developer = "null",
|
|
||||||
Path = applicationPath,
|
|
||||||
Icon = _nsoIcon,
|
|
||||||
};
|
|
||||||
OnApplicationAdded(new ApplicationAddedEventArgs
|
|
||||||
{
|
|
||||||
AppData = folder,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
long fileSize = fileInfo.Length;
|
|
||||||
string titleName = "Unknown";
|
string titleName = "Unknown";
|
||||||
string titleId = "0000000000000000";
|
string titleId = "0000000000000000";
|
||||||
string developer = "Unknown";
|
string developer = "Unknown";
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
private const int HotKeyPressDelayMs = 500;
|
private const int HotKeyPressDelayMs = 500;
|
||||||
|
|
||||||
private ObservableCollection<ApplicationData> _applications;
|
private ObservableCollection<ApplicationData> _applications;
|
||||||
private readonly Queue<string> _pathHistory;
|
private readonly Stack<string> _pathHistory;
|
||||||
private string _aspectStatusText;
|
private string _aspectStatusText;
|
||||||
|
|
||||||
private string _loadHeading;
|
private string _loadHeading;
|
||||||
|
@ -122,7 +122,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
.Bind(out _appsObservableList).AsObservableList();
|
.Bind(out _appsObservableList).AsObservableList();
|
||||||
|
|
||||||
_rendererWaitEvent = new AutoResetEvent(false);
|
_rendererWaitEvent = new AutoResetEvent(false);
|
||||||
_pathHistory = new Queue<string>();
|
_pathHistory = new Stack<string>();
|
||||||
|
|
||||||
if (Program.PreviewerDetached)
|
if (Program.PreviewerDetached)
|
||||||
{
|
{
|
||||||
|
@ -217,6 +217,8 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Stack<string> PathHistory => _pathHistory;
|
||||||
|
|
||||||
public bool IsPaused
|
public bool IsPaused
|
||||||
{
|
{
|
||||||
get => _isPaused;
|
get => _isPaused;
|
||||||
|
@ -1296,7 +1298,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
|
|
||||||
public void OpenFolder(string path)
|
public void OpenFolder(string path)
|
||||||
{
|
{
|
||||||
_pathHistory.Enqueue(path);
|
_pathHistory.Push(path);
|
||||||
IsInFolder = _pathHistory.Count != 0;
|
IsInFolder = _pathHistory.Count != 0;
|
||||||
|
|
||||||
Applications.Clear();
|
Applications.Clear();
|
||||||
|
@ -1309,7 +1311,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
{
|
{
|
||||||
if (_pathHistory.Count != 0)
|
if (_pathHistory.Count != 0)
|
||||||
{
|
{
|
||||||
string path = _pathHistory.Dequeue();
|
_pathHistory.Pop();
|
||||||
Applications.Clear();
|
Applications.Clear();
|
||||||
if (_pathHistory.Count == 0)
|
if (_pathHistory.Count == 0)
|
||||||
{
|
{
|
||||||
|
@ -1317,8 +1319,8 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
List<string> SearchPaths = new List<string>();
|
List<string> SearchPaths = new();
|
||||||
SearchPaths.Add(path);
|
SearchPaths.Add(_pathHistory.Peek());
|
||||||
ApplicationLibrary.LoadApplications(SearchPaths, ConfigurationState.Instance.System.Language);
|
ApplicationLibrary.LoadApplications(SearchPaths, ConfigurationState.Instance.System.Language);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ using Ryujinx.UI.Common;
|
||||||
using Ryujinx.UI.Common.Configuration;
|
using Ryujinx.UI.Common.Configuration;
|
||||||
using Ryujinx.UI.Common.Helper;
|
using Ryujinx.UI.Common.Helper;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Runtime.Versioning;
|
using System.Runtime.Versioning;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
@ -542,7 +543,16 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
|
|
||||||
Thread applicationLibraryThread = new(() =>
|
Thread applicationLibraryThread = new(() =>
|
||||||
{
|
{
|
||||||
ApplicationLibrary.LoadApplications(ConfigurationState.Instance.UI.GameDirs, ConfigurationState.Instance.System.Language);
|
if (ViewModel.IsInFolder)
|
||||||
|
{
|
||||||
|
List<string> SearchPaths = new();
|
||||||
|
SearchPaths.Add(ViewModel.PathHistory.Peek());
|
||||||
|
ApplicationLibrary.LoadApplications(SearchPaths, ConfigurationState.Instance.System.Language);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ApplicationLibrary.LoadApplications(ConfigurationState.Instance.UI.GameDirs, ConfigurationState.Instance.System.Language);
|
||||||
|
}
|
||||||
|
|
||||||
_isLoading = false;
|
_isLoading = false;
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue