change automation editor window title on rename automation pattern

This commit is contained in:
Steffen Baranowsky
2016-09-18 13:56:36 +02:00
parent 354cb78412
commit d600d56ad3
2 changed files with 15 additions and 0 deletions

View File

@@ -288,6 +288,9 @@ protected slots:
void play();
void stop();
private slots:
void updateWindowTitle();
private:
QAction* m_discreteAction;
QAction* m_linearAction;

View File

@@ -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() ) );
}