From cefa0ac18c23ce896052a9c122eccc96e9f2b496 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Sun, 19 Aug 2018 10:42:11 -1000 Subject: [PATCH] Ensure all post-show widgets are constructed with a parent --- Editor/SongGroupEditor.cpp | 6 +++- Editor/SoundGroupEditor.cpp | 2 +- Editor/resources/lang_de.ts | 68 ++++++++++++++++++------------------- 3 files changed, 40 insertions(+), 36 deletions(-) diff --git a/Editor/SongGroupEditor.cpp b/Editor/SongGroupEditor.cpp index 1dac26c..5749fcf 100644 --- a/Editor/SongGroupEditor.cpp +++ b/Editor/SongGroupEditor.cpp @@ -337,7 +337,10 @@ void MIDIFileDelegate::setModelData(QWidget* editor, QAbstractItemModel* m, cons const SetupListModel* model = static_cast(index.model()); auto entry = model->m_sorted[index.row()]; if (g_MainWindow->projectModel()->getMIDIPathOfSong(entry->first) == widget->path()) + { + emit m->dataChanged(index, index); return; + } g_MainWindow->pushUndoCommand(new SongMIDIPathChangeUndoCommand(model->m_node.get(), tr("Change MIDI Path"), entry->first, widget->path())); emit m->dataChanged(index, index); @@ -1417,7 +1420,8 @@ void SongGroupEditor::setupDataChanged() std::vector arrData = LoadSongFile(g_MainWindow->projectModel()->dir().absoluteFilePath(path)); if (!arrData.empty()) { - MIDIPlayerWidget* newW = new MIDIPlayerWidget(index, m_setupList.m_node->m_id, p.m_it->first, std::move(arrData)); + MIDIPlayerWidget* newW = new MIDIPlayerWidget(index, m_setupList.m_node->m_id, p.m_it->first, + std::move(arrData), m_setupTable->m_listView->viewport()); m_setupTable->m_listView->setIndexWidget(index, newW); } else diff --git a/Editor/SoundGroupEditor.cpp b/Editor/SoundGroupEditor.cpp index 646bdee..70cd492 100644 --- a/Editor/SoundGroupEditor.cpp +++ b/Editor/SoundGroupEditor.cpp @@ -645,7 +645,7 @@ void SoundGroupEditor::sfxDataChanged() SFXPlayerWidget* w = qobject_cast(m_sfxTable->indexWidget(index)); if (!w || w->sfxId() != p->first) { - SFXPlayerWidget* newW = new SFXPlayerWidget(index, m_sfxs.m_node->m_id, p->first); + SFXPlayerWidget* newW = new SFXPlayerWidget(index, m_sfxs.m_node->m_id, p->first, m_sfxTable->viewport()); m_sfxTable->setIndexWidget(index, newW); } ++idx; diff --git a/Editor/resources/lang_de.ts b/Editor/resources/lang_de.ts index 3bfb078..f350b3f 100644 --- a/Editor/resources/lang_de.ts +++ b/Editor/resources/lang_de.ts @@ -329,7 +329,7 @@ MIDIFileDelegate - + Change MIDI Path @@ -350,13 +350,13 @@ MIDIPlayerWidget - + Stop - - + + Play @@ -1002,38 +1002,38 @@ PageModel - + Program Conflict - + Program %1 is already defined in table - - + + Change %1 - + Program - + Object - + Priority - + Max Voices @@ -1067,12 +1067,12 @@ PageTableView - + Delete Page Entries - + Delete Page Entry @@ -1490,27 +1490,27 @@ SetupListModel - + Song Conflict - + Song %1 is already defined in project - + Change Song Name - + Song - + MIDI File @@ -1518,32 +1518,32 @@ SetupModel - + Change %1 - + Program - + Volume - + Panning - + Reverb - + Chorus @@ -1551,12 +1551,12 @@ SetupTableView - + Delete Setup Entries - + Delete Setup Entry @@ -1564,37 +1564,37 @@ SongGroupEditor - + Add new page entry - + Remove selected page entries - + Normal Pages - + Add Page Entry - + Add Setup Entry - + Drum Pages - + MIDI Setups