Set "fresh start" settings as the default path

Also, prevent migrating library tables when not also migrating settings
This commit is contained in:
Jon Evans 2021-11-16 18:13:12 -05:00
parent fe2844fb9c
commit 2ca54c2efc
1 changed files with 13 additions and 8 deletions

View File

@ -54,14 +54,11 @@ bool DIALOG_MIGRATE_SETTINGS::TransferDataToWindow()
std::vector<wxString> paths;
// SetValue does not fire the "OnRadioButton" event, so have to fabricate this
wxCommandEvent dummy;
m_btnUseDefaults->SetValue( true );
if( !m_manager->GetPreviousVersionPaths( &paths ) )
{
m_btnPrevVer->SetLabelText( _( "Import settings from a previous version (none found)" ) );
m_btnUseDefaults->SetValue( true );
OnDefaultSelected( dummy );
}
else
{
@ -71,10 +68,12 @@ bool DIALOG_MIGRATE_SETTINGS::TransferDataToWindow()
m_cbPath->Append( path );
m_cbPath->SetSelection( 0 );
m_btnPrevVer->SetValue( true );
OnPrevVerSelected( dummy );
}
// SetValue does not fire the "OnRadioButton" event, so have to fabricate this
wxCommandEvent dummy;
OnDefaultSelected( dummy );
Fit();
return true;
@ -87,11 +86,17 @@ bool DIALOG_MIGRATE_SETTINGS::TransferDataFromWindow()
return false;
if( m_btnPrevVer->GetValue() )
{
m_manager->SetMigrateLibraryTables( m_cbCopyLibraryTables->GetValue() );
m_manager->SetMigrationSource( m_cbPath->GetValue() );
}
else
{
m_manager->SetMigrateLibraryTables( false );
m_manager->SetMigrationSource( wxEmptyString );
}
m_manager->SetMigrateLibraryTables( m_cbCopyLibraryTables->GetValue() );
return true;
}