diff options
author | Peter Wu <peter@lekensteyn.nl> | 2017-03-10 14:37:18 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2017-03-29 15:16:56 +0000 |
commit | 601fe5e3516b67e709628f9c4a4fa2c2f8918041 (patch) | |
tree | 3db1e0e4b0711496d6726c13e17f9b3e9c734148 /ui/qt/main_welcome.cpp | |
parent | 5eaa9e770533345dfc6664a5d53c6931b00fdc75 (diff) |
Qt: propagate selection from main screen to dialog
Ensure that the selection in main screen is updated on refreshing
interfaces (InterfaceFrame::interfaceListChanged). Add additional
patches to ensure that selection changes from the main screen propagate
to the dialog and be careful to avoid infinite recursions.
Life of a signal for InterfaceFrame:
ui->interfaceTree->selectionModel emits selectionChanged
-> slot InterfaceFrame::interfaceTreeSelectionChanged
-> emits InterfaceFrame::itemSelectionChanged
-> slot MainWelcome::interfaceSelected
-> emits MainWelcome::interfacesChanged
-> slot CaptureInterfacesDialog::interfaceSelected
(updats dialog selection)
Life of a signal for CaptureInterfacesDialog:
ui->interfaceTree emits itemSelectionChanged
-> slot CaptureInterfacesDialog::interfaceSelected
(emission of next signal because sender is ui->interfaceTree)
-> emits CaptureInterfacesDialog::interfacesChanged
-> slot InterfaceFrame::updateSelectedInterfaces
(updates main screen selection)
This should probably be updated to model/view with shared selection
model in the future.
Change-Id: Ibb32c201a92bd2f1310523b3e6e63b03209c9ce4
Reviewed-on: https://code.wireshark.org/review/20487
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'ui/qt/main_welcome.cpp')
-rw-r--r-- | ui/qt/main_welcome.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/qt/main_welcome.cpp b/ui/qt/main_welcome.cpp index 3cf1b8a52d..8832b519dc 100644 --- a/ui/qt/main_welcome.cpp +++ b/ui/qt/main_welcome.cpp @@ -327,6 +327,9 @@ void MainWelcome::interfaceSelected() } else { welcome_ui_->captureFilterComboBox->lineEdit()->setText(user_filter); } + + // Notify others (capture interfaces dialog) that the selection has changed. + emit interfacesChanged(); } #ifdef HAVE_EXTCAP |