mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-28 08:49:42 -05:00
Replace MessageBox dialogs that don't require user interaction with
inline MessageWidget in ChangeMasterKeyWidget.
This commit is contained in:
parent
a710181388
commit
3c4af1a194
@ -30,6 +30,8 @@ ChangeMasterKeyWidget::ChangeMasterKeyWidget(QWidget* parent)
|
|||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
|
m_ui->messageWidget->setHidden(true);
|
||||||
|
|
||||||
connect(m_ui->buttonBox, SIGNAL(accepted()), SLOT(generateKey()));
|
connect(m_ui->buttonBox, SIGNAL(accepted()), SLOT(generateKey()));
|
||||||
connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(reject()));
|
connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(reject()));
|
||||||
m_ui->togglePasswordButton->setIcon(filePath()->onOffIcon("actions", "password-show"));
|
m_ui->togglePasswordButton->setIcon(filePath()->onOffIcon("actions", "password-show"));
|
||||||
@ -52,7 +54,7 @@ void ChangeMasterKeyWidget::createKeyFile()
|
|||||||
QString errorMsg;
|
QString errorMsg;
|
||||||
bool created = FileKey::create(fileName, &errorMsg);
|
bool created = FileKey::create(fileName, &errorMsg);
|
||||||
if (!created) {
|
if (!created) {
|
||||||
MessageBox::warning(this, tr("Error"), tr("Unable to create Key File : ") + errorMsg);
|
m_ui->messageWidget->showMessageError(tr("Unable to create Key File : ").append(errorMsg));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_ui->keyFileCombo->setEditText(fileName);
|
m_ui->keyFileCombo->setEditText(fileName);
|
||||||
@ -110,7 +112,7 @@ void ChangeMasterKeyWidget::generateKey()
|
|||||||
m_key.addKey(PasswordKey(m_ui->enterPasswordEdit->text()));
|
m_key.addKey(PasswordKey(m_ui->enterPasswordEdit->text()));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
MessageBox::warning(this, tr("Error"), tr("Different passwords supplied."));
|
m_ui->messageWidget->showMessageError(tr("Different passwords supplied."));
|
||||||
m_ui->enterPasswordEdit->setText("");
|
m_ui->enterPasswordEdit->setText("");
|
||||||
m_ui->repeatPasswordEdit->setText("");
|
m_ui->repeatPasswordEdit->setText("");
|
||||||
return;
|
return;
|
||||||
|
@ -7,10 +7,13 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>438</width>
|
<width>438</width>
|
||||||
<height>256</height>
|
<height>342</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="MessageWidget" name="messageWidget" native="true"/>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="headlineLabel"/>
|
<widget class="QLabel" name="headlineLabel"/>
|
||||||
</item>
|
</item>
|
||||||
@ -151,6 +154,12 @@
|
|||||||
<extends>QLineEdit</extends>
|
<extends>QLineEdit</extends>
|
||||||
<header>gui/PasswordEdit.h</header>
|
<header>gui/PasswordEdit.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>MessageWidget</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>gui/MessageWidget.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>passwordGroup</tabstop>
|
<tabstop>passwordGroup</tabstop>
|
||||||
|
Loading…
Reference in New Issue
Block a user