mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-13 06:19:20 +00:00
Move saving chats to a thread and display what we're doing to the user.
This commit is contained in:
@@ -24,6 +24,25 @@ Window {
|
||||
|
||||
property var currentChat: LLM.chatListModel.currentChat
|
||||
property var chatModel: currentChat.chatModel
|
||||
property bool hasSaved: false
|
||||
|
||||
onClosing: function(close) {
|
||||
if (window.hasSaved)
|
||||
return;
|
||||
|
||||
savingPopup.open();
|
||||
LLM.chatListModel.saveChats();
|
||||
close.accepted = false
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: LLM.chatListModel
|
||||
function onSaveChatsFinished() {
|
||||
window.hasSaved = true;
|
||||
savingPopup.close();
|
||||
window.close()
|
||||
}
|
||||
}
|
||||
|
||||
color: theme.backgroundDarkest
|
||||
|
||||
@@ -406,6 +425,14 @@ Window {
|
||||
}
|
||||
}
|
||||
|
||||
PopupDialog {
|
||||
id: savingPopup
|
||||
anchors.centerIn: parent
|
||||
shouldTimeOut: false
|
||||
shouldShowBusy: true
|
||||
text: qsTr("Saving chats.")
|
||||
}
|
||||
|
||||
MyToolButton {
|
||||
id: copyButton
|
||||
anchors.right: settingsButton.left
|
||||
|
Reference in New Issue
Block a user