2022-04-19 06:16:41 +00:00
|
|
|
#ifndef NAME_DIALOG_H
|
|
|
|
#define NAME_DIALOG_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
2022-04-20 19:50:39 +00:00
|
|
|
#include <QLabel>
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
#include <QLineEdit>
|
|
|
|
#include <QPushButton>
|
|
|
|
|
2022-05-30 23:05:08 +00:00
|
|
|
#include <set>
|
|
|
|
|
2022-06-13 22:53:46 +00:00
|
|
|
#include "comdel/domain/instance.h"
|
|
|
|
#include "generic_dialog.h"
|
2022-04-19 06:16:41 +00:00
|
|
|
|
|
|
|
namespace display {
|
|
|
|
|
2022-06-13 22:53:46 +00:00
|
|
|
class NameDialog : public GenericDialog {
|
2022-04-20 19:50:39 +00:00
|
|
|
|
2022-05-27 06:18:17 +00:00
|
|
|
public:
|
2022-06-01 23:37:14 +00:00
|
|
|
NameDialog(std::string currentName, std::set<std::string>& names);
|
2022-04-19 06:16:41 +00:00
|
|
|
|
2022-06-01 23:37:14 +00:00
|
|
|
std::string getName();
|
2022-05-15 15:00:20 +00:00
|
|
|
|
2022-06-13 22:53:46 +00:00
|
|
|
protected:
|
|
|
|
bool onUpdate() override;
|
|
|
|
|
2022-05-27 06:18:17 +00:00
|
|
|
public slots:
|
2022-05-30 23:05:08 +00:00
|
|
|
void onNameUpdate(const QString& text);
|
2022-06-13 22:53:46 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::set<std::string> usedNames;
|
|
|
|
QLineEdit *edit = nullptr;
|
|
|
|
std::string currentName;
|
|
|
|
|
2022-05-27 06:18:17 +00:00
|
|
|
};
|
2022-04-19 06:16:41 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-04-20 19:50:39 +00:00
|
|
|
#endif //NAME_DIALOG_H
|