2023-04-14 14:44:28 -04:00
|
|
|
import QtCore
|
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
2023-04-23 23:56:33 -04:00
|
|
|
import QtQuick.Controls.Basic
|
2023-04-14 14:44:28 -04:00
|
|
|
import QtQuick.Layouts
|
|
|
|
import download
|
|
|
|
import network
|
|
|
|
import llm
|
|
|
|
|
|
|
|
Dialog {
|
|
|
|
id: thumbsDownDialog
|
|
|
|
modal: true
|
|
|
|
opacity: 0.9
|
|
|
|
padding: 20
|
|
|
|
width: 900
|
2023-04-23 09:42:35 -04:00
|
|
|
|
|
|
|
Theme {
|
|
|
|
id: theme
|
|
|
|
}
|
|
|
|
|
2023-04-14 14:44:28 -04:00
|
|
|
property alias response: thumbsDownNewResponse.text
|
|
|
|
Column {
|
|
|
|
anchors.fill: parent
|
|
|
|
spacing: 20
|
|
|
|
Item {
|
|
|
|
width: childrenRect.width
|
|
|
|
height: childrenRect.height
|
|
|
|
Image {
|
|
|
|
id: img
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.left: parent.left
|
|
|
|
width: 60
|
|
|
|
height: 60
|
2023-04-23 09:42:35 -04:00
|
|
|
source: "qrc:/gpt4all/icons/thumbs_down.svg"
|
2023-04-14 14:44:28 -04:00
|
|
|
}
|
|
|
|
Text {
|
|
|
|
anchors.left: img.right
|
|
|
|
anchors.leftMargin: 30
|
|
|
|
anchors.verticalCenter: img.verticalCenter
|
2023-04-24 11:14:23 -04:00
|
|
|
text: qsTr("Please edit the text below to provide a better response...")
|
2023-04-23 09:42:35 -04:00
|
|
|
color: theme.textColor
|
2023-04-14 14:44:28 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ScrollView {
|
|
|
|
clip: true
|
|
|
|
height: 300
|
|
|
|
width: parent.width
|
|
|
|
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
|
|
|
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
|
|
|
|
|
|
|
TextArea {
|
|
|
|
id: thumbsDownNewResponse
|
2023-04-23 09:42:35 -04:00
|
|
|
color: theme.textColor
|
2023-04-14 14:44:28 -04:00
|
|
|
padding: 20
|
|
|
|
width: parent.width
|
|
|
|
height: 300
|
|
|
|
wrapMode: Text.Wrap
|
2023-04-23 11:23:02 -04:00
|
|
|
font.pixelSize: theme.fontSizeLarge
|
2023-04-14 14:44:28 -04:00
|
|
|
placeholderText: qsTr("Please provide a better response...")
|
2023-04-23 09:42:35 -04:00
|
|
|
placeholderTextColor: theme.backgroundLightest
|
2023-04-14 14:44:28 -04:00
|
|
|
background: Rectangle {
|
2023-04-23 09:42:35 -04:00
|
|
|
color: theme.backgroundLighter
|
2023-04-14 14:44:28 -04:00
|
|
|
radius: 10
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
anchors.fill: parent
|
2023-04-23 09:42:35 -04:00
|
|
|
color: theme.backgroundDarkest
|
2023-04-14 14:44:28 -04:00
|
|
|
border.width: 1
|
2023-04-23 09:42:35 -04:00
|
|
|
border.color: theme.dialogBorder
|
2023-04-14 14:44:28 -04:00
|
|
|
radius: 10
|
|
|
|
}
|
|
|
|
|
|
|
|
footer: DialogButtonBox {
|
|
|
|
padding: 20
|
|
|
|
alignment: Qt.AlignRight
|
|
|
|
spacing: 10
|
|
|
|
Button {
|
2023-04-24 00:14:52 -04:00
|
|
|
contentItem: Text {
|
|
|
|
color: theme.textColor
|
|
|
|
text: qsTr("Submit")
|
|
|
|
}
|
2023-04-14 14:44:28 -04:00
|
|
|
background: Rectangle {
|
2023-04-23 09:42:35 -04:00
|
|
|
border.color: theme.backgroundLightest
|
2023-04-14 14:44:28 -04:00
|
|
|
border.width: 1
|
|
|
|
radius: 10
|
2023-04-23 09:42:35 -04:00
|
|
|
color: theme.backgroundLight
|
2023-04-14 14:44:28 -04:00
|
|
|
}
|
|
|
|
padding: 15
|
|
|
|
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
|
|
|
|
}
|
|
|
|
Button {
|
2023-04-24 00:14:52 -04:00
|
|
|
contentItem: Text {
|
|
|
|
color: theme.textColor
|
|
|
|
text: qsTr("Cancel")
|
|
|
|
}
|
2023-04-14 14:44:28 -04:00
|
|
|
background: Rectangle {
|
2023-04-23 09:42:35 -04:00
|
|
|
border.color: theme.backgroundLightest
|
2023-04-14 14:44:28 -04:00
|
|
|
border.width: 1
|
|
|
|
radius: 10
|
2023-04-23 09:42:35 -04:00
|
|
|
color: theme.backgroundLight
|
2023-04-14 14:44:28 -04:00
|
|
|
}
|
|
|
|
padding: 15
|
|
|
|
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
|
|
|
|
}
|
|
|
|
background: Rectangle {
|
|
|
|
color: "transparent"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|