aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/conversation_dialog.h
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2014-08-06 10:07:42 -0700
committerGerald Combs <gerald@wireshark.org>2014-09-05 01:06:53 +0000
commit30f3d524411445c26418c757ac9deb0940afc409 (patch)
treed60cadae8fdfb0612ee6e00bc5f17b550534af29 /ui/qt/conversation_dialog.h
parent382815d6bdd9a66421ae2e07c734df4c8a4ac398 (diff)
Qt: Refactor ConversationDialog for endpoints.
Create a TrafficTableDialog (for lack of a better name) parent class from the general parts of ConversationDialog. Use it to create EndpointsDialog. Move the contents of conversation_tree_widget.{cpp,h} to conversation_dialog.{cpp,h} to match endpoint_dialog and traffic_table_dialog. Fill in GeoIP columns dynamically instead of using a hard-coded limit. Use "endp_" and "ENDP_" prefixes for a lot of endpoint variables and defines. Try to make geoip_db_lookup_ipv4 and geoip_db_lookup_ipv6 more robust. Clean up some includes. Fix a shadowed variable. Change-Id: I23054816ac7f8c6edb3b1f01c8536db37ba4122d Reviewed-on: https://code.wireshark.org/review/3462 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/conversation_dialog.h')
-rw-r--r--ui/qt/conversation_dialog.h46
1 files changed, 19 insertions, 27 deletions
diff --git a/ui/qt/conversation_dialog.h b/ui/qt/conversation_dialog.h
index 59c183d22c..cfff90e9ee 100644
--- a/ui/qt/conversation_dialog.h
+++ b/ui/qt/conversation_dialog.h
@@ -22,23 +22,29 @@
#ifndef CONVERSATION_DIALOG_H
#define CONVERSATION_DIALOG_H
-#include <conversation_tree_widget.h>
+#include "traffic_table_dialog.h"
-#include <file.h>
+Q_DECLARE_METATYPE(conv_item_t *)
-#include "ui/follow.h"
-#include "epan/conversation_table.h"
+class ConversationTreeWidget : public TrafficTableTreeWidget
+{
+ Q_OBJECT
+public:
+ explicit ConversationTreeWidget(QWidget *parent, register_ct_t* table);
+ ~ConversationTreeWidget();
-#include <QAction>
-#include <QMenu>
+ static void tapReset(void *conv_hash_ptr);
+ static void tapDraw(void *conv_hash_ptr);
-#include <QDialog>
+private:
+ void initDirectionMap();
-namespace Ui {
-class ConversationDialog;
-}
+private slots:
+ void updateItems();
+ void filterActionTriggered();
+};
-class ConversationDialog : public QDialog
+class ConversationDialog : public TrafficTableDialog
{
Q_OBJECT
@@ -50,7 +56,7 @@ public:
* @param proto_id If valid, add this protocol and bring it to the front.
* @param filter Display filter to apply.
*/
- explicit ConversationDialog(QWidget *parent = 0, capture_file *cf = NULL, int proto_id = -1, const char *filter = NULL);
+ explicit ConversationDialog(QWidget *parent = 0, capture_file *cf = NULL, int cli_proto_id = -1, const char *filter = NULL);
~ConversationDialog();
public slots:
@@ -62,32 +68,18 @@ signals:
void openTcpStreamGraph(int graph_type);
private:
- Ui::ConversationDialog *ui;
-
- capture_file *cap_file_;
- QString filter_;
- QMenu conv_type_menu_;
- QMap<int, ConversationTreeWidget *> proto_id_to_tree_;
QList<QAction> conv_actions_;
- QPushButton *copy_bt_;
QPushButton *follow_bt_;
QPushButton *graph_bt_;
- // Adds a conversation tree. Returns true if the tree was freshly created, false if it was cached.
- bool addConversationTable(register_ct_t* table);
+ bool addTrafficTable(register_ct_t* table);
conv_item_t *currentConversation();
private slots:
- void updateWidgets();
- void toggleConversation();
void itemSelectionChanged();
void on_nameResolutionCheckBox_toggled(bool checked);
void on_displayFilterCheckBox_toggled(bool checked);
- void setTabText(QWidget *tree, const QString &text);
- void chainFilterAction(QString& filter, FilterAction::Action action, FilterAction::ActionType type);
void followStream();
- void copyAsCsv();
- void copyAsYaml();
void graphTcp();
void on_buttonBox_helpRequested();
};