SetupDialog: added option for disabling auto save feature

As requested by various users, it should be configurable whether the
auto save feature is active or not.
This commit is contained in:
Tobias Doerffel
2012-10-27 22:45:59 +02:00
parent d448e6743d
commit c1368ddb1a
3 changed files with 28 additions and 4 deletions

View File

@@ -105,6 +105,7 @@ private slots:
void toggleDisableChActInd( bool _disabled );
void toggleManualChPiano( bool _enabled );
void toggleSmoothScroll( bool _enabled );
void toggleAutoSave( bool _enabled );
void toggleOneInstrumentTrackWindow( bool _enabled );
void toggleCompactTrackButtons( bool _enabled );
@@ -152,6 +153,7 @@ private:
bool m_disableChActInd;
bool m_manualChPiano;
bool m_smoothScroll;
bool m_disableAutoSave;
bool m_oneInstrumentTrackWindow;
bool m_compactTrackButtons;

View File

@@ -184,9 +184,12 @@ MainWindow::MainWindow( void ) :
m_updateTimer.start( 1000 / 20, this ); // 20 fps
// connect auto save
connect(&m_autoSaveTimer, SIGNAL(timeout()), this, SLOT(autoSave()));
m_autoSaveTimer.start(1000 * 60); // 1 minute
if( !configManager::inst()->value( "ui", "disableautosave" ).toInt() )
{
// connect auto save
connect(&m_autoSaveTimer, SIGNAL(timeout()), this, SLOT(autoSave()));
m_autoSaveTimer.start(1000 * 60); // 1 minute
}
}

View File

@@ -113,6 +113,7 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) :
m_manualChPiano( configManager::inst()->value( "ui",
"manualchannelpiano" ).toInt() ),
m_smoothScroll( configManager::inst()->value( "ui", "smoothscroll" ).toInt() ),
m_disableAutoSave( configManager::inst()->value( "ui", "disableautosave" ).toInt() ),
m_oneInstrumentTrackWindow( configManager::inst()->value( "ui",
"oneinstrumenttrackwindow" ).toInt() ),
m_compactTrackButtons( configManager::inst()->value( "ui",
@@ -464,7 +465,7 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) :
tabWidget * ui_fx_tw = new tabWidget( tr( "UI effects vs. "
"performance" ).toUpper(),
performance );
ui_fx_tw->setFixedHeight( 90 );
ui_fx_tw->setFixedHeight( 100 );
ledCheckBox * disable_ch_act_ind = new ledCheckBox(
tr( "Disable channel activity indicators" ),
@@ -491,6 +492,14 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) :
this, SLOT( toggleSmoothScroll( bool ) ) );
ledCheckBox * autoSave = new ledCheckBox(
tr( "Disable auto save feature" ), ui_fx_tw );
autoSave->move( 10, 80 );
autoSave->setChecked( m_disableAutoSave );
connect( autoSave, SIGNAL( toggled( bool ) ),
this, SLOT( toggleAutoSave( bool ) ) );
perf_layout->addWidget( ui_fx_tw );
perf_layout->addStretch();
@@ -759,6 +768,8 @@ void setupDialog::accept()
QString::number( m_manualChPiano ) );
configManager::inst()->setValue( "ui", "smoothscroll",
QString::number( m_smoothScroll ) );
configManager::inst()->setValue( "ui", "disableautosave",
QString::number( m_disableAutoSave ) );
configManager::inst()->setValue( "ui", "oneinstrumenttrackwindow",
QString::number( m_oneInstrumentTrackWindow ) );
configManager::inst()->setValue( "ui", "compacttrackbuttons",
@@ -926,6 +937,14 @@ void setupDialog::toggleSmoothScroll( bool _enabled )
void setupDialog::toggleAutoSave( bool _enabled )
{
m_disableAutoSave = _enabled;
}
void setupDialog::toggleCompactTrackButtons( bool _enabled )