From e120eb50088c6a59101443e4de8028bcbfa2755f Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Sun, 9 Jul 2023 15:08:14 -0400 Subject: [PATCH] Allow closing the download dialog and display a message to the user if no models are installed. --- gpt4all-chat/main.qml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/gpt4all-chat/main.qml b/gpt4all-chat/main.qml index 83ad8300..3a188cbe 100644 --- a/gpt4all-chat/main.qml +++ b/gpt4all-chat/main.qml @@ -87,6 +87,8 @@ Window { } } + property bool hasShownModelDownload: false + function startupDialogs() { if (!LLM.compatHardware) { Network.sendNonCompatHardware(); @@ -100,9 +102,10 @@ Window { return; } - // check for any current models and if not, open download dialog - if (ModelList.installedModels.count === 0 && !firstStartDialog.opened) { + // check for any current models and if not, open download dialog once + if (!hasShownModelDownload && ModelList.installedModels.count === 0 && !firstStartDialog.opened) { downloadNewModels.open(); + hasShownModelDownload = true; return; } @@ -654,8 +657,18 @@ Window { anchors.fill: parent color: currentChat.isServer ? theme.backgroundDark : theme.backgroundLight + Text { + text: qsTr("You must install a model via the download dialog to continue. The download dialog can be accessed via the drawer button in the top left corner and then clicking the 'Downloads' button.") + color: theme.textColor + width: 500 + wrapMode: Text.WordWrap + anchors.centerIn: parent + visible: ModelList.installedModels.count === 0 + } + ListView { id: listView + visible: ModelList.installedModels.count !== 0 anchors.fill: parent model: chatModel