From 601fe5e3516b67e709628f9c4a4fa2c2f8918041 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Fri, 10 Mar 2017 14:37:18 +0100 Subject: Qt: propagate selection from main screen to dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Stig Bjørlykke Reviewed-by: Peter Wu --- ui/qt/main_welcome.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ui/qt/main_welcome.cpp') 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 -- cgit v1.2.3