mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-03-11 08:54:48 +00:00
Merge 1b75fd9969 into d9be1b0682
This commit is contained in:
commit
eb3967c558
8 changed files with 53 additions and 0 deletions
1
COPYING
1
COPYING
|
|
@ -216,6 +216,7 @@ Files: share/icons/application/scalable/actions/application-exit.svg
|
|||
share/icons/application/scalable/actions/system-help.svg
|
||||
share/icons/application/scalable/actions/system-search.svg
|
||||
share/icons/application/scalable/actions/system-software-update.svg
|
||||
share/icons/application/scalable/actions/sweep.svg
|
||||
share/icons/application/scalable/actions/tag.svg
|
||||
share/icons/application/scalable/actions/tag-multiple.svg
|
||||
share/icons/application/scalable/actions/tag-search.svg
|
||||
|
|
|
|||
1
share/icons/application/scalable/actions/sweep.svg
Normal file
1
share/icons/application/scalable/actions/sweep.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19.36,2.72L20.78,4.14L15.06,9.85C16.13,11.39 16.28,13.24 15.38,14.44L9.06,8.12C10.26,7.22 12.11,7.37 13.65,8.44L19.36,2.72M5.93,17.57C3.92,15.56 2.69,13.16 2.35,10.92L7.23,8.83L14.67,16.27L12.58,21.15C10.34,20.81 7.94,19.58 5.93,17.57Z" /></svg>
|
||||
|
After Width: | Height: | Size: 315 B |
|
|
@ -85,6 +85,7 @@
|
|||
<file>application/scalable/actions/system-help.svg</file>
|
||||
<file>application/scalable/actions/system-search.svg</file>
|
||||
<file>application/scalable/actions/system-software-update.svg</file>
|
||||
<file>application/scalable/actions/sweep.svg</file>
|
||||
<file>application/scalable/actions/tag.svg</file>
|
||||
<file>application/scalable/actions/tag-multiple.svg</file>
|
||||
<file>application/scalable/actions/tag-search.svg</file>
|
||||
|
|
|
|||
|
|
@ -6432,6 +6432,10 @@ Expect some bugs and minor issues, this version is meant for testing purposes.</
|
|||
<numerusform></numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Clear the clipboard immediately</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManageDatabase</name>
|
||||
|
|
|
|||
|
|
@ -679,6 +679,7 @@ MainWindow::MainWindow()
|
|||
m_progressBarLabel = new QLabel(statusBar());
|
||||
m_progressBarLabel->setVisible(false);
|
||||
statusBar()->addPermanentWidget(m_progressBarLabel);
|
||||
|
||||
m_progressBar = new QProgressBar(statusBar());
|
||||
m_progressBar->setVisible(false);
|
||||
m_progressBar->setTextVisible(false);
|
||||
|
|
@ -686,7 +687,17 @@ MainWindow::MainWindow()
|
|||
m_progressBar->setFixedHeight(15);
|
||||
m_progressBar->setMaximum(100);
|
||||
statusBar()->addPermanentWidget(m_progressBar);
|
||||
|
||||
m_clearClipboardButton = new QToolButton(statusBar());
|
||||
m_clearClipboardButton->setIcon(icons()->icon("sweep"));
|
||||
m_clearClipboardButton->setToolTip(tr("Clear the clipboard immediately"));
|
||||
m_clearClipboardButton->setObjectName("clearClipboardButton");
|
||||
m_clearClipboardButton->setVisible(false);
|
||||
m_clearClipboardButton->setStyleSheet("QToolButton { border: none; background-color: transparent; }");
|
||||
statusBar()->addPermanentWidget(m_clearClipboardButton);
|
||||
|
||||
connect(clipboard(), &Clipboard::updateCountdown, this, &MainWindow::updateProgressBar);
|
||||
connect(m_clearClipboardButton.data(), &QToolButton::clicked, this, &MainWindow::clearClipboard);
|
||||
m_actionMultiplexer.connect(SIGNAL(updateSyncProgress(int, QString)), this, SLOT(updateProgressBar(int, QString)));
|
||||
m_actionMultiplexer.connect(SIGNAL(databaseSyncInProgress()), this, SLOT(disableMenuAndToolbar()));
|
||||
m_actionMultiplexer.connect(SIGNAL(databaseSyncCompleted(QString)), this, SLOT(enableMenuAndToolbar()));
|
||||
|
|
@ -1535,6 +1546,11 @@ void MainWindow::clearSSHAgent()
|
|||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::clearClipboard()
|
||||
{
|
||||
clipboard()->clearCopiedText();
|
||||
}
|
||||
|
||||
void MainWindow::saveWindowInformation()
|
||||
{
|
||||
if (isVisible()) {
|
||||
|
|
@ -1633,11 +1649,17 @@ void MainWindow::updateProgressBar(int percentage, QString message)
|
|||
if (percentage < 0) {
|
||||
m_progressBar->setVisible(false);
|
||||
m_progressBarLabel->setVisible(false);
|
||||
m_clearClipboardButton->setVisible(false);
|
||||
} else {
|
||||
m_progressBar->setValue(percentage);
|
||||
m_progressBar->setVisible(true);
|
||||
m_progressBarLabel->setText(message);
|
||||
m_progressBarLabel->setVisible(true);
|
||||
|
||||
Clipboard* cb = qobject_cast<Clipboard*>(sender());
|
||||
if (cb) {
|
||||
m_clearClipboardButton->setVisible(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include <QProgressBar>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QTimer>
|
||||
#include <QToolButton>
|
||||
|
||||
#include "core/SignalMultiplexer.h"
|
||||
#include "gui/DatabaseWidget.h"
|
||||
|
|
@ -155,6 +156,7 @@ private slots:
|
|||
void enableMenuAndToolbar();
|
||||
void disableMenuAndToolbar();
|
||||
void clearSSHAgent();
|
||||
void clearClipboard();
|
||||
|
||||
private:
|
||||
static const QString BaseWindowTitle;
|
||||
|
|
@ -190,6 +192,7 @@ private:
|
|||
QPointer<QProgressBar> m_progressBar;
|
||||
QPointer<QLabel> m_progressBarLabel;
|
||||
QPointer<QLabel> m_statusBarLabel;
|
||||
QPointer<QToolButton> m_clearClipboardButton;
|
||||
|
||||
Q_DISABLE_COPY(MainWindow)
|
||||
|
||||
|
|
|
|||
|
|
@ -2502,6 +2502,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());
|
||||
|
||||
QToolButton* clearClipboardButton = m_mainWindow->findChild<QToolButton*>("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