summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/webwindow/webwindow.cpp22
-rw-r--r--src/webwindow/webwindow.h2
2 files changed, 24 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);
+}
diff --git a/src/webwindow/webwindow.h b/src/webwindow/webwindow.h
index cd7235b3..ed8a7f2b 100644
--- a/src/webwindow/webwindow.h
+++ b/src/webwindow/webwindow.h
@@ -111,6 +111,8 @@ private Q_SLOTS:
void viewPageSource();
void viewFullScreen(bool enable);
+ void populateUserAgentMenu();
+
Q_SIGNALS:
void titleChanged(QString);