2015-07-23 21:16:36 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "ui_VariationsDialog.h"
|
|
|
|
#include "FractoriumSettings.h"
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// FractoriumVariationsDialog class.
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The variations filter dialog displays several columns
|
|
|
|
/// with the different types of variations shown as checkboxes.
|
|
|
|
/// This is used to filter the variations that are shown in the main window
|
|
|
|
/// because the list is very long.
|
|
|
|
/// The results are stored in a map and returned.
|
|
|
|
/// These are used in conjunction with the filter edit box to filter what's shown.
|
|
|
|
/// </summary>
|
|
|
|
class FractoriumVariationsDialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2016-12-05 22:04:33 -05:00
|
|
|
FractoriumVariationsDialog(QWidget* p = nullptr, Qt::WindowFlags f = nullptr);
|
2015-07-23 21:16:36 -04:00
|
|
|
void ForEachCell(std::function<void(QTableWidgetItem* cb)> func);
|
|
|
|
void ForEachSelectedCell(std::function<void(QTableWidgetItem* cb)> func);
|
|
|
|
void SyncSettings();
|
2015-07-29 20:25:02 -04:00
|
|
|
const QMap<QString, QVariant>& Map();
|
2015-07-23 21:16:36 -04:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void OnSelectAllButtonClicked(bool checked);
|
|
|
|
void OnInvertSelectionButtonClicked(bool checked);
|
|
|
|
void OnSelectNoneButtonClicked(bool checked);
|
2016-05-18 19:48:40 -04:00
|
|
|
void OnSelectionCheckBoxStateChanged(int i);
|
2015-07-23 21:16:36 -04:00
|
|
|
void OnVariationsTableItemChanged(QTableWidgetItem* item);
|
2015-07-29 20:25:02 -04:00
|
|
|
virtual void accept() override;
|
|
|
|
virtual void reject() override;
|
2015-07-23 21:16:36 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void showEvent(QShowEvent* e) override;
|
|
|
|
|
|
|
|
private:
|
2016-05-18 19:48:40 -04:00
|
|
|
void ClearTypesStealth();
|
2015-07-29 20:25:02 -04:00
|
|
|
void DataToGui();
|
|
|
|
void GuiToData();
|
2015-07-23 21:16:36 -04:00
|
|
|
void Populate();
|
|
|
|
void SetCheckFromMap(QTableWidgetItem* cb, const Variation<float>* var);
|
2016-04-13 23:59:57 -04:00
|
|
|
shared_ptr<VariationList<float>> m_VariationList;
|
2016-05-18 19:48:40 -04:00
|
|
|
vector<QCheckBox*> m_CheckBoxes;
|
2015-07-23 21:16:36 -04:00
|
|
|
QMap<QString, QVariant> m_Vars;
|
2016-12-05 22:04:33 -05:00
|
|
|
shared_ptr<FractoriumSettings> m_Settings;
|
2015-07-23 21:16:36 -04:00
|
|
|
Ui::VariationsDialog ui;
|
|
|
|
};
|