fix: Compatibility problem with nvenc on windows

* change default chat render to software on windows
This commit is contained in:
Petr Mironychev
2025-09-17 10:20:19 +02:00
parent 76309be0a6
commit 561661b476
4 changed files with 23 additions and 4 deletions

View File

@ -120,6 +120,9 @@ public:
Constants::QODE_ASSIST_GENERAL_OPTIONS_DISPLAY_CATEGORY,
":/resources/images/qoderassist-icon.png");
#endif
QQuickWindow::setSceneGraphBackend(
Settings::chatAssistantSettings().chatRenderer.stringValue());
loadTranslations();
Providers::registerProviders();
@ -202,12 +205,13 @@ public:
showChatViewAction.setText(Tr::tr("Show QodeAssist Chat"));
showChatViewAction.setIcon(QCODEASSIST_CHAT_ICON.icon());
showChatViewAction.addOnTriggered(this, [this] {
if (!m_chatView) {
m_chatView.reset(new Chat::ChatView());
}
if (!m_chatView->isVisible()) {
m_chatView->show();
}
m_chatView->raise();
m_chatView->requestActivate();
});
m_statusWidget->setChatButtonAction(showChatViewAction.contextAction());
@ -237,7 +241,7 @@ public:
}
}
void extensionsInitialized() final { m_chatView.reset(new Chat::ChatView()); }
void extensionsInitialized() final {}
void restartClient()
{

View File

@ -206,6 +206,17 @@ ChatAssistantSettings::ChatAssistantSettings()
textFormat.addOption("HTML");
textFormat.addOption("Plain Text");
chatRenderer.setSettingsKey(Constants::CA_CHAT_RENDERER);
chatRenderer.setLabelText(Tr::tr("Chat Renderer:"));
chatRenderer.addOption("rhi");
chatRenderer.addOption("software");
chatRenderer.setDisplayStyle(Utils::SelectionAspect::DisplayStyle::ComboBox);
#ifdef Q_OS_WIN
chatRenderer.setDefaultValue("software");
#else
chatRenderer.setDefaultValue("rhi");
#endif
resetToDefaults.m_buttonText = TrConstants::RESET_TO_DEFAULTS;
readSettings();
@ -233,6 +244,7 @@ ChatAssistantSettings::ChatAssistantSettings()
chatViewSettingsGrid.addRow({textFontFamily, textFontSize});
chatViewSettingsGrid.addRow({codeFontFamily, codeFontSize});
chatViewSettingsGrid.addRow({textFormat});
chatViewSettingsGrid.addRow({chatRenderer});
return Column{Row{Stretch{1}, resetToDefaults},
Space{8},

View File

@ -72,6 +72,8 @@ public:
Utils::IntegerAspect codeFontSize{this};
Utils::SelectionAspect textFormat{this};
Utils::SelectionAspect chatRenderer{this};
private:
void setupConnections();
void resetSettingsToDefaults();

View File

@ -167,5 +167,6 @@ const char CA_TEXT_FONT_SIZE[] = "QodeAssist.caTextFontSize";
const char CA_CODE_FONT_FAMILY[] = "QodeAssist.caCodeFontFamily";
const char CA_CODE_FONT_SIZE[] = "QodeAssist.caCodeFontSize";
const char CA_TEXT_FORMAT[] = "QodeAssist.caTextFormat";
const char CA_CHAT_RENDERER[] = "QodeAssist.caChatRenderer";
} // namespace QodeAssist::Constants