Commit 2e05ad34 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Window's name is updated according to the project state

parent d753473b
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
#include "Import.h" #include "Import.h"
#include "MediaLibraryWidget.h" #include "MediaLibraryWidget.h"
#include "LanguagePreferences.h" #include "LanguagePreferences.h"
#include "ProjectManager.h"
MainWindow::MainWindow( QWidget *parent ) : MainWindow::MainWindow( QWidget *parent ) :
QMainWindow( parent ), m_renderer( NULL ) QMainWindow( parent ), m_renderer( NULL )
...@@ -83,6 +84,9 @@ MainWindow::MainWindow( QWidget *parent ) : ...@@ -83,6 +84,9 @@ MainWindow::MainWindow( QWidget *parent ) :
connect( this, SIGNAL( toolChanged( ToolButtons ) ), connect( this, SIGNAL( toolChanged( ToolButtons ) ),
m_timeline, SLOT( setTool( ToolButtons ) ) ); m_timeline, SLOT( setTool( ToolButtons ) ) );
connect( ProjectManager::getInstance(), SIGNAL( projectChanged( const QString&, bool ) ),
this, SLOT( projectChanged( const QString&, bool ) ) );
QSettings s; QSettings s;
// Restore the geometry // Restore the geometry
restoreGeometry( s.value( "MainWindowGeometry" ).toByteArray() ); restoreGeometry( s.value( "MainWindowGeometry" ).toByteArray() );
...@@ -414,3 +418,13 @@ void MainWindow::closeEvent( QCloseEvent* e ) ...@@ -414,3 +418,13 @@ void MainWindow::closeEvent( QCloseEvent* e )
else else
e->accept(); e->accept();
} }
void MainWindow::projectChanged( const QString& projectName, bool savedStatus )
{
QString title = tr( "VideoLAN Movie Creator" );
title += " ";
title += projectName;
if ( savedStatus == false )
title += " *";
setWindowTitle( title );
}
...@@ -94,6 +94,7 @@ private slots: ...@@ -94,6 +94,7 @@ private slots:
void on_actionProject_Preferences_triggered(); void on_actionProject_Preferences_triggered();
void on_actionProject_Wizard_triggered(); void on_actionProject_Wizard_triggered();
void toolButtonClicked( int id ); void toolButtonClicked( int id );
void projectChanged( const QString& projectName, bool savedStatus );
signals: signals:
void translateDockWidgetTitle(); void translateDockWidgetTitle();
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
ProjectManager::ProjectManager() : m_projectFile( NULL ), m_needSave( false ) ProjectManager::ProjectManager() : m_projectFile( NULL ), m_needSave( false )
{ {
} }
ProjectManager::~ProjectManager() ProjectManager::~ProjectManager()
...@@ -46,12 +47,17 @@ bool ProjectManager::needSave() const ...@@ -46,12 +47,17 @@ bool ProjectManager::needSave() const
void ProjectManager::cleanChanged( bool val ) void ProjectManager::cleanChanged( bool val )
{ {
m_needSave = !val; m_needSave = !val;
if ( m_projectFile != NULL )
emit projectChanged( m_projectFile->fileName(), val );
else
emit projectChanged( tr( "<Unsaved project>" ), val );
} }
void ProjectManager::loadTimeline() void ProjectManager::loadTimeline()
{ {
QDomElement root = m_domDocument->documentElement(); QDomElement root = m_domDocument->documentElement();
MainWorkflow::getInstance()->loadProject( root.firstChildElement( "timeline" ) ); MainWorkflow::getInstance()->loadProject( root.firstChildElement( "timeline" ) );
emit projectChanged( m_projectFile->fileName(), true );
} }
void ProjectManager::loadProject() void ProjectManager::loadProject()
......
...@@ -55,6 +55,9 @@ private: ...@@ -55,6 +55,9 @@ private:
private slots: private slots:
void loadTimeline(); void loadTimeline();
void cleanChanged( bool val ); void cleanChanged( bool val );
signals:
void projectChanged( const QString& projectName, bool savedState );
}; };
#endif // PROJECTMANAGER_H #endif // PROJECTMANAGER_H
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