Skip to content
Snippets Groups Projects

some View classes renamed -> Display or Listing

Merged Wuttke, Joachim requested to merge j.corr2 into main
4 files
+ 19
20
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -36,11 +36,11 @@ InstrumentView::InstrumentView(QWidget* parent, ProjectDocument* document)
, m_document(document)
{
// Left margin: instrument list
m_instrumentListView = new InstrumentListing(document, this);
m_instrumentListView->setVisible(!document->singleInstrumentMode());
m_listing = new InstrumentListing(document, this);
m_listing->setVisible(!document->singleInstrumentMode());
connect(m_document, &ProjectDocument::singleInstrumentModeChanged,
[this]() { m_instrumentListView->setVisible(!m_document->singleInstrumentMode()); });
connect(m_instrumentListView, &InstrumentListing::instrumentSelected, this,
[this]() { m_listing->setVisible(!m_document->singleInstrumentMode()); });
connect(m_listing, &InstrumentListing::instrumentSelected, this,
&InstrumentView::createWidgetsForCurrentInstrument);
// Large widget: current instrument
@@ -51,11 +51,11 @@ InstrumentView::InstrumentView(QWidget* parent, ProjectDocument* document)
// Top toolbar with action buttons "new ...instrument" etc
auto* toolbar = new StyledToolbar(this);
toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
toolbar->addActions(m_instrumentListView->toolbarActions());
toolbar->addActions(m_listing->toolbarActions());
// Overall layout
auto* horizontalLayout = new QHBoxLayout;
horizontalLayout->addWidget(m_instrumentListView);
horizontalLayout->addWidget(m_listing);
horizontalLayout->addWidget(m_scrollArea, 1);
auto* mainLayout = new QVBoxLayout(this);
mainLayout->setContentsMargins(0, 0, 0, 0);
@@ -86,7 +86,7 @@ void InstrumentView::hideEvent(QHideEvent*)
void InstrumentView::createWidgetsForCurrentInstrument()
{
auto* currentInstrument = m_instrumentListView->currentInstrumentItem();
auto* currentInstrument = m_listing->currentInstrumentItem();
if (!currentInstrument) {
m_scrollArea->setWidget(new QWidget(m_scrollArea)); // blank widget
return;
@@ -155,14 +155,14 @@ void InstrumentView::createWidgetsForCurrentInstrument()
void InstrumentView::onInstrumentNameEdited(const QString& newName)
{
auto* currentInstrument = m_instrumentListView->currentInstrumentItem();
auto* currentInstrument = m_listing->currentInstrumentItem();
if (currentInstrument && currentInstrument->instrumentName() != newName)
m_document->multiNotifier()->setInstrumentName(currentInstrument, newName);
}
void InstrumentView::onInstrumentdescriptionEdited(const QString& t)
{
auto* currentInstrument = m_instrumentListView->currentInstrumentItem();
auto* currentInstrument = m_listing->currentInstrumentItem();
if (currentInstrument && currentInstrument->description() != t) {
currentInstrument->setDescription(t);
onInstrumentChangedByEditor();
@@ -174,13 +174,12 @@ void InstrumentView::onInstrumentChangedByEditor()
// uses 'MultiInstrumentNotifier::instrumentChanged' signal for two purposes:
// 1) notify 'ProjectDocument' that user has changed data ==> mark project with '*'
// 2) notify 'LinkInstrumentManager' ==> unlink instrument from data if they are incompatible
m_document->multiNotifier()->notifyInstrumentChanged(
m_instrumentListView->currentInstrumentItem());
m_document->multiNotifier()->notifyInstrumentChanged(m_listing->currentInstrumentItem());
}
void InstrumentView::onInstrumentChangedFromExternal(const InstrumentItem* instrument)
{
if (instrument == m_instrumentListView->currentInstrumentItem())
if (instrument == m_listing->currentInstrumentItem())
createWidgetsForCurrentInstrument();
}
Loading