2022-06-13 22:53:46 +00:00
|
|
|
#ifndef SCHEMEEDITOR_GENERIC_DIALOG_H
|
|
|
|
#define SCHEMEEDITOR_GENERIC_DIALOG_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QPushButton>
|
|
|
|
|
2022-06-19 18:10:44 +00:00
|
|
|
#include <optional>
|
|
|
|
|
2022-06-13 22:53:46 +00:00
|
|
|
namespace display {
|
|
|
|
|
|
|
|
class GenericDialog: public QDialog {
|
|
|
|
public:
|
|
|
|
|
2022-06-19 18:10:44 +00:00
|
|
|
explicit GenericDialog(std::string title,
|
|
|
|
std::optional<std::string> action = "msg_dialog_actions_update",
|
|
|
|
std::string cancel = "msg_dialog_actions_cancel");
|
2022-06-13 22:53:46 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void setOkButtonDisabled(bool disabled);
|
|
|
|
virtual bool onUpdate() = 0;
|
|
|
|
|
|
|
|
private:
|
|
|
|
QPushButton *okButton;
|
|
|
|
QPushButton *cancelButton;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
QWidget *content;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //SCHEMEEDITOR_GENERIC_DIALOG_H
|