From 59f99b7f21e3e821e680a2d907a6e4cd1f9d53ff Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Sat, 9 Mar 2024 10:32:35 -0500 Subject: [PATCH] Minor fixes to server port feature. Signed-off-by: Adam Treat --- gpt4all-chat/mysettings.cpp | 2 +- gpt4all-chat/qml/ApplicationSettings.qml | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/gpt4all-chat/mysettings.cpp b/gpt4all-chat/mysettings.cpp index d5a7e9df..5f96eaaf 100644 --- a/gpt4all-chat/mysettings.cpp +++ b/gpt4all-chat/mysettings.cpp @@ -684,7 +684,7 @@ int MySettings::networkPort() const { QSettings setting; setting.sync(); - return setting.value("networkPort", default_serverChat).toInt(); + return setting.value("networkPort", default_networkPort).toInt(); } void MySettings::setNetworkPort(int c) diff --git a/gpt4all-chat/qml/ApplicationSettings.qml b/gpt4all-chat/qml/ApplicationSettings.qml index 882a2910..d2dc2150 100644 --- a/gpt4all-chat/qml/ApplicationSettings.qml +++ b/gpt4all-chat/qml/ApplicationSettings.qml @@ -254,16 +254,15 @@ MySettingsTab { } ToolTip.text: qsTr("WARNING: This enables the gui to act as a local REST web server(OpenAI API compliant) for API requests and will increase your RAM usage as well") ToolTip.visible: hovered - } - Label { + } + MySettingsLabel { id: serverPortLabel - text: qsTr("Server Port (Requires restart):") - color: theme.textColor - font.pixelSize: theme.fontSizeLarge + text: qsTr("API Server Port (Requires restart):") Layout.row: 9 Layout.column: 0 } MyTextField { + id: serverPortField text: MySettings.networkPort color: theme.textColor font.pixelSize: theme.fontSizeLarge @@ -284,7 +283,7 @@ MySettingsTab { } } Accessible.role: Accessible.EditableText - Accessible.name: nServerPortLabel.text + Accessible.name: serverPortField.text Accessible.description: ToolTip.text } Rectangle {