mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-05-30 02:49:12 -04:00
* refactor: Uses single QML engine for all QML code * fix: Adds missing `QPointer` include * Parents QML engine instance to plugin instance. --------- Co-authored-by: Ivan Lebedev <ilebedev@flightpath3d.com> Co-authored-by: Ivan Lebedev <ilebedev1988@gmail.com>
80 lines
1.3 KiB
C++
80 lines
1.3 KiB
C++
// Copyright (C) 2024-2026 Petr Mironychev
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#include "ChatOutputPane.h"
|
|
|
|
#include "QodeAssisttr.h"
|
|
|
|
namespace QodeAssist::Chat {
|
|
|
|
ChatOutputPane::ChatOutputPane(QQmlEngine* engine, QObject *parent)
|
|
: Core::IOutputPane(parent)
|
|
, m_chatWidget{new ChatWidget{engine}}
|
|
{
|
|
setId("QodeAssistChat");
|
|
setDisplayName(Tr::tr("QodeAssist Chat"));
|
|
setPriorityInStatusBar(-40);
|
|
}
|
|
|
|
ChatOutputPane::~ChatOutputPane()
|
|
{
|
|
delete m_chatWidget;
|
|
}
|
|
|
|
QWidget *ChatOutputPane::outputWidget(QWidget *)
|
|
{
|
|
return m_chatWidget;
|
|
}
|
|
|
|
QList<QWidget *> ChatOutputPane::toolBarWidgets() const
|
|
{
|
|
return {};
|
|
}
|
|
|
|
void ChatOutputPane::clearContents()
|
|
{
|
|
m_chatWidget->clear();
|
|
}
|
|
|
|
void ChatOutputPane::visibilityChanged(bool visible)
|
|
{
|
|
if (visible)
|
|
m_chatWidget->scrollToBottom();
|
|
}
|
|
|
|
void ChatOutputPane::setFocus()
|
|
{
|
|
m_chatWidget->setFocus();
|
|
}
|
|
|
|
bool ChatOutputPane::hasFocus() const
|
|
{
|
|
return m_chatWidget->hasFocus();
|
|
}
|
|
|
|
bool ChatOutputPane::canFocus() const
|
|
{
|
|
return true;
|
|
}
|
|
|
|
bool ChatOutputPane::canNavigate() const
|
|
{
|
|
return false;
|
|
}
|
|
|
|
bool ChatOutputPane::canNext() const
|
|
{
|
|
return false;
|
|
}
|
|
|
|
bool ChatOutputPane::canPrevious() const
|
|
{
|
|
return false;
|
|
}
|
|
|
|
void ChatOutputPane::goToNext() {}
|
|
|
|
void ChatOutputPane::goToPrev() {}
|
|
|
|
} // namespace QodeAssist::Chat
|