2023-04-21 12:23:39 +00:00
|
|
|
import QtCore
|
2023-04-09 03:28:39 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
2023-04-10 19:03:00 +00:00
|
|
|
import QtQuick.Controls.Basic
|
2023-04-16 05:14:42 +00:00
|
|
|
import QtQuick.Layouts
|
2023-05-31 01:03:40 +00:00
|
|
|
import Qt5Compat.GraphicalEffects
|
2023-04-09 03:28:39 +00:00
|
|
|
import llm
|
2023-06-22 19:44:49 +00:00
|
|
|
import chatlistmodel
|
2023-04-28 14:54:05 +00:00
|
|
|
import download
|
2023-06-22 19:44:49 +00:00
|
|
|
import modellist
|
2023-04-14 18:44:28 +00:00
|
|
|
import network
|
2023-06-10 14:15:38 +00:00
|
|
|
import gpt4all
|
2023-06-28 19:47:15 +00:00
|
|
|
import mysettings
|
2023-04-09 03:28:39 +00:00
|
|
|
|
|
|
|
Window {
|
|
|
|
id: window
|
2024-01-22 19:41:47 +00:00
|
|
|
width: 1920
|
|
|
|
height: 1080
|
2024-02-06 14:59:26 +00:00
|
|
|
minimumWidth: 720
|
|
|
|
minimumHeight: 480
|
2023-04-09 03:28:39 +00:00
|
|
|
visible: true
|
2023-04-17 11:50:39 +00:00
|
|
|
title: qsTr("GPT4All v") + Qt.application.version
|
2023-04-23 13:42:35 +00:00
|
|
|
|
2024-02-21 16:40:05 +00:00
|
|
|
Settings {
|
|
|
|
property alias x: window.x
|
|
|
|
property alias y: window.y
|
|
|
|
property alias width: window.width
|
|
|
|
property alias height: window.height
|
|
|
|
}
|
|
|
|
|
2023-04-23 13:42:35 +00:00
|
|
|
Theme {
|
|
|
|
id: theme
|
|
|
|
}
|
|
|
|
|
2023-06-20 21:14:11 +00:00
|
|
|
property bool hasSaved: false
|
|
|
|
|
2024-03-13 23:57:05 +00:00
|
|
|
PopupDialog {
|
|
|
|
id: savingPopup
|
|
|
|
anchors.centerIn: parent
|
|
|
|
shouldTimeOut: false
|
|
|
|
shouldShowBusy: true
|
|
|
|
text: qsTr("Saving chats.")
|
|
|
|
font.pixelSize: theme.fontSizeLarge
|
|
|
|
}
|
|
|
|
|
2023-06-20 21:14:11 +00:00
|
|
|
onClosing: function(close) {
|
|
|
|
if (window.hasSaved)
|
|
|
|
return;
|
|
|
|
|
|
|
|
savingPopup.open();
|
2023-06-22 19:44:49 +00:00
|
|
|
ChatListModel.saveChats();
|
2023-06-20 21:14:11 +00:00
|
|
|
close.accepted = false
|
|
|
|
}
|
|
|
|
|
|
|
|
Connections {
|
2023-06-22 19:44:49 +00:00
|
|
|
target: ChatListModel
|
2023-06-20 21:14:11 +00:00
|
|
|
function onSaveChatsFinished() {
|
|
|
|
window.hasSaved = true;
|
|
|
|
savingPopup.close();
|
|
|
|
window.close()
|
|
|
|
}
|
|
|
|
}
|
2023-04-24 01:05:38 +00:00
|
|
|
|
2024-01-22 19:41:47 +00:00
|
|
|
color: theme.black
|
2023-06-03 00:19:50 +00:00
|
|
|
|
2024-04-18 18:52:29 +00:00
|
|
|
ChatView {
|
|
|
|
anchors.fill: parent
|
2023-04-09 03:28:39 +00:00
|
|
|
}
|
|
|
|
}
|