Commit 0dbdc2a3 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Have a default location for project workspace.

parent e480a507
......@@ -292,6 +292,11 @@ MainWindow::initVlmcPreferences()
QT_TRANSLATE_NOOP( "PreferenceWidget", "Proxy Password" ),
QT_TRANSLATE_NOOP( "PreferenceWidget", "The HTTP Proxy Password" ) );
VLMC_CREATE_PREFERENCE_PATH( "general/DefaultProjectLocation", QDir::homePath(),
QT_TRANSLATE_NOOP( "PreferencesWidget", "Project default location" ),
QT_TRANSLATE_NOOP( "PreferenceWidget", "The default location where to store projects folders" ) );
//Load saved preferences :
QSettings s;
if ( s.value( "VlmcVersion" ).toString() != PROJECT_VERSION )
......
......@@ -121,10 +121,12 @@ GUIProjectManager::createNewProjectFile( bool saveAs )
{
bool relocate = false;
QString defaultPath = VLMC_PROJECT_GET_STRING( "general/Workspace" );
if ( defaultPath.length() == 0 )
defaultPath = VLMC_GET_STRING( "general/DefaultProjectLocation" );
QString outputFileName =
QFileDialog::getSaveFileName( NULL, "Enter the output file name",
VLMC_PROJECT_GET_STRING( "general/Workspace" ),
"VLMC project file(*.vlmc)" );
defaultPath, "VLMC project file(*.vlmc)" );
if ( outputFileName.length() == 0 )
return false;
if ( Workspace::isInProjectDir( outputFileName ) == false )
......@@ -291,10 +293,10 @@ GUIProjectManager::loadProject( const QString &fileName )
void
GUIProjectManager::loadProject()
{
//FIXME: Have a default path to store projects
QString fileName =
QFileDialog::getOpenFileName( NULL, "Enter the output file name",
QString(), "VLMC project file(*.vlmc)" );
VLMC_GET_STRING( "general/DefaultProjectLocation" ),
"VLMC project file(*.vlmc)" );
if ( fileName.length() <= 0 ) //If the user canceled.
return ;
loadProject( fileName );
......
......@@ -76,8 +76,7 @@ void GeneralPage::initializePage()
ui.lineEditName->setText( projectName );
//fetching the global workspace path
//FIXME: have a default path to store projects.
QString workspacePath = QDir::homePath();
QString workspacePath = VLMC_GET_STRING( "general/DefaultProjectLocation" );
ui.lineEditWorkspace->setText( workspacePath );
updateProjectLocation();
......
......@@ -132,10 +132,10 @@ void WelcomePage::loadRecentsProjects()
void WelcomePage::loadProject()
{
//FIXME: have a default path to store vlmc projects
QString projectPath =
QFileDialog::getOpenFileName( NULL, "Enter the output file name",
QDir::homePath(), "VLMC project file(*.vlmc)" );
VLMC_GET_STRING( "general/DefaultProjectLocation" ),
"VLMC project file(*.vlmc)" );
if ( projectPath.isEmpty() ) return;
......
......@@ -58,10 +58,6 @@ ProjectManager::ProjectManager() : m_projectFile( NULL ), m_needSave( false )
VLMC_CREATE_PROJECT_INT( "audio/AudioSampleRate", 0,
QT_TRANSLATE_NOOP( "PreferenceWidget", "Audio samplerate" ),
QT_TRANSLATE_NOOP( "PreferenceWidget", "Output project audio samplerate" ) );
//FIXME: Change this to have a default path for vlmc projects
// VLMC_CREATE_PREFERENCE_STRING( "general/VLMCWorkspace", QDir::homePath(),
// QT_TRANSLATE_NOOP( "PreferenceWidget", "Workspace location" ),
// QT_TRANSLATE_NOOP( "PreferenceWidget", "The place where all project's medias will be stored" ) );
VLMC_CREATE_PROJECT_STRING( "general/ProjectName", unNamedProject,
QT_TRANSLATE_NOOP( "PreferenceWidget", "Project name" ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment