mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Disable automatic hiding of an information message for YubiKey
This commit is contained in:
parent
75cfe1c5dd
commit
f38fe5a9dd
@ -1325,9 +1325,10 @@ void DatabaseWidget::closeUnlockDialog()
|
||||
m_unlockDatabaseDialog->close();
|
||||
}
|
||||
|
||||
void DatabaseWidget::showMessage(const QString& text, MessageWidget::MessageType type)
|
||||
void DatabaseWidget::showMessage(const QString& text, MessageWidget::MessageType type, bool showClosebutton, int autoHideTimeout)
|
||||
{
|
||||
m_messageWidget->showMessage(text, type);
|
||||
m_messageWidget->setCloseButtonVisible(showClosebutton);
|
||||
m_messageWidget->showMessage(text, type, autoHideTimeout);
|
||||
}
|
||||
|
||||
void DatabaseWidget::hideMessage()
|
||||
|
@ -166,7 +166,8 @@ public slots:
|
||||
void setSearchLimitGroup(bool state);
|
||||
void endSearch();
|
||||
|
||||
void showMessage(const QString& text, MessageWidget::MessageType type);
|
||||
void showMessage(const QString& text, MessageWidget::MessageType type, bool showClosebutton = true,
|
||||
int autoHideTimeout = MessageWidget::DefaultAutoHideTimeout);
|
||||
void hideMessage();
|
||||
|
||||
private slots:
|
||||
|
@ -952,16 +952,17 @@ bool MainWindow::isTrayIconEnabled() const
|
||||
&& QSystemTrayIcon::isSystemTrayAvailable();
|
||||
}
|
||||
|
||||
void MainWindow::displayGlobalMessage(const QString& text, MessageWidget::MessageType type, bool showClosebutton)
|
||||
void MainWindow::displayGlobalMessage(const QString& text, MessageWidget::MessageType type, bool showClosebutton,
|
||||
int autoHideTimeout)
|
||||
{
|
||||
m_ui->globalMessageWidget->setCloseButtonVisible(showClosebutton);
|
||||
m_ui->globalMessageWidget->showMessage(text, type);
|
||||
m_ui->globalMessageWidget->showMessage(text, type, autoHideTimeout);
|
||||
}
|
||||
|
||||
void MainWindow::displayTabMessage(const QString& text, MessageWidget::MessageType type, bool showClosebutton)
|
||||
void MainWindow::displayTabMessage(const QString& text, MessageWidget::MessageType type, bool showClosebutton,
|
||||
int autoHideTimeout)
|
||||
{
|
||||
m_ui->globalMessageWidget->setCloseButtonVisible(showClosebutton);
|
||||
m_ui->tabWidget->currentDatabaseWidget()->showMessage(text, type);
|
||||
m_ui->tabWidget->currentDatabaseWidget()->showMessage(text, type, showClosebutton, autoHideTimeout);
|
||||
}
|
||||
|
||||
void MainWindow::hideGlobalMessage()
|
||||
@ -978,7 +979,8 @@ void MainWindow::hideTabMessage()
|
||||
|
||||
void MainWindow::showYubiKeyPopup()
|
||||
{
|
||||
displayGlobalMessage(tr("Please touch the button on your YubiKey!"), MessageWidget::Information, false);
|
||||
displayGlobalMessage(tr("Please touch the button on your YubiKey!"), MessageWidget::Information,
|
||||
false, MessageWidget::DisableAutoHide);
|
||||
setEnabled(false);
|
||||
}
|
||||
|
||||
|
@ -54,8 +54,10 @@ public slots:
|
||||
void openDatabase(const QString& fileName, const QString& pw = QString(),
|
||||
const QString& keyFile = QString());
|
||||
void appExit();
|
||||
void displayGlobalMessage(const QString& text, MessageWidget::MessageType type, bool showClosebutton = true);
|
||||
void displayTabMessage(const QString& text, MessageWidget::MessageType type, bool showClosebutton = true);
|
||||
void displayGlobalMessage(const QString& text, MessageWidget::MessageType type, bool showClosebutton = true,
|
||||
int autoHideTimeout = MessageWidget::DefaultAutoHideTimeout);
|
||||
void displayTabMessage(const QString& text, MessageWidget::MessageType type, bool showClosebutton = true,
|
||||
int autoHideTimeout = MessageWidget::DefaultAutoHideTimeout);
|
||||
void hideGlobalMessage();
|
||||
void showYubiKeyPopup();
|
||||
void hideYubiKeyPopup();
|
||||
|
@ -20,10 +20,13 @@
|
||||
|
||||
#include "QTimer"
|
||||
|
||||
const int MessageWidget::DefaultAutoHideTimeout = 6000;
|
||||
const int MessageWidget::DisableAutoHide = -1;
|
||||
|
||||
MessageWidget::MessageWidget(QWidget* parent)
|
||||
: KMessageWidget(parent)
|
||||
, m_autoHideTimer(new QTimer(this))
|
||||
, m_autoHideTimeout(6000)
|
||||
, m_autoHideTimeout(DefaultAutoHideTimeout)
|
||||
{
|
||||
m_autoHideTimer->setSingleShot(true);
|
||||
connect(m_autoHideTimer, SIGNAL(timeout()), this, SLOT(animatedHide()));
|
||||
|
@ -32,6 +32,9 @@ public:
|
||||
|
||||
int autoHideTimeout() const;
|
||||
|
||||
static const int DefaultAutoHideTimeout;
|
||||
static const int DisableAutoHide;
|
||||
|
||||
public slots:
|
||||
void showMessage(const QString& text, MessageWidget::MessageType type);
|
||||
void showMessage(const QString& text, MessageWidget::MessageType type, int autoHideTimeout);
|
||||
|
@ -35,7 +35,7 @@ OptionDialog::OptionDialog(QWidget *parent) :
|
||||
m_ui->warningWidget->showMessage(tr("The following options can be dangerous!\nChange them only if you know what you are doing."), MessageWidget::Warning);
|
||||
m_ui->warningWidget->setIcon(FilePath::instance()->icon("status", "dialog-warning"));
|
||||
m_ui->warningWidget->setCloseButtonVisible(false);
|
||||
m_ui->warningWidget->setAutoHideTimeout(-1);
|
||||
m_ui->warningWidget->setAutoHideTimeout(MessageWidget::DisableAutoHide);
|
||||
|
||||
m_ui->tabWidget->setEnabled(m_ui->enableHttpServer->isChecked());
|
||||
connect(m_ui->enableHttpServer, SIGNAL(toggled(bool)), m_ui->tabWidget, SLOT(setEnabled(bool)));
|
||||
|
Loading…
Reference in New Issue
Block a user