--Code Change

-Add Clear Sequence button to Sequence Panel
This commit is contained in:
Seth Troisi 2022-02-12 18:47:42 -08:00
parent 0fc2d3107e
commit 36e83c5552
5 changed files with 28 additions and 0 deletions

View File

@ -1234,6 +1234,7 @@ void Fractorium::SetTabOrders()
w = SetTabOrder(this, w, ui.SequenceLinearCheckBox);
w = SetTabOrder(this, w, ui.SequenceGenerateButton);
w = SetTabOrder(this, w, ui.SequenceRenderButton);
w = SetTabOrder(this, w, ui.SequenceClearButton);
w = SetTabOrder(this, w, ui.SequenceSaveButton);
w = SetTabOrder(this, w, ui.SequenceOpenButton);
w = SetTabOrder(this, w, ui.SequenceTree);

View File

@ -206,6 +206,7 @@ public slots:
void OnSequenceAllButtonClicked(bool checked);
void OnSequenceGenerateButtonClicked(bool checked);
void OnSequenceRenderButtonClicked(bool checked);
void OnSequenceClearButtonClicked(bool checked);
void OnSequenceSaveButtonClicked(bool checked);
void OnSequenceOpenButtonClicked(bool checked);
void OnSequenceRandomizeStaggerCheckBoxStateChanged(int state);

View File

@ -8097,6 +8097,16 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="SequenceClearButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Clear the sequence of generated thumbnails.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="SequenceSaveButton">
<property name="toolTip">

View File

@ -136,6 +136,7 @@ public:
virtual void Delete(const vector<pair<size_t, QTreeWidgetItem*>>& v) { }
virtual void FillSequenceTree() { }
virtual void SequenceGenerateButtonClicked() { }
virtual void SequenceClearButtonClicked() { }
virtual void SequenceSaveButtonClicked() { }
virtual void SequenceOpenButtonClicked() { }
@ -428,6 +429,7 @@ public:
void StopAllPreviewRenderers() override;
void FillSequenceTree() override;
void SequenceGenerateButtonClicked() override;
void SequenceClearButtonClicked() override;
void SequenceSaveButtonClicked() override;
void SequenceOpenButtonClicked() override;

View File

@ -17,6 +17,7 @@ void Fractorium::InitLibraryUI()
connect(ui.SequenceAllButton, SIGNAL(clicked(bool)), this, SLOT(OnSequenceAllButtonClicked(bool)), Qt::QueuedConnection);
connect(ui.SequenceGenerateButton, SIGNAL(clicked(bool)), this, SLOT(OnSequenceGenerateButtonClicked(bool)), Qt::QueuedConnection);
connect(ui.SequenceRenderButton, SIGNAL(clicked(bool)), this, SLOT(OnSequenceRenderButtonClicked(bool)), Qt::QueuedConnection);
connect(ui.SequenceClearButton, SIGNAL(clicked(bool)), this, SLOT(OnSequenceClearButtonClicked(bool)), Qt::QueuedConnection);
connect(ui.SequenceSaveButton, SIGNAL(clicked(bool)), this, SLOT(OnSequenceSaveButtonClicked(bool)), Qt::QueuedConnection);
connect(ui.SequenceOpenButton, SIGNAL(clicked(bool)), this, SLOT(OnSequenceOpenButtonClicked(bool)), Qt::QueuedConnection);
connect(ui.SequenceRandomizeStaggerCheckBox, SIGNAL(stateChanged(int)), this, SLOT(OnSequenceRandomizeStaggerCheckBoxStateChanged(int)), Qt::QueuedConnection);
@ -773,6 +774,19 @@ void Fractorium::OnSequenceRenderButtonClicked(bool checked)
}
}
/// <summary>
/// Clear the sequence.
/// </summary>
template <typename T>
void FractoriumEmberController<T>::SequenceClearButtonClicked()
{
const auto tree = m_Fractorium->ui.SequenceTree;
m_SequencePreviewRenderer->Stop();
tree->clear();
}
void Fractorium::OnSequenceClearButtonClicked(bool checked) { m_Controller->SequenceClearButtonClicked(); }
/// <summary>
/// Save the sequence to a file.
/// </summary>