domStorageActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("view-web-browser-dom-tree")));
// Update the on-the-fly menus.
- connect(browserViewPointer, SIGNAL(updateUserAgentActions(QString)), this, SLOT(updateUserAgentActions(QString)));
+ connect(browserViewPointer, SIGNAL(updateUserAgentActions(QString, bool)), this, SLOT(updateUserAgentActions(QString, bool)));
connect(browserViewPointer, SIGNAL(updateZoomFactorAction(double)), this, SLOT(updateZoomFactorAction(double)));
- connect(browserViewPointer, SIGNAL(updateSearchEngineActions(QString)), this, SLOT(updateSearchEngineActions(QString)));
+ connect(browserViewPointer, SIGNAL(updateSearchEngineActions(QString, bool)), this, SLOT(updateSearchEngineActions(QString, bool)));
// Apply the on-the-fly settings when selected.
connect(userAgentActionGroupPointer, SIGNAL(triggered(QAction*)), browserViewPointer, SLOT(applyOnTheFlyUserAgent(QAction*)));
void BrowserWindow::addCookieToList(const QNetworkCookie &newCookie) const
{
- qDebug() << "Add cookie: " << newCookie.toRawForm();
+ //qDebug() << "Add cookie: " << newCookie.toRawForm();
// Add the new cookie to the list.
cookieListPointer->push_front(newCookie);
void BrowserWindow::removeCookieFromList(const QNetworkCookie &cookie) const
{
- qDebug() << "Remove cookie: " << cookie.toRawForm();
+ //qDebug() << "Remove cookie: " << cookie.toRawForm();
// Remove the cookie from the list.
cookieListPointer->remove(cookie);
domStorageActionPointer->setEnabled(localStorageEnabled & javaScriptEnabled);
}
-void BrowserWindow::updateSearchEngineActions(const QString &searchEngine) const
+void BrowserWindow::updateSearchEngineActions(const QString &searchEngine, const bool &updateCustomSearchEngineStatus)
{
// Initialize the custom search engine flag.
bool customSearchEngine = false;
// Update the search engine menu action text.
searchEngineMenuActionPointer->setText(i18nc("The main search engine menu action", "Search Engine - Custom"));
+ // Set the custom search engine text.
+ searchEngineCustomActionPointer->setText(searchEngine);
+
// Set the custom search engine flag.
customSearchEngine = true;
}
+ // Update the custom search engine enabled boolean.
+ if (updateCustomSearchEngineStatus)
+ customSearchEngineEnabled = customSearchEngine;
+
// Format the custom search engine.
- if (customSearchEngine)
+ if (customSearchEngineEnabled)
{
// Enable the custom search engine.
searchEngineCustomActionPointer->setEnabled(true);
-
- // Set the custom search engine text.
- searchEngineCustomActionPointer->setText(searchEngine);
}
else
{
}
}
-void BrowserWindow::updateUserAgentActions(const QString &userAgent) const
+void BrowserWindow::updateUserAgentActions(const QString &userAgent, const bool &updateCustomUserAgentStatus)
{
// Initialize the custom user agent flag.
bool customUserAgent = false;
// Update the user agent menu action text.
userAgentMenuActionPointer->setText(i18nc("The main user agent menu action", "User Agent - Custom"));
+ // Set the custom user agent text.
+ userAgentCustomActionPointer->setText(userAgent);
+
// Set the custom user agent flag.
customUserAgent = true;
}
+ // Update the custom user agent enabled boolean.
+ if (updateCustomUserAgentStatus)
+ customUserAgentEnabled = customUserAgent;
+
// Format the custom user agent.
- if (customUserAgent)
+ if (customUserAgentEnabled)
{
// Enable the custom user agent.
userAgentCustomActionPointer->setEnabled(true);
-
- // Set the custom user agent text.
- userAgentCustomActionPointer->setText(userAgent);
}
else
{