summaryrefslogtreecommitdiffstats
path: root/ui/qt/endpoint_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ui/qt/endpoint_dialog.cpp')
-rw-r--r--ui/qt/endpoint_dialog.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/ui/qt/endpoint_dialog.cpp b/ui/qt/endpoint_dialog.cpp
index 38a30be2..d3fd98d0 100644
--- a/ui/qt/endpoint_dialog.cpp
+++ b/ui/qt/endpoint_dialog.cpp
@@ -69,7 +69,7 @@ EndpointDialog::EndpointDialog(QWidget &parent, CaptureFile &cf) :
{
trafficList()->setProtocolInfo(table_name_, &(recent.endpoint_tabs));
- trafficTab()->setProtocolInfo(table_name_, trafficList(), &(recent.endpoint_tabs_columns), &createModel);
+ trafficTab()->setProtocolInfo(table_name_, trafficList(), &(recent.endpoint_tabs), &(recent.endpoint_tabs_columns), &createModel);
trafficTab()->setFilter(cf.displayFilter());
connect(trafficTab(), &TrafficTab::filterAction, this, &EndpointDialog::filterAction);
@@ -111,6 +111,29 @@ void EndpointDialog::tabChanged(int idx)
Q_UNUSED(idx);
#endif
+
+ // By default we'll open the last known opened tab from the Profile
+ GList *selected_tab = NULL;
+
+ if (!file_closed_) {
+ QVariant proto_id = trafficTab()->currentItemData(ATapDataModel::PROTO_ID);
+ if (!proto_id.isNull()) {
+
+ for (GList * endTab = recent.endpoint_tabs; endTab; endTab = endTab->next) {
+ int protoId = proto_get_id_by_short_name((const char *)endTab->data);
+ if ((protoId > -1) && (protoId==proto_id.toInt())) {
+ selected_tab = endTab;
+ }
+ }
+
+ // Move the selected tab to the head
+ if (selected_tab != nullptr) {
+ recent.endpoint_tabs = g_list_remove_link(recent.endpoint_tabs, selected_tab);
+ recent.endpoint_tabs = g_list_prepend(recent.endpoint_tabs, selected_tab->data);
+ }
+ }
+ }
+
TrafficTableDialog::currentTabChanged();
}