#ifndef COMMANDCONFIGDIALOG_H
#define COMMANDCONFIGDIALOG_H

#include <QDialog>
#include <QLabel>
#include <QGridLayout>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
#include <QKeyEvent>
#include <memory>

#include "commandtemplatelist.h"
#include <global/kaglobal.h>

using namespace std;

class CommandConfigDialog : public QDialog
{
    Q_OBJECT

public:
    explicit CommandConfigDialog(PromptContentAccessType commandType, int actorId, QString name, QString content, QWidget *parent = nullptr);
    explicit CommandConfigDialog(QWidget *parent = nullptr);
    ~CommandConfigDialog();

    // 编辑指令
    void loadData(PromptContentAccessType commandType, int actorId, QString name, QString content);

protected:
    void keyPressEvent(QKeyEvent* event) override;
    void focusInEvent(QFocusEvent* event) override;
    void focusOutEvent(QFocusEvent* event) override;

private slots:
    void changeTheme();

signals:


private:
    // 布局
    void initLayout();
    // 信号槽
    void initConnect();
    // 更新按钮状态
    void updateButtonState();

    void accept() override;

private:
    class Private;
    shared_ptr<Private> d_ptr;
};


#endif // COMMANDCONFIGDIALOG_H
