message: qt: Refactor ShowProgress to DispatchNotifications
diff: @@ -96,13 +96,14 @@ public:
  */
  QList<TransactionRecord> cachedWallet;
  - bool fQueueNotifications = false;
  /** True when model finishes loading all wallet transactions on start */
  bool m_loaded = false;
  + /** True when transactions are being notified, for instance when scanning */
  + bool m_loading = false;
  std::vector< TransactionNotification > vQueueNotifications;
  void NotifyTransactionChanged(const uint256 &hash, ChangeType status);
  - void ShowProgress(const std::string &title, int nProgress);
  + void DispatchNotifications();
  /* Query entire wallet anew from core.
  */
  @@ -727,7 +728,7 @@ void TransactionTablePriv::NotifyTransactionChanged(const uint256 &hash, ChangeT
  TransactionNotification notification(hash, status, showTransaction);
  - if (fQueueNotifications)
  + if (m_loading)
  {
  vQueueNotifications.push_back(notification);
  return;
  @@ -735,14 +736,11 @@ void TransactionTablePriv::NotifyTransactionChanged(const uint256 &hash, ChangeT
  notification.invoke(parent);
  }
  -void TransactionTablePriv::ShowProgress(const std::string &title, int nProgress)
  +void TransactionTablePriv::DispatchNotifications()
  {
  - if (nProgress == 0)
  - fQueueNotifications = true;
  + if (m_loading) return;
  - if (nProgress == 100)
  {
  - fQueueNotifications = false;
  if (vQueueNotifications.size() > 10) { // prevent balloon spam, show maximum 10 balloons
  bool invoked = QMetaObject::invokeMethod(parent, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, true));
  assert(invoked);
  @@ -764,7 +762,10 @@ void TransactionTableModel::subscribeToCoreSignals()
  {
  // Connect signals to wallet
  m_handler_transaction_changed = walletModel->wallet().handleTransactionChanged(std::bind(&TransactionTablePriv::NotifyTransactionChanged, priv, std::placeholders::_1, std::placeholders::_2));
  - m_handler_show_progress = walletModel->wallet().handleShowProgress(std::bind(&TransactionTablePriv::ShowProgress, priv, std::placeholders::_1, std::placeholders::_2));
  + m_handler_show_progress = walletModel->wallet().handleShowProgress([this](const std::string&, int progress) {
  + priv->m_loading = progress < 100;
  + priv->DispatchNotifications();
  + });
  }
  void TransactionTableModel::unsubscribeFromCoreSignals()
  