From b72cf40878b9e8e42fb61044c2f5dec17a5833c5 Mon Sep 17 00:00:00 2001 From: Aaron Miller Date: Tue, 25 Apr 2023 08:40:19 -0700 Subject: [PATCH] use TextField onEditingFinished instead of onAccepted this will save settings on defocus instead of only on pressing enter Closes https://github.com/nomic-ai/gpt4all/issues/440 --- qml/SettingsDialog.qml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/qml/SettingsDialog.qml b/qml/SettingsDialog.qml index 35ee4571..7b9d7753 100644 --- a/qml/SettingsDialog.qml +++ b/qml/SettingsDialog.qml @@ -152,7 +152,7 @@ The prompt below is a question to answer, a task to complete, or a conversation Layout.row: 0 Layout.column: 1 validator: DoubleValidator { } - onAccepted: { + onEditingFinished: { var val = parseFloat(text) if (!isNaN(val)) { settings.temperature = val @@ -187,7 +187,7 @@ The prompt below is a question to answer, a task to complete, or a conversation Layout.row: 1 Layout.column: 1 validator: DoubleValidator {} - onAccepted: { + onEditingFinished: { var val = parseFloat(text) if (!isNaN(val)) { settings.topP = val @@ -222,7 +222,7 @@ The prompt below is a question to answer, a task to complete, or a conversation Layout.row: 2 Layout.column: 1 validator: IntValidator { bottom: 1 } - onAccepted: { + onEditingFinished: { var val = parseInt(text) if (!isNaN(val)) { settings.topK = val @@ -257,7 +257,7 @@ The prompt below is a question to answer, a task to complete, or a conversation Layout.row: 3 Layout.column: 1 validator: IntValidator { bottom: 1 } - onAccepted: { + onEditingFinished: { var val = parseInt(text) if (!isNaN(val)) { settings.maxLength = val @@ -293,7 +293,7 @@ The prompt below is a question to answer, a task to complete, or a conversation Layout.row: 4 Layout.column: 1 validator: IntValidator { bottom: 1 } - onAccepted: { + onEditingFinished: { var val = parseInt(text) if (!isNaN(val)) { settings.promptBatchSize = val @@ -328,7 +328,7 @@ The prompt below is a question to answer, a task to complete, or a conversation Layout.row: 5 Layout.column: 1 validator: DoubleValidator {} - onAccepted: { + onEditingFinished: { var val = parseFloat(text) if (!isNaN(val)) { settings.repeatPenalty = val @@ -363,7 +363,7 @@ The prompt below is a question to answer, a task to complete, or a conversation Layout.row: 6 Layout.column: 1 validator: IntValidator { bottom: 1 } - onAccepted: { + onEditingFinished: { var val = parseInt(text) if (!isNaN(val)) { settings.repeatPenaltyTokens = val @@ -515,7 +515,7 @@ The prompt below is a question to answer, a task to complete, or a conversation Layout.row: 2 Layout.column: 1 validator: IntValidator { bottom: 1 } - onAccepted: { + onEditingFinished: { var val = parseInt(text) if (!isNaN(val)) { settingsDialog.threadCount = val