mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-05-10 10:35:17 -04: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:
parent
551637f0c2
commit
d5b70b1bef
11 changed files with 176 additions and 41 deletions
|
@ -19,12 +19,12 @@
|
|||
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "ui_DatabaseOpenWidget.h"
|
||||
#include "core/Database.h"
|
||||
#include "core/Metadata.h"
|
||||
#include "format/KeePass1Reader.h"
|
||||
#include "gui/MessageBox.h"
|
||||
|
||||
KeePass1OpenWidget::KeePass1OpenWidget(QWidget* parent)
|
||||
: DatabaseOpenWidget(parent)
|
||||
|
@ -64,8 +64,8 @@ void KeePass1OpenWidget::openDatabase()
|
|||
Q_EMIT editFinished(true);
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, tr("Error"), tr("Unable to open the database.\n%1")
|
||||
.arg(reader.errorString()));
|
||||
MessageBox::warning(this, tr("Error"), tr("Unable to open the database.\n%1")
|
||||
.arg(reader.errorString()));
|
||||
m_ui->editPassword->clear();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue