Auto save: fix case of auto save interval is set to 0 (disabling auto save feature)
This fix allows also the new value of the auto save interval immediately taken in account.
This commit is contained in:
parent
f7cc0a9334
commit
334c50477a
|
@ -200,6 +200,25 @@ bool EDA_BASE_FRAME::Enable( bool enable )
|
|||
}
|
||||
|
||||
|
||||
void EDA_BASE_FRAME::SetAutoSaveInterval( int aInterval )
|
||||
{
|
||||
m_autoSaveInterval = aInterval;
|
||||
|
||||
if( m_autoSaveTimer->IsRunning() )
|
||||
{
|
||||
if( m_autoSaveInterval > 0 )
|
||||
{
|
||||
m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_autoSaveTimer->Stop();
|
||||
m_autoSaveState = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void EDA_BASE_FRAME::onAutoSaveTimer( wxTimerEvent& aEvent )
|
||||
{
|
||||
if( !doAutoSave() )
|
||||
|
|
|
@ -209,7 +209,7 @@ public:
|
|||
|
||||
bool Enable( bool enable ) override;
|
||||
|
||||
void SetAutoSaveInterval( int aInterval ) { m_autoSaveInterval = aInterval; }
|
||||
void SetAutoSaveInterval( int aInterval );
|
||||
|
||||
int GetAutoSaveInterval() const { return m_autoSaveInterval; }
|
||||
|
||||
|
|
Loading…
Reference in New Issue