From a98534ac46bd5fb04499ec531f80ac4b17d95daa Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Wed, 1 Jul 2015 23:39:51 +0200 Subject: [PATCH] Fixes #2144 ("Track name not shown in PianoRoll titlebar") Moves the code that sets the window title from PianoRoll::setCurrentPattern to PianoRollWindow::setCurrentPattern which is the widget that corresponds to the MDI window. --- src/gui/editors/PianoRoll.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 11e744809..9496f3581 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -534,7 +534,6 @@ void PianoRoll::setCurrentPattern( Pattern* newPattern ) if( ! hasValidPattern() ) { //resizeEvent( NULL ); - setWindowTitle( tr( "Piano-Roll - no pattern" ) ); update(); emit currentPatternChanged(); @@ -577,8 +576,6 @@ void PianoRoll::setCurrentPattern( Pattern* newPattern ) connect( m_pattern->instrumentTrack(), SIGNAL( midiNoteOff( const Note& ) ), this, SLOT( finishRecordNote( const Note& ) ) ); connect( m_pattern->instrumentTrack()->pianoModel(), SIGNAL( dataChanged() ), this, SLOT( update() ) ); - setWindowTitle( tr( "Piano-Roll - %1" ).arg( m_pattern->name() ) ); - update(); emit currentPatternChanged(); } @@ -4264,6 +4261,15 @@ const Pattern* PianoRollWindow::currentPattern() const void PianoRollWindow::setCurrentPattern(Pattern* pattern) { m_editor->setCurrentPattern(pattern); + + if ( pattern ) + { + setWindowTitle( tr( "Piano-Roll - %1" ).arg( pattern->name() ) ); + } + else + { + setWindowTitle( tr( "Piano-Roll - no pattern" ) ); + } } bool PianoRollWindow::isRecording() const