feat(app): first-run data location wizard step
On first launch (no data yet, no portable dir, no pointer file), the wizard now shows a new step-0 screen asking where to store wallets, config and certificates. AppPaths changes: - DefaultDataRoot() → ~/.PalladiumWallet (home, always writable) - IsDataLocationConfigured() → true when portable / override / pointer already written / legacy or default already has data - ConfigureDataLocation(root) writes a bootstrap pointer file and creates the directory - DataRoot() resolution order: override → portable → pointer → legacy (has data) → default ViewModel: new StepDataLocation step, UseDefaultDataLocationCommand, ApplyDataLocation(root) (also called from View's folder picker). View: new wizard panel with description, default-path display, two buttons (use default / choose folder); folder picker via StorageProvider.OpenFolderPickerAsync. Loc: add wiz.data.* keys (6 languages); fix fallback language "it"→"en"; update test assertion accordingly.
This commit is contained in:
@@ -41,6 +41,23 @@
|
||||
<TextBlock Text="Palladium Wallet" FontSize="28" FontWeight="Bold"
|
||||
HorizontalAlignment="Center"/>
|
||||
|
||||
<!-- Passo 0 (primo avvio): dove salvare i dati -->
|
||||
<StackPanel IsVisible="{Binding IsStepDataLocation}" Spacing="12">
|
||||
<TextBlock Text="{Binding Loc[wiz.data.title]}" FontSize="18" FontWeight="Bold"/>
|
||||
<TextBlock Text="{Binding Loc[wiz.data.info]}" TextWrapping="Wrap" Foreground="Gray"/>
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="{Binding Loc[wiz.data.default]}" FontSize="11" Foreground="Gray"/>
|
||||
<SelectableTextBlock Text="{Binding DefaultDataPath}"
|
||||
FontFamily="monospace" FontSize="13" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
<Button Content="{Binding Loc[wiz.data.usedefault]}" FontSize="16" Classes="accent"
|
||||
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center"
|
||||
Command="{Binding UseDefaultDataLocationCommand}"/>
|
||||
<Button Content="{Binding Loc[wiz.data.choose]}" FontSize="16"
|
||||
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center"
|
||||
Click="OnChooseDataFolderClick"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Passo 1: scelta iniziale -->
|
||||
<StackPanel IsVisible="{Binding IsStepStart}" Spacing="12">
|
||||
<StackPanel Orientation="Horizontal" Spacing="10" HorizontalAlignment="Center">
|
||||
|
||||
@@ -72,6 +72,21 @@ public partial class MainWindow : Window
|
||||
vm.IsServerSettingsOpen = false;
|
||||
}
|
||||
|
||||
private async void OnChooseDataFolderClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is not MainWindowViewModel vm)
|
||||
return;
|
||||
|
||||
var folders = await StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
|
||||
{
|
||||
Title = "Cartella dati Palladium Wallet",
|
||||
AllowMultiple = false,
|
||||
});
|
||||
|
||||
if (folders.FirstOrDefault()?.TryGetLocalPath() is { } path)
|
||||
vm.ApplyDataLocation(path);
|
||||
}
|
||||
|
||||
private void OnConnectionStatusTapped(object? sender, TappedEventArgs e)
|
||||
{
|
||||
if (DataContext is MainWindowViewModel vm)
|
||||
|
||||
Reference in New Issue
Block a user