mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
parent
1635a5211f
commit
878995366a
@ -341,15 +341,25 @@ void DatabaseWidget::deleteEntries()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (selected.size() > 1) {
|
QMessageBox::StandardButton result;
|
||||||
QMessageBox::StandardButton result = MessageBox::question(
|
|
||||||
|
if (selected.size() == 1) {
|
||||||
|
result = MessageBox::question(
|
||||||
|
this, tr("Move entry to recycle bin?"),
|
||||||
|
tr("Do you really want to move entry \"%1\" to the recycle bin?")
|
||||||
|
.arg(selectedEntries.first()->title()),
|
||||||
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
result = MessageBox::question(
|
||||||
this, tr("Move entries to recycle bin?"),
|
this, tr("Move entries to recycle bin?"),
|
||||||
tr("Do you really want to move %n entry(s) to the recycle bin?", 0, selected.size()),
|
tr("Do you really want to move %n entry(s) to the recycle bin?", 0, selected.size()),
|
||||||
QMessageBox::Yes | QMessageBox::No);
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
|
}
|
||||||
|
|
||||||
if (result == QMessageBox::No) {
|
if (result == QMessageBox::No) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Q_FOREACH (Entry* entry, selectedEntries) {
|
Q_FOREACH (Entry* entry, selectedEntries) {
|
||||||
m_db->recycleEntry(entry);
|
m_db->recycleEntry(entry);
|
||||||
|
@ -239,6 +239,7 @@ void TestGui::testSearch()
|
|||||||
QVERIFY(entryDeleteWidget->isEnabled());
|
QVERIFY(entryDeleteWidget->isEnabled());
|
||||||
QVERIFY(!m_db->metadata()->recycleBin());
|
QVERIFY(!m_db->metadata()->recycleBin());
|
||||||
|
|
||||||
|
MessageBox::setNextAnswer(QMessageBox::Yes);
|
||||||
QTest::mouseClick(entryDeleteWidget, Qt::LeftButton);
|
QTest::mouseClick(entryDeleteWidget, Qt::LeftButton);
|
||||||
|
|
||||||
QCOMPARE(entryView->model()->rowCount(), 3);
|
QCOMPARE(entryView->model()->rowCount(), 3);
|
||||||
|
Loading…
Reference in New Issue
Block a user