Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/InstrumentTrackView.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ class InstrumentTrackView : public TrackView


private slots:
//! Slot to update the state of the track label button when the instrument changes.
//! An instrument may be loaded or removed, so the button should be enabled or disabled accordingly.
Comment thread
rubiefawn marked this conversation as resolved.
Outdated
void onInstrumentChanged();
void toggleInstrumentWindow( bool _on );
void toggleMidiCCRack();
void activityIndicatorPressed();
Expand Down
5 changes: 5 additions & 0 deletions src/gui/instrument/InstrumentTrackWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,11 @@ void InstrumentTrackWindow::viewPrevInstrument()

void InstrumentTrackWindow::adjustTabSize(QWidget *w)
{
// Check if the widget is null, as not all tabs are always present (e.g. the plugin tab is only present if an instrument is loaded)
if( w == nullptr )
{
return;
}
Comment thread
rubiefawn marked this conversation as resolved.
Outdated
// "-1" :
// in "TabWidget::addTab", under "Position tab's window", the widget is
// moved up by 1 pixel
Expand Down
18 changes: 18 additions & 0 deletions src/gui/tracks/InstrumentTrackView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, TrackContainerV
m_tlb->setIcon(determinePixmap(_it));
m_tlb->show();

// Check if an instrument has been loaded, if not disable the track label button to prevent opening an empty instrument window.
if( !_it->m_instrument ) {
m_tlb->setEnabled( false );
}
Comment thread
rubiefawn marked this conversation as resolved.
Outdated

connect( m_tlb, SIGNAL(toggled(bool)),
this, SLOT(toggleInstrumentWindow(bool)));

Expand All @@ -80,6 +85,10 @@ InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, TrackContainerV
connect(ConfigManager::inst(), SIGNAL(valueChanged(QString,QString,QString)),
this, SLOT(handleConfigChange(QString,QString,QString)));

// update the state of the track label button when the instrument changes, as an instrument may be loaded or removed.
connect( _it, SIGNAL(instrumentChanged()),
this, SLOT(onInstrumentChanged()));

Comment thread
rubiefawn marked this conversation as resolved.
Outdated
m_mixerChannelNumber = new MixerChannelLcdSpinBox(2, getTrackSettingsWidget(), tr("Mixer channel"), this);
m_mixerChannelNumber->show();

Expand Down Expand Up @@ -300,6 +309,15 @@ void InstrumentTrackView::dropEvent( QDropEvent * _de )



void InstrumentTrackView::onInstrumentChanged()
{
// Check if an instrument has been loaded, if not disable the track label button to prevent opening an empty instrument window.
m_tlb->setEnabled( model()->m_instrument != nullptr );
Comment thread
rubiefawn marked this conversation as resolved.
Outdated
}




void InstrumentTrackView::toggleInstrumentWindow( bool _on )
{
if (_on && ConfigManager::inst()->value("ui", "oneinstrumenttrackwindow").toInt())
Expand Down
Loading