From 3715286eba54970802b85eb4f759b6e1992a7f7c Mon Sep 17 00:00:00 2001 From: Janek Bevendorff Date: Sat, 25 Feb 2017 22:09:55 +0100 Subject: [PATCH] Hide close button on YubiKey user interaction message --- src/gui/MainWindow.cpp | 8 +++++--- src/gui/MainWindow.h | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 1258d9f6e..ff63d7b3f 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -862,13 +862,15 @@ bool MainWindow::isTrayIconEnabled() const #endif } -void MainWindow::displayGlobalMessage(const QString& text, MessageWidget::MessageType type) +void MainWindow::displayGlobalMessage(const QString& text, MessageWidget::MessageType type, bool showClosebutton) { + m_ui->globalMessageWidget->setCloseButtonVisible(showClosebutton); m_ui->globalMessageWidget->showMessage(text, type); } -void MainWindow::displayTabMessage(const QString& text, MessageWidget::MessageType type) +void MainWindow::displayTabMessage(const QString& text, MessageWidget::MessageType type, bool showClosebutton) { + m_ui->globalMessageWidget->setCloseButtonVisible(showClosebutton); m_ui->tabWidget->currentDatabaseWidget()->showMessage(text, type); } @@ -886,7 +888,7 @@ void MainWindow::hideTabMessage() void MainWindow::showYubiKeyPopup() { - displayGlobalMessage(tr("Please touch the button on your YubiKey!"), MessageWidget::Information); + displayGlobalMessage(tr("Please touch the button on your YubiKey!"), MessageWidget::Information, false); setEnabled(false); } diff --git a/src/gui/MainWindow.h b/src/gui/MainWindow.h index 4435c13ba..131ccc225 100644 --- a/src/gui/MainWindow.h +++ b/src/gui/MainWindow.h @@ -44,8 +44,8 @@ public Q_SLOTS: void openDatabase(const QString& fileName, const QString& pw = QString(), const QString& keyFile = QString()); void appExit(); - void displayGlobalMessage(const QString& text, MessageWidget::MessageType type); - void displayTabMessage(const QString& text, MessageWidget::MessageType type); + void displayGlobalMessage(const QString& text, MessageWidget::MessageType type, bool showClosebutton = true); + void displayTabMessage(const QString& text, MessageWidget::MessageType type, bool showClosebutton = true); void hideGlobalMessage(); void showYubiKeyPopup(); void hideYubiKeyPopup();