|
|
|
@ -153,13 +153,6 @@ Rectangle {
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AboutDialog {
|
|
|
|
|
id: aboutDialog
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
width: Math.min(1024, window.width - (window.width * .2))
|
|
|
|
|
height: Math.min(600, window.height - (window.height * .2))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Item {
|
|
|
|
|
Accessible.role: Accessible.Window
|
|
|
|
|
Accessible.name: title
|
|
|
|
@ -294,37 +287,41 @@ Rectangle {
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
height: 100
|
|
|
|
|
color: theme.mainHeader
|
|
|
|
|
Item {
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
height: childrenRect.height
|
|
|
|
|
visible: true
|
|
|
|
|
|
|
|
|
|
Label {
|
|
|
|
|
id: modelLabel
|
|
|
|
|
color: theme.textColor
|
|
|
|
|
padding: 20
|
|
|
|
|
font.pixelSize: theme.fontSizeLarger
|
|
|
|
|
text: ""
|
|
|
|
|
background: Rectangle {
|
|
|
|
|
color: theme.mainHeader
|
|
|
|
|
}
|
|
|
|
|
horizontalAlignment: TextInput.AlignRight
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
|
id: comboLayout
|
|
|
|
|
anchors.top: modelLabel.top
|
|
|
|
|
anchors.bottom: modelLabel.bottom
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
anchors.horizontalCenterOffset: window.width >= 950 ? 0 : Math.max(-((950 - window.width) / 2), -99.5)
|
|
|
|
|
height: 80
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
spacing: 20
|
|
|
|
|
|
|
|
|
|
MyToolButton {
|
|
|
|
|
id: drawerButton
|
|
|
|
|
Layout.alignment: Qt.AlignLeft
|
|
|
|
|
Layout.leftMargin: 30
|
|
|
|
|
backgroundColor: theme.iconBackgroundLight
|
|
|
|
|
width: 40
|
|
|
|
|
height: 40
|
|
|
|
|
scale: 1.5
|
|
|
|
|
z: 200
|
|
|
|
|
padding: 15
|
|
|
|
|
source: conversation.state === "expanded" ? "qrc:/gpt4all/icons/left_panel_open.svg" : "qrc:/gpt4all/icons/left_panel_closed.svg"
|
|
|
|
|
Accessible.role: Accessible.ButtonMenu
|
|
|
|
|
Accessible.name: qsTr("Chat panel")
|
|
|
|
|
Accessible.description: qsTr("Chat panel with options")
|
|
|
|
|
onClicked: {
|
|
|
|
|
conversation.toggleLeftPanel()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MyComboBox {
|
|
|
|
|
id: comboBox
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
implicitWidth: 575
|
|
|
|
|
width: window.width >= 750 ? implicitWidth : implicitWidth - (750 - window.width)
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.minimumWidth: 375
|
|
|
|
|
Layout.maximumWidth: 675
|
|
|
|
|
enabled: !currentChat.isServer
|
|
|
|
|
&& !window.trySwitchContextInProgress
|
|
|
|
|
&& !window.isCurrentlyLoading
|
|
|
|
@ -480,102 +477,59 @@ Rectangle {
|
|
|
|
|
ToolTip.visible: hovered
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SettingsDialog {
|
|
|
|
|
id: settingsDialog
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
width: Math.min(1920, window.width - (window.width * .1))
|
|
|
|
|
height: window.height - (window.height * .1)
|
|
|
|
|
onDownloadClicked: {
|
|
|
|
|
downloadNewModels.showEmbeddingModels = true
|
|
|
|
|
downloadNewModels.open()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
RowLayout {
|
|
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
|
Layout.rightMargin: 30
|
|
|
|
|
spacing: 20
|
|
|
|
|
|
|
|
|
|
MyToolButton {
|
|
|
|
|
id: drawerButton
|
|
|
|
|
id: resetContextButton
|
|
|
|
|
backgroundColor: theme.iconBackgroundLight
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.topMargin: 42.5
|
|
|
|
|
anchors.leftMargin: 30
|
|
|
|
|
width: 40
|
|
|
|
|
height: 40
|
|
|
|
|
scale: 1.5
|
|
|
|
|
z: 200
|
|
|
|
|
padding: 15
|
|
|
|
|
source: conversation.state === "expanded" ? "qrc:/gpt4all/icons/left_panel_open.svg" : "qrc:/gpt4all/icons/left_panel_closed.svg"
|
|
|
|
|
Accessible.role: Accessible.ButtonMenu
|
|
|
|
|
Accessible.name: qsTr("Chat panel")
|
|
|
|
|
Accessible.description: qsTr("Chat panel with options")
|
|
|
|
|
onClicked: {
|
|
|
|
|
conversation.toggleLeftPanel()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
source: "qrc:/gpt4all/icons/regenerate.svg"
|
|
|
|
|
|
|
|
|
|
NetworkDialog {
|
|
|
|
|
id: networkDialog
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
width: Math.min(1024, window.width - (window.width * .2))
|
|
|
|
|
height: Math.min(600, window.height - (window.height * .2))
|
|
|
|
|
Item {
|
|
|
|
|
Accessible.role: Accessible.Dialog
|
|
|
|
|
Accessible.name: qsTr("Network dialog")
|
|
|
|
|
Accessible.description: qsTr("opt-in to share feedback/conversations")
|
|
|
|
|
Accessible.name: text
|
|
|
|
|
Accessible.description: qsTr("Reset the context and erase current conversation")
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
Network.sendResetContext(chatModel.count)
|
|
|
|
|
currentChat.reset();
|
|
|
|
|
currentChat.processSystemPrompt();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MyToolButton {
|
|
|
|
|
id: networkButton
|
|
|
|
|
id: copyButton
|
|
|
|
|
backgroundColor: theme.iconBackgroundLight
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.topMargin: 42.5
|
|
|
|
|
anchors.rightMargin: 30
|
|
|
|
|
width: 40
|
|
|
|
|
height: 40
|
|
|
|
|
z: 200
|
|
|
|
|
padding: 15
|
|
|
|
|
toggled: MySettings.networkIsActive
|
|
|
|
|
source: "qrc:/gpt4all/icons/network.svg"
|
|
|
|
|
Accessible.name: qsTr("Network")
|
|
|
|
|
Accessible.description: qsTr("Reveals a dialogue where you can opt-in for sharing data over network")
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
if (MySettings.networkIsActive) {
|
|
|
|
|
MySettings.networkIsActive = false
|
|
|
|
|
Network.sendNetworkToggled(false);
|
|
|
|
|
} else
|
|
|
|
|
networkDialog.open()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
source: "qrc:/gpt4all/icons/copy.svg"
|
|
|
|
|
Accessible.name: qsTr("Copy")
|
|
|
|
|
Accessible.description: qsTr("Copy the conversation to the clipboard")
|
|
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
|
target: Network
|
|
|
|
|
function onHealthCheckFailed(code) {
|
|
|
|
|
healthCheckFailed.open();
|
|
|
|
|
}
|
|
|
|
|
TextEdit{
|
|
|
|
|
id: copyEdit
|
|
|
|
|
visible: false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CollectionsDialog {
|
|
|
|
|
id: collectionsDialog
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
onAddRemoveClicked: {
|
|
|
|
|
settingsDialog.pageToDisplay = 2;
|
|
|
|
|
settingsDialog.open();
|
|
|
|
|
onClicked: {
|
|
|
|
|
var conversation = getConversation()
|
|
|
|
|
copyEdit.text = conversation
|
|
|
|
|
copyEdit.selectAll()
|
|
|
|
|
copyEdit.copy()
|
|
|
|
|
copyMessage.open()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MyToolButton {
|
|
|
|
|
id: collectionsButton
|
|
|
|
|
backgroundColor: theme.iconBackgroundLight
|
|
|
|
|
anchors.right: networkButton.left
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.topMargin: 42.5
|
|
|
|
|
anchors.rightMargin: 10
|
|
|
|
|
width: 40
|
|
|
|
|
height: 42.5
|
|
|
|
|
z: 200
|
|
|
|
@ -589,24 +543,34 @@ Rectangle {
|
|
|
|
|
collectionsDialog.open()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MyToolButton {
|
|
|
|
|
id: settingsButton
|
|
|
|
|
backgroundColor: theme.iconBackgroundLight
|
|
|
|
|
anchors.right: collectionsButton.left
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.topMargin: 42.5
|
|
|
|
|
anchors.rightMargin: 10
|
|
|
|
|
width: 40
|
|
|
|
|
height: 40
|
|
|
|
|
z: 200
|
|
|
|
|
padding: 15
|
|
|
|
|
source: "qrc:/gpt4all/icons/settings.svg"
|
|
|
|
|
Accessible.name: qsTr("Settings")
|
|
|
|
|
Accessible.description: qsTr("Reveals a dialogue with settings")
|
|
|
|
|
SettingsDialog {
|
|
|
|
|
id: settingsDialog
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
width: Math.min(1920, window.width - (window.width * .1))
|
|
|
|
|
height: window.height - (window.height * .1)
|
|
|
|
|
onDownloadClicked: {
|
|
|
|
|
downloadNewModels.showEmbeddingModels = true
|
|
|
|
|
downloadNewModels.open()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
settingsDialog.open()
|
|
|
|
|
Connections {
|
|
|
|
|
target: Network
|
|
|
|
|
function onHealthCheckFailed(code) {
|
|
|
|
|
healthCheckFailed.open();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CollectionsDialog {
|
|
|
|
|
id: collectionsDialog
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
onAddRemoveClicked: {
|
|
|
|
|
settingsDialog.pageToDisplay = 2;
|
|
|
|
|
settingsDialog.open();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -650,35 +614,6 @@ Rectangle {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MyToolButton {
|
|
|
|
|
id: copyButton
|
|
|
|
|
backgroundColor: theme.iconBackgroundLight
|
|
|
|
|
anchors.right: settingsButton.left
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.topMargin: 42.5
|
|
|
|
|
anchors.rightMargin: 10
|
|
|
|
|
width: 40
|
|
|
|
|
height: 40
|
|
|
|
|
z: 200
|
|
|
|
|
padding: 15
|
|
|
|
|
source: "qrc:/gpt4all/icons/copy.svg"
|
|
|
|
|
Accessible.name: qsTr("Copy")
|
|
|
|
|
Accessible.description: qsTr("Copy the conversation to the clipboard")
|
|
|
|
|
|
|
|
|
|
TextEdit{
|
|
|
|
|
id: copyEdit
|
|
|
|
|
visible: false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
var conversation = getConversation()
|
|
|
|
|
copyEdit.text = conversation
|
|
|
|
|
copyEdit.selectAll()
|
|
|
|
|
copyEdit.copy()
|
|
|
|
|
copyMessage.open()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getConversation() {
|
|
|
|
|
var conversation = "";
|
|
|
|
|
for (var i = 0; i < chatModel.count; i++) {
|
|
|
|
@ -716,29 +651,6 @@ Rectangle {
|
|
|
|
|
return str + "]}"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MyToolButton {
|
|
|
|
|
id: resetContextButton
|
|
|
|
|
backgroundColor: theme.iconBackgroundLight
|
|
|
|
|
anchors.right: copyButton.left
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.topMargin: 42.5
|
|
|
|
|
anchors.rightMargin: 10
|
|
|
|
|
width: 40
|
|
|
|
|
height: 40
|
|
|
|
|
z: 200
|
|
|
|
|
padding: 15
|
|
|
|
|
source: "qrc:/gpt4all/icons/regenerate.svg"
|
|
|
|
|
|
|
|
|
|
Accessible.name: text
|
|
|
|
|
Accessible.description: qsTr("Reset the context and erase current conversation")
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
Network.sendResetContext(chatModel.count)
|
|
|
|
|
currentChat.reset();
|
|
|
|
|
currentChat.processSystemPrompt();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Dialog {
|
|
|
|
|
id: checkForUpdatesError
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
@ -785,14 +697,7 @@ Rectangle {
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.top: accentRibbon.bottom
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
width: Math.min(600, 0.2 * window.width)
|
|
|
|
|
onDownloadClicked: {
|
|
|
|
|
downloadNewModels.showEmbeddingModels = false
|
|
|
|
|
downloadNewModels.open()
|
|
|
|
|
}
|
|
|
|
|
onAboutClicked: {
|
|
|
|
|
aboutDialog.open()
|
|
|
|
|
}
|
|
|
|
|
width: Math.max(180, Math.min(600, 0.2 * window.width))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PopupDialog {
|
|
|
|
@ -970,10 +875,7 @@ Rectangle {
|
|
|
|
|
ListView {
|
|
|
|
|
id: listView
|
|
|
|
|
visible: ModelList.installedModels.count !== 0 && chatModel.count !== 0
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
width: Math.min(1280, parent.width)
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
model: chatModel
|
|
|
|
|
|
|
|
|
|
ScrollBar.vertical: ScrollBar {
|
|
|
|
@ -987,7 +889,8 @@ Rectangle {
|
|
|
|
|
delegate: TextArea {
|
|
|
|
|
id: myTextArea
|
|
|
|
|
text: value + references
|
|
|
|
|
width: listView.width
|
|
|
|
|
anchors.horizontalCenter: listView.contentItem.horizontalCenter
|
|
|
|
|
width: Math.min(1280, listView.contentItem.width)
|
|
|
|
|
color: theme.textColor
|
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
|
textFormat: TextEdit.PlainText
|
|
|
|
|