aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/main_window.cpp
diff options
context:
space:
mode:
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>2012-08-14 04:12:56 +0000
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>2012-08-14 04:12:56 +0000
commitc6bf2491b78283b5da0a15922a7407eba1ceaef9 (patch)
tree7b599899eb84e8e8527c65ea6f2ce1fe1af2d022 /ui/qt/main_window.cpp
parent1eaf3ffce43ce1dee1e17a3ce11ec882953fda5a (diff)
Add a "View" menu along with actions+slots for expanding and collapsing
packet details. Connect the "Go" menu actions directly to their corresponding packet list slots. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@44483 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'ui/qt/main_window.cpp')
-rw-r--r--ui/qt/main_window.cpp48
1 files changed, 32 insertions, 16 deletions
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index d9a9cf82e6..dba12cc75b 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -47,6 +47,7 @@
#include <QAction>
#include <QToolButton>
#include <QKeyEvent>
+#include <QMetaObject>
//menu_recent_file_write_all
@@ -117,6 +118,22 @@ MainWindow::MainWindow(QWidget *parent) :
connect(wsApp, SIGNAL(captureFileClosed(const capture_file*)),
this, SLOT(captureFileClosed(const capture_file*)));
+ connect(ui->actionGoNextPacket, SIGNAL(triggered()),
+ m_packetList, SLOT(goNextPacket()));
+ connect(ui->actionGoPreviousPacket, SIGNAL(triggered()),
+ m_packetList, SLOT(goPreviousPacket()));
+ connect(ui->actionGoFirstPacket, SIGNAL(triggered()),
+ m_packetList, SLOT(goFirstPacket()));
+ connect(ui->actionGoLastPacket, SIGNAL(triggered()),
+ m_packetList, SLOT(goLastPacket()));
+
+ connect(ui->actionViewExpandSubtrees, SIGNAL(triggered()),
+ protoTree, SLOT(expandSubtrees()));
+ connect(ui->actionViewExpandAll, SIGNAL(triggered()),
+ protoTree, SLOT(expandAll()));
+ connect(ui->actionViewCollapseAll, SIGNAL(triggered()),
+ protoTree, SLOT(collapseAll()));
+
connect(protoTree, SIGNAL(protoItemSelected(QString&)),
ui->statusBar, SLOT(pushFieldStatus(QString&)));
connect(protoTree, SIGNAL(protoItemUnselected()),
@@ -132,17 +149,26 @@ MainWindow::~MainWindow()
void MainWindow::keyPressEvent(QKeyEvent *event) {
+ // Explicitly focus on the display filter combo.
if (event->modifiers() & Qt::ControlModifier && event->key() == Qt::Key_Slash) {
dfComboBox->setFocus(Qt::ShortcutFocusReason);
return;
}
+ // The user typed some text. Start filling in a filter.
+ // XXX We need to install an event filter for the packet list and proto tree
+ if ((event->modifiers() == Qt::NoModifier || event->modifiers() == Qt::ShiftModifier) && event->text().length() > 0) {
+ QApplication::sendEvent(dfComboBox, event);
+ }
+
+ // Move up & down the packet list.
if (event->key() == Qt::Key_F7) {
- m_packetList->goToPrev();
+ m_packetList->goPreviousPacket();
} else if (event->key() == Qt::Key_F8) {
- m_packetList->goToNext();
+ m_packetList->goNextPacket();
}
+ // Move along, citizen.
QMainWindow::keyPressEvent(event);
}
@@ -196,23 +222,13 @@ void MainWindow::captureFileClosing(const capture_file *cf) {
// gtk_widget_show(expert_info_none);
}
-// Go Menu
-
-void MainWindow::on_actionGoNextPacket_triggered() {
- m_packetList->goToNext();
-}
+// View Menu
-void MainWindow::on_actionGoPreviousPacket_triggered() {
- m_packetList->goToPrev();
-}
+// Expand / collapse slots in proto_tree
-void MainWindow::on_actionGoFirstPacket_triggered() {
- m_packetList->goToFirst();
-}
+// Go Menu
-void MainWindow::on_actionGoLastPacket_triggered() {
- m_packetList->goToLast();
-}
+// Next / previous / first / last slots in packet_list
// Help Menu
void MainWindow::on_actionHelpWebsite_triggered() {