This completes the work of consolidating all settings that can be changed by the user on new settings object.

This commit is contained in:
Adam Treat
2023-06-28 20:42:40 -04:00
committed by AT
parent 8d19ef3909
commit 7f252b4970
15 changed files with 228 additions and 188 deletions

View File

@@ -6,6 +6,7 @@ import QtQuick.Layouts
import download
import network
import llm
import mysettings
Dialog {
id: networkDialog
@@ -18,16 +19,6 @@ Dialog {
id: theme
}
Settings {
id: settings
category: "network"
property string attribution: ""
}
Component.onDestruction: {
settings.sync()
}
Column {
id: column
spacing: 20
@@ -86,7 +77,7 @@ NOTE: By turning on this feature, you will be sending your data to the GPT4All O
color: theme.textColor
padding: 20
width: parent.width
text: settings.attribution
text: MySettings.networkAttribution
font.pixelSize: theme.fontSizeLarge
placeholderText: qsTr("Please provide a name for attribution (optional)")
placeholderTextColor: theme.backgroundLightest
@@ -98,8 +89,7 @@ NOTE: By turning on this feature, you will be sending your data to the GPT4All O
Accessible.name: qsTr("Attribution (optional)")
Accessible.description: qsTr("Textfield for providing attribution")
onEditingFinished: {
settings.attribution = attribution.text;
settings.sync();
MySettings.networkAttribution = attribution.text;
}
}
}
@@ -133,16 +123,16 @@ NOTE: By turning on this feature, you will be sending your data to the GPT4All O
}
onAccepted: {
if (Network.isActive)
if (MySettings.networkIsActive)
return
Network.isActive = true;
MySettings.networkIsActive = true;
Network.sendNetworkToggled(true);
}
onRejected: {
if (!Network.isActive)
if (!MySettings.networkIsActive)
return
Network.isActive = false;
MySettings.networkIsActive = false;
Network.sendNetworkToggled(false);
}
}