Commit 19bbe9e9 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Saving project is functionnal

parent 7170c83f
......@@ -140,6 +140,21 @@ void MainWindow::setupLibrary()
this, SLOT( mediaListItemDoubleClicked( QListWidgetItem* ) ) );
}
void MainWindow::on_actionSave_triggered()
{
QString outputFileName =
QFileDialog::getSaveFileName( NULL, "Enter the output file name",
QString(), "VLMC project file(*.vlmc)" );
if ( outputFileName.length() == 0 )
return ;
else
{
//Project manager will destroy itself.
ProjectManager* pm = new ProjectManager( outputFileName );
pm->saveProject();
}
}
void MainWindow::on_actionLoad_Project_triggered()
{
QString outputFileName =
......@@ -252,7 +267,7 @@ void MainWindow::on_actionRender_triggered()
}
QString outputFileName =
QFileDialog::getSaveFileName( NULL, "Enter the output file name",
QString(), "Videos(*.avi *.mpg)" );
QDir::currentPath(), "Videos(*.avi *.mpg)" );
if ( outputFileName.length() == 0 )
return ;
else
......@@ -285,13 +300,6 @@ void MainWindow::on_actionNew_Project_triggered()
m_projectPreferences->show();
}
void MainWindow::on_actionOpen_Project_triggered()
{
QString path = QFileDialog::getOpenFileName( this, tr( "Choose a project to open" ),
QDir::currentPath(),
tr( "VideoLAN Movie Creator file (*.vlmc)" ) );
}
void MainWindow::zoomIn()
{
m_zoomSlider->setValue( m_zoomSlider->value() - 1 );
......
......@@ -81,8 +81,8 @@ private slots:
void on_actionTranscode_File_triggered();
void on_actionRender_triggered();
void on_actionNew_Project_triggered();
void on_actionOpen_Project_triggered();
void on_actionLoad_Project_triggered();
void on_actionSave_triggered();
void mediaListItemDoubleClicked( QListWidgetItem* );
signals:
......
......@@ -35,8 +35,8 @@
<string>File</string>
</property>
<addaction name="actionNew_Project"/>
<addaction name="actionOpen_Project"/>
<addaction name="actionLoad_Project"/>
<addaction name="actionSave"/>
<addaction name="actionTranscode_File"/>
<addaction name="actionRender"/>
<addaction name="actionQuit"/>
......@@ -171,6 +171,11 @@
<string>Load Project</string>
</property>
</action>
<action name="actionSave">
<property name="text">
<string>Save</string>
</property>
</action>
</widget>
<resources>
<include location="../../../ressources.qrc"/>
......
......@@ -149,7 +149,7 @@ void Library::loadProject( const QDomElement& medias )
}
}
void Library::saveProject( QDomDocument& doc )
void Library::saveProject( QDomDocument& doc, QDomElement& rootNode )
{
QHash<QUuid, Media*>::iterator it = m_medias.begin();
QHash<QUuid, Media*>::iterator end = m_medias.end();
......@@ -174,5 +174,5 @@ void Library::saveProject( QDomDocument& doc )
media.appendChild( mrl );
media.appendChild( uuid );
}
doc.appendChild( medias );
rootNode.appendChild( medias );
}
......@@ -70,7 +70,7 @@ public slots:
void removingMediaAsked( const QUuid& uuid );
void loadProject( const QDomElement& project );
void saveProject( QDomDocument& doc );
void saveProject( QDomDocument& doc, QDomElement& rootNode );
private slots:
void metaDataComputed( Media* );
......
......@@ -474,7 +474,7 @@ void MainWorkflow::loadProject( const QDomElement& project )
}
}
void MainWorkflow::saveProject( QDomDocument& doc )
void MainWorkflow::saveProject( QDomDocument& doc, QDomElement& rootNode )
{
QDomElement project = doc.createElement( "timeline" );
for ( unsigned int i = 0; i < m_trackCount; ++i )
......@@ -489,7 +489,7 @@ void MainWorkflow::saveProject( QDomDocument& doc )
project.appendChild( trackNode );
}
}
doc.appendChild( project );
rootNode.appendChild( project );
}
void MainWorkflow::clear()
......
......@@ -148,7 +148,7 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
public slots:
void loadProject( const QDomElement& project );
void saveProject( QDomDocument& doc );
void saveProject( QDomDocument& doc, QDomElement& rootNode );
signals:
/**
......
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