qTabWidgetPointer->currentWidget()->setFocus();
}
-PrivacyWebEngineView* TabWidget::addTab(const bool removeUrlLineEditFocus, const bool backgroundTab)
+PrivacyWebEngineView* TabWidget::addTab(const bool removeUrlLineEditFocus, const bool backgroundTab, const QString urlString)
{
// Create a privacy WebEngine view.
PrivacyWebEngineView *privacyWebEngineViewPointer = new PrivacyWebEngineView();
}
});
- // Update the zoom factor when changed by CTRL-Scrolling. This can be modified when <https://redmine.stoutner.com/issues/845> is fixed.
+ // Update the zoom actions when changed by CTRL-Scrolling. This can be modified when <https://redmine.stoutner.com/issues/845> is fixed.
connect(webEnginePagePointer, &QWebEnginePage::contentsSizeChanged, [webEnginePagePointer, this] ()
{
- // Only update the zoom factor action text if this is the current tab.
+ // Only update the zoom actions if this is the current tab.
if (webEnginePagePointer == currentWebEnginePagePointer)
- emit updateZoomFactorAction(webEnginePagePointer->zoomFactor());
+ emit updateZoomActions(webEnginePagePointer->zoomFactor());
});
// Display find text results.
if (removeUrlLineEditFocus)
emit clearUrlLineEditFocus();
+ if (urlString != nullptr)
+ privacyWebEngineViewPointer->load(QUrl::fromUserInput(urlString));
+
// Return the privacy WebEngine view pointer.
return privacyWebEngineViewPointer;
}
return currentPrivacyWebEngineViewPointer->cookieListPointer;
}
+QIcon TabWidget::getCurrentTabFavoritIcon() const
+{
+ // Return the current Privacy WebEngine favorite icon.
+ return currentPrivacyWebEngineViewPointer->favoriteIcon;
+}
+
+QString TabWidget::getCurrentTabTitle() const
+{
+ // Return the current Privacy WebEngine title.
+ return currentPrivacyWebEngineViewPointer->title();
+}
+
+QString TabWidget::getCurrentTabUrl() const
+{
+ // Return the current Privacy WebEngine URL as a string.
+ return currentPrivacyWebEngineViewPointer->url().toString();
+}
+
QString& TabWidget::getDomainSettingsName() const
{
// Return the domain settings name.
void TabWidget::loadUrlFromLineEdit(QString url) const
{
// Decide if the text is more likely to be a URL or a search.
- if (url.startsWith("file://")) // The text is likely a file URL.
+ if (url.startsWith("file://") || url.startsWith("view-source:")) // The text is likely a file or view source URL.
{
// Load the URL.
currentPrivacyWebEngineViewPointer->load(QUrl::fromUserInput(url));
if (privacyWebEngineViewPointer == currentPrivacyWebEngineViewPointer)
{
// Update the UI.
+ emit updateDefaultZoomFactor(currentPrivacyWebEngineViewPointer->defaultZoomFactor);
emit updateDomainSettingsIndicator(currentPrivacyWebEngineViewPointer->domainSettingsName != QLatin1String(""));
emit updateJavaScriptAction(currentWebEngineSettingsPointer->testAttribute(QWebEngineSettings::JavascriptEnabled));
emit updateLocalStorageAction(currentPrivacyWebEngineViewPointer->localStorageEnabled);
emit updateDomStorageAction(currentWebEngineSettingsPointer->testAttribute(QWebEngineSettings::LocalStorageEnabled));
emit updateUserAgentActions(currentWebEngineProfilePointer->httpUserAgent(), true);
- emit updateZoomFactorAction(currentPrivacyWebEngineViewPointer->zoomFactor());
+ emit updateZoomActions(currentPrivacyWebEngineViewPointer->zoomFactor());
}
}
emit clearUrlLineEditFocus();
// Update the actions.
+ emit updateDefaultZoomFactor(currentPrivacyWebEngineViewPointer->defaultZoomFactor);
emit updateBackAction(currentWebEngineHistoryPointer->canGoBack());
emit updateCookiesAction(currentPrivacyWebEngineViewPointer->cookieListPointer->size());
emit updateDomStorageAction(currentWebEngineSettingsPointer->testAttribute(QWebEngineSettings::LocalStorageEnabled));
emit updateJavaScriptAction(currentWebEngineSettingsPointer->testAttribute(QWebEngineSettings::JavascriptEnabled));
emit updateLocalStorageAction(currentPrivacyWebEngineViewPointer->localStorageEnabled);
emit updateUserAgentActions(currentWebEngineProfilePointer->httpUserAgent(), true);
- emit updateZoomFactorAction(currentPrivacyWebEngineViewPointer->zoomFactor());
+ emit updateZoomActions(currentPrivacyWebEngineViewPointer->zoomFactor());
// Update the URL.
emit updateWindowTitle(currentPrivacyWebEngineViewPointer->title());