]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blobdiff - src/widgets/TabWidget.cpp
Implement loading of new tabs from the context menu.
[PrivacyBrowserPC.git] / src / widgets / TabWidget.cpp
index 59e424331fd78643d2ae7927a56c87239ee300ff..ba12f042d4076bc1cc0bb7e679e47f79f7c15e25 100644 (file)
@@ -141,7 +141,7 @@ void TabWidget::addFirstTab()
     tabWidgetPointer->currentWidget()->setFocus();
 }
 
-void TabWidget::addTab()
+PrivacyWebEngineView* TabWidget::addTab()
 {
     // Create a privacy WebEngine view.
     PrivacyWebEngineView *privacyWebEngineViewPointer = new PrivacyWebEngineView();
@@ -168,7 +168,6 @@ void TabWidget::addTab()
     // Update the URL line edit when the URL changes.
     connect(privacyWebEngineViewPointer, SIGNAL(urlChanged(const QUrl)), this, SLOT(updateUrl(const QUrl)));
 
-
     // Update the progress bar.
     connect(privacyWebEngineViewPointer, SIGNAL(loadStarted()), this, SLOT(loadStarted()));
     connect(privacyWebEngineViewPointer, SIGNAL(loadProgress(const int)), this, SLOT(loadProgress(const int)));
@@ -290,6 +289,9 @@ void TabWidget::addTab()
 
     // Move to the new tab.
     tabWidgetPointer->setCurrentIndex(newTabIndex);
+
+    // Return the privacy WebEngine view pointer.
+    return privacyWebEngineViewPointer;
 }
 
 void TabWidget::applyApplicationSettings()