diff --git a/ui/qt/conversation_dialog.cpp b/ui/qt/conversation_dialog.cpp index b1bde96a16..8dfe9d1385 100644 --- a/ui/qt/conversation_dialog.cpp +++ b/ui/qt/conversation_dialog.cpp @@ -53,7 +53,8 @@ static const QString table_name_ = QObject::tr("Conversation"); ConversationDialog::ConversationDialog(QWidget &parent, CaptureFile &cf, int cli_proto_id, const char *filter) : - TrafficTableDialog(parent, cf, filter, table_name_) + TrafficTableDialog(parent, cf, filter, table_name_), + tcp_graph_requested_(false) { follow_bt_ = buttonBox()->addButton(tr("Follow Stream" UTF8_HORIZONTAL_ELLIPSIS), QDialogButtonBox::ActionRole); follow_bt_->setToolTip(tr("Follow a TCP or UDP stream.")); @@ -63,6 +64,9 @@ ConversationDialog::ConversationDialog(QWidget &parent, CaptureFile &cf, int cli graph_bt_->setToolTip(tr("Graph a TCP conversation.")); connect(graph_bt_, SIGNAL(clicked()), this, SLOT(graphTcp())); + connect(wsApp->mainWindow(), SIGNAL(displayFilterSuccess(bool)), + this, SLOT(displayFilterSuccess(bool))); + absoluteTimeCheckBox()->show(); addProgressFrame(&parent); @@ -236,10 +240,10 @@ void ConversationDialog::graphTcp() return; } - // Apply the filter for this conversation. + tcp_graph_requested_ = true; + // Apply the filter for this conversation. When the filter is active, we + // can draw the TCP graph. emit filterAction(filter, FilterAction::ActionApply, FilterAction::ActionTypePlain); - // This action will now find a packet from the intended conversation/stream. - openTcpStreamGraph(GRAPH_TSEQ_TCPTRACE); } void ConversationDialog::currentTabChanged() @@ -300,6 +304,18 @@ void ConversationDialog::on_buttonBox_helpRequested() wsApp->helpTopicAction(HELP_STATS_CONVERSATIONS_DIALOG); } +void ConversationDialog::displayFilterSuccess(bool success) +{ + if (tcp_graph_requested_) { + if (success) { + // The display filter was applied successfully, i.e. the current + // packet is now part of our selected tcp conversation. + openTcpStreamGraph(GRAPH_TSEQ_TCPTRACE); + } + tcp_graph_requested_ = false; + } +} + void init_conversation_table(struct register_ct* ct, const char *filter) { wsApp->emitStatCommandSignal("Conversations", filter, GINT_TO_POINTER(get_conversation_proto_id(ct))); diff --git a/ui/qt/conversation_dialog.h b/ui/qt/conversation_dialog.h index b6b86422b6..95f42e4726 100644 --- a/ui/qt/conversation_dialog.h +++ b/ui/qt/conversation_dialog.h @@ -67,6 +67,8 @@ private: bool addTrafficTable(register_ct_t* table); conv_item_t *currentConversation(); + bool tcp_graph_requested_; + private slots: void currentTabChanged(); void conversationSelectionChanged(); @@ -74,6 +76,7 @@ private slots: void followStream(); void graphTcp(); void on_buttonBox_helpRequested(); + void displayFilterSuccess(bool success); }; void init_conversation_table(struct register_ct* ct, const char *filter);