Capture options dialog: Fix start of capture by double click
This commit is contained in:
parent
460d4c85c2
commit
dd5f86c674
|
@ -233,7 +233,7 @@ CaptureOptionsDialog::CaptureOptionsDialog(QWidget *parent) :
|
||||||
connect(mainApp, SIGNAL(localInterfaceListChanged()), this, SLOT(updateLocalInterfaces()));
|
connect(mainApp, SIGNAL(localInterfaceListChanged()), this, SLOT(updateLocalInterfaces()));
|
||||||
connect(ui->browseButton, SIGNAL(clicked()), this, SLOT(browseButtonClicked()));
|
connect(ui->browseButton, SIGNAL(clicked()), this, SLOT(browseButtonClicked()));
|
||||||
connect(ui->interfaceTree, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(itemClicked(QTreeWidgetItem*,int)));
|
connect(ui->interfaceTree, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(itemClicked(QTreeWidgetItem*,int)));
|
||||||
connect(ui->interfaceTree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(itemDoubleClicked(QTreeWidgetItem*)));
|
connect(ui->interfaceTree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(itemDoubleClicked(QTreeWidgetItem*,int)));
|
||||||
connect(ui->tempDirBrowseButton, SIGNAL(clicked()), this, SLOT(tempDirBrowseButtonClicked()));
|
connect(ui->tempDirBrowseButton, SIGNAL(clicked()), this, SLOT(tempDirBrowseButtonClicked()));
|
||||||
|
|
||||||
ui->tabWidget->setCurrentIndex(0);
|
ui->tabWidget->setCurrentIndex(0);
|
||||||
|
@ -518,29 +518,41 @@ void CaptureOptionsDialog::itemClicked(QTreeWidgetItem *item, int column)
|
||||||
#endif /* HAVE_LIBPCAP */
|
#endif /* HAVE_LIBPCAP */
|
||||||
}
|
}
|
||||||
|
|
||||||
void CaptureOptionsDialog::itemDoubleClicked(QTreeWidgetItem *item)
|
void CaptureOptionsDialog::itemDoubleClicked(QTreeWidgetItem *item, int column)
|
||||||
{
|
{
|
||||||
InterfaceTreeWidgetItem *ti = dynamic_cast<InterfaceTreeWidgetItem *>(item);
|
InterfaceTreeWidgetItem *ti = dynamic_cast<InterfaceTreeWidgetItem *>(item);
|
||||||
if (!ti) return;
|
if (!ti) return;
|
||||||
|
|
||||||
#ifdef HAVE_LIBPCAP
|
switch(column) {
|
||||||
interface_t *device;
|
|
||||||
QString interface_name = ti->text(col_interface_);
|
|
||||||
device = find_device_by_if_name(interface_name);
|
|
||||||
if (!device) return;
|
|
||||||
|
|
||||||
if (device->if_info.type == IF_EXTCAP) {
|
// Double click starts capture just on columns which are not editable
|
||||||
/* this checks if configuration is required and not yet provided or saved via prefs */
|
case col_interface_:
|
||||||
QString device_name = ti->data(col_extcap_, Qt::UserRole).value<QString>();
|
case col_traffic_:
|
||||||
if (extcap_has_configuration((const char *)(device_name.toStdString().c_str()), TRUE))
|
{
|
||||||
{
|
#ifdef HAVE_LIBPCAP
|
||||||
emit showExtcapOptions(device_name, true);
|
interface_t *device;
|
||||||
return;
|
QString interface_name = ti->text(col_interface_);
|
||||||
|
device = find_device_by_if_name(interface_name);
|
||||||
|
if (!device) return;
|
||||||
|
|
||||||
|
if (device->if_info.type == IF_EXTCAP) {
|
||||||
|
/* this checks if configuration is required and not yet provided or saved via prefs */
|
||||||
|
QString device_name = ti->data(col_extcap_, Qt::UserRole).value<QString>();
|
||||||
|
if (extcap_has_configuration((const char *)(device_name.toStdString().c_str()), TRUE))
|
||||||
|
{
|
||||||
|
emit showExtcapOptions(device_name, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif /* HAVE_LIBPCAP */
|
#endif /* HAVE_LIBPCAP */
|
||||||
emit startCapture();
|
emit startCapture();
|
||||||
close();
|
close();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CaptureOptionsDialog::on_gbStopCaptureAuto_toggled(bool checked)
|
void CaptureOptionsDialog::on_gbStopCaptureAuto_toggled(bool checked)
|
||||||
|
|
|
@ -91,7 +91,7 @@ private slots:
|
||||||
void browseButtonClicked();
|
void browseButtonClicked();
|
||||||
void interfaceItemChanged(QTreeWidgetItem *item, int column);
|
void interfaceItemChanged(QTreeWidgetItem *item, int column);
|
||||||
void itemClicked(QTreeWidgetItem *item, int column);
|
void itemClicked(QTreeWidgetItem *item, int column);
|
||||||
void itemDoubleClicked(QTreeWidgetItem *item);
|
void itemDoubleClicked(QTreeWidgetItem *item, int column);
|
||||||
void changeEvent(QEvent* event);
|
void changeEvent(QEvent* event);
|
||||||
void tempDirBrowseButtonClicked();
|
void tempDirBrowseButtonClicked();
|
||||||
|
|
||||||
|
|
|
@ -434,7 +434,10 @@ void InterfaceFrame::on_interfaceTree_doubleClicked(const QModelIndex &index)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
startCapture(interfaces);
|
// Start capture for all columns except the first one with extcap
|
||||||
|
if (IFTREE_COL_EXTCAP != realIndex.column()) {
|
||||||
|
startCapture(interfaces);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBPCAP
|
#ifdef HAVE_LIBPCAP
|
||||||
|
|
Loading…
Reference in New Issue