diff --git a/CMakeLists.txt b/CMakeLists.txt index 209c377..56f41a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,7 @@ add_definitions( add_subdirectory(llmcore) add_subdirectory(settings) add_subdirectory(logger) +add_subdirectory(UIControls) add_subdirectory(ChatView) add_subdirectory(context) if(GTest_FOUND) diff --git a/ChatView/CMakeLists.txt b/ChatView/CMakeLists.txt index 28459b6..18e78ba 100644 --- a/ChatView/CMakeLists.txt +++ b/ChatView/CMakeLists.txt @@ -6,14 +6,13 @@ qt_policy(SET QTP0004 NEW) qt_add_qml_module(QodeAssistChatView URI ChatView VERSION 1.0 - DEPENDENCIES QtQuick + DEPENDENCIES + QtQuick QML_FILES qml/RootItem.qml qml/ChatItem.qml - qml/Badge.qml qml/dialog/CodeBlock.qml qml/dialog/TextBlock.qml - qml/controls/QoAButton.qml qml/parts/TopBar.qml qml/parts/BottomBar.qml qml/parts/AttachedFilesPlace.qml @@ -55,6 +54,7 @@ target_link_libraries(QodeAssistChatView LLMCore QodeAssistSettings Context + QodeAssistUIControlsplugin ) target_include_directories(QodeAssistChatView diff --git a/ChatView/ChatRootView.cpp b/ChatView/ChatRootView.cpp index be9668d..08e9897 100644 --- a/ChatView/ChatRootView.cpp +++ b/ChatView/ChatRootView.cpp @@ -47,6 +47,7 @@ ChatRootView::ChatRootView(QQuickItem *parent) , m_chatModel(new ChatModel(this)) , m_promptProvider(LLMCore::PromptTemplateManager::instance()) , m_clientInterface(new ClientInterface(m_chatModel, &m_promptProvider, this)) + , m_isRequestInProgress(false) { m_isSyncOpenFiles = Settings::chatAssistantSettings().linkOpenFiles(); connect( diff --git a/ChatView/qml/ChatItem.qml b/ChatView/qml/ChatItem.qml index 04d22a3..042752f 100644 --- a/ChatView/qml/ChatItem.qml +++ b/ChatView/qml/ChatItem.qml @@ -20,6 +20,8 @@ import QtQuick import ChatView import QtQuick.Layouts +import UIControls + import "./dialog" Rectangle { diff --git a/ChatView/qml/RootItem.qml b/ChatView/qml/RootItem.qml index 16871a0..7ee9b25 100644 --- a/ChatView/qml/RootItem.qml +++ b/ChatView/qml/RootItem.qml @@ -22,7 +22,7 @@ import QtQuick.Controls import QtQuick.Controls.Basic as QQC import QtQuick.Layouts import ChatView -import "./controls" +import UIControls import "./parts" ChatRootView { diff --git a/ChatView/qml/dialog/CodeBlock.qml b/ChatView/qml/dialog/CodeBlock.qml index b0927b5..30bae28 100644 --- a/ChatView/qml/dialog/CodeBlock.qml +++ b/ChatView/qml/dialog/CodeBlock.qml @@ -20,6 +20,7 @@ import QtQuick import QtQuick.Controls import ChatView +import UIControls Rectangle { id: root diff --git a/ChatView/qml/parts/BottomBar.qml b/ChatView/qml/parts/BottomBar.qml index f22f120..33f6a20 100644 --- a/ChatView/qml/parts/BottomBar.qml +++ b/ChatView/qml/parts/BottomBar.qml @@ -21,6 +21,7 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts import ChatView +import UIControls Rectangle { id: root diff --git a/ChatView/qml/parts/TopBar.qml b/ChatView/qml/parts/TopBar.qml index 7aad2ff..bb321ab 100644 --- a/ChatView/qml/parts/TopBar.qml +++ b/ChatView/qml/parts/TopBar.qml @@ -21,6 +21,7 @@ import QtQuick import QtQuick.Layouts import QtQuick.Controls import ChatView +import UIControls Rectangle { id: root diff --git a/UIControls/CMakeLists.txt b/UIControls/CMakeLists.txt new file mode 100644 index 0000000..d5d18f6 --- /dev/null +++ b/UIControls/CMakeLists.txt @@ -0,0 +1,23 @@ +qt_add_library(QodeAssistUIControls STATIC) + +qt_policy(SET QTP0001 NEW) +qt_policy(SET QTP0004 NEW) + +qt_add_qml_module(QodeAssistUIControls + URI UIControls + VERSION 1.0 + DEPENDENCIES QtQuick + QML_FILES + qml/Badge.qml + qml/QoAButton.qml +) + +target_link_libraries(QodeAssistUIControls + PRIVATE + Qt6::Core + Qt6::Quick +) + +target_include_directories(QodeAssistUIControls + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/ChatView/qml/Badge.qml b/UIControls/qml/Badge.qml similarity index 100% rename from ChatView/qml/Badge.qml rename to UIControls/qml/Badge.qml diff --git a/ChatView/qml/controls/QoAButton.qml b/UIControls/qml/QoAButton.qml similarity index 100% rename from ChatView/qml/controls/QoAButton.qml rename to UIControls/qml/QoAButton.qml