Browse Source

Merge pull request #133 from ionite34/force-migration

Force package migration if the new library dir is the same as the old one
pull/14/head
JT 1 year ago committed by GitHub
parent
commit
fb8f05b0d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      StabilityMatrix/DataDirectoryMigrationDialog.xaml
  2. 6
      StabilityMatrix/ViewModels/DataDirectoryMigrationViewModel.cs

1
StabilityMatrix/DataDirectoryMigrationDialog.xaml

@ -89,6 +89,7 @@
FontSize="16" FontSize="16"
HorizontalAlignment="Center" HorizontalAlignment="Center"
Margin="8" Margin="8"
Visibility="{Binding CanShowNoThanksButton, Converter={StaticResource BooleanToVisibilityConverter}}"
IsEnabled="{Binding IsMigrating, Converter={StaticResource BoolNegationConverter}}" IsEnabled="{Binding IsMigrating, Converter={StaticResource BoolNegationConverter}}"
Padding="16,8" /> Padding="16,8" />
<ui:Button <ui:Button

6
StabilityMatrix/ViewModels/DataDirectoryMigrationViewModel.cs

@ -35,6 +35,7 @@ public partial class DataDirectoryMigrationViewModel : ObservableObject
private int migrateProgressCount; private int migrateProgressCount;
[ObservableProperty] private bool isMigrating; [ObservableProperty] private bool isMigrating;
[ObservableProperty] private bool canShowNoThanksButton;
public string AutoMigrateText => AutoMigrateCount == 0 ? string.Empty : public string AutoMigrateText => AutoMigrateCount == 0 ? string.Empty :
$"{AutoMigrateCount} Packages will be automatically migrated to the new format"; $"{AutoMigrateCount} Packages will be automatically migrated to the new format";
@ -72,6 +73,11 @@ public partial class DataDirectoryMigrationViewModel : ObservableObject
AutoMigrateCount = oldPackages.Count(p => p.CanPureMigratePath()); AutoMigrateCount = oldPackages.Count(p => p.CanPureMigratePath());
// Any remaining packages need to be moved // Any remaining packages need to be moved
NeedsMoveMigrateCount = oldPackages.Length - AutoMigrateCount; NeedsMoveMigrateCount = oldPackages.Length - AutoMigrateCount;
var oldLibraryDir =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"StabilityMatrix");
CanShowNoThanksButton = settingsManager.LibraryDir != oldLibraryDir;
} }
public void CleanupOldInstall() public void CleanupOldInstall()

Loading…
Cancel
Save