aboutsummaryrefslogtreecommitdiff
path: root/src/qt/guiutil.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-05-29 17:12:03 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-05-29 17:15:21 +0300
commitbe1c512437f7aa8215d2e05eda5cc8b58c3d3937 (patch)
treea7cadc12a74a578c2a7a6d684e3cc4f156925d4a /src/qt/guiutil.cpp
parent123b401e0acf3b26f149711bdf06d7f6eced1968 (diff)
parent4935ac583bbdc289dd31a1caae3d711edef742b6 (diff)
Merge bitcoin-core/gui#343: Improve the GUI responsiveness when progress dialogs are used
4935ac583bbdc289dd31a1caae3d711edef742b6 qt: Improve GUI responsiveness (Hennadii Stepanov) 75850106aeecfed1d2dc16d8a67ec210c5826a47 qt, macos: Fix GUIUtil::PolishProgressDialog bug (Hennadii Stepanov) Pull request description: [`QProgressDialog`](https://doc.qt.io/qt-5/qprogressdialog.html) estimates the time the operation will take (based on time for steps), and only shows itself if that estimate is beyond [`minimumDuration`](https://doc.qt.io/qt-5/qprogressdialog.html#minimumDuration-prop). The default `minimumDuration` value is [4 seconds](https://doc.qt.io/qt-5/qprogressdialog.html#details), and it could make users think that the GUI is frozen. This PR sets `minimumDuration` to zero for all progress dialogs, that affects ones in the `WalletControllerActivity` class. ACKs for top commit: ryanofsky: Code review ACK 4935ac583bbdc289dd31a1caae3d711edef742b6. I'm not very familiar with this API but all the changes and explanations make sense and are very clear, and this seems like it should be an improvement. promag: Code review ACK 4935ac583bbdc289dd31a1caae3d711edef742b6. jarolrod: ACK 4935ac583bbdc289dd31a1caae3d711edef742b6 Tree-SHA512: 2ddd74e7fd87894d341d2439dbaa544d031a350f7f57d4c7e9fbba977dc24080fe60fd7a80a542b1647f1de9091d7fd04a36eab695088d4d75fb836548e99b5f
Diffstat (limited to 'src/qt/guiutil.cpp')
-rw-r--r--src/qt/guiutil.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index 5ff40ae924..393dca8ccd 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -853,10 +853,12 @@ void PolishProgressDialog(QProgressDialog* dialog)
// Workaround for macOS-only Qt bug; see: QTBUG-65750, QTBUG-70357.
const int margin = TextWidth(dialog->fontMetrics(), ("X"));
dialog->resize(dialog->width() + 2 * margin, dialog->height());
- dialog->show();
-#else
- Q_UNUSED(dialog);
#endif
+ // QProgressDialog estimates the time the operation will take (based on time
+ // for steps), and only shows itself if that estimate is beyond minimumDuration.
+ // The default minimumDuration value is 4 seconds, and it could make users
+ // think that the GUI is frozen.
+ dialog->setMinimumDuration(0);
}
int TextWidth(const QFontMetrics& fm, const QString& text)