mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Storage - Replace LiteDB with SQLite + EF Core (#843)
Storage - Added LiteDB to SQLite migration UI - Try to die a bit more gracefully Core - Delay start watching plugins for hot reload after initializing UI - Simplify category management logic UI - Avoid crash during profile icon load Storage - Fix entry metadata retrieval
This commit is contained in:
1 parent
9132301dbf
commit
551921db9f
130 files changed
+2965
-1135
No files matched your search
@@ -68,8 +68,8 @@ public class SidebarCategoryViewDropHandler : DropHandlerBase
|
||||
{
|
||||
int index = vm.ProfileConfigurations.IndexOf(targetItem);
|
||||
if (!before)
|
||||
index++;
|
||||
vm.AddProfileConfiguration(sourceItem.ProfileConfiguration, index);
|
||||
targetItem = index < vm.ProfileConfigurations.Count - 1 ? vm.ProfileConfigurations[index + 1] : null;
|
||||
vm.AddProfileConfiguration(sourceItem.ProfileConfiguration, targetItem?.ProfileConfiguration);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -122,8 +122,8 @@ public partial class ProfileConfigurationEditViewModel : DialogViewModelBase<Pro
|
||||
ProfileConfiguration.FadeInAndOut = FadeInAndOut;
|
||||
|
||||
await SaveIcon();
|
||||
ProfileConfiguration.Save();
|
||||
|
||||
_profileService.SaveProfileConfigurationIcon(ProfileConfiguration);
|
||||
_profileService.SaveProfileCategory(_profileCategory);
|
||||
Close(ProfileConfiguration);
|
||||
}
|
||||
@@ -144,7 +144,7 @@ public partial class ProfileConfigurationEditViewModel : DialogViewModelBase<Pro
|
||||
{
|
||||
try
|
||||
{
|
||||
Stream? iconStream = _profileConfiguration.Icon.GetIconStream();
|
||||
Stream? iconStream = _profileConfiguration.Icon.IconBytes != null ? new MemoryStream(_profileConfiguration.Icon.IconBytes) : null;
|
||||
SelectedBitmapSource = iconStream != null ? new Bitmap(iconStream) : null;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
@@ -103,10 +103,10 @@ public partial class SidebarCategoryViewModel : ActivatableViewModelBase
|
||||
public bool IsCollapsed => _isCollapsed?.Value ?? false;
|
||||
public bool IsSuspended => _isSuspended?.Value ?? false;
|
||||
|
||||
public void AddProfileConfiguration(ProfileConfiguration profileConfiguration, int? index)
|
||||
public void AddProfileConfiguration(ProfileConfiguration profileConfiguration, ProfileConfiguration? target)
|
||||
{
|
||||
ProfileCategory oldCategory = profileConfiguration.Category;
|
||||
ProfileCategory.AddProfileConfiguration(profileConfiguration, index);
|
||||
ProfileCategory.AddProfileConfiguration(profileConfiguration, target);
|
||||
|
||||
_profileService.SaveProfileCategory(ProfileCategory);
|
||||
// If the profile moved to a new category, also save the old category
|
||||
|
||||
@@ -40,15 +40,6 @@ public class SidebarProfileConfigurationViewModel : ActivatableViewModelBase
|
||||
.Select(p => p == null)
|
||||
.ToProperty(this, vm => vm.IsDisabled)
|
||||
.DisposeWith(d));
|
||||
|
||||
try
|
||||
{
|
||||
_profileService.LoadProfileConfigurationIcon(ProfileConfiguration);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// ignored, too bad but don't crash over corrupt icons
|
||||
}
|
||||
}
|
||||
|
||||
public ProfileConfiguration ProfileConfiguration { get; }
|
||||
|
||||
Reference in new issue
Block a user