connect(statsTreeWidget(), SIGNAL(itemSelectionChanged()),
this, SLOT(updateHeaderLabels()));
+
+ // Set handler for when display filter string is changed.
+ connect(this, SIGNAL(updateFilter(QString)),
+ this, SLOT(filterUpdated(QString)));
}
WlanStatisticsDialog::~WlanStatisticsDialog()
{
if (!registerTapListener("wlan",
this,
- NULL,
+ displayFilter_.toLatin1().data(),
TL_REQUIRES_NOTHING,
tapReset,
tapPacket,
WiresharkDialog::captureFileClosing();
}
+// Store filter from signal.
+void WlanStatisticsDialog::filterUpdated(QString filter)
+{
+ displayFilter_ = filter;
+}
+
+// This is how an item is represented for exporting.
+QList<QVariant> WlanStatisticsDialog::treeItemData(QTreeWidgetItem *it) const
+{
+ // Cast up to our type.
+ WlanNetworkTreeWidgetItem *nit = dynamic_cast<WlanNetworkTreeWidgetItem*>(it);
+ if (nit) {
+ return nit->rowData();
+ }
+ // TODO: not going to cast to WlanStationTreeWidgetItem* and do the same as
+ // some of the columns are different...
+
+ return QList<QVariant>();
+}
+
// Stat command + args
static void
int packet_count_;
int cur_network_;
QElapsedTimer *add_station_timer_;
-
+ QString displayFilter_;
// Callbacks for register_tap_listener
static void tapReset(void *ws_dlg_ptr);
virtual const QString filterExpression();
+ // How each item will be exported
+ virtual QList<QVariant> treeItemData(QTreeWidgetItem *) const;
+
private slots:
virtual void fillTree();
void addStationTreeItems();
void updateHeaderLabels();
void captureFileClosing();
+ void filterUpdated(QString filter);
};
#endif // WLANSTATISTICSDIALOG_H