mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-06-05 01:03:44 -04:00
parent
c29de2c77c
commit
c410e745b1
5 changed files with 63 additions and 6 deletions
|
@ -16,6 +16,10 @@ public partial class SettingsService : SettingsBase
|
||||||
|
|
||||||
public bool IsTokenPersisted { get; set; } = true;
|
public bool IsTokenPersisted { get; set; } = true;
|
||||||
|
|
||||||
|
public bool ShouldShowThreads { get; set; }
|
||||||
|
|
||||||
|
public bool ShouldShowArchivedThreads { get; set; }
|
||||||
|
|
||||||
public string DateFormat { get; set; } = "MM/dd/yyyy h:mm tt";
|
public string DateFormat { get; set; } = "MM/dd/yyyy h:mm tt";
|
||||||
|
|
||||||
public int ParallelLimit { get; set; } = 1;
|
public int ParallelLimit { get; set; } = 1;
|
||||||
|
|
|
@ -89,11 +89,8 @@ public class DashboardViewModel : PropertyChangedBase
|
||||||
Token = _settingsService.LastToken;
|
Token = _settingsService.LastToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async ValueTask ShowSettingsAsync()
|
public async ValueTask ShowSettingsAsync() =>
|
||||||
{
|
await _dialogManager.ShowDialogAsync(_viewModelFactory.CreateSettingsViewModel());
|
||||||
var dialog = _viewModelFactory.CreateSettingsViewModel();
|
|
||||||
await _dialogManager.ShowDialogAsync(dialog);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ShowHelp() => ProcessEx.StartShellExecute(App.DocumentationUrl);
|
public void ShowHelp() => ProcessEx.StartShellExecute(App.DocumentationUrl);
|
||||||
|
|
||||||
|
@ -165,6 +162,7 @@ public class DashboardViewModel : PropertyChangedBase
|
||||||
|
|
||||||
var channels = new List<Channel>();
|
var channels = new List<Channel>();
|
||||||
|
|
||||||
|
// Regular channels
|
||||||
await foreach (var channel in _discord.GetGuildChannelsAsync(SelectedGuild.Id))
|
await foreach (var channel in _discord.GetGuildChannelsAsync(SelectedGuild.Id))
|
||||||
{
|
{
|
||||||
if (channel.Kind == ChannelKind.GuildCategory)
|
if (channel.Kind == ChannelKind.GuildCategory)
|
||||||
|
@ -173,6 +171,17 @@ public class DashboardViewModel : PropertyChangedBase
|
||||||
channels.Add(channel);
|
channels.Add(channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Threads
|
||||||
|
if (_settingsService.ShouldShowThreads)
|
||||||
|
{
|
||||||
|
await foreach (var thread in _discord.GetGuildThreadsAsync(
|
||||||
|
SelectedGuild.Id,
|
||||||
|
_settingsService.ShouldShowArchivedThreads))
|
||||||
|
{
|
||||||
|
channels.Add(thread);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
AvailableChannels = channels;
|
AvailableChannels = channels;
|
||||||
SelectedChannels = null;
|
SelectedChannels = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,18 @@ public class SettingsViewModel : DialogScreen
|
||||||
set => _settingsService.IsTokenPersisted = value;
|
set => _settingsService.IsTokenPersisted = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool ShouldShowThreads
|
||||||
|
{
|
||||||
|
get => _settingsService.ShouldShowThreads;
|
||||||
|
set => _settingsService.ShouldShowThreads = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool ShouldShowArchivedThreads
|
||||||
|
{
|
||||||
|
get => _settingsService.ShouldShowArchivedThreads;
|
||||||
|
set => _settingsService.ShouldShowArchivedThreads = value;
|
||||||
|
}
|
||||||
|
|
||||||
public string DateFormat
|
public string DateFormat
|
||||||
{
|
{
|
||||||
get => _settingsService.DateFormat;
|
get => _settingsService.DateFormat;
|
||||||
|
|
|
@ -304,7 +304,7 @@
|
||||||
<ListBox
|
<ListBox
|
||||||
HorizontalContentAlignment="Stretch"
|
HorizontalContentAlignment="Stretch"
|
||||||
SelectionMode="Extended"
|
SelectionMode="Extended"
|
||||||
TextSearch.TextPath="Model.Name"
|
TextSearch.TextPath="Name"
|
||||||
VirtualizingPanel.IsVirtualizingWhenGrouping="True">
|
VirtualizingPanel.IsVirtualizingWhenGrouping="True">
|
||||||
<b:Interaction.Behaviors>
|
<b:Interaction.Behaviors>
|
||||||
<behaviors:ChannelMultiSelectionListBoxBehavior SelectedItems="{Binding SelectedChannels}" />
|
<behaviors:ChannelMultiSelectionListBoxBehavior SelectedItems="{Binding SelectedChannels}" />
|
||||||
|
|
|
@ -82,6 +82,38 @@
|
||||||
IsChecked="{Binding IsTokenPersisted}" />
|
IsChecked="{Binding IsTokenPersisted}" />
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|
||||||
|
<!-- Show threads -->
|
||||||
|
<DockPanel
|
||||||
|
Margin="16,8"
|
||||||
|
Background="Transparent"
|
||||||
|
LastChildFill="False"
|
||||||
|
ToolTip="Pull threads and show them in the channel list">
|
||||||
|
<TextBlock
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
DockPanel.Dock="Left"
|
||||||
|
Text="Show threads" />
|
||||||
|
<ToggleButton
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
DockPanel.Dock="Right"
|
||||||
|
IsChecked="{Binding ShouldShowThreads}" />
|
||||||
|
</DockPanel>
|
||||||
|
|
||||||
|
<!-- Show archived threads -->
|
||||||
|
<DockPanel
|
||||||
|
Margin="16,8"
|
||||||
|
Background="Transparent"
|
||||||
|
LastChildFill="False"
|
||||||
|
ToolTip="Pull archived threads and show them in the channel list">
|
||||||
|
<TextBlock
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
DockPanel.Dock="Left"
|
||||||
|
Text="Show archived threads" />
|
||||||
|
<ToggleButton
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
DockPanel.Dock="Right"
|
||||||
|
IsChecked="{Binding ShouldShowArchivedThreads}" />
|
||||||
|
</DockPanel>
|
||||||
|
|
||||||
<!-- Date format -->
|
<!-- Date format -->
|
||||||
<DockPanel
|
<DockPanel
|
||||||
Margin="16,8"
|
Margin="16,8"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue