* @brief MainWindow::reencryptPath re-encrypt all passwords in a directory * @param dir Directory path to re-encrypt */
| 1482 | * @param dir Directory path to re-encrypt |
| 1483 | */ |
| 1484 | void MainWindow::reencryptPath(const QString &dir) { |
| 1485 | QDir checkDir(dir); |
| 1486 | if (!checkDir.exists()) { |
| 1487 | QMessageBox::critical(this, tr("Error"), |
| 1488 | tr("Directory does not exist: %1").arg(dir)); |
| 1489 | return; |
| 1490 | } |
| 1491 | |
| 1492 | int ret = QMessageBox::question( |
| 1493 | this, tr("Re-encrypt passwords"), |
| 1494 | tr("Re-encrypt all passwords in %1?\n\n" |
| 1495 | "This will re-encrypt ALL password files in this folder " |
| 1496 | "using the current recipients defined in .gpg-id.\n\n" |
| 1497 | "This may rewrite many files and cannot be undone easily.\n\n" |
| 1498 | "Continue?") |
| 1499 | .arg(QDir(dir).dirName()), |
| 1500 | QMessageBox::Yes | QMessageBox::No); |
| 1501 | |
| 1502 | if (ret != QMessageBox::Yes) |
| 1503 | return; |
| 1504 | |
| 1505 | // Prevent double execution - use same method as startReencryptPath |
| 1506 | setUiElementsEnabled(false); |
| 1507 | ui->treeView->setDisabled(true); |
| 1508 | |
| 1509 | QtPassSettings::getImitatePass()->reencryptPath( |
| 1510 | QDir::cleanPath(QDir(dir).absolutePath())); |
| 1511 | } |
| 1512 | |
| 1513 | /** |
| 1514 | * @brief MainWindow::startReencryptPath disable ui elements and treeview |
nothing calls this directly
no outgoing calls
no test coverage detected