summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorPanagiotis Papadopoulos <pano_90@gmx.net>2009-12-09 17:23:35 +0100
committerPanagiotis Papadopoulos <pano_90@gmx.net>2009-12-09 17:23:35 +0100
commitba21553e2e6ce17fc4ad84b5ab587b4e7bc5345c (patch)
tree64f7b3a5cec066f06268e954899a78523dcaedf5 /src/mainwindow.cpp
parentChange a bit the WebKit settings UI (diff)
parentxss attach prevention. (diff)
downloadrekonq-ba21553e2e6ce17fc4ad84b5ab587b4e7bc5345c.tar.xz
Merge branch 'master' of git://gitorious.org/rekonq/mainline into click-to-flash-ui
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp51
1 files changed, 23 insertions, 28 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 8b43f6ae..6186ebea 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -42,6 +42,7 @@
#include "findbar.h"
#include "sidepanel.h"
#include "bookmarkspanel.h"
+#include "webinspectordock.h"
#include "urlbar.h"
#include "tabbar.h"
#include "newtabpage.h"
@@ -96,10 +97,11 @@
MainWindow::MainWindow()
: KMainWindow()
- , m_view(new MainView(this))
- , m_findBar(new FindBar(this))
+ , m_view( new MainView(this) )
+ , m_findBar( new FindBar(this) )
, m_sidePanel(0)
- , m_bookmarksPanel(0)
+ , m_bookmarksPanel(0)
+ , m_webInspectorDock(0)
, m_historyBackMenu(0)
, m_mainBar( new KToolBar( QString("MainToolBar"), this, Qt::TopToolBarArea, true, false, false) )
, m_bmBar( new KToolBar( QString("BookmarkToolBar"), this, Qt::TopToolBarArea, true, false, false) )
@@ -136,7 +138,8 @@ MainWindow::MainWindow()
// setting Side Panel
setupSidePanel();
- setupBookmarksPanel();
+ setupBookmarksPanel();
+ setupWebInspector();
// setting up rekonq tools
setupTools();
@@ -336,11 +339,6 @@ void MainWindow::setupActions()
actionCollection()->addAction(QLatin1String("page_source"), a);
connect(a, SIGNAL(triggered(bool)), this, SLOT(viewPageSource()));
- a = new KAction(KIcon("tools-report-bug"), i18n("Web &Inspector"), this);
- a->setCheckable(true);
- actionCollection()->addAction(QLatin1String("web_inspector"), a);
- connect(a, SIGNAL(triggered(bool)), this, SLOT(toggleInspector(bool)));
-
a = new KAction(KIcon("view-media-artist"), i18n("Private &Browsing"), this);
a->setCheckable(true);
actionCollection()->addAction(QLatin1String("private_browsing"), a);
@@ -490,6 +488,22 @@ void MainWindow::setupBookmarksPanel()
}
+void MainWindow::setupWebInspector()
+{
+ m_webInspectorDock = new WebInspectorDock(i18n("Web Inspector"), this);
+ connect(mainView(), SIGNAL(currentChanged(int)), m_webInspectorDock, SLOT(changeCurrentPage()));
+
+ KAction *a = new KAction(KIcon("tools-report-bug"), i18n("Web &Inspector"), this);
+ a->setCheckable(true);
+ actionCollection()->addAction(QLatin1String("web_inspector"), a);
+ connect(a, SIGNAL(triggered(bool)), m_webInspectorDock, SLOT(toggle(bool)));
+
+ addDockWidget(Qt::BottomDockWidgetArea, m_webInspectorDock);
+ m_webInspectorDock->hide();
+}
+
+
+
void MainWindow::updateConfiguration()
{
// ============== General ==================
@@ -847,25 +861,6 @@ void MainWindow::homePage()
}
-void MainWindow::toggleInspector(bool enable)
-{
- QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, enable);
- if (enable)
- {
- int result = KMessageBox::questionYesNo(this,
- i18n("The web inspector will only work correctly for pages that were loaded after enabling.\n" \
- "Do you want to reload all pages?"),
- i18n("Web Inspector")
- );
-
- if (result == KMessageBox::Yes)
- {
- m_view->reloadAllTabs();
- }
- }
-}
-
-
MainView *MainWindow::mainView() const
{
return m_view;