Pith - whittle
#pragma once
#include <QDialog>
#include <QString>
#include <QStringList>

class QLineEdit; class QListWidget; class QPushButton;

namespace whittle {

	class SaveSchemeDialog : public QDialog {
		Q_OBJECT
	public:
		SaveSchemeDialog(const QStringList& existing, bool allowSave = true,
			QWidget* parent = nullptr);
		QString schemeName() const;

		bool listChanged() const { return m_listChanged; }

		private slots:
		void validate();
		void tryAccept();
		void onDelete();

	private:
		QLineEdit*   m_edit = nullptr;
		QListWidget* m_list = nullptr;
		QPushButton* m_ok   = nullptr;
		QPushButton* m_del  = nullptr;
		QStringList  m_existing;
		bool m_allowSave   = true;
		bool m_listChanged = false;
	};

}