Skip to content

Commit

Permalink
use TextField onEditingFinished instead of onAccepted
Browse files Browse the repository at this point in the history
this will save settings on defocus instead of only
on pressing enter

Closes nomic-ai#440
  • Loading branch information
apage43 authored and manyoso committed Apr 25, 2023
1 parent 15a979b commit b72cf40
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions qml/SettingsDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b72cf40

Please sign in to comment.