Don't revert commit after user has OK'ed the dialog.

Fixes https://gitlab.com/kicad/code/kicad/issues/7799
This commit is contained in:
Jeff Young 2021-03-04 19:15:52 +00:00
parent 658bc2f4b2
commit 528f933ad5
2 changed files with 10 additions and 21 deletions

View File

@ -101,7 +101,6 @@ int InvokeCopperZonesEditor( PCB_BASE_FRAME* aCaller, ZONE_SETTINGS* aSettings )
return dlg.ShowQuasiModal();
}
#define MIN_THICKNESS ZONE_THICKNESS_MIN_VALUE_MIL*IU_PER_MILS
DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE( PCB_BASE_FRAME* aParent, ZONE_SETTINGS* aSettings ) :
DIALOG_COPPER_ZONE_BASE( aParent ),
@ -194,7 +193,7 @@ bool DIALOG_COPPER_ZONE::TransferDataToWindow()
m_NetFiltering = false;
m_NetSortingByPadCount = true;
auto cfg = m_Parent->GetPcbNewSettings();
PCBNEW_SETTINGS* cfg = m_Parent->GetPcbNewSettings();
int opt = cfg->m_Zones.net_sort_mode;
m_NetFiltering = opt >= 2;
@ -214,10 +213,8 @@ bool DIALOG_COPPER_ZONE::TransferDataToWindow()
switch( m_settings.m_FillMode )
{
case ZONE_FILL_MODE::HATCH_PATTERN:
m_GridStyleCtrl->SetSelection( 1 ); break;
default:
m_GridStyleCtrl->SetSelection( 0 ); break;
case ZONE_FILL_MODE::HATCH_PATTERN: m_GridStyleCtrl->SetSelection( 1 ); break;
default: m_GridStyleCtrl->SetSelection( 0 ); break;
}
m_gridStyleRotation.SetUnits( EDA_UNITS::DEGREES );
@ -355,18 +352,10 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aUseExportableSetupOnly )
switch( m_PadInZoneOpt->GetSelection() )
{
case 3:
m_settings.SetPadConnection( ZONE_CONNECTION::NONE );
break;
case 2:
m_settings.SetPadConnection( ZONE_CONNECTION::THT_THERMAL );
break;
case 1:
m_settings.SetPadConnection( ZONE_CONNECTION::THERMAL );
break;
case 0:
m_settings.SetPadConnection( ZONE_CONNECTION::FULL );
break;
case 3: m_settings.SetPadConnection( ZONE_CONNECTION::NONE ); break;
case 2: m_settings.SetPadConnection( ZONE_CONNECTION::THT_THERMAL ); break;
case 1: m_settings.SetPadConnection( ZONE_CONNECTION::THERMAL ); break;
case 0: m_settings.SetPadConnection( ZONE_CONNECTION::FULL ); break;
}
switch( m_OutlineDisplayCtrl->GetSelection() )
@ -376,7 +365,7 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aUseExportableSetupOnly )
case 2: m_settings.m_ZoneBorderDisplayStyle = ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_FULL; break;
}
auto cfg = m_Parent->GetPcbNewSettings();
PCBNEW_SETTINGS* cfg = m_Parent->GetPcbNewSettings();
cfg->m_Zones.hatching_style = static_cast<int>( m_settings.m_ZoneBorderDisplayStyle );
cfg->m_Zones.net_filter = m_DoNotShowNetNameFilter->GetValue().ToStdString();

View File

@ -135,8 +135,8 @@ void PCB_EDIT_FRAME::Edit_Zone_Params( ZONE* aZone )
if( !filler.Fill( zones_to_refill ) )
{
commit.Revert();
return;
// User has already OK'ed dialog so we're going to go ahead and commit even if the
// fill was cancelled.
}
}