Revert "Save change made in zone manager when apply"

This reverts commit 4f9d0daeef9fe0ed0c98c54f3293f506fa8a30ce.
This commit is contained in:
Lucas Dumont 2024-07-08 18:26:14 +02:00 committed by jean-pierre charras
parent e0453d9bcc
commit 0420930d0d
2 changed files with 11 additions and 21 deletions

View File

@ -170,22 +170,6 @@ void DIALOG_ZONE_MANAGER::PostProcessZoneViewSelectionChange( wxDataViewItem con
}
void DIALOG_ZONE_MANAGER::SaveChange()
{
for( ZONE_MANAGEMENT_BASE* zone_management :
std::list<ZONE_MANAGEMENT_BASE*>{ m_panelZoneProperties, m_zonesContainer.get() } )
{
zone_management->OnUserConfirmChange();
}
if( m_zoneInfo )
{
if( std::shared_ptr<ZONE_SETTINGS> zone = m_panelZoneProperties->GetZoneSettings() )
*m_zoneInfo = *zone;
}
}
void DIALOG_ZONE_MANAGER::GenericProcessChar( wxKeyEvent& aEvent )
{
aEvent.Skip();
@ -265,7 +249,17 @@ void DIALOG_ZONE_MANAGER::SelectZoneTableItem( wxDataViewItem const& aItem )
void DIALOG_ZONE_MANAGER::OnOk( wxCommandEvent& aEvt )
{
SaveChange();
for( ZONE_MANAGEMENT_BASE* zone_management :
std::list<ZONE_MANAGEMENT_BASE*>{ m_panelZoneProperties, m_zonesContainer.get() } )
{
zone_management->OnUserConfirmChange();
}
if( m_zoneInfo )
{
if( std::shared_ptr<ZONE_SETTINGS> zone = m_panelZoneProperties->GetZoneSettings() )
*m_zoneInfo = *zone;
}
aEvt.Skip();
}
@ -381,8 +375,6 @@ void DIALOG_ZONE_MANAGER::OnButtonApplyClick( wxCommandEvent& aEvent )
if( m_isFillingZones )
return;
SaveChange();
m_isFillingZones = true;
m_zonesContainer->FlushZoneSettingsChange();
m_zonesContainer->FlushPriorityChange();

View File

@ -106,8 +106,6 @@ protected:
void OnTableCharHook( wxKeyEvent& event ) override;
private:
void SaveChange();
void GenericProcessChar( wxKeyEvent& event );
void OnIdle( wxIdleEvent& aEvent );