|
|
|
@ -106,25 +106,30 @@ void AutoFillManager::changePasswordBackend() |
|
|
|
|
|
|
|
|
|
|
|
int current = 0; |
|
|
|
int current = 0; |
|
|
|
|
|
|
|
|
|
|
|
foreach (const QString &key, backends.keys()) { |
|
|
|
QHashIterator<QString, PasswordBackend*> i(backends); |
|
|
|
if (backends[key] == m_passwordManager->activeBackend()) { |
|
|
|
while (i.hasNext()) { |
|
|
|
|
|
|
|
i.next(); |
|
|
|
|
|
|
|
if (i.value() == m_passwordManager->activeBackend()) { |
|
|
|
current = items.size(); |
|
|
|
current = items.size(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
items << i.value()->name(); |
|
|
|
items << backends[key]->name(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QString item = QInputDialog::getItem(this, tr("Change backend..."), tr("Change backend:"), items, current, false); |
|
|
|
QString item = QInputDialog::getItem(this, tr("Change backend..."), tr("Change backend:"), items, current, false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Switch backends
|
|
|
|
if (!item.isEmpty()) { |
|
|
|
if (!item.isEmpty()) { |
|
|
|
Settings settings; |
|
|
|
Settings settings; |
|
|
|
settings.beginGroup("PasswordManager"); |
|
|
|
settings.beginGroup("PasswordManager"); |
|
|
|
|
|
|
|
|
|
|
|
PasswordBackend* backend = 0; |
|
|
|
PasswordBackend* backend = 0; |
|
|
|
foreach (const QString &key, backends.keys()) { |
|
|
|
|
|
|
|
if (backends[key]->name() == item) { |
|
|
|
QHashIterator<QString, PasswordBackend*> i(backends); |
|
|
|
backend = backends[key]; |
|
|
|
while (i.hasNext()) { |
|
|
|
settings.setValue("Backend", key); |
|
|
|
i.next(); |
|
|
|
|
|
|
|
if (i.value()->name() == item) { |
|
|
|
|
|
|
|
backend = i.value(); |
|
|
|
|
|
|
|
settings.setValue("Backend", i.key()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -133,7 +138,8 @@ void AutoFillManager::changePasswordBackend() |
|
|
|
|
|
|
|
|
|
|
|
if (backend) { |
|
|
|
if (backend) { |
|
|
|
m_passwordManager->switchBackend(backend); |
|
|
|
m_passwordManager->switchBackend(backend); |
|
|
|
ui->backendOptions->setVisible(backend); |
|
|
|
ui->backendOptions->setVisible(backend->hasSettings()); |
|
|
|
|
|
|
|
ui->currentBackend->setText(QString("<b>%1</b>").arg(backend->name())); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|