Skip to content

Commit

Permalink
Disable main window when saving
Browse files Browse the repository at this point in the history
  • Loading branch information
xboxones1 committed Dec 18, 2024
1 parent 6a1b502 commit 3a3ed56
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/gui/DatabaseWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2393,9 +2393,10 @@ bool DatabaseWidget::performSave(QString& errorMessage, const QString& fileName)
QPointer<QWidget> focusWidget(qApp->focusWidget());

// Lock out interactions
m_entryView->setDisabled(true);
m_groupView->setDisabled(true);
m_tagView->setDisabled(true);
QWidget *mainWindow = this->window();
if (mainWindow) {
mainWindow->setDisabled(true);
}
QApplication::processEvents();

Database::SaveAction saveAction = Database::Atomic;
Expand Down Expand Up @@ -2435,9 +2436,9 @@ bool DatabaseWidget::performSave(QString& errorMessage, const QString& fileName)
}

// Return control
m_entryView->setDisabled(false);
m_groupView->setDisabled(false);
m_tagView->setDisabled(false);
if (mainWindow) {
mainWindow->setDisabled(false);
}

if (focusWidget && focusWidget->isVisible()) {
focusWidget->setFocus();
Expand Down

0 comments on commit 3a3ed56

Please sign in to comment.