diff options
author | Gerald Combs <gerald@wireshark.org> | 2017-02-24 09:26:40 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2017-02-26 17:51:33 +0000 |
commit | dcfc288130e0576249f3ba7f8db7ad1681ff70f5 (patch) | |
tree | b1042e7c0395154aca21ad4fb2e956035c368349 /ui/qt/capture_interfaces_dialog.cpp | |
parent | 74f4664f93d94c4d160cc73366b9d5c4fb86a463 (diff) | |
download | wireshark-dcfc288130e0576249f3ba7f8db7ad1681ff70f5.tar.gz |
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>
Diffstat (limited to 'ui/qt/capture_interfaces_dialog.cpp')
-rw-r--r-- | ui/qt/capture_interfaces_dialog.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/ui/qt/capture_interfaces_dialog.cpp b/ui/qt/capture_interfaces_dialog.cpp index e0eb171016..66334959e9 100644 --- a/ui/qt/capture_interfaces_dialog.cpp +++ b/ui/qt/capture_interfaces_dialog.cpp @@ -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(); |