summaryrefslogtreecommitdiffstats
path: root/Tools/QtBiomeVisualiser/GeneratorSetup.h
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-09-25 16:22:08 +0200
committerTycho <work.tycho+git@gmail.com>2014-09-25 16:22:08 +0200
commit9c459cbe50dd7c7c327d712369b523dd018575bf (patch)
tree9dea40b71ffdca0dccf31fa1f005e279d822fa46 /Tools/QtBiomeVisualiser/GeneratorSetup.h
parentFix accedental c++11 (diff)
parentMerge pull request #1449 from mc-server/WorldLoader (diff)
downloadcuberite-9c459cbe50dd7c7c327d712369b523dd018575bf.tar
cuberite-9c459cbe50dd7c7c327d712369b523dd018575bf.tar.gz
cuberite-9c459cbe50dd7c7c327d712369b523dd018575bf.tar.bz2
cuberite-9c459cbe50dd7c7c327d712369b523dd018575bf.tar.lz
cuberite-9c459cbe50dd7c7c327d712369b523dd018575bf.tar.xz
cuberite-9c459cbe50dd7c7c327d712369b523dd018575bf.tar.zst
cuberite-9c459cbe50dd7c7c327d712369b523dd018575bf.zip
Diffstat (limited to 'Tools/QtBiomeVisualiser/GeneratorSetup.h')
-rw-r--r--Tools/QtBiomeVisualiser/GeneratorSetup.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/Tools/QtBiomeVisualiser/GeneratorSetup.h b/Tools/QtBiomeVisualiser/GeneratorSetup.h
new file mode 100644
index 000000000..e72d3abbc
--- /dev/null
+++ b/Tools/QtBiomeVisualiser/GeneratorSetup.h
@@ -0,0 +1,64 @@
+#pragma once
+
+#include <memory>
+#include <QDialog>
+#include <QComboBox>
+#include <QVBoxLayout>
+#include <QFormLayout>
+
+
+
+
+
+class cIniFile;
+typedef std::shared_ptr<cIniFile> cIniFilePtr;
+
+
+
+
+
+class GeneratorSetup :
+ public QWidget
+{
+ typedef QWidget super;
+
+ Q_OBJECT
+
+public:
+ /** 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; }
+
+signals:
+ /** Emitted when the generator parameters have changed. */
+ void generatorUpdated();
+
+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);
+
+protected slots:
+ /** Called when any of the edit widgets are changed. */
+ void editChanged(const QString & a_NewValue);
+
+protected:
+ QComboBox * m_cbGenerator;
+ QLineEdit * m_eSeed;
+ QVBoxLayout * m_MainLayout;
+ QFormLayout * m_FormLayout;
+
+ cIniFilePtr m_IniFile;
+
+ int m_Seed;
+
+
+ /** Updates the form layout with the values from m_IniFile. */
+ void updateFromIni();
+};
+
+
+
+