Update LLMQore to v0.0.4 (#339)

This commit is contained in:
Petr Mironychev
2026-04-19 11:58:54 +02:00
committed by GitHub
parent 6c05f0d594
commit ede2c01eb7
91 changed files with 381 additions and 2225 deletions

View File

@@ -124,18 +124,10 @@ GeneralSettings::GeneralSettings()
ccSelectTemplate.m_buttonText = TrConstants::SELECT;
initStringAspect(ccUrl, Constants::CC_URL, TrConstants::URL, "http://localhost:11434");
ccUrl.setHistoryCompleter(Constants::CC_CUSTOM_ENDPOINT_HISTORY);
ccUrl.setHistoryCompleter(Constants::CC_URL_HISTORY);
ccSetUrl.m_buttonText = TrConstants::SELECT;
ccEndpointMode.setSettingsKey(Constants::CC_ENDPOINT_MODE);
ccEndpointMode.setDisplayStyle(Utils::SelectionAspect::DisplayStyle::ComboBox);
ccEndpointMode.addOption("Auto");
ccEndpointMode.addOption("Custom");
ccEndpointMode.addOption("FIM");
ccEndpointMode.addOption("Chat");
ccEndpointMode.setDefaultValue("Auto");
initStringAspect(ccCustomEndpoint, Constants::CC_CUSTOM_ENDPOINT, TrConstants::ENDPOINT_MODE, "");
initStringAspect(ccCustomEndpoint, Constants::CC_CUSTOM_ENDPOINT, TrConstants::CUSTOM_ENDPOINT, "");
ccCustomEndpoint.setHistoryCompleter(Constants::CC_CUSTOM_ENDPOINT_HISTORY);
ccStatus.setDisplayStyle(Utils::StringAspect::LabelDisplay);
@@ -176,18 +168,10 @@ GeneralSettings::GeneralSettings()
ccPreset1Url.setHistoryCompleter(Constants::CC_PRESET1_URL_HISTORY);
ccPreset1SetUrl.m_buttonText = TrConstants::SELECT;
ccPreset1EndpointMode.setSettingsKey(Constants::CC_PRESET1_ENDPOINT_MODE);
ccPreset1EndpointMode.setDisplayStyle(Utils::SelectionAspect::DisplayStyle::ComboBox);
ccPreset1EndpointMode.addOption("Auto");
ccPreset1EndpointMode.addOption("Custom");
ccPreset1EndpointMode.addOption("FIM");
ccPreset1EndpointMode.addOption("Chat");
ccPreset1EndpointMode.setDefaultValue("Auto");
initStringAspect(
ccPreset1CustomEndpoint,
Constants::CC_PRESET1_CUSTOM_ENDPOINT,
TrConstants::ENDPOINT_MODE,
TrConstants::CUSTOM_ENDPOINT,
"");
ccPreset1CustomEndpoint.setHistoryCompleter(Constants::CC_PRESET1_CUSTOM_ENDPOINT_HISTORY);
@@ -219,15 +203,7 @@ GeneralSettings::GeneralSettings()
caUrl.setHistoryCompleter(Constants::CA_URL_HISTORY);
caSetUrl.m_buttonText = TrConstants::SELECT;
caEndpointMode.setSettingsKey(Constants::CA_ENDPOINT_MODE);
caEndpointMode.setDisplayStyle(Utils::SelectionAspect::DisplayStyle::ComboBox);
caEndpointMode.addOption("Auto");
caEndpointMode.addOption("Custom");
caEndpointMode.addOption("FIM");
caEndpointMode.addOption("Chat");
caEndpointMode.setDefaultValue("Auto");
initStringAspect(caCustomEndpoint, Constants::CA_CUSTOM_ENDPOINT, TrConstants::ENDPOINT_MODE, "");
initStringAspect(caCustomEndpoint, Constants::CA_CUSTOM_ENDPOINT, TrConstants::CUSTOM_ENDPOINT, "");
caCustomEndpoint.setHistoryCompleter(Constants::CA_CUSTOM_ENDPOINT_HISTORY);
caStatus.setDisplayStyle(Utils::StringAspect::LabelDisplay);
@@ -264,15 +240,7 @@ GeneralSettings::GeneralSettings()
qrUrl.setHistoryCompleter(Constants::QR_URL_HISTORY);
qrSetUrl.m_buttonText = TrConstants::SELECT;
qrEndpointMode.setSettingsKey(Constants::QR_ENDPOINT_MODE);
qrEndpointMode.setDisplayStyle(Utils::SelectionAspect::DisplayStyle::ComboBox);
qrEndpointMode.addOption("Auto");
qrEndpointMode.addOption("Custom");
qrEndpointMode.addOption("FIM");
qrEndpointMode.addOption("Chat");
qrEndpointMode.setDefaultValue("Auto");
initStringAspect(qrCustomEndpoint, Constants::QR_CUSTOM_ENDPOINT, TrConstants::ENDPOINT_MODE, "");
initStringAspect(qrCustomEndpoint, Constants::QR_CUSTOM_ENDPOINT, TrConstants::CUSTOM_ENDPOINT, "");
qrCustomEndpoint.setHistoryCompleter(Constants::QR_CUSTOM_ENDPOINT_HISTORY);
qrStatus.setDisplayStyle(Utils::StringAspect::LabelDisplay);
@@ -310,10 +278,6 @@ GeneralSettings::GeneralSettings()
setupConnections();
updatePreset1Visiblity(specifyPreset1.value());
ccCustomEndpoint.setEnabled(ccEndpointMode.stringValue() == "Custom");
ccPreset1CustomEndpoint.setEnabled(ccPreset1EndpointMode.stringValue() == "Custom");
caCustomEndpoint.setEnabled(caEndpointMode.stringValue() == "Custom");
qrCustomEndpoint.setEnabled(qrEndpointMode.stringValue() == "Custom");
setLayouter([this]() {
using namespace Layouting;
@@ -321,28 +285,28 @@ GeneralSettings::GeneralSettings()
auto ccGrid = Grid{};
ccGrid.addRow({ccProvider, ccSelectProvider});
ccGrid.addRow({ccUrl, ccSetUrl});
ccGrid.addRow({ccCustomEndpoint, ccEndpointMode});
ccGrid.addRow({ccCustomEndpoint});
ccGrid.addRow({ccModel, ccSelectModel});
ccGrid.addRow({ccTemplate, ccSelectTemplate, ccShowTemplateInfo});
auto ccPreset1Grid = Grid{};
ccPreset1Grid.addRow({ccPreset1Provider, ccPreset1SelectProvider});
ccPreset1Grid.addRow({ccPreset1Url, ccPreset1SetUrl});
ccPreset1Grid.addRow({ccPreset1CustomEndpoint, ccPreset1EndpointMode});
ccPreset1Grid.addRow({ccPreset1CustomEndpoint});
ccPreset1Grid.addRow({ccPreset1Model, ccPreset1SelectModel});
ccPreset1Grid.addRow({ccPreset1Template, ccPreset1SelectTemplate});
auto caGrid = Grid{};
caGrid.addRow({caProvider, caSelectProvider});
caGrid.addRow({caUrl, caSetUrl});
caGrid.addRow({caCustomEndpoint, caEndpointMode});
caGrid.addRow({caCustomEndpoint});
caGrid.addRow({caModel, caSelectModel});
caGrid.addRow({caTemplate, caSelectTemplate, caShowTemplateInfo});
auto qrGrid = Grid{};
qrGrid.addRow({qrProvider, qrSelectProvider});
qrGrid.addRow({qrUrl, qrSetUrl});
qrGrid.addRow({qrCustomEndpoint, qrEndpointMode});
qrGrid.addRow({qrCustomEndpoint});
qrGrid.addRow({qrModel, qrSelectModel});
qrGrid.addRow({qrTemplate, qrSelectTemplate, qrShowTemplateInfo});
@@ -589,7 +553,6 @@ void GeneralSettings::updatePreset1Visiblity(bool state)
ccPreset1SelectModel.updateVisibility(specifyPreset1.volatileValue());
ccPreset1Template.setVisible(specifyPreset1.volatileValue());
ccPreset1SelectTemplate.updateVisibility(specifyPreset1.volatileValue());
ccPreset1EndpointMode.setVisible(specifyPreset1.volatileValue());
ccPreset1CustomEndpoint.setVisible(specifyPreset1.volatileValue());
}
@@ -633,24 +596,6 @@ void GeneralSettings::setupConnections()
connect(&specifyPreset1, &Utils::BoolAspect::volatileValueChanged, this, [this]() {
updatePreset1Visiblity(specifyPreset1.volatileValue());
});
connect(&ccEndpointMode, &Utils::BaseAspect::volatileValueChanged, this, [this]() {
ccCustomEndpoint.setEnabled(
ccEndpointMode.volatileValue() == ccEndpointMode.indexForDisplay("Custom"));
});
connect(&ccPreset1EndpointMode, &Utils::BaseAspect::volatileValueChanged, this, [this]() {
ccPreset1CustomEndpoint.setEnabled(
ccPreset1EndpointMode.volatileValue()
== ccPreset1EndpointMode.indexForDisplay("Custom"));
});
connect(&caEndpointMode, &Utils::BaseAspect::volatileValueChanged, this, [this]() {
caCustomEndpoint.setEnabled(
caEndpointMode.volatileValue() == caEndpointMode.indexForDisplay("Custom"));
});
connect(&qrEndpointMode, &Utils::BaseAspect::volatileValueChanged, this, [this]() {
qrCustomEndpoint.setEnabled(
qrEndpointMode.volatileValue() == qrEndpointMode.indexForDisplay("Custom"));
});
connect(&ccShowTemplateInfo, &ButtonAspect::clicked, this, [this]() {
showTemplateInfoDialog(ccTemplateDescription, ccTemplate.value());
});
@@ -733,17 +678,13 @@ void GeneralSettings::resetPageToDefaults()
resetAspect(ccPreset1Model);
resetAspect(ccPreset1Template);
resetAspect(ccPreset1Url);
resetAspect(ccEndpointMode);
resetAspect(ccCustomEndpoint);
resetAspect(ccPreset1EndpointMode);
resetAspect(ccPreset1CustomEndpoint);
resetAspect(caEndpointMode);
resetAspect(caCustomEndpoint);
resetAspect(qrProvider);
resetAspect(qrModel);
resetAspect(qrTemplate);
resetAspect(qrUrl);
resetAspect(qrEndpointMode);
resetAspect(qrCustomEndpoint);
writeSettings();
}
@@ -773,7 +714,6 @@ void GeneralSettings::onSaveConfiguration(const QString &prefix)
config.model = ccModel.value();
config.templateName = ccTemplate.value();
config.url = ccUrl.value();
config.endpointMode = ccEndpointMode.stringValue();
config.customEndpoint = ccCustomEndpoint.value();
config.type = ConfigurationType::CodeCompletion;
} else if (prefix == "ca") {
@@ -781,7 +721,6 @@ void GeneralSettings::onSaveConfiguration(const QString &prefix)
config.model = caModel.value();
config.templateName = caTemplate.value();
config.url = caUrl.value();
config.endpointMode = caEndpointMode.stringValue();
config.customEndpoint = caCustomEndpoint.value();
config.type = ConfigurationType::Chat;
} else if (prefix == "qr") {
@@ -789,7 +728,6 @@ void GeneralSettings::onSaveConfiguration(const QString &prefix)
config.model = qrModel.value();
config.templateName = qrTemplate.value();
config.url = qrUrl.value();
config.endpointMode = qrEndpointMode.stringValue();
config.customEndpoint = qrCustomEndpoint.value();
config.type = ConfigurationType::QuickRefactor;
}
@@ -926,21 +864,18 @@ void GeneralSettings::onLoadConfiguration(const QString &prefix)
ccModel.setValue(config.model);
ccTemplate.setValue(config.templateName);
ccUrl.setValue(config.url);
ccEndpointMode.setValue(ccEndpointMode.indexForDisplay(config.endpointMode));
ccCustomEndpoint.setValue(config.customEndpoint);
} else if (prefix == "ca") {
caProvider.setValue(config.provider);
caModel.setValue(config.model);
caTemplate.setValue(config.templateName);
caUrl.setValue(config.url);
caEndpointMode.setValue(caEndpointMode.indexForDisplay(config.endpointMode));
caCustomEndpoint.setValue(config.customEndpoint);
} else if (prefix == "qr") {
qrProvider.setValue(config.provider);
qrModel.setValue(config.model);
qrTemplate.setValue(config.templateName);
qrUrl.setValue(config.url);
qrEndpointMode.setValue(qrEndpointMode.indexForDisplay(config.endpointMode));
qrCustomEndpoint.setValue(config.customEndpoint);
}
@@ -1008,21 +943,18 @@ void GeneralSettings::applyPresetConfiguration(int index, ConfigurationType type
ccModel.setValue(config.model);
ccTemplate.setValue(config.templateName);
ccUrl.setValue(config.url);
ccEndpointMode.setValue(ccEndpointMode.indexForDisplay(config.endpointMode));
ccCustomEndpoint.setValue(config.customEndpoint);
} else if (type == ConfigurationType::Chat) {
caProvider.setValue(config.provider);
caModel.setValue(config.model);
caTemplate.setValue(config.templateName);
caUrl.setValue(config.url);
caEndpointMode.setValue(caEndpointMode.indexForDisplay(config.endpointMode));
caCustomEndpoint.setValue(config.customEndpoint);
} else if (type == ConfigurationType::QuickRefactor) {
qrProvider.setValue(config.provider);
qrModel.setValue(config.model);
qrTemplate.setValue(config.templateName);
qrUrl.setValue(config.url);
qrEndpointMode.setValue(qrEndpointMode.indexForDisplay(config.endpointMode));
qrCustomEndpoint.setValue(config.customEndpoint);
}