[vlmc-devel] commit: Have a default location for project workspace. ( Hugo Beauzée-Luyssen )
git at videolan.org
git at videolan.org
Sun Jun 27 23:06:26 CEST 2010
vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Sun Jun 27 20:50:09 2010 +0200| [0dbdc2a3914f9502dd4a580c80e42942de227c9b] | committer: Hugo Beauzée-Luyssen
Have a default location for project workspace.
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=0dbdc2a3914f9502dd4a580c80e42942de227c9b
---
src/Gui/MainWindow.cpp | 5 +++++
src/Gui/project/GuiProjectManager.cpp | 10 ++++++----
src/Gui/wizard/GeneralPage.cpp | 3 +--
src/Gui/wizard/WelcomePage.cpp | 4 ++--
src/Project/ProjectManager.cpp | 4 ----
5 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index 4db65df..2c9d79c 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -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 )
diff --git a/src/Gui/project/GuiProjectManager.cpp b/src/Gui/project/GuiProjectManager.cpp
index 950b260..a9bac37 100644
--- a/src/Gui/project/GuiProjectManager.cpp
+++ b/src/Gui/project/GuiProjectManager.cpp
@@ -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 );
diff --git a/src/Gui/wizard/GeneralPage.cpp b/src/Gui/wizard/GeneralPage.cpp
index 241a82d..b30c7a5 100644
--- a/src/Gui/wizard/GeneralPage.cpp
+++ b/src/Gui/wizard/GeneralPage.cpp
@@ -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();
diff --git a/src/Gui/wizard/WelcomePage.cpp b/src/Gui/wizard/WelcomePage.cpp
index 564bb50..39d949e 100644
--- a/src/Gui/wizard/WelcomePage.cpp
+++ b/src/Gui/wizard/WelcomePage.cpp
@@ -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;
diff --git a/src/Project/ProjectManager.cpp b/src/Project/ProjectManager.cpp
index f580434..1a2a233 100644
--- a/src/Project/ProjectManager.cpp
+++ b/src/Project/ProjectManager.cpp
@@ -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" ),
More information about the Vlmc-devel
mailing list