mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-10-04 11:06:20 -04:00
fix: Compatibility problem with nvenc on windows
* change default chat render to software on windows
This commit is contained in:
@ -120,6 +120,9 @@ public:
|
|||||||
Constants::QODE_ASSIST_GENERAL_OPTIONS_DISPLAY_CATEGORY,
|
Constants::QODE_ASSIST_GENERAL_OPTIONS_DISPLAY_CATEGORY,
|
||||||
":/resources/images/qoderassist-icon.png");
|
":/resources/images/qoderassist-icon.png");
|
||||||
#endif
|
#endif
|
||||||
|
QQuickWindow::setSceneGraphBackend(
|
||||||
|
Settings::chatAssistantSettings().chatRenderer.stringValue());
|
||||||
|
|
||||||
loadTranslations();
|
loadTranslations();
|
||||||
|
|
||||||
Providers::registerProviders();
|
Providers::registerProviders();
|
||||||
@ -202,12 +205,13 @@ public:
|
|||||||
showChatViewAction.setText(Tr::tr("Show QodeAssist Chat"));
|
showChatViewAction.setText(Tr::tr("Show QodeAssist Chat"));
|
||||||
showChatViewAction.setIcon(QCODEASSIST_CHAT_ICON.icon());
|
showChatViewAction.setIcon(QCODEASSIST_CHAT_ICON.icon());
|
||||||
showChatViewAction.addOnTriggered(this, [this] {
|
showChatViewAction.addOnTriggered(this, [this] {
|
||||||
|
if (!m_chatView) {
|
||||||
|
m_chatView.reset(new Chat::ChatView());
|
||||||
|
}
|
||||||
|
|
||||||
if (!m_chatView->isVisible()) {
|
if (!m_chatView->isVisible()) {
|
||||||
m_chatView->show();
|
m_chatView->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_chatView->raise();
|
|
||||||
m_chatView->requestActivate();
|
|
||||||
});
|
});
|
||||||
m_statusWidget->setChatButtonAction(showChatViewAction.contextAction());
|
m_statusWidget->setChatButtonAction(showChatViewAction.contextAction());
|
||||||
|
|
||||||
@ -237,7 +241,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void extensionsInitialized() final { m_chatView.reset(new Chat::ChatView()); }
|
void extensionsInitialized() final {}
|
||||||
|
|
||||||
void restartClient()
|
void restartClient()
|
||||||
{
|
{
|
||||||
|
@ -206,6 +206,17 @@ ChatAssistantSettings::ChatAssistantSettings()
|
|||||||
textFormat.addOption("HTML");
|
textFormat.addOption("HTML");
|
||||||
textFormat.addOption("Plain Text");
|
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;
|
resetToDefaults.m_buttonText = TrConstants::RESET_TO_DEFAULTS;
|
||||||
|
|
||||||
readSettings();
|
readSettings();
|
||||||
@ -233,6 +244,7 @@ ChatAssistantSettings::ChatAssistantSettings()
|
|||||||
chatViewSettingsGrid.addRow({textFontFamily, textFontSize});
|
chatViewSettingsGrid.addRow({textFontFamily, textFontSize});
|
||||||
chatViewSettingsGrid.addRow({codeFontFamily, codeFontSize});
|
chatViewSettingsGrid.addRow({codeFontFamily, codeFontSize});
|
||||||
chatViewSettingsGrid.addRow({textFormat});
|
chatViewSettingsGrid.addRow({textFormat});
|
||||||
|
chatViewSettingsGrid.addRow({chatRenderer});
|
||||||
|
|
||||||
return Column{Row{Stretch{1}, resetToDefaults},
|
return Column{Row{Stretch{1}, resetToDefaults},
|
||||||
Space{8},
|
Space{8},
|
||||||
|
@ -72,6 +72,8 @@ public:
|
|||||||
Utils::IntegerAspect codeFontSize{this};
|
Utils::IntegerAspect codeFontSize{this};
|
||||||
Utils::SelectionAspect textFormat{this};
|
Utils::SelectionAspect textFormat{this};
|
||||||
|
|
||||||
|
Utils::SelectionAspect chatRenderer{this};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setupConnections();
|
void setupConnections();
|
||||||
void resetSettingsToDefaults();
|
void resetSettingsToDefaults();
|
||||||
|
@ -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_FAMILY[] = "QodeAssist.caCodeFontFamily";
|
||||||
const char CA_CODE_FONT_SIZE[] = "QodeAssist.caCodeFontSize";
|
const char CA_CODE_FONT_SIZE[] = "QodeAssist.caCodeFontSize";
|
||||||
const char CA_TEXT_FORMAT[] = "QodeAssist.caTextFormat";
|
const char CA_TEXT_FORMAT[] = "QodeAssist.caTextFormat";
|
||||||
|
const char CA_CHAT_RENDERER[] = "QodeAssist.caChatRenderer";
|
||||||
|
|
||||||
} // namespace QodeAssist::Constants
|
} // namespace QodeAssist::Constants
|
||||||
|
Reference in New Issue
Block a user