summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-05-05 15:46:28 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-05-05 15:46:28 +0200
commit1830a45a0e1ae8f257667899a6c34f32545dbd62 (patch)
treec5a94ad37b50c484c7434e6dde01b1ece43672e4 /src/mainwindow.cpp
parentif the url of an item have the same domaine name as the typed string, it is m... (diff)
downloadrekonq-1830a45a0e1ae8f257667899a6c34f32545dbd62.tar.xz
This commit implements another dockwidget for rekonq, containing a
network analyzer. Its code is based on previous implementation of Web Inspector Dock and on Richmoore example about QNAM proxy. Many thanks for :)
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index a598128b..ef665cc7 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -47,6 +47,7 @@
#include "urlbar.h"
#include "tabbar.h"
#include "adblockmanager.h"
+#include "analyzerpanel.h"
// Ui Includes
#include "ui_cleardata.h"
@@ -99,6 +100,7 @@ MainWindow::MainWindow()
, m_historyPanel(0)
, m_bookmarksPanel(0)
, m_webInspectorPanel(0)
+ , m_analyzerPanel(0)
, m_historyBackMenu(0)
, m_encodingMenu(new KMenu(this))
, m_mainBar(new KToolBar(QString("MainToolBar"), this, Qt::TopToolBarArea, true, true, true))
@@ -494,9 +496,10 @@ void MainWindow::setupTools()
toolsMenu->addSeparator();
- KActionMenu *webMenu = new KActionMenu(KIcon("applications-development-web"), i18n("Web Development"), this);
+ KActionMenu *webMenu = new KActionMenu(KIcon("applications-development-web"), i18n("Development"), this);
webMenu->addAction(actionByName(QL1S("web_inspector")));
webMenu->addAction(actionByName(QL1S("page_source")));
+ webMenu->addAction(actionByName(QL1S("net_analyzer")));
toolsMenu->addAction(webMenu);
toolsMenu->addSeparator();
@@ -565,6 +568,19 @@ void MainWindow::setupPanels()
addDockWidget(Qt::BottomDockWidgetArea, m_webInspectorPanel);
m_webInspectorPanel->hide();
+
+ // STEP 4
+ // Setup Network analyzer panel
+ m_analyzerPanel = new NetworkAnalyzerPanel( i18n("Network Analyzer"), this);
+ connect(mainView(), SIGNAL(currentChanged(int)), m_analyzerPanel, SLOT(changeCurrentPage()));
+
+ a = new KAction(KIcon("document-edit-decrypt-verify"), i18n("Network Analyzer"), this);
+ a->setCheckable(true);
+ actionCollection()->addAction(QL1S("net_analyzer"), a);
+ connect(a, SIGNAL(triggered(bool)), this, SLOT(enableNetworkAnalysis(bool)));
+
+ addDockWidget(Qt::BottomDockWidgetArea, m_analyzerPanel);
+ m_analyzerPanel->hide();
}
@@ -1262,3 +1278,10 @@ void MainWindow::populateEncodingMenu()
action->setChecked(true);
}
}
+
+
+void MainWindow::enableNetworkAnalysis(bool b)
+{
+ currentTab()->page()->enableNetworkAnalyzer(b);
+ m_analyzerPanel->toggle(b);
+}