Qt: Enable/disable Capture Interfaces buttons consistently.

The "Compile BPFs" and "Start" buttons need to be enabled and disabled
at the same time and according to the same criteria. Make sure we do so.

Change-Id: I708886564dcf569cd71f936119195209ef6dcbd5
Reviewed-on: https://code.wireshark.org/review/20265
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
Gerald Combs 2017-02-24 09:26:40 -08:00
parent 74f4664f93
commit dcfc288130
1 changed files with 3 additions and 6 deletions

View File

@ -188,11 +188,8 @@ CaptureInterfacesDialog::CaptureInterfacesDialog(QWidget *parent) :
stat_timer_ = NULL;
stat_cache_ = NULL;
// XXX - Enable / disable as needed
ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Start"));
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
ui->interfaceTree->sortByColumn(-1, Qt::AscendingOrder);
@ -231,6 +228,8 @@ CaptureInterfacesDialog::CaptureInterfacesDialog(QWidget *parent) :
connect(this, SIGNAL(ifsChanged()), this, SLOT(refreshInterfaceList()));
connect(wsApp, SIGNAL(localInterfaceListChanged()), this, SLOT(updateLocalInterfaces()));
connect(ui->browseButton, SIGNAL(clicked()), this, SLOT(browseButtonClicked()));
updateWidgets();
}
/* Update global device selections based on the TreeWidget selection. */
@ -273,8 +272,6 @@ void CaptureInterfacesDialog::interfaceSelected()
{
updateGlobalDeviceSelections();
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled((global_capture_opts.num_selected > 0) ? true: false);
emit interfacesChanged();
updateSelectedFilter();
@ -724,7 +721,7 @@ void CaptureInterfacesDialog::updateInterfaces()
}
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled((global_capture_opts.num_selected > 0)? true: false);
updateWidgets();
if (!stat_timer_) {
updateStatistics();