forked from qt-creator/qt-creator
Copilot: Update authenticator widget while changing settings
Use a separate client for the authenticator widget that can react on changes in the settings widget. This removes the need to manually apply the settings between setting up the nodejs and agent.js paths and signing into github. Change-Id: I6628a3a8906ccbba208f9dac968262df962f93c0 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -54,6 +54,24 @@ file from the Copilot neovim plugin.
|
||||
st
|
||||
}.attachTo(this);
|
||||
// clang-format on
|
||||
|
||||
auto updateAuthWidget = [authWidget]() {
|
||||
authWidget->updateClient(
|
||||
FilePath::fromUserInput(
|
||||
CopilotSettings::instance().nodeJsPath.volatileValue().toString()),
|
||||
FilePath::fromUserInput(
|
||||
CopilotSettings::instance().distPath.volatileValue().toString()));
|
||||
};
|
||||
|
||||
connect(CopilotSettings::instance().nodeJsPath.pathChooser(),
|
||||
&PathChooser::textChanged,
|
||||
authWidget,
|
||||
updateAuthWidget);
|
||||
connect(CopilotSettings::instance().distPath.pathChooser(),
|
||||
&PathChooser::textChanged,
|
||||
authWidget,
|
||||
updateAuthWidget);
|
||||
updateAuthWidget();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user