/*
 * Copyright (C) 2020, KylinSoft Co., Ltd.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
#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;

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
