From 886187baee4da2a138664a1bc48fd13d03bc0d12 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Fri, 27 Jul 2012 18:54:35 +0200 Subject: [PATCH] Show a busy cursor while doing master key transformations. --- src/gui/DatabaseOpenWidget.cpp | 2 ++ src/gui/DatabaseSettingsWidget.cpp | 6 +++++- src/gui/DatabaseWidget.cpp | 2 ++ src/gui/KeePass1OpenWidget.cpp | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gui/DatabaseOpenWidget.cpp b/src/gui/DatabaseOpenWidget.cpp index 792164c5e..d478a6988 100644 --- a/src/gui/DatabaseOpenWidget.cpp +++ b/src/gui/DatabaseOpenWidget.cpp @@ -127,7 +127,9 @@ void DatabaseOpenWidget::openDatabase() if (m_db) { delete m_db; } + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); m_db = reader.readDatabase(&file, masterKey); + QApplication::restoreOverrideCursor(); if (m_db) { Q_EMIT editFinished(true); diff --git a/src/gui/DatabaseSettingsWidget.cpp b/src/gui/DatabaseSettingsWidget.cpp index f7071f423..bba11f9aa 100644 --- a/src/gui/DatabaseSettingsWidget.cpp +++ b/src/gui/DatabaseSettingsWidget.cpp @@ -83,7 +83,11 @@ void DatabaseSettingsWidget::save() meta->setDescription(m_ui->dbDescriptionEdit->text()); meta->setDefaultUserName(m_ui->defaultUsernameEdit->text()); meta->setRecycleBinEnabled(m_ui->recycleBinEnabledCheckBox->isChecked()); - m_db->setTransformRounds(m_ui->transformRoundsSpinBox->value()); + if (static_cast(m_ui->transformRoundsSpinBox->value()) != m_db->transformRounds()) { + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + m_db->setTransformRounds(m_ui->transformRoundsSpinBox->value()); + QApplication::restoreOverrideCursor(); + } bool truncate = false; diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index e2d9984c2..55e8b8886 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -504,7 +504,9 @@ void DatabaseWidget::switchToGroupEdit(Group* group, bool create) void DatabaseWidget::updateMasterKey(bool accepted) { if (accepted) { + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); m_db->setKey(m_changeMasterKeyWidget->newMasterKey()); + QApplication::restoreOverrideCursor(); } else if (!m_db->hasKey()) { Q_EMIT closeRequest(); diff --git a/src/gui/KeePass1OpenWidget.cpp b/src/gui/KeePass1OpenWidget.cpp index 7bd6eaa82..db6da050a 100644 --- a/src/gui/KeePass1OpenWidget.cpp +++ b/src/gui/KeePass1OpenWidget.cpp @@ -55,7 +55,9 @@ void KeePass1OpenWidget::openDatabase() if (m_db) { delete m_db; } + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); m_db = reader.readDatabase(&file, password, keyFileName); + QApplication::restoreOverrideCursor(); if (m_db) { m_db->metadata()->setName(QFileInfo(m_filename).completeBaseName());