mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-07-23 19:51:05 -04:00
feat: add support acp in common chat (#369)
This commit is contained in:
74
sources/settings/AgentsWidget.hpp
Normal file
74
sources/settings/AgentsWidget.hpp
Normal file
@@ -0,0 +1,74 @@
|
||||
// Copyright (C) 2026 Petr Mironychev
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Additional attribution terms under GPLv3 §7(b) apply — see LICENSE
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
#include <utils/aspects.h>
|
||||
|
||||
#include "acp/AgentDefinition.hpp"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QListWidget;
|
||||
class QPushButton;
|
||||
class QTextBrowser;
|
||||
class QVBoxLayout;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace QodeAssist::Acp {
|
||||
class AgentCatalogStore;
|
||||
class AgentTester;
|
||||
} // namespace QodeAssist::Acp
|
||||
|
||||
namespace QodeAssist::Settings {
|
||||
|
||||
class AgentsWidget : public Core::IOptionsPageWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AgentsWidget(Acp::AgentCatalogStore *store);
|
||||
|
||||
void apply() override;
|
||||
|
||||
private:
|
||||
void setupUI();
|
||||
void populateList();
|
||||
void updateButtons();
|
||||
void showSelectedAgent();
|
||||
void showStatus(const QString &message);
|
||||
|
||||
void onTest();
|
||||
void onRefresh();
|
||||
void onOpenAgentsFolder();
|
||||
|
||||
std::optional<Acp::AgentDefinition> selectedAgent() const;
|
||||
static QString testWorkingDirectory();
|
||||
|
||||
Acp::AgentCatalogStore *m_store = nullptr;
|
||||
Acp::AgentTester *m_tester = nullptr;
|
||||
|
||||
QLineEdit *addSettingRow(QVBoxLayout *layout, Utils::StringAspect &aspect);
|
||||
|
||||
QLineEdit *m_extraPathsEdit = nullptr;
|
||||
QLineEdit *m_forwardedVariablesEdit = nullptr;
|
||||
QListWidget *m_agentsList = nullptr;
|
||||
QTextBrowser *m_details = nullptr;
|
||||
QLabel *m_status = nullptr;
|
||||
QPushButton *m_testButton = nullptr;
|
||||
QPushButton *m_reloadButton = nullptr;
|
||||
QPushButton *m_refreshButton = nullptr;
|
||||
};
|
||||
|
||||
class AgentsSettingsPage : public Core::IOptionsPage
|
||||
{
|
||||
public:
|
||||
explicit AgentsSettingsPage(Acp::AgentCatalogStore *store);
|
||||
};
|
||||
|
||||
} // namespace QodeAssist::Settings
|
||||
Reference in New Issue
Block a user