aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ui/qt/capture_interfaces_dialog.cpp13
-rw-r--r--ui/qt/capture_interfaces_dialog.h4
-rw-r--r--ui/qt/capture_interfaces_dialog.ui2
3 files changed, 8 insertions, 11 deletions
diff --git a/ui/qt/capture_interfaces_dialog.cpp b/ui/qt/capture_interfaces_dialog.cpp
index 9a27eb3cf3..42798ed474 100644
--- a/ui/qt/capture_interfaces_dialog.cpp
+++ b/ui/qt/capture_interfaces_dialog.cpp
@@ -175,10 +175,9 @@ CaptureInterfacesDialog::CaptureInterfacesDialog(QWidget *parent) :
stat_cache_ = NULL;
// XXX - Enable / disable as needed
- start_bt_ = ui->buttonBox->addButton(tr("Start"), QDialogButtonBox::AcceptRole);
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Start"));
- start_bt_->setEnabled((global_capture_opts.num_selected > 0)? true: false);
- connect(start_bt_, SIGNAL(clicked(bool)), this, SLOT(startButtonClicked()));
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled((global_capture_opts.num_selected > 0)? true: false);
// Start out with the list *not* sorted, so they show up in the order
// in which they were provided
@@ -228,7 +227,7 @@ void CaptureInterfacesDialog::interfaceSelected()
{
InterfaceTree::updateGlobalDeviceSelections(ui->interfaceTree, col_interface_);
- start_bt_->setEnabled((global_capture_opts.num_selected > 0) ? true: false);
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled((global_capture_opts.num_selected > 0) ? true: false);
emit interfacesChanged();
@@ -265,7 +264,7 @@ void CaptureInterfacesDialog::updateWidgets()
}
ui->compileBPF->setEnabled(can_capture);
- start_bt_->setEnabled(can_capture);
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(can_capture);
}
CaptureInterfacesDialog::~CaptureInterfacesDialog()
@@ -357,7 +356,7 @@ void CaptureInterfacesDialog::on_cbResolveTransportNames_toggled(bool checked)
gbl_resolv_flags.transport_name = checked;
}
-void CaptureInterfacesDialog::startButtonClicked()
+void CaptureInterfacesDialog::on_buttonBox_accepted()
{
if (saveOptionsToPreferences()) {
emit setFilterValid(true, ui->captureFilterComboBox->lineEdit()->text());
@@ -578,7 +577,7 @@ void CaptureInterfacesDialog::updateInterfaces()
}
- start_bt_->setEnabled((global_capture_opts.num_selected > 0)? true: false);
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled((global_capture_opts.num_selected > 0)? true: false);
if (!stat_timer_) {
updateStatistics();
diff --git a/ui/qt/capture_interfaces_dialog.h b/ui/qt/capture_interfaces_dialog.h
index ed3b05e523..0a7f2efa04 100644
--- a/ui/qt/capture_interfaces_dialog.h
+++ b/ui/qt/capture_interfaces_dialog.h
@@ -94,7 +94,7 @@ private slots:
void on_manageButton_clicked();
void on_cbResolveNetworkNames_toggled(bool checked);
void on_cbResolveTransportNames_toggled(bool checked);
- void startButtonClicked();
+ void on_buttonBox_accepted();
void on_buttonBox_rejected();
void on_buttonBox_helpRequested();
void interfaceSelected();
@@ -121,8 +121,6 @@ private:
Ui::CaptureInterfacesDialog *ui;
Qt::CheckState m_pressedItemState;
- QPushButton *start_bt_;
- QPushButton *stop_bt_;
if_stat_cache_t *stat_cache_;
QTimer *stat_timer_;
InterfaceTreeDelegate interface_item_delegate_;
diff --git a/ui/qt/capture_interfaces_dialog.ui b/ui/qt/capture_interfaces_dialog.ui
index cd1f1abdfc..17c648ad8d 100644
--- a/ui/qt/capture_interfaces_dialog.ui
+++ b/ui/qt/capture_interfaces_dialog.ui
@@ -791,7 +791,7 @@ PLEASE NOTE: One option MUST be selected.</string>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
- <set>QDialogButtonBox::Close|QDialogButtonBox::Help</set>
+ <set>QDialogButtonBox::Close|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>