summaryrefslogtreecommitdiff
path: root/ui/qt/capture_interfaces_dialog.cpp
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2016-05-31 12:43:42 -0700
committerGerald Combs <gerald@wireshark.org>2016-05-31 22:09:05 +0000
commit99f4ccb7a0b202af6f8e02252d8b23935e7f4825 (patch)
treeb75e56e430a2f21e58caee5dee62dcf3a446b26f /ui/qt/capture_interfaces_dialog.cpp
parent469719f39d82eaa89646ec8471f91dee884723f6 (diff)
downloadwireshark-99f4ccb7a0b202af6f8e02252d8b23935e7f4825.tar.gz
Qt: Use a standard "Start" button in Capture Options.
QDialogButtonBox does a fine job of creating and managing buttons. Instead of creating our own "Start" button, just rename the "OK" button. This matches what we do elsewhere, e.g. in the Extcap Options dialog. Change-Id: I3c5eec1f01925f7b82c4e7360d685acbe4bb2fea Reviewed-on: https://code.wireshark.org/review/15653 Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/capture_interfaces_dialog.cpp')
-rw-r--r--ui/qt/capture_interfaces_dialog.cpp13
1 files changed, 6 insertions, 7 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();