From 9c434e284354768c1b6a4269b66db831103ff5ae Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 8 Aug 2012 12:42:09 +0200 Subject: User agent management restored --- src/webwindow/webwindow.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/webwindow/webwindow.cpp') diff --git a/src/webwindow/webwindow.cpp b/src/webwindow/webwindow.cpp index dc023ff6..72bdc1e8 100644 --- a/src/webwindow/webwindow.cpp +++ b/src/webwindow/webwindow.cpp @@ -31,6 +31,7 @@ #include "bookmarkmanager.h" #include "iconmanager.h" +#include "useragentmanager.h" #include "webpage.h" #include "webtab.h" @@ -227,6 +228,14 @@ void WebWindow::setupActions() KShortcut bkShortcut(Qt::CTRL + Qt::Key_D); a->setShortcut(bkShortcut); + // User Agent + a = new KAction(KIcon("preferences-web-browser-identification"), i18n("Browser Identification"), this); + actionCollection()->addAction(QL1S("useragent"), a); + KMenu *uaMenu = new KMenu(this); + a->setMenu(uaMenu); + connect(uaMenu, SIGNAL(aboutToShow()), this, SLOT(populateUserAgentMenu())); + + // // --- // + @@ -737,3 +746,16 @@ void WebWindow::viewFullScreen(bool makeFullScreen) // FIXME setWidgetsVisible(!makeFullScreen); KToggleFullScreenAction::setFullScreen(this, makeFullScreen); } + + +void WebWindow::populateUserAgentMenu() +{ + KMenu *uaMenu = static_cast(QObject::sender()); + if (!uaMenu) + { + kDebug() << "oops... NO user agent menu"; + return; + } + + UserAgentManager::self()->populateUAMenuForTabUrl(uaMenu, this); +} -- cgit v1.2.1