mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-06-30 10:09:19 -04:00
refactor: Provider settings panel improve
This commit is contained in:
@@ -125,6 +125,8 @@ public:
|
||||
this, &ProvidersPageWidget::onApiKeySave);
|
||||
connect(m_detailPane, &ProviderDetailPane::apiKeyClearRequested,
|
||||
this, &ProvidersPageWidget::onApiKeyClear);
|
||||
connect(m_detailPane, &ProviderDetailPane::apiKeyRevealRequested,
|
||||
this, &ProvidersPageWidget::onApiKeyReveal);
|
||||
connect(m_detailPane, &ProviderDetailPane::launchStartRequested,
|
||||
this, &ProvidersPageWidget::onLaunchStart);
|
||||
connect(m_detailPane, &ProviderDetailPane::launchStopRequested,
|
||||
@@ -447,6 +449,16 @@ private slots:
|
||||
m_detailPane->refreshKeyStatus(true);
|
||||
}
|
||||
|
||||
void onApiKeyReveal()
|
||||
{
|
||||
if (!m_factory || !m_secrets || m_currentName.isEmpty())
|
||||
return;
|
||||
const auto *inst = m_factory->instanceByName(m_currentName);
|
||||
if (!inst || inst->apiKeyRef.isEmpty())
|
||||
return;
|
||||
m_detailPane->showRevealedKey(m_secrets->readKeySync(inst->apiKeyRef));
|
||||
}
|
||||
|
||||
void onApiKeyClear()
|
||||
{
|
||||
if (!m_factory || !m_secrets || m_currentName.isEmpty())
|
||||
|
||||
Reference in New Issue
Block a user