Added a Gig directory to user lmms folder

Added option to set gig folder in setup dialog
Gig player now opens at this location
This commit is contained in:
Dave French
2015-03-06 18:56:15 +00:00
parent 8dfa2cf7d0
commit 2271af81c4
5 changed files with 68 additions and 2 deletions

View File

@@ -67,6 +67,7 @@ ConfigManager::ConfigManager() :
#endif
m_vstDir( m_workingDir + "vst" + QDir::separator() ),
m_flDir( QDir::home().absolutePath() ),
m_gigDir( m_workingDir + GIG_PATH ),
m_version( defaultVersion() )
{
}
@@ -179,6 +180,11 @@ void ConfigManager::setBackgroundArtwork( const QString & _ba )
#endif
}
void ConfigManager::setGIGDir(const QString &gd)
{
m_gigDir = gd;
}
@@ -339,6 +345,8 @@ void ConfigManager::loadConfigFile()
}
}
setWorkingDir( value( "paths", "workingdir" ) );
setGIGDir( value( "paths", "gigdir" ) == "" ? gigDir() : value( "paths", "gigdir" ) );
setVSTDir( value( "paths", "vstdir" ) );
setFLDir( value( "paths", "fldir" ) );
setLADSPADir( value( "paths", "laddir" ) );
@@ -425,6 +433,7 @@ void ConfigManager::loadConfigFile()
QDir().mkpath( userProjectsDir() );
QDir().mkpath( userSamplesDir() );
QDir().mkpath( userPresetsDir() );
QDir().mkpath( userGigDir() );
}
upgrade();
@@ -439,6 +448,7 @@ void ConfigManager::saveConfigFile()
setValue( "paths", "workingdir", m_workingDir );
setValue( "paths", "vstdir", m_vstDir );
setValue( "paths", "fldir", m_flDir );
setValue( "paths", "gigdir", m_gigDir );
setValue( "paths", "laddir", m_ladDir );
#ifdef LMMS_HAVE_STK
setValue( "paths", "stkdir", m_stkDir );

View File

@@ -106,6 +106,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) :
m_artworkDir( QDir::toNativeSeparators( ConfigManager::inst()->artworkDir() ) ),
m_flDir( QDir::toNativeSeparators( ConfigManager::inst()->flDir() ) ),
m_ladDir( QDir::toNativeSeparators( ConfigManager::inst()->ladspaDir() ) ),
m_gigDir( QDir::toNativeSeparators( ConfigManager::inst()->gigDir() ) ),
#ifdef LMMS_HAVE_FLUIDSYNTH
m_defaultSoundfont( QDir::toNativeSeparators( ConfigManager::inst()->defaultSoundfont() ) ),
#endif
@@ -501,6 +502,25 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) :
connect( vstdir_select_btn, SIGNAL( clicked() ), this,
SLOT( openVSTDir() ) );
// gig-dir
TabWidget * gig_tw = new TabWidget( tr(
"GIG directory" ).toUpper(),
pathSelectors );
gig_tw->setFixedHeight( 48 );
m_gigLineEdit = new QLineEdit( m_gigDir, gig_tw );
m_gigLineEdit->setGeometry( 10, 20, txtLength, 16 );
connect( m_gigLineEdit, SIGNAL( textChanged( const QString & ) ), this,
SLOT( setGIGDir( const QString & ) ) );
QPushButton * gigdir_select_btn = new QPushButton(
embed::getIconPixmap( "project_open", 16, 16 ),
"", gig_tw );
gigdir_select_btn->setFixedSize( 24, 24 );
gigdir_select_btn->move( btnStart, 16 );
connect( gigdir_select_btn, SIGNAL( clicked() ), this,
SLOT( openGIGDir() ) );
// LADSPA-dir
TabWidget * lad_tw = new TabWidget( tr(
"LADSPA plugin directories" ).toUpper(),
@@ -566,6 +586,8 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) :
pathSelectorLayout->addWidget( lmms_wd_tw );
pathSelectorLayout->addSpacing( 10 );
pathSelectorLayout->addWidget( gig_tw );
pathSelectorLayout->addSpacing( 10 );
pathSelectorLayout->addWidget( artwork_tw );
pathSelectorLayout->addSpacing( 10 );
pathSelectorLayout->addWidget( backgroundArtwork_tw );
@@ -931,6 +953,7 @@ void SetupDialog::accept()
ConfigManager::inst()->setWorkingDir( m_workingDir );
ConfigManager::inst()->setVSTDir( m_vstDir );
ConfigManager::inst()->setGIGDir( m_gigDir );
ConfigManager::inst()->setArtworkDir( m_artworkDir );
ConfigManager::inst()->setFLDir( m_flDir );
ConfigManager::inst()->setLADSPADir( m_ladDir );
@@ -1154,6 +1177,17 @@ void SetupDialog::openWorkingDir()
}
}
void SetupDialog::openGIGDir()
{
QString new_dir = FileDialog::getExistingDirectory( this,
tr( "Choose your GIG directory" ),
m_gigDir );
if( new_dir != QString::null )
{
m_gigLineEdit->setText( new_dir );
}
}
@@ -1184,6 +1218,11 @@ void SetupDialog::setVSTDir( const QString & _vd )
m_vstDir = _vd;
}
void SetupDialog::setGIGDir(const QString &_gd)
{
}