0
0
Fork 0
This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ryujinx-final/src/Ryujinx.Ava
SamusAranX 623604c391
Overhaul of string formatting/parsing/sorting logic for TimeSpans, DateTimes, and file sizes (#4956)
* Fixed formatting/parsing issues with ApplicationData properties TimePlayed, LastPlayed, and FileSize

Replaced double-based TimePlayed property with TimeSpan?-based one in ApplicationData and ApplicationMetadata
Added a migration for TimePlayed, just like in #4861
Consolidated ApplicationData's FileSize* properties into one FileSize property
Added a formatting/parsing helper class ValueFormatUtils for TimeSpans, DateTimes, and file sizes
Added new value converters for TimeSpans and file sizes for the Avalonia UI
Added TimePlayedSortComparer
Fixed sort order in LastPlayedSortComparer
Fixed sort order for ApplicationData fields TimePlayed, LastPlayed, and FileSize
Fixed crashes caused by SortHelper
Replaced SystemInfo.ToMiBString with ToGiBString backed by ValueFormatUtils
Replaced SaveModel.GetSizeString() with ValueFormatUtils

* Additional ApplicationLibrary changes that got lost in the last commit

* Removed unneeded usings

* Removed converters as they are no longer needed

* Updated comment on FormatDateTime

* Removed base10 parameter from ValueFormatUtils

FormatFileSize now always returns base 2 values with base 10 units
Made ParseFileSize capable of parsing both base 2 and base 10 units

* Removed nullable attribute from TimePlayed property

Centralized TimePlayed update code into ApplicationMetadata

* Changed UpdateTimePlayed() to use TimeSpan logic

* Removed JsonIgnore attributes from ApplicationData

* Implemented requested format changes

* Fixed mistakes in method documentation comments

* Made it so the Last Played value "Never" is localized in the Avalonia UI

* Implemented suggestions

* Remove unused import

* Did a comment refinement pass in ValueFormatUtils.cs

* Reordered ValueFormatUtils methods and sorted them into #regions

* Integrated functionality from #5056

Also removed Logger print from last_played migration code

* Implemented suggestions

* Moved ValueFormatUtils and SystemInfo to namespace Ryujinx.Ui.Common

* common: Respect proper value format convention and use base10 by default

This could be discuss again in another issue/PR, for now revert to the previous behavior.

Signed-off-by: Mary Guillemard <mary@mary.zone>

---------

Signed-off-by: Mary Guillemard <mary@mary.zone>
Co-authored-by: TSR Berry <20988865+TSRBerry@users.noreply.github.com>
Co-authored-by: Mary Guillemard <mary@mary.zone>
2023-11-06 22:47:44 +01:00
..
Assets Add ldn_mitm as a network client for LDN (#5656) 2023-10-26 00:32:13 +02:00
Common Update to LibHac 0.19.0 (#5831) 2023-10-22 20:30:46 -03:00
Input Ava UI: Refactor async usage (#5516) 2023-09-26 00:04:58 +02:00
Modules/Updater Ava UI: Refactor async usage (#5516) 2023-09-26 00:04:58 +02:00
UI Overhaul of string formatting/parsing/sorting logic for TimeSpans, DateTimes, and file sizes (#4956) 2023-11-06 22:47:44 +01:00
App.axaml Ava UI: Avalonia 11 & FluentAvalonia 2 Support (#4362) 2023-08-12 02:47:22 +02:00
App.axaml.cs Ava UI: Refactor async usage (#5516) 2023-09-26 00:04:58 +02:00
app.manifest Ava UI: Avalonia 11 & FluentAvalonia 2 Support (#4362) 2023-08-12 02:47:22 +02:00
AppHost.cs Overhaul of string formatting/parsing/sorting logic for TimeSpans, DateTimes, and file sizes (#4956) 2023-11-06 22:47:44 +01:00
Program.cs Overhaul of string formatting/parsing/sorting logic for TimeSpans, DateTimes, and file sizes (#4956) 2023-11-06 22:47:44 +01:00
Ryujinx.Ava.csproj Add "Create Shortcut" To app context menu (#4734) 2023-10-20 20:51:15 +02:00
Ryujinx.ico Move solution and projects to src 2023-04-27 23:51:14 +02:00