[vlmc-devel] ProjectManager: Create a project file when creating a new project.

Hugo Beauzée-Luyssen git at videolan.org
Wed Sep 5 17:43:03 CEST 2012


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Sep  4 23:36:00 2012 +0300| [d0b1ee19a14a8da4ac617e459000160a5623e055] | committer: Hugo Beauzée-Luyssen

ProjectManager: Create a project file when creating a new project.

This avoid the user to be queried with the project file name just after
creating a project.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=d0b1ee19a14a8da4ac617e459000160a5623e055
---

 src/Gui/project/GuiProjectManager.cpp |    4 +++-
 src/Gui/project/GuiProjectManager.h   |    2 +-
 src/Gui/wizard/ProjectWizard.cpp      |    2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/Gui/project/GuiProjectManager.cpp b/src/Gui/project/GuiProjectManager.cpp
index 5f5be55..f56029a 100644
--- a/src/Gui/project/GuiProjectManager.cpp
+++ b/src/Gui/project/GuiProjectManager.cpp
@@ -176,11 +176,13 @@ GUIProjectManager::closeProject()
 }
 
 void
-GUIProjectManager::newProject( const QString &projectName )
+GUIProjectManager::newProject( const QString &projectName, const QString &workspacePath )
 {
     if ( closeProject() == false )
         return ;
     m_projectName = projectName;
+    //Current project file has already been delete/nulled by ProjectManager::closeProject()
+    m_projectFile = new QFile( workspacePath + '/' + "project.vlmc" );
     emit projectUpdated( this->projectName(), false );
 }
 
diff --git a/src/Gui/project/GuiProjectManager.h b/src/Gui/project/GuiProjectManager.h
index cf45322..1a02360 100644
--- a/src/Gui/project/GuiProjectManager.h
+++ b/src/Gui/project/GuiProjectManager.h
@@ -36,7 +36,7 @@ public:
     GUIProjectManager();
 
     bool            askForSaveIfModified();
-    void            newProject( const QString& projectName );
+    void            newProject( const QString& projectName, const QString &workspacePath );
     /**
      *  \brief      Save the project using the current project file.
      */
diff --git a/src/Gui/wizard/ProjectWizard.cpp b/src/Gui/wizard/ProjectWizard.cpp
index ebfa095..2db9752 100644
--- a/src/Gui/wizard/ProjectWizard.cpp
+++ b/src/Gui/wizard/ProjectWizard.cpp
@@ -100,7 +100,7 @@ ProjectWizard::accept()
     if ( currentId() == Page_Video )
     {
         SettingsManager *sManager = SettingsManager::getInstance();
-        GUIProjectManager::getInstance()->newProject( field( "projectName" ).toString() );
+        GUIProjectManager::getInstance()->newProject( field( "projectName" ).toString(), field( "workspace" ).toString() );
         sManager->setValue( "general/Workspace", field( "workspace" ), SettingsManager::Project );
 
         sManager->setValue( "video/VLMCOutputFPS", field( "fps" ), SettingsManager::Project );



More information about the Vlmc-devel mailing list