mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
Add a QMessageBox wrapper class to help gui tests.
QMessageBox displays modal dialogs which blocks the gui tests. To work around this we add a MessageBox wrapper class where the tests can set the answer for the next dialog. The answer is then returned without actually showing the dialog.
This commit is contained in:
@@ -17,10 +17,9 @@
|
||||
|
||||
#include "UnlockDatabaseWidget.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "ui_DatabaseOpenWidget.h"
|
||||
#include "core/Database.h"
|
||||
#include "gui/MessageBox.h"
|
||||
|
||||
UnlockDatabaseWidget::UnlockDatabaseWidget(QWidget* parent)
|
||||
: DatabaseOpenWidget(parent)
|
||||
@@ -50,7 +49,7 @@ void UnlockDatabaseWidget::openDatabase()
|
||||
Q_EMIT editFinished(true);
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, tr("Error"), tr("Wrong key."));
|
||||
MessageBox::warning(this, tr("Error"), tr("Wrong key."));
|
||||
m_ui->editPassword->clear();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user