Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorosx user <gili.shemesh@gmail.com>2021-06-28 14:44:14 +0300
committerJonathan White <support@dmapps.us>2021-10-02 07:04:03 +0300
commit2514c1d5c56b785aad7ee59b8d12e7603e130607 (patch)
treefb4e6f9e940187cf96e202dc7a50646f1856d929 /src/gui
parente660802facb6e52efe6dfda8bcb1351219554a1d (diff)
feature/AutoTypeTOTP
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/DatabaseWidget.cpp5
-rw-r--r--src/gui/DatabaseWidget.h1
-rw-r--r--src/gui/MainWindow.cpp5
-rw-r--r--src/gui/MainWindow.ui14
4 files changed, 25 insertions, 0 deletions
diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp
index 7ace475bf..5e7044c78 100644
--- a/src/gui/DatabaseWidget.cpp
+++ b/src/gui/DatabaseWidget.cpp
@@ -713,6 +713,11 @@ void DatabaseWidget::performAutoTypePasswordEnter()
performAutoType(QStringLiteral("{PASSWORD}{ENTER}"));
}
+void DatabaseWidget::performAutoTypeTOTP()
+{
+ performAutoType(QStringLiteral("{TOTP}"));
+}
+
void DatabaseWidget::openUrl()
{
auto currentEntry = currentSelectedEntry();
diff --git a/src/gui/DatabaseWidget.h b/src/gui/DatabaseWidget.h
index 957b8290e..b0abdc29c 100644
--- a/src/gui/DatabaseWidget.h
+++ b/src/gui/DatabaseWidget.h
@@ -187,6 +187,7 @@ public slots:
void performAutoTypeUsernameEnter();
void performAutoTypePassword();
void performAutoTypePasswordEnter();
+ void performAutoTypeTOTP();
void openUrl();
void downloadSelectedFavicons();
void downloadAllFavicons();
diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp
index a7cfe075e..1f99448b1 100644
--- a/src/gui/MainWindow.cpp
+++ b/src/gui/MainWindow.cpp
@@ -158,6 +158,7 @@ MainWindow::MainWindow()
autotypeMenu->addAction(m_ui->actionEntryAutoTypeUsernameEnter);
autotypeMenu->addAction(m_ui->actionEntryAutoTypePassword);
autotypeMenu->addAction(m_ui->actionEntryAutoTypePasswordEnter);
+ autotypeMenu->addAction(m_ui->actionEntryAutoTypeTOTP);
m_ui->actionEntryAutoType->setMenu(autotypeMenu);
auto autoTypeButton = qobject_cast<QToolButton*>(m_ui->toolBar->widgetForAction(m_ui->actionEntryAutoType));
if (autoTypeButton) {
@@ -379,6 +380,7 @@ MainWindow::MainWindow()
m_ui->actionEntryAutoTypeUsernameEnter->setIcon(icons()->icon("auto-type"));
m_ui->actionEntryAutoTypePassword->setIcon(icons()->icon("auto-type"));
m_ui->actionEntryAutoTypePasswordEnter->setIcon(icons()->icon("auto-type"));
+ m_ui->actionEntryAutoTypeTOTP->setIcon(icons()->icon("auto-type"));
m_ui->actionEntryMoveUp->setIcon(icons()->icon("move-up"));
m_ui->actionEntryMoveDown->setIcon(icons()->icon("move-down"));
m_ui->actionEntryCopyUsername->setIcon(icons()->icon("username-copy"));
@@ -482,6 +484,7 @@ MainWindow::MainWindow()
m_ui->actionEntryAutoTypePassword, SIGNAL(triggered()), SLOT(performAutoTypePassword()));
m_actionMultiplexer.connect(
m_ui->actionEntryAutoTypePasswordEnter, SIGNAL(triggered()), SLOT(performAutoTypePasswordEnter()));
+ m_actionMultiplexer.connect(m_ui->actionEntryAutoTypeTOTP, SIGNAL(triggered()), SLOT(performAutoTypeTOTP()));
m_actionMultiplexer.connect(m_ui->actionEntryOpenUrl, SIGNAL(triggered()), SLOT(openUrl()));
m_actionMultiplexer.connect(m_ui->actionEntryDownloadIcon, SIGNAL(triggered()), SLOT(downloadSelectedFavicons()));
#ifdef WITH_XC_SSHAGENT
@@ -823,6 +826,8 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode)
m_ui->actionEntryAutoTypePassword->setEnabled(singleEntrySelected && dbWidget->currentEntryHasPassword());
m_ui->actionEntryAutoTypePasswordEnter->setEnabled(singleEntrySelected
&& dbWidget->currentEntryHasPassword());
+ m_ui->actionEntryAutoTypeTOTP->setEnabled(singleEntrySelected && dbWidget->currentEntryHasTotp());
+ m_ui->actionEntryAutoTypeTOTP->setVisible(singleEntrySelected && dbWidget->currentEntryHasTotp());
m_ui->actionEntryOpenUrl->setEnabled(singleEntrySelected && dbWidget->currentEntryHasUrl());
m_ui->actionEntryTotp->setEnabled(singleEntrySelected && dbWidget->currentEntryHasTotp());
m_ui->actionEntryCopyTotp->setEnabled(singleEntrySelected && dbWidget->currentEntryHasTotp());
diff --git a/src/gui/MainWindow.ui b/src/gui/MainWindow.ui
index 2dd852ca9..8b36b97aa 100644
--- a/src/gui/MainWindow.ui
+++ b/src/gui/MainWindow.ui
@@ -741,6 +741,20 @@
<string notr="true">{PASSWORD}{ENTER}</string>
</property>
</action>
+ <action name="actionEntryAutoTypeTOTP">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string notr="true">{TOTP}</string>
+ </property>
+ <property name="iconText">
+ <string notr="true">{TOTP}</string>
+ </property>
+ <property name="toolTip">
+ <string notr="true">{TOTP}</string>
+ </property>
+ </action>
<action name="actionEntryDownloadIcon">
<property name="text">
<string>Download &amp;Favicon</string>