summaryrefslogtreecommitdiff
path: root/src/webwindow
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-08-08 12:42:09 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-12-10 02:48:04 +0100
commit9c434e284354768c1b6a4269b66db831103ff5ae (patch)
tree3d1cf0ce0bdc0a3e8eb7026a511eb2204ec54ef5 /src/webwindow
parentAdd actions to the web window, STEP 1 (the easiest ones...) (diff)
downloadrekonq-9c434e284354768c1b6a4269b66db831103ff5ae.tar.xz
User agent management restored
Diffstat (limited to 'src/webwindow')
-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);