ask whether to create working-directory if it does not exist

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1241 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-06-30 19:57:42 +00:00
parent 6fb0c2cd42
commit 9c3fa640ae
2 changed files with 25 additions and 54 deletions

View File

@@ -1,5 +1,8 @@
2008-06-30 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* src/core/config_mgr.cpp:
ask whether to create working-directory if it does not exist
* src/core/fx_mixer.cpp:
reset mute-model in fxMixer::clear()

View File

@@ -75,20 +75,6 @@ configManager::~configManager()
/*void configManager::openWorkingDir( void )
{
QString new_dir = QFileDialog::getExistingDirectory( this,
tr( "Choose LMMS working directory" ),
m_workingDir );
if( new_dir != QString::null )
{
m_wdLineEdit->setText( new_dir );
}
}*/
void configManager::setWorkingDir( const QString & _wd )
{
m_workingDir = _wd;
@@ -138,43 +124,6 @@ void configManager::setSTKDir( const QString & _fd )
/*
void configManager::accept( void )
{
if( m_workingDir.right( 1 ) != "/" )
{
m_workingDir += '/';
}
if( !QDir( m_workingDir ).exists() )
{
if( QMessageBox::question
( 0, tr( "Directory not existing" ),
tr( "The directory you "
"specified does not "
"exist. Create it?" ),
QMessageBox::Yes, QMessageBox::No )
== QMessageBox::Yes )
{
QDir().mkpath( m_workingDir );
}
else
{
switchPage( m_pageWorkingDir );
return;
}
}
QDir().mkpath( userProjectsDir() );
QDir().mkpath( userSamplesDir() );
QDir().mkpath( userPresetsDir() );
saveConfigFile();
QDialog::accept();
}
*/
void configManager::addRecentlyOpenedProject( const QString & _file )
{
@@ -334,14 +283,33 @@ bool configManager::loadConfigFile( void )
#ifdef LMMS_LMMS_HAVE_STK_H
if( m_stkDir == "" )
{
m_stkDir = "/usr/share/stk/rawwaves/";
}
{
m_stkDir = "/usr/share/stk/rawwaves/";
}
#endif
QDir::setSearchPaths( "resources", QStringList() << artworkDir()
<< defaultArtworkDir() );
if( !QDir( m_workingDir ).exists() )
{
if( QMessageBox::question( 0,
mainWindow::tr( "Working directory" ),
mainWindow::tr( "The LMMS working directory %1 does not "
"exist. Create it now? You can change the directory "
"later via Edit -> Settings." ).arg( m_workingDir ),
QMessageBox::Yes, QMessageBox::No ) ==
QMessageBox::Yes )
{
QDir().mkpath( m_workingDir );
}
}
if( QDir( m_workingDir ).exists() )
{
QDir().mkpath( userProjectsDir() );
QDir().mkpath( userSamplesDir() );
QDir().mkpath( userPresetsDir() );
}
return( TRUE );
}