From 6620c6299c5308732278032ecdee2a29b33f847f Mon Sep 17 00:00:00 2001
From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Date: Wed, 15 Feb 2023 22:59:08 +0200
Subject: [PATCH] Move "reuse assets" option in GUI from settings to export
dialog
---
.../Services/SettingsService.cs | 4 ++--
.../Components/DashboardViewModel.cs | 2 +-
.../ViewModels/Dialogs/ExportSetupViewModel.cs | 4 ++++
.../ViewModels/Dialogs/SettingsViewModel.cs | 6 ------
.../Views/Dialogs/ExportSetupView.xaml | 18 ++++++++++++++++++
.../Views/Dialogs/SettingsView.xaml | 16 ----------------
6 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/DiscordChatExporter.Gui/Services/SettingsService.cs b/DiscordChatExporter.Gui/Services/SettingsService.cs
index 19958a4..3cabcb3 100644
--- a/DiscordChatExporter.Gui/Services/SettingsService.cs
+++ b/DiscordChatExporter.Gui/Services/SettingsService.cs
@@ -19,8 +19,6 @@ public partial class SettingsService : SettingsManager
public int ParallelLimit { get; set; } = 1;
- public bool ShouldReuseAssets { get; set; }
-
public Version? LastAppVersion { get; set; }
public string? LastToken { get; set; }
@@ -35,6 +33,8 @@ public partial class SettingsService : SettingsManager
public bool LastShouldDownloadAssets { get; set; }
+ public bool LastShouldReuseAssets { get; set; }
+
public SettingsService()
{
Configuration.StorageSpace = StorageSpace.Instance;
diff --git a/DiscordChatExporter.Gui/ViewModels/Components/DashboardViewModel.cs b/DiscordChatExporter.Gui/ViewModels/Components/DashboardViewModel.cs
index 9c99404..e7ec4d7 100644
--- a/DiscordChatExporter.Gui/ViewModels/Components/DashboardViewModel.cs
+++ b/DiscordChatExporter.Gui/ViewModels/Components/DashboardViewModel.cs
@@ -193,7 +193,7 @@ public class DashboardViewModel : PropertyChangedBase
dialog.MessageFilter,
dialog.ShouldFormatMarkdown,
dialog.ShouldDownloadAssets,
- _settingsService.ShouldReuseAssets,
+ dialog.ShouldReuseAssets,
_settingsService.DateFormat
);
diff --git a/DiscordChatExporter.Gui/ViewModels/Dialogs/ExportSetupViewModel.cs b/DiscordChatExporter.Gui/ViewModels/Dialogs/ExportSetupViewModel.cs
index a30d51e..c5180a8 100644
--- a/DiscordChatExporter.Gui/ViewModels/Dialogs/ExportSetupViewModel.cs
+++ b/DiscordChatExporter.Gui/ViewModels/Dialogs/ExportSetupViewModel.cs
@@ -63,6 +63,8 @@ public class ExportSetupViewModel : DialogScreen
public bool ShouldDownloadAssets { get; set; }
+ public bool ShouldReuseAssets { get; set; }
+
public bool IsAdvancedSectionDisplayed { get; set; }
public ExportSetupViewModel(DialogManager dialogManager, SettingsService settingsService)
@@ -76,6 +78,7 @@ public class ExportSetupViewModel : DialogScreen
MessageFilterValue = _settingsService.LastMessageFilterValue;
ShouldFormatMarkdown = _settingsService.LastShouldFormatMarkdown;
ShouldDownloadAssets = _settingsService.LastShouldDownloadAssets;
+ ShouldReuseAssets = _settingsService.LastShouldReuseAssets;
// Show the "advanced options" section by default if any
// of the advanced options are set to non-default values.
@@ -134,6 +137,7 @@ public class ExportSetupViewModel : DialogScreen
_settingsService.LastMessageFilterValue = MessageFilterValue;
_settingsService.LastShouldFormatMarkdown = ShouldFormatMarkdown;
_settingsService.LastShouldDownloadAssets = ShouldDownloadAssets;
+ _settingsService.LastShouldReuseAssets = ShouldReuseAssets;
Close(true);
}
diff --git a/DiscordChatExporter.Gui/ViewModels/Dialogs/SettingsViewModel.cs b/DiscordChatExporter.Gui/ViewModels/Dialogs/SettingsViewModel.cs
index 67fffc0..82492e3 100644
--- a/DiscordChatExporter.Gui/ViewModels/Dialogs/SettingsViewModel.cs
+++ b/DiscordChatExporter.Gui/ViewModels/Dialogs/SettingsViewModel.cs
@@ -38,12 +38,6 @@ public class SettingsViewModel : DialogScreen
set => _settingsService.ParallelLimit = Math.Clamp(value, 1, 10);
}
- public bool ShouldReuseAssets
- {
- get => _settingsService.ShouldReuseAssets;
- set => _settingsService.ShouldReuseAssets = value;
- }
-
public SettingsViewModel(SettingsService settingsService) =>
_settingsService = settingsService;
}
\ No newline at end of file
diff --git a/DiscordChatExporter.Gui/Views/Dialogs/ExportSetupView.xaml b/DiscordChatExporter.Gui/Views/Dialogs/ExportSetupView.xaml
index 98e9150..2d9003d 100644
--- a/DiscordChatExporter.Gui/Views/Dialogs/ExportSetupView.xaml
+++ b/DiscordChatExporter.Gui/Views/Dialogs/ExportSetupView.xaml
@@ -267,6 +267,24 @@
VerticalAlignment="Center"
IsChecked="{Binding ShouldDownloadAssets}" />
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DiscordChatExporter.Gui/Views/Dialogs/SettingsView.xaml b/DiscordChatExporter.Gui/Views/Dialogs/SettingsView.xaml
index 2015948..18eb032 100644
--- a/DiscordChatExporter.Gui/Views/Dialogs/SettingsView.xaml
+++ b/DiscordChatExporter.Gui/Views/Dialogs/SettingsView.xaml
@@ -82,22 +82,6 @@
IsChecked="{Binding IsTokenPersisted}" />
-
-
-
-
-
-