From 2e96585d9a36d95a5dd33859365b6047a133a051 Mon Sep 17 00:00:00 2001 From: matgic78 Date: Wed, 2 Dec 2009 18:01:30 +0100 Subject: Docked web inspector --- src/mainwindow.cpp | 47 +++++++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 26 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 628743ee..fc005014 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 ================== @@ -843,25 +857,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; -- cgit v1.2.1 From eaa82c1922c7cc133458c65ecbe8eb2ab6adc03d Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 6 Dec 2009 23:36:15 +0100 Subject: KWebWallet integration --- src/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 583825af..6186ebea 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -97,8 +97,8 @@ 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_webInspectorDock(0) -- cgit v1.2.1