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 @@
#include "Import.h"
#include "MediaLibraryWidget.h"
#include "LanguagePreferences.h"
#include "ProjectManager.h"
MainWindow::MainWindow( QWidget *parent ) :
QMainWindow( parent ), m_renderer( NULL )
......@@ -83,6 +84,9 @@ MainWindow::MainWindow( QWidget *parent ) :
connect( this, SIGNAL( toolChanged( ToolButtons ) ),
m_timeline, SLOT( setTool( ToolButtons ) ) );
connect( ProjectManager::getInstance(), SIGNAL( projectChanged( const QString&, bool ) ),
this, SLOT( projectChanged( const QString&, bool ) ) );
QSettings s;
// Restore the geometry
restoreGeometry( s.value( "MainWindowGeometry" ).toByteArray() );
......@@ -414,3 +418,13 @@ void MainWindow::closeEvent( QCloseEvent* e )
else
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 );
}
......@@ -79,21 +79,22 @@ private:
ProjectWizard* m_pWizard;
private slots:
void on_actionBypass_effects_engine_toggled(bool );
void on_actionFullscreen_triggered( bool checked );
void on_actionQuit_triggered();
void on_actionAbout_triggered();
void on_actionPreferences_triggered();
void on_actionTranscode_triggered();
void on_actionRender_triggered();
void on_actionNew_Project_triggered();
void on_actionLoad_Project_triggered();
void on_actionSave_triggered();
void on_actionImport_triggered();
void on_actionHelp_triggered();
void on_actionProject_Preferences_triggered();
void on_actionProject_Wizard_triggered();
void toolButtonClicked( int id );
void on_actionBypass_effects_engine_toggled(bool );
void on_actionFullscreen_triggered( bool checked );
void on_actionQuit_triggered();
void on_actionAbout_triggered();
void on_actionPreferences_triggered();
void on_actionTranscode_triggered();
void on_actionRender_triggered();
void on_actionNew_Project_triggered();
void on_actionLoad_Project_triggered();
void on_actionSave_triggered();
void on_actionImport_triggered();
void on_actionHelp_triggered();
void on_actionProject_Preferences_triggered();
void on_actionProject_Wizard_triggered();
void toolButtonClicked( int id );
void projectChanged( const QString& projectName, bool savedStatus );
signals:
void translateDockWidgetTitle();
......
......@@ -30,6 +30,7 @@
ProjectManager::ProjectManager() : m_projectFile( NULL ), m_needSave( false )
{
}
ProjectManager::~ProjectManager()
......@@ -46,12 +47,17 @@ bool ProjectManager::needSave() const
void ProjectManager::cleanChanged( bool val )
{
m_needSave = !val;
if ( m_projectFile != NULL )
emit projectChanged( m_projectFile->fileName(), val );
else
emit projectChanged( tr( "<Unsaved project>" ), val );
}
void ProjectManager::loadTimeline()
{
QDomElement root = m_domDocument->documentElement();
MainWorkflow::getInstance()->loadProject( root.firstChildElement( "timeline" ) );
emit projectChanged( m_projectFile->fileName(), true );
}
void ProjectManager::loadProject()
......
......@@ -55,6 +55,9 @@ private:
private slots:
void loadTimeline();
void cleanChanged( bool val );
signals:
void projectChanged( const QString& projectName, bool savedState );
};
#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