From d600d56ad369dcb0715208067c1e17c03e2f7d7a Mon Sep 17 00:00:00 2001 From: Steffen Baranowsky Date: Sun, 18 Sep 2016 13:56:36 +0200 Subject: [PATCH] change automation editor window title on rename automation pattern --- include/AutomationEditor.h | 3 +++ src/gui/editors/AutomationEditor.cpp | 12 ++++++++++++ 2 files changed, 15 insertions(+) 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() ) ); +}