2014-09-21 16:58:09 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QComboBox>
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
#include <QFormLayout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class cIniFile;
|
2014-09-22 12:26:35 -04:00
|
|
|
typedef std::shared_ptr<cIniFile> cIniFilePtr;
|
2014-09-21 16:58:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-22 12:26:35 -04:00
|
|
|
class GeneratorSetup :
|
|
|
|
public QWidget
|
2014-09-21 16:58:09 -04:00
|
|
|
{
|
2014-09-22 12:26:35 -04:00
|
|
|
typedef QWidget super;
|
2014-09-21 16:58:09 -04:00
|
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2014-09-22 12:26:35 -04:00
|
|
|
/** Creates the widget and loads the contents of the INI file, if not empty. */
|
|
|
|
explicit GeneratorSetup(const std::string & a_IniFileName, QWidget * parent = nullptr);
|
|
|
|
|
|
|
|
/** Returns the cIniFile instance that is being edited by this widget. */
|
|
|
|
cIniFilePtr getIniFile() { return m_IniFile; }
|
2014-09-21 16:58:09 -04:00
|
|
|
|
|
|
|
signals:
|
2014-09-22 15:51:59 -04:00
|
|
|
/** Emitted when the generator parameters have changed. */
|
|
|
|
void generatorUpdated();
|
2014-09-21 16:58:09 -04:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
/** Called when the user selects a different generator from the top combobox.
|
|
|
|
Re-creates m_IniFile and updates the form layout. */
|
|
|
|
void generatorChanged(const QString & a_NewName);
|
|
|
|
|
2014-09-22 15:51:59 -04:00
|
|
|
protected slots:
|
|
|
|
/** Called when any of the edit widgets are changed. */
|
|
|
|
void editChanged(const QString & a_NewValue);
|
|
|
|
|
2014-09-21 16:58:09 -04:00
|
|
|
protected:
|
|
|
|
QComboBox * m_cbGenerator;
|
2014-09-22 15:51:59 -04:00
|
|
|
QLineEdit * m_eSeed;
|
2014-09-21 16:58:09 -04:00
|
|
|
QVBoxLayout * m_MainLayout;
|
|
|
|
QFormLayout * m_FormLayout;
|
|
|
|
|
2014-09-22 12:26:35 -04:00
|
|
|
cIniFilePtr m_IniFile;
|
2014-09-21 16:58:09 -04:00
|
|
|
|
|
|
|
int m_Seed;
|
|
|
|
|
|
|
|
|
|
|
|
/** Updates the form layout with the values from m_IniFile. */
|
|
|
|
void updateFromIni();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|