refactor: Provider settings panel improve

This commit is contained in:
Petr Mironychev
2026-06-29 10:42:33 +02:00
parent 70c6d30a72
commit 86c537477d
16 changed files with 49 additions and 22 deletions

View File

@@ -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())