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"
HorizontalAlignment="Center"
Margin="8"
Visibility="{Binding CanShowNoThanksButton, Converter={StaticResource BooleanToVisibilityConverter}}"
IsEnabled="{Binding IsMigrating, Converter={StaticResource BoolNegationConverter}}"
Padding="16,8" />
<ui:Button

6
StabilityMatrix/ViewModels/DataDirectoryMigrationViewModel.cs

@ -35,6 +35,7 @@ public partial class DataDirectoryMigrationViewModel : ObservableObject
private int migrateProgressCount;
[ObservableProperty] private bool isMigrating;
[ObservableProperty] private bool canShowNoThanksButton;
public string AutoMigrateText => AutoMigrateCount == 0 ? string.Empty :
$"{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());
// Any remaining packages need to be moved
NeedsMoveMigrateCount = oldPackages.Length - AutoMigrateCount;
var oldLibraryDir =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"StabilityMatrix");
CanShowNoThanksButton = settingsManager.LibraryDir != oldLibraryDir;
}
public void CleanupOldInstall()

Loading…
Cancel
Save