forked from Shinonome/dots-hyprland
configoptions: use quickshell jsonadapter
This commit is contained in:
@@ -106,7 +106,7 @@ Item {
|
||||
break;
|
||||
}
|
||||
}
|
||||
Booru.makeRequest(tagList, PersistentStates.booru.allowNsfw, ConfigOptions.sidebar.booru.limit, pageIndex);
|
||||
Booru.makeRequest(tagList, PersistentStates.booru.allowNsfw, Config.options.sidebar.booru.limit, pageIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ Item {
|
||||
required property var scopeRoot
|
||||
anchors.fill: parent
|
||||
property var tabButtonList: [
|
||||
...(ConfigOptions.policies.ai !== 0 ? [{"icon": "neurology", "name": qsTr("Intelligence")}] : []),
|
||||
...(Config.options.policies.ai !== 0 ? [{"icon": "neurology", "name": qsTr("Intelligence")}] : []),
|
||||
{"icon": "translate", "name": qsTr("Translator")},
|
||||
...(ConfigOptions.policies.weeb === 1 ? [{"icon": "bookmark_heart", "name": qsTr("Anime")}] : [])
|
||||
...(Config.options.policies.weeb === 1 ? [{"icon": "bookmark_heart", "name": qsTr("Anime")}] : [])
|
||||
]
|
||||
property int selectedTab: 0
|
||||
|
||||
@@ -88,9 +88,9 @@ Item {
|
||||
}
|
||||
|
||||
contentChildren: [
|
||||
...(ConfigOptions.policies.ai !== 0 ? [aiChat.createObject()] : []),
|
||||
...(Config.options.policies.ai !== 0 ? [aiChat.createObject()] : []),
|
||||
translator.createObject(),
|
||||
...(ConfigOptions.policies.weeb === 0 ? [] : [anime.createObject()])
|
||||
...(Config.options.policies.weeb === 0 ? [] : [anime.createObject()])
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ Item {
|
||||
property string translatedText: ""
|
||||
property list<string> languages: []
|
||||
// Options
|
||||
property string targetLanguage: ConfigOptions.language.translator.targetLanguage
|
||||
property string sourceLanguage: ConfigOptions.language.translator.sourceLanguage
|
||||
property string targetLanguage: Config.options.language.translator.targetLanguage
|
||||
property string sourceLanguage: Config.options.language.translator.sourceLanguage
|
||||
property string hostLanguage: targetLanguage
|
||||
|
||||
property bool showLanguageSelector: false
|
||||
@@ -43,7 +43,7 @@ Item {
|
||||
|
||||
Timer {
|
||||
id: translateTimer
|
||||
interval: ConfigOptions.sidebar.translator.delay
|
||||
interval: Config.options.sidebar.translator.delay
|
||||
repeat: false
|
||||
onTriggered: () => {
|
||||
if (root.inputField.text.trim().length > 0) {
|
||||
@@ -155,8 +155,8 @@ Item {
|
||||
color: searchButton.enabled ? Appearance.colors.colOnLayer1 : Appearance.colors.colSubtext
|
||||
}
|
||||
onClicked: {
|
||||
let url = ConfigOptions.search.engineBaseUrl + outputCanvas.displayedText;
|
||||
for (let site of ConfigOptions.search.excludedSites) {
|
||||
let url = Config.options.search.engineBaseUrl + outputCanvas.displayedText;
|
||||
for (let site of Config.options.search.excludedSites) {
|
||||
url += ` -site:${site}`;
|
||||
}
|
||||
Qt.openUrlExternally(url);
|
||||
@@ -235,10 +235,10 @@ Item {
|
||||
|
||||
if (root.languageSelectorTarget) {
|
||||
root.targetLanguage = result;
|
||||
ConfigLoader.setConfigValueAndSave("language.translator.targetLanguage", result); // Save to config
|
||||
Config.options.language.translator.targetLanguage = result; // Save to config
|
||||
} else {
|
||||
root.sourceLanguage = result;
|
||||
ConfigLoader.setConfigValueAndSave("language.translator.sourceLanguage", result); // Save to config
|
||||
Config.options.language.translator.sourceLanguage = result; // Save to config
|
||||
}
|
||||
|
||||
translateTimer.restart(); // Restart translation after language change
|
||||
|
||||
Reference in New Issue
Block a user