From debcabf1a33bd40f70128c2283f991110cc81202 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 14 Jun 2017 11:48:51 +0300 Subject: [PATCH] Set wait cursor to inform a user that the program is busy when openning Preferences dialog. Because Preferences dialog reads data about installed localizations each time a user opens it in some cases it's take some time. Especially when a hard drive is busy. --HG-- branch : develop --- src/app/tape/tmainwindow.cpp | 2 ++ src/app/valentina/mainwindow.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index 36b1b9711..1e3d26786 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -486,6 +486,7 @@ void TMainWindow::Preferences() static QPointer guard;// Prevent any second run if (guard.isNull()) { + QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); DialogTapePreferences *preferences = new DialogTapePreferences(this); // QScopedPointer needs to be sure any exception will never block guard QScopedPointer dlg(preferences); @@ -493,6 +494,7 @@ void TMainWindow::Preferences() // Must be first connect(dlg.data(), &DialogTapePreferences::UpdateProperties, this, &TMainWindow::WindowsLocale); connect(dlg.data(), &DialogTapePreferences::UpdateProperties, this, &TMainWindow::ToolBarStyles); + QGuiApplication::restoreOverrideCursor(); dlg->exec(); } } diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 2f8cb845c..4ef3a00c5 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -4310,6 +4310,7 @@ void MainWindow::Preferences() static QPointer guard;// Prevent any second run if (guard.isNull()) { + QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); DialogPreferences *preferences = new DialogPreferences(this); // QScopedPointer needs to be sure any exception will never block guard QScopedPointer dlg(preferences); @@ -4318,6 +4319,7 @@ void MainWindow::Preferences() connect(dlg.data(), &DialogPreferences::UpdateProperties, toolOptions, &VToolOptionsPropertyBrowser::RefreshOptions); connect(dlg.data(), &DialogPreferences::UpdateProperties, this, &MainWindow::ToolBarStyles); + QGuiApplication::restoreOverrideCursor(); if (guard->exec() == QDialog::Accepted) {