Rework General Settings

This commit is contained in:
Petr Mironychev
2024-11-10 20:31:57 +01:00
parent 1ec6098210
commit b141e54e3e
27 changed files with 564 additions and 575 deletions

View File

@ -34,50 +34,49 @@ public:
GeneralSettings();
Utils::BoolAspect enableQodeAssist{this};
Utils::BoolAspect enableAutoComplete{this};
Utils::BoolAspect multiLineCompletion{this};
Utils::BoolAspect enableLogging{this};
Utils::IntegerAspect startSuggestionTimer{this};
Utils::IntegerAspect autoCompletionCharThreshold{this};
Utils::IntegerAspect autoCompletionTypingInterval{this};
Utils::SelectionAspect llmProviders{this};
Utils::StringAspect url{this};
Utils::StringAspect endPoint{this};
Utils::StringAspect modelName{this};
ButtonAspect selectModels{this};
Utils::SelectionAspect fimPrompts{this};
ButtonAspect resetToDefaults{this};
Utils::SelectionAspect chatLlmProviders{this};
Utils::StringAspect chatUrl{this};
Utils::StringAspect chatEndPoint{this};
// code completion setttings
Utils::StringAspect ccProvider{this};
ButtonAspect ccSelectProvider{this};
Utils::StringAspect chatModelName{this};
ButtonAspect chatSelectModels{this};
Utils::SelectionAspect chatPrompts{this};
Utils::StringAspect ccModel{this};
ButtonAspect ccSelectModel{this};
Utils::StringAspect fimModelIndicator{this};
Utils::StringAspect fimUrlIndicator{this};
Utils::StringAspect chatModelIndicator{this};
Utils::StringAspect chatUrlIndicator{this};
Utils::StringAspect ccTemplate{this};
ButtonAspect ccSelectTemplate{this};
Utils::IntegerAspect chatTokensThreshold{this};
Utils::StringAspect ccUrl{this};
ButtonAspect ccSetUrl{this};
Utils::StringAspect ccStatus{this};
ButtonAspect ccTest{this};
// chat assistant settings
Utils::StringAspect caProvider{this};
ButtonAspect caSelectProvider{this};
Utils::StringAspect caModel{this};
ButtonAspect caSelectModel{this};
Utils::StringAspect caTemplate{this};
ButtonAspect caSelectTemplate{this};
Utils::StringAspect caUrl{this};
ButtonAspect caSetUrl{this};
Utils::StringAspect caStatus{this};
ButtonAspect caTest{this};
void showSelectionDialog(const QStringList &data,
Utils::StringAspect &aspect,
const QString &title = {},
const QString &text = {});
private:
void setupConnections();
void showModelSelectionDialog(Utils::StringAspect *modelNameObj, LLMCore::Provider *provider);
void resetPageToDefaults();
void updateStatusIndicators();
void setIndicatorStatus(Utils::StringAspect &indicator, const QString &tooltip, bool isValid);
void setCurrentFimProvider(const QString &name);
void setCurrentChatProvider(const QString &name);
void loadProviders();
void loadPrompts();
};
GeneralSettings &generalSettings();