mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-05-30 02:49:12 -04:00
feat: Add agents pipelines
This commit is contained in:
77
sources/settings/AgentSlotWidget.hpp
Normal file
77
sources/settings/AgentSlotWidget.hpp
Normal file
@@ -0,0 +1,77 @@
|
||||
// Copyright (C) 2026 Petr Mironychev
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QLabel>
|
||||
#include <QWidget>
|
||||
|
||||
#include <AgentConfig.hpp>
|
||||
|
||||
class QPushButton;
|
||||
|
||||
namespace QodeAssist::Settings {
|
||||
|
||||
class Pill : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum Kind { Template, On, Off, User, Tag };
|
||||
|
||||
Pill(Kind kind, const QString &text = {}, QWidget *parent = nullptr);
|
||||
void setKind(Kind kind);
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *event) override;
|
||||
|
||||
private:
|
||||
void applyTheme();
|
||||
|
||||
Kind m_kind;
|
||||
bool m_inApplyTheme = false;
|
||||
};
|
||||
|
||||
class AgentSlotWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AgentSlotWidget(QWidget *parent = nullptr);
|
||||
|
||||
void setAgentConfig(const AgentConfig &cfg);
|
||||
void clear();
|
||||
|
||||
QPushButton *changeButton() const { return m_changeBtn; }
|
||||
|
||||
signals:
|
||||
void changeRequested();
|
||||
void editRequested();
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *event) override;
|
||||
|
||||
private:
|
||||
void applyTheme();
|
||||
|
||||
QLabel *m_name = nullptr;
|
||||
Pill *m_sourcePill = nullptr;
|
||||
QPushButton *m_changeBtn = nullptr;
|
||||
QPushButton *m_editBtn = nullptr;
|
||||
|
||||
QLabel *m_modelLabel = nullptr;
|
||||
QLabel *m_modelValue = nullptr;
|
||||
QLabel *m_urlLabel = nullptr;
|
||||
QLabel *m_urlValue = nullptr;
|
||||
QLabel *m_endpointLabel = nullptr;
|
||||
QLabel *m_endpointValue = nullptr;
|
||||
QLabel *m_templateLabel = nullptr;
|
||||
QLabel *m_templateValue = nullptr;
|
||||
|
||||
QLabel *m_description = nullptr;
|
||||
|
||||
Pill *m_thinkingPill = nullptr;
|
||||
Pill *m_toolsPill = nullptr;
|
||||
|
||||
bool m_inApplyTheme = false;
|
||||
};
|
||||
|
||||
} // namespace QodeAssist::Settings
|
||||
Reference in New Issue
Block a user