mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-03-09 15:20:06 -04:00
* fix: Fixes `undefined-bool-conversion` compilation warning. * refactor: Replaces `AgentRoleDialog::m_editMode` with `AgentRoleDialog::m_action` --------- Co-authored-by: Ivan Lebedev <ilebedev@flightpath3d.com>
66 lines
1.6 KiB
C++
66 lines
1.6 KiB
C++
/*
|
|
* Copyright (C) 2024-2025 Petr Mironychev
|
|
*
|
|
* This file is part of QodeAssist.
|
|
*
|
|
* QodeAssist 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.
|
|
*
|
|
* QodeAssist 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 QodeAssist. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <QDialog>
|
|
|
|
#include "AgentRole.hpp"
|
|
|
|
class QLineEdit;
|
|
class QTextEdit;
|
|
class QDialogButtonBox;
|
|
|
|
namespace QodeAssist::Settings {
|
|
|
|
class AgentRoleDialog : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
enum class Action {
|
|
Add,
|
|
Duplicate,
|
|
Edit,
|
|
};
|
|
|
|
explicit AgentRoleDialog(Action action, QWidget *parent = nullptr);
|
|
explicit AgentRoleDialog(const AgentRole &role, Action action, QWidget *parent = nullptr)
|
|
: AgentRoleDialog{action, parent}
|
|
{
|
|
setRole(role);
|
|
}
|
|
|
|
AgentRole getRole() const;
|
|
void setRole(const AgentRole &role);
|
|
|
|
private:
|
|
void setupUI();
|
|
void validateInput();
|
|
|
|
QLineEdit *m_nameEdit = nullptr;
|
|
QLineEdit *m_idEdit = nullptr;
|
|
QTextEdit *m_descriptionEdit = nullptr;
|
|
QTextEdit *m_systemPromptEdit = nullptr;
|
|
QDialogButtonBox *m_buttonBox = nullptr;
|
|
Action m_action;
|
|
};
|
|
|
|
} // namespace QodeAssist::Settings
|