diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-12-03 01:17:51 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-12-03 01:17:51 +0100 |
commit | 033ceeaf69a031ef706797a577fe8f1e14256970 (patch) | |
tree | 111fc073946568704eace728071574bff4fea3b8 /src/mainwindow.cpp | |
parent | push startup on disabled adblock (don't load filters) (diff) | |
parent | fix copyright (diff) | |
download | rekonq-033ceeaf69a031ef706797a577fe8f1e14256970.tar.xz |
Merge commit 'refs/merge-requests/62' of git://gitorious.org/rekonq/mainline into AdFixes
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r-- | src/mainwindow.cpp | 47 |
1 files changed, 21 insertions, 26 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 8b43f6ae..583825af 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" @@ -99,7 +100,8 @@ MainWindow::MainWindow() , 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; |