mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-03-11 08:54:48 +00:00
Update language files and add test case
This commit is contained in:
parent
c239abeb2e
commit
536999daea
4 changed files with 26 additions and 0 deletions
|
|
@ -6432,6 +6432,10 @@ Expect some bugs and minor issues, this version is meant for testing purposes.</
|
|||
<numerusform></numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Clear Clipboard</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManageDatabase</name>
|
||||
|
|
|
|||
|
|
@ -690,6 +690,7 @@ MainWindow::MainWindow()
|
|||
|
||||
m_clearClipboardButton = new QPushButton(statusBar());
|
||||
m_clearClipboardButton->setText(tr("Clear Clipboard"));
|
||||
m_clearClipboardButton->setObjectName("clearClipboardButton");
|
||||
m_clearClipboardButton->setVisible(false);
|
||||
statusBar()->addPermanentWidget(m_clearClipboardButton);
|
||||
|
||||
|
|
|
|||
|
|
@ -2494,6 +2494,26 @@ void TestGui::addCannedEntries()
|
|||
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
||||
}
|
||||
|
||||
void TestGui::testClearClipboard()
|
||||
{
|
||||
addCannedEntries();
|
||||
|
||||
EntryView* entryView = m_dbWidget->findChild<EntryView*>("entryView");
|
||||
QVERIFY(entryView->isVisible());
|
||||
|
||||
QClipboard* clipboard = QApplication::clipboard();
|
||||
|
||||
clickIndex(entryView->model()->index(1, 1), entryView, Qt::LeftButton);
|
||||
QTRY_VERIFY(entryView->hasFocus());
|
||||
QTest::keyClick(entryView, Qt::Key_C, Qt::ControlModifier);
|
||||
QTRY_COMPARE(clipboard->text(), entryView->currentEntry()->password());
|
||||
|
||||
QPushButton *clearClipboardButton = m_mainWindow->findChild<QPushButton *>("clearClipboardButton");
|
||||
QTRY_VERIFY(clearClipboardButton->isVisible());
|
||||
clearClipboardButton->click();
|
||||
QCOMPARE(clipboard->text(), QString());
|
||||
}
|
||||
|
||||
void TestGui::checkDatabase(const QString& filePath, const QString& expectedDbName)
|
||||
{
|
||||
auto key = QSharedPointer<CompositeKey>::create();
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ private slots:
|
|||
void testTrayRestoreHide();
|
||||
void testShortcutConfig();
|
||||
void testMenuActionStates();
|
||||
void testClearClipboard();
|
||||
|
||||
private:
|
||||
void addCannedEntries();
|
||||
|
|
|
|||
Loading…
Reference in a new issue