summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-07-21 09:51:12 -0700
committerGerald Combs <gerald@wireshark.org>2015-07-21 22:43:05 +0000
commite30a0ff765ff63d4f461df7aafc7c8a365dc265b (patch)
tree0801b89fc98e1695be76dccc856e53a94bdde31f
parente8f24f319ed28d9b419201f431f028c691fc396f (diff)
downloadwireshark-e30a0ff765ff63d4f461df7aafc7c8a365dc265b.tar.gz
Add manual name address resolution.
Make it an editor frame instead of a dialog similar to the column editor and prototocol preference editor. Change-Id: If1a0cdf02dcab0eca98e8d39c94a3c2fe236df5a Reviewed-on: https://code.wireshark.org/review/9743 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
-rw-r--r--ui/help_url.h2
-rw-r--r--ui/qt/CMakeLists.txt3
-rw-r--r--ui/qt/Makefile.am2
-rw-r--r--ui/qt/Makefile.common4
-rw-r--r--ui/qt/Wireshark.pro3
-rw-r--r--ui/qt/address_editor_frame.cpp188
-rw-r--r--ui/qt/address_editor_frame.h79
-rw-r--r--ui/qt/address_editor_frame.ui133
-rw-r--r--ui/qt/column_editor_frame.ui10
-rw-r--r--ui/qt/main_window.cpp7
-rw-r--r--ui/qt/main_window.h1
-rw-r--r--ui/qt/main_window.ui19
-rw-r--r--ui/qt/main_window_slots.cpp39
-rw-r--r--ui/qt/packet_list.cpp6
14 files changed, 474 insertions, 22 deletions
diff --git a/ui/help_url.h b/ui/help_url.h
index ae1002f319..bfc80ea3f2 100644
--- a/ui/help_url.h
+++ b/ui/help_url.h
@@ -71,7 +71,7 @@ typedef enum {
HELP_FILTER_EXPRESSION_DIALOG,
HELP_COLORING_RULES_DIALOG,
HELP_CONFIG_PROFILES_DIALOG,
- HELP_MANUAL_ADDR_RESOLVE_DIALOG,
+ HELP_MANUAL_ADDR_RESOLVE_DIALOG, /* GTK+ only? */
HELP_PRINT_DIALOG,
HELP_FIND_DIALOG,
HELP_FILESET_DIALOG,
diff --git a/ui/qt/CMakeLists.txt b/ui/qt/CMakeLists.txt
index e190255e03..b46d7714e7 100644
--- a/ui/qt/CMakeLists.txt
+++ b/ui/qt/CMakeLists.txt
@@ -24,6 +24,7 @@
set(WIRESHARK_QT_HEADERS
about_dialog.h
accordion_frame.h
+ address_editor_frame.h
bluetooth_att_server_attributes_dialog.h
bluetooth_devices_dialog.h
bluetooth_hci_summary_dialog.h
@@ -156,6 +157,7 @@ file(GLOB EXTRA_QT_HEADERS
set(WIRESHARK_QT_SRC
about_dialog.cpp
accordion_frame.cpp
+ address_editor_frame.cpp
bluetooth_att_server_attributes_dialog.cpp
bluetooth_devices_dialog.cpp
bluetooth_hci_summary_dialog.cpp
@@ -291,6 +293,7 @@ set(WIRESHARK_QT_FILES
set(WIRESHARK_QT_UI
about_dialog.ui
+ address_editor_frame.ui
bluetooth_att_server_attributes_dialog.ui
bluetooth_devices_dialog.ui
bluetooth_hci_summary_dialog.ui
diff --git a/ui/qt/Makefile.am b/ui/qt/Makefile.am
index 740f19566b..caf64516a6 100644
--- a/ui/qt/Makefile.am
+++ b/ui/qt/Makefile.am
@@ -130,6 +130,8 @@ ui_%.h: %.ui
#
about_dialog.$(OBJEXT): ui_about_dialog.h
+address_editor_frame.$(OBJEXT): ui_address_editor_frame.h
+
bluetooth_att_server_attributes_dialog.$(OBJEXT): ui_bluetooth_att_server_attributes_dialog.h
bluetooth_devices_dialog.$(OBJEXT): ui_bluetooth_devices_dialog.h
diff --git a/ui/qt/Makefile.common b/ui/qt/Makefile.common
index 481612a21f..89ad33e293 100644
--- a/ui/qt/Makefile.common
+++ b/ui/qt/Makefile.common
@@ -30,6 +30,7 @@ GENERATED_HEADER_FILES =
# Generated header files that we don't want in the distribution.
NODIST_GENERATED_HEADER_FILES = \
ui_about_dialog.h \
+ ui_address_editor_frame.h \
ui_bluetooth_att_server_attributes_dialog.h \
ui_bluetooth_devices_dialog.h \
ui_bluetooth_hci_summary_dialog.h \
@@ -134,6 +135,7 @@ GENERATOR_FILES =
MOC_HDRS = \
about_dialog.h \
accordion_frame.h \
+ address_editor_frame.h \
bluetooth_att_server_attributes_dialog.h \
bluetooth_devices_dialog.h \
bluetooth_hci_summary_dialog.h \
@@ -248,6 +250,7 @@ MOC_HDRS = \
#
UI_FILES = \
about_dialog.ui \
+ address_editor_frame.ui \
bluetooth_att_server_attributes_dialog.ui \
bluetooth_devices_dialog.ui \
bluetooth_hci_summary_dialog.ui \
@@ -367,6 +370,7 @@ QRC_SRC = $(QRC_FILES:.qrc=.rcc.cpp)
WIRESHARK_QT_SRC = \
about_dialog.cpp \
accordion_frame.cpp \
+ address_editor_frame.cpp \
bluetooth_att_server_attributes_dialog.cpp \
bluetooth_devices_dialog.cpp \
bluetooth_hci_summary_dialog.cpp \
diff --git a/ui/qt/Wireshark.pro b/ui/qt/Wireshark.pro
index 7d083eb099..6ac3ebd58c 100644
--- a/ui/qt/Wireshark.pro
+++ b/ui/qt/Wireshark.pro
@@ -206,6 +206,7 @@ HEADERS_WS_C = \
FORMS += \
about_dialog.ui \
+ address_editor_frame.ui \
bluetooth_att_server_attributes_dialog.ui \
bluetooth_devices_dialog.ui \
bluetooth_hci_summary_dialog.ui \
@@ -277,6 +278,7 @@ FORMS += \
HEADERS += $$HEADERS_WS_C \
about_dialog.h \
accordion_frame.h \
+ address_editor_frame.h \
bluetooth_att_server_attributes_dialog.h \
bluetooth_devices_dialog.h \
bluetooth_hci_summary_dialog.h \
@@ -636,6 +638,7 @@ HEADERS += \
SOURCES += \
about_dialog.cpp \
accordion_frame.cpp \
+ address_editor_frame.cpp \
bluetooth_att_server_attributes_dialog.cpp \
bluetooth_devices_dialog.cpp \
bluetooth_hci_summary_dialog.cpp \
diff --git a/ui/qt/address_editor_frame.cpp b/ui/qt/address_editor_frame.cpp
new file mode 100644
index 0000000000..bec9780beb
--- /dev/null
+++ b/ui/qt/address_editor_frame.cpp
@@ -0,0 +1,188 @@
+/* address_editor_frame.h
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+
+#include <glib.h>
+
+#include "file.h"
+#include "frame_tvbuff.h"
+
+#include "epan/addr_resolv.h"
+#include "epan/epan_dissect.h"
+#include "epan/frame_data.h"
+
+#include "address_editor_frame.h"
+#include <ui_address_editor_frame.h>
+
+#include "qt_ui_utils.h"
+
+// To do:
+// - Fill in currently resolved address.
+
+AddressEditorFrame::AddressEditorFrame(QWidget *parent) :
+ AccordionFrame(parent),
+ ui(new Ui::AddressEditorFrame)
+{
+ ui->setupUi(this);
+
+#ifdef Q_OS_MAC
+ foreach (QWidget *w, findChildren<QWidget *>()) {
+ w->setAttribute(Qt::WA_MacSmallSize, true);
+ }
+#endif
+
+}
+
+AddressEditorFrame::~AddressEditorFrame()
+{
+ delete ui;
+}
+
+void AddressEditorFrame::editAddresses(CaptureFile &cf, int column)
+{
+ if (!cf.capFile()->current_frame) {
+ on_cancelButton_clicked();
+ return;
+ }
+
+ if (!cf_read_record(cf.capFile(), cf.capFile()->current_frame)) {
+ on_cancelButton_clicked();
+ return; // error reading the frame
+ }
+
+ epan_dissect_t edt;
+ QStringList addresses;
+
+ ui->addressComboBox->clear();
+
+ epan_dissect_init(&edt, cf.capFile()->epan, FALSE, FALSE);
+ col_custom_prime_edt(&edt, &cf.capFile()->cinfo);
+
+ epan_dissect_run(&edt, cf.capFile()->cd_t, &cf.capFile()->phdr,
+ frame_tvbuff_new_buffer(cf.capFile()->current_frame, &cf.capFile()->buf), cf.capFile()->current_frame, &cf.capFile()->cinfo);
+ epan_dissect_fill_in_columns(&edt, TRUE, TRUE);
+
+ /* First check selected column */
+ if (isAddressColumn(&cf.capFile()->cinfo, column)) {
+ addresses << cf.capFile()->cinfo.col_expr.col_expr_val[column];
+ }
+
+ for (int col = 0; col < cf.capFile()->cinfo.num_cols; col++) {
+ /* Then check all columns except the selected */
+ if ((col != column) && (isAddressColumn(&cf.capFile()->cinfo, col))) {
+ addresses << cf.capFile()->cinfo.col_expr.col_expr_val[col];
+ }
+ }
+
+ epan_dissect_cleanup(&edt);
+
+ ui->addressComboBox->addItems(addresses);
+ ui->nameLineEdit->setFocus();
+ updateWidgets();
+}
+
+void AddressEditorFrame::updateWidgets()
+{
+ bool ok_enable = false;
+ if (ui->addressComboBox->count() > 0 && !ui->nameLineEdit->text().isEmpty()) {
+ ok_enable = true;
+ }
+
+ ui->okButton->setEnabled(ok_enable);
+}
+
+void AddressEditorFrame::on_nameResolutionPreferencesToolButton_clicked()
+{
+ static const QString module_name = "nameres";
+ on_cancelButton_clicked();
+ emit showNameResolutionPreferences(module_name);
+}
+
+void AddressEditorFrame::on_addressComboBox_currentIndexChanged(const QString &)
+{
+ updateWidgets();
+}
+
+void AddressEditorFrame::on_nameLineEdit_textEdited(const QString &)
+{
+ updateWidgets();
+}
+
+void AddressEditorFrame::on_nameLineEdit_returnPressed()
+{
+ if (ui->okButton->isEnabled()) {
+ on_okButton_clicked();
+ }
+}
+
+void AddressEditorFrame::on_okButton_clicked()
+{
+ if (ui->addressComboBox->count() < 1 || ui->nameLineEdit->text().isEmpty()) {
+ return;
+ }
+ QString addr = ui->addressComboBox->currentText();
+ QString name = ui->nameLineEdit->text().toUtf8();
+ if (!add_ip_name_from_string(addr.toUtf8().constData(), name.toUtf8().constData())) {
+ QString error_msg = tr("Can't assign %1 to %2").arg(name).arg(addr);
+ emit editAddressStatus(error_msg);
+ ui->okButton->setEnabled(false);
+ return;
+ }
+ on_cancelButton_clicked();
+ emit redissectPackets();
+}
+
+void AddressEditorFrame::on_cancelButton_clicked()
+{
+ ui->addressComboBox->clear();
+ ui->nameLineEdit->clear();
+ animatedHide();
+}
+
+bool AddressEditorFrame::isAddressColumn(epan_column_info *cinfo, int column)
+{
+ if (!cinfo || column < 0 || column >= cinfo->num_cols) return false;
+
+ if (((cinfo->columns[column].col_fmt == COL_DEF_SRC) ||
+ (cinfo->columns[column].col_fmt == COL_RES_SRC) ||
+ (cinfo->columns[column].col_fmt == COL_DEF_DST) ||
+ (cinfo->columns[column].col_fmt == COL_RES_DST)) &&
+ strlen(cinfo->col_expr.col_expr_val[column]))
+ {
+ return true;
+ }
+
+ return false;
+}
+
+/*
+ * Editor modelines
+ *
+ * Local Variables:
+ * c-basic-offset: 4
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * ex: set shiftwidth=4 tabstop=8 expandtab:
+ * :indentSize=4:tabSize=8:noTabs=true:
+ */
diff --git a/ui/qt/address_editor_frame.h b/ui/qt/address_editor_frame.h
new file mode 100644
index 0000000000..92b3463e4c
--- /dev/null
+++ b/ui/qt/address_editor_frame.h
@@ -0,0 +1,79 @@
+/* address_editor_frame.h
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef ADDRESS_EDITOR_FRAME_H
+#define ADDRESS_EDITOR_FRAME_H
+
+#include "accordion_frame.h"
+
+#include "capture_file.h"
+
+namespace Ui {
+class AddressEditorFrame;
+}
+
+struct epan_column_info;
+
+class AddressEditorFrame : public AccordionFrame
+{
+ Q_OBJECT
+
+public:
+ explicit AddressEditorFrame(QWidget *parent = 0);
+ ~AddressEditorFrame();
+
+public slots:
+ void editAddresses(CaptureFile &cf, int column = -1);
+
+signals:
+ void showNameResolutionPreferences(const QString module_name);
+ void editAddressStatus(const QString &status);
+ void redissectPackets();
+
+private slots:
+ void updateWidgets();
+ void on_nameResolutionPreferencesToolButton_clicked();
+ void on_addressComboBox_currentIndexChanged(const QString &);
+ void on_nameLineEdit_textEdited(const QString &);
+ void on_nameLineEdit_returnPressed();
+ void on_okButton_clicked();
+ void on_cancelButton_clicked();
+
+private:
+ Ui::AddressEditorFrame *ui;
+
+ bool isAddressColumn(struct epan_column_info *cinfo, int column);
+};
+
+#endif // ADDRESS_EDITOR_FRAME_H
+
+/*
+ * Editor modelines
+ *
+ * Local Variables:
+ * c-basic-offset: 4
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * ex: set shiftwidth=4 tabstop=8 expandtab:
+ * :indentSize=4:tabSize=8:noTabs=true:
+ */
diff --git a/ui/qt/address_editor_frame.ui b/ui/qt/address_editor_frame.ui
new file mode 100644
index 0000000000..77c88532fa
--- /dev/null
+++ b/ui/qt/address_editor_frame.ui
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>AddressEditorFrame</class>
+ <widget class="QFrame" name="AddressEditorFrame">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>833</width>
+ <height>28</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Frame</string>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Plain</enum>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,3,0,0,0,0,1,0,0,0">
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QToolButton" name="nameResolutionPreferencesToolButton">
+ <property name="text">
+ <string>Name Resolution Preferences...</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>81</width>
+ <height>5</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="addressLabel">
+ <property name="text">
+ <string>Address:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="addressComboBox"/>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>10</width>
+ <height>5</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Name:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="SyntaxLineEdit" name="nameLineEdit">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>80</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QToolButton" name="okButton">
+ <property name="text">
+ <string>OK</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="cancelButton">
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>SyntaxLineEdit</class>
+ <extends>QLineEdit</extends>
+ <header>syntax_line_edit.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/ui/qt/column_editor_frame.ui b/ui/qt/column_editor_frame.ui
index 644f171ba4..97d06bf9cd 100644
--- a/ui/qt/column_editor_frame.ui
+++ b/ui/qt/column_editor_frame.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>1029</width>
- <height>49</height>
+ <width>1018</width>
+ <height>30</height>
</rect>
</property>
<property name="windowTitle">
@@ -44,7 +44,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
- <height>20</height>
+ <height>5</height>
</size>
</property>
</spacer>
@@ -90,7 +90,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
- <height>20</height>
+ <height>5</height>
</size>
</property>
</spacer>
@@ -113,7 +113,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>59</width>
- <height>20</height>
+ <height>5</height>
</size>
</property>
</spacer>
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index 6aebee84e9..1be6b20f1b 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -301,6 +301,7 @@ MainWindow::MainWindow(QWidget *parent) :
connect(main_ui_->searchFrame, SIGNAL(visibilityChanged(bool)),
main_ui_->actionEditFindPacket, SLOT(setChecked(bool)));
+ main_ui_->addressEditorFrame->hide();
main_ui_->columnEditorFrame->hide();
main_ui_->preferenceEditorFrame->hide();
@@ -429,6 +430,12 @@ MainWindow::MainWindow(QWidget *parent) :
connect(main_welcome_, SIGNAL(popFilterSyntaxStatus()),
main_ui_->statusBar, SLOT(popFilterStatus()));
+ connect(main_ui_->addressEditorFrame, SIGNAL(editAddressStatus(QString)),
+ main_ui_->statusBar, SLOT(pushTemporaryStatus(QString)));
+ connect(main_ui_->addressEditorFrame, SIGNAL(redissectPackets()),
+ this, SLOT(redissectPackets()));
+ connect(main_ui_->addressEditorFrame, SIGNAL(showNameResolutionPreferences(QString)),
+ this, SLOT(showPreferencesDialog(QString)));
connect(main_ui_->preferenceEditorFrame, SIGNAL(showProtocolPreferences(QString)),
this, SLOT(showPreferencesDialog(QString)));
diff --git a/ui/qt/main_window.h b/ui/qt/main_window.h
index 1c238b7495..f593b782b8 100644
--- a/ui/qt/main_window.h
+++ b/ui/qt/main_window.h
@@ -365,6 +365,7 @@ private slots:
void setTimestampFormat(QAction *action);
void setTimestampPrecision(QAction *action);
void on_actionViewTimeDisplaySecondsWithHoursAndMinutes_triggered(bool checked);
+ void on_actionViewEditResolvedName_triggered();
void setNameResolution();
void on_actionViewNameResolutionPhysical_triggered();
void on_actionViewNameResolutionNetwork_triggered();
diff --git a/ui/qt/main_window.ui b/ui/qt/main_window.ui
index 637dcd949a..a2fa8cf7f9 100644
--- a/ui/qt/main_window.ui
+++ b/ui/qt/main_window.ui
@@ -92,6 +92,9 @@
<widget class="SearchFrame" name="searchFrame" native="true"/>
</item>
<item>
+ <widget class="AddressEditorFrame" name="addressEditorFrame"/>
+ </item>
+ <item>
<widget class="ColumnEditorFrame" name="columnEditorFrame"/>
</item>
<item>
@@ -275,6 +278,8 @@
<property name="title">
<string>Name Resolution</string>
</property>
+ <addaction name="actionViewEditResolvedName"/>
+ <addaction name="separator"/>
<addaction name="actionViewNameResolutionPhysical"/>
<addaction name="actionViewNameResolutionNetwork"/>
<addaction name="actionViewNameResolutionTransport"/>
@@ -2550,6 +2555,14 @@
<string>RTP Stream Analysis</string>
</property>
</action>
+ <action name="actionViewEditResolvedName">
+ <property name="text">
+ <string>Edit Resolved Name</string>
+ </property>
+ <property name="toolTip">
+ <string>Manually edit a name resolution entry.</string>
+ </property>
+ </action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
@@ -2576,6 +2589,12 @@
<header>search_frame.h</header>
</customwidget>
<customwidget>
+ <class>AddressEditorFrame</class>
+ <extends>QFrame</extends>
+ <header>address_editor_frame.h</header>
+ <container>1</container>
+ </customwidget>
+ <customwidget>
<class>ColumnEditorFrame</class>
<extends>QFrame</extends>
<header>column_editor_frame.h</header>
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp
index 9f77bd487f..38598614e2 100644
--- a/ui/qt/main_window_slots.cpp
+++ b/ui/qt/main_window_slots.cpp
@@ -958,7 +958,7 @@ void MainWindow::recentActionTriggered() {
void MainWindow::setMenusForSelectedPacket()
{
// gboolean is_ip = FALSE, is_tcp = FALSE, is_udp = FALSE, is_sctp = FALSE, is_ssl = FALSE;
- gboolean is_tcp = FALSE, is_sctp = FALSE, is_rtp = FALSE;
+ gboolean is_ip = FALSE, is_tcp = FALSE, is_sctp = FALSE, is_rtp = FALSE;
// /* Making the menu context-sensitive allows for easier selection of the
// desired item and has the added benefit, with large captures, of
@@ -967,25 +967,25 @@ void MainWindow::setMenusForSelectedPacket()
// gboolean is_ssl = epan_dissect_packet_contains_field(cf->edt, "ssl");
/* We have one or more items in the packet list */
- gboolean have_frames = FALSE;
+ bool have_frames = false;
/* A frame is selected */
- gboolean frame_selected = FALSE;
+ bool frame_selected = false;
/* We have marked frames. (XXX - why check frame_selected?) */
- gboolean have_marked = FALSE;
+ bool have_marked = false;
/* We have a marked frame other than the current frame (i.e.,
we have at least one marked frame, and either there's more
than one marked frame or the current frame isn't marked). */
- gboolean another_is_marked = FALSE;
+ bool another_is_marked = false;
/* One or more frames are hidden by a display filter */
- gboolean have_filtered = FALSE;
+ bool have_filtered = false;
/* One or more frames have been ignored */
- gboolean have_ignored = FALSE;
- gboolean have_time_ref = FALSE;
+ bool have_ignored = false;
+ bool have_time_ref = false;
/* We have a time reference frame other than the current frame (i.e.,
we have at least one time reference frame, and either there's more
than one time reference frame or the current frame isn't a
time reference frame). (XXX - why check frame_selected?) */
- gboolean another_is_time_ref = FALSE;
+ bool another_is_time_ref = false;
if (capture_file_.capFile()) {
frame_selected = capture_file_.capFile()->current_frame != NULL;
@@ -1001,7 +1001,7 @@ void MainWindow::setMenusForSelectedPacket()
if (capture_file_.capFile()->edt)
{
- proto_get_frame_protocols(capture_file_.capFile()->edt->pi.layers, NULL, &is_tcp, NULL, &is_sctp, NULL, &is_rtp);
+ proto_get_frame_protocols(capture_file_.capFile()->edt->pi.layers, &is_ip, &is_tcp, NULL, &is_sctp, NULL, &is_rtp);
}
}
// if (cfile.edt && cfile.edt->tree) {
@@ -1075,8 +1075,7 @@ void MainWindow::setMenusForSelectedPacket()
// tmp_color_filters_used());
main_ui_->actionViewShowPacketInNewWindow->setEnabled(frame_selected);
-// set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/ManuallyResolveAddress",
-// frame_selected ? is_ip : FALSE);
+ main_ui_->actionViewEditResolvedName->setEnabled(frame_selected && is_ip);
// set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/SCTP",
// frame_selected ? is_sctp : FALSE);
// set_menu_sensitivity(ui_manager_packet_list_menu, "/PacketListMenuPopup/FollowTCPStream",
@@ -1403,7 +1402,8 @@ void MainWindow::showAccordionFrame(AccordionFrame *show_frame, bool toggle)
{
QList<AccordionFrame *>frame_list = QList<AccordionFrame *>()
<< main_ui_->goToFrame << main_ui_->searchFrame
- << main_ui_->columnEditorFrame << main_ui_->preferenceEditorFrame;
+ << main_ui_->addressEditorFrame << main_ui_->columnEditorFrame
+ << main_ui_->preferenceEditorFrame;
frame_list.removeAll(show_frame);
foreach (AccordionFrame *af, frame_list) af->animatedHide();
@@ -2168,6 +2168,19 @@ void MainWindow::on_actionViewTimeDisplaySecondsWithHoursAndMinutes_triggered(bo
}
}
+void MainWindow::on_actionViewEditResolvedName_triggered()
+{
+// int column = packet_list_->selectedColumn();
+ int column = -1;
+
+ if (packet_list_->currentIndex().isValid()) {
+ column = packet_list_->currentIndex().column();
+ }
+
+ main_ui_->addressEditorFrame->editAddresses(capture_file_, column);
+ showAccordionFrame(main_ui_->addressEditorFrame);
+}
+
void MainWindow::setNameResolution()
{
gbl_resolv_flags.mac_name = main_ui_->actionViewNameResolutionPhysical->isChecked() ? TRUE : FALSE;
diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp
index 96c3ae1408..8f91bcd561 100644
--- a/ui/qt/packet_list.cpp
+++ b/ui/qt/packet_list.cpp
@@ -267,6 +267,9 @@ PacketList::PacketList(QWidget *parent) :
ctx_menu_.addSeparator();
+ ctx_menu_.addAction(window()->findChild<QAction *>("actionViewEditResolvedName"));
+ ctx_menu_.addSeparator();
+
action = window()->findChild<QAction *>("actionFollow");
submenu = new QMenu();
action->setMenu(submenu);
@@ -286,9 +289,6 @@ PacketList::PacketList(QWidget *parent) :
ctx_menu_.addSeparator();
-// " <menuitem name='ManuallyResolveAddress' action='/ManuallyResolveAddress'/>\n"
-// ctx_menu_.addSeparator();
-
action = window()->findChild<QAction *>("actionApply_as_Filter");
submenu = new QMenu();
action->setMenu(submenu);