diff options
Diffstat (limited to 'src/webwindow/webwindow.cpp')
-rw-r--r-- | src/webwindow/webwindow.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
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())); + + // <Menu name="rekonqMenu" noMerge="1"> // <Action name="new_tab" /> --- // <Action name="new_window" /> + @@ -737,3 +746,16 @@ void WebWindow::viewFullScreen(bool makeFullScreen) // FIXME setWidgetsVisible(!makeFullScreen); KToggleFullScreenAction::setFullScreen(this, makeFullScreen); } + + +void WebWindow::populateUserAgentMenu() +{ + KMenu *uaMenu = static_cast<KMenu *>(QObject::sender()); + if (!uaMenu) + { + kDebug() << "oops... NO user agent menu"; + return; + } + + UserAgentManager::self()->populateUAMenuForTabUrl(uaMenu, this); +} |