- // Update the progress bar.
- connect(privacyWebEngineViewPointer, SIGNAL(loadStarted()), this, SLOT(loadStarted()));
- connect(privacyWebEngineViewPointer, SIGNAL(loadProgress(const int)), this, SLOT(loadProgress(const int)));
- connect(privacyWebEngineViewPointer, SIGNAL(loadFinished(const bool)), this, SLOT(loadFinished()));
+ // Update the progress bar when a load is started.
+ connect(privacyWebEngineViewPointer, &PrivacyWebEngineView::loadStarted, [privacyWebEngineViewPointer, this] ()
+ {
+ // Store the load progress.
+ privacyWebEngineViewPointer->loadProgressInt = 0;
+
+ // Show the progress bar if this is the current tab.
+ if (privacyWebEngineViewPointer == currentPrivacyWebEngineViewPointer)
+ emit showProgressBar(0);
+ });
+
+ // Update the progress bar when a load progresses.
+ connect(privacyWebEngineViewPointer, &PrivacyWebEngineView::loadProgress, [privacyWebEngineViewPointer, this] (const int progress)
+ {
+ // Store the load progress.
+ privacyWebEngineViewPointer->loadProgressInt = progress;
+
+ // Update the progress bar if this is the current tab.
+ if (privacyWebEngineViewPointer == currentPrivacyWebEngineViewPointer)
+ emit showProgressBar(progress);
+ });
+
+ // Update the progress bar when a load finishes.
+ connect(privacyWebEngineViewPointer, &PrivacyWebEngineView::loadFinished, [privacyWebEngineViewPointer, this] ()
+ {
+ // Store the load progress.
+ privacyWebEngineViewPointer->loadProgressInt = -1;
+
+ // Hide the progress bar if this is the current tab.
+ if (privacyWebEngineViewPointer == currentPrivacyWebEngineViewPointer)
+ emit hideProgressBar();
+ });