diff --git a/include/AutomationEditor.h b/include/AutomationEditor.h index c85ca55be..3e0faaced 100644 --- a/include/AutomationEditor.h +++ b/include/AutomationEditor.h @@ -288,6 +288,9 @@ protected slots: void play(); void stop(); +private slots: + void updateWindowTitle(); + private: QAction* m_discreteAction; QAction* m_linearAction; diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index c532d1414..7ff86dbb2 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -2318,6 +2318,7 @@ void AutomationEditorWindow::setCurrentPattern(AutomationPattern* pattern) if (pattern) { connect(pattern, SIGNAL(dataChanged()), this, SLOT(update())); + connect( pattern, SIGNAL( dataChanged() ), this, SLOT( updateWindowTitle() ) ); connect(pattern, SIGNAL(destroyed()), this, SLOT(clearCurrentPattern())); connect(m_flipXAction, SIGNAL(triggered()), pattern, SLOT(flipX())); @@ -2394,3 +2395,14 @@ void AutomationEditorWindow::stop() { m_editor->stop(); } + +void AutomationEditorWindow::updateWindowTitle() +{ + if ( m_editor->m_pattern == nullptr) + { + setWindowTitle( tr( "Automation Editor - no pattern" ) ); + return; + } + + setWindowTitle( tr( "Automation Editor - %1" ).arg( m_editor->m_pattern->name() ) ); +}