From c8d761a0040c19108b61443cbb1b3a13d393d9fb Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Sun, 9 Jul 2023 15:51:59 -0400 Subject: [PATCH] Add a nicer message. --- gpt4all-chat/CMakeLists.txt | 1 + gpt4all-chat/icons/download.svg | 5 +++++ gpt4all-chat/icons/question.svg | 8 +++++++ gpt4all-chat/main.qml | 38 +++++++++++++++++++++++++++++++-- 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 gpt4all-chat/icons/download.svg create mode 100644 gpt4all-chat/icons/question.svg diff --git a/gpt4all-chat/CMakeLists.txt b/gpt4all-chat/CMakeLists.txt index b98989e2..cfd68ae0 100644 --- a/gpt4all-chat/CMakeLists.txt +++ b/gpt4all-chat/CMakeLists.txt @@ -122,6 +122,7 @@ qt_add_qml_module(chat icons/close.svg icons/copy.svg icons/db.svg + icons/download.svg icons/settings.svg icons/edit.svg icons/image.svg diff --git a/gpt4all-chat/icons/download.svg b/gpt4all-chat/icons/download.svg new file mode 100644 index 00000000..76f56c3f --- /dev/null +++ b/gpt4all-chat/icons/download.svg @@ -0,0 +1,5 @@ + + diff --git a/gpt4all-chat/icons/question.svg b/gpt4all-chat/icons/question.svg new file mode 100644 index 00000000..7cf18fdd --- /dev/null +++ b/gpt4all-chat/icons/question.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/gpt4all-chat/main.qml b/gpt4all-chat/main.qml index 3a188cbe..94f86e4b 100644 --- a/gpt4all-chat/main.qml +++ b/gpt4all-chat/main.qml @@ -658,12 +658,46 @@ Window { 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.") + id: warningLabel + text: qsTr("You must install a model to continue. Models are available via the download dialog or you can install them manually by downloading from the GPT4All website (look for the Models Explorer) and placing them in the model folder. The model folder can be found in the settings dialog under the application tab.") color: theme.textColor - width: 500 + width: 600 + linkColor: theme.linkColor wrapMode: Text.WordWrap anchors.centerIn: parent visible: ModelList.installedModels.count === 0 + onLinkActivated: function(link) { + Qt.openUrlExternally(link) + } + } + + MyButton { + id: downloadButton + text: qsTr("Download models") + visible: ModelList.installedModels.count === 0 + anchors.top: warningLabel.bottom + anchors.topMargin: 20 + anchors.horizontalCenter: warningLabel.horizontalCenter + padding: 15 + leftPadding: 50 + Image { + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.leftMargin: 15 + width: 24 + height: 24 + mipmap: true + source: "qrc:/gpt4all/icons/download.svg" + } + background: Rectangle { + border.color: downloadButton.down ? theme.backgroundLightest : theme.buttonBorder + border.width: 2 + radius: 10 + color: downloadButton.hovered ? theme.backgroundLighter : theme.backgroundLight + } + onClicked: { + downloadNewModels.open(); + } } ListView {