diff options
author | Jirka Novak <j.novak@netsystem.cz> | 2021-01-10 21:57:47 +0100 |
---|---|---|
committer | AndersBroman <a.broman58@gmail.com> | 2021-01-11 13:30:18 +0000 |
commit | 8dd84917136e763c08be821cef360a225baa089e (patch) | |
tree | 13aac6c668e33c765369b6fe07e677a155b583f0 /ui | |
parent | aad42108e0108b0cd195fa7d22dc34bb35dfac6f (diff) |
Qt framework: Dialogs are correctly notified when capture file was closed
The patch reintroduces WiresharkDialog::captureFileClosed() method and
calls captureFileClosing() and captureFileClosed() in right order.
Both methods call updateWidgets() at its end.
All dialogs were reviewed and captureFileClosing/Closed methods updated
when appropriate.
captureEvent() method in multiple dialogs changed to captureFileClosing/Closed
as it does same actions - looks like old style of detecting of capture
file closing.
Diffstat (limited to 'ui')
34 files changed, 99 insertions, 86 deletions
diff --git a/ui/qt/bluetooth_att_server_attributes_dialog.cpp b/ui/qt/bluetooth_att_server_attributes_dialog.cpp index ebce65996a..b9a6c9fed0 100644 --- a/ui/qt/bluetooth_att_server_attributes_dialog.cpp +++ b/ui/qt/bluetooth_att_server_attributes_dialog.cpp @@ -96,13 +96,13 @@ BluetoothAttServerAttributesDialog::~BluetoothAttServerAttributesDialog() } -void BluetoothAttServerAttributesDialog::captureFileClosing() +void BluetoothAttServerAttributesDialog::captureFileClosed() { ui->interfaceComboBox->setEnabled(FALSE); ui->deviceComboBox->setEnabled(FALSE); ui->removeDuplicatesCheckBox->setEnabled(FALSE); - WiresharkDialog::captureFileClosing(); + WiresharkDialog::captureFileClosed(); } diff --git a/ui/qt/bluetooth_att_server_attributes_dialog.h b/ui/qt/bluetooth_att_server_attributes_dialog.h index e8b35f7dbb..a220de9307 100644 --- a/ui/qt/bluetooth_att_server_attributes_dialog.h +++ b/ui/qt/bluetooth_att_server_attributes_dialog.h @@ -53,6 +53,7 @@ signals: protected: void keyPressEvent(QKeyEvent *event); + void captureFileClosed(); protected slots: void changeEvent(QEvent* event); @@ -67,7 +68,6 @@ private: static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); private slots: - void captureFileClosing(); void on_tableTreeWidget_itemActivated(QTreeWidgetItem *item, int); void on_buttonBox_clicked(QAbstractButton *button); void on_actionMark_Unmark_Cell_triggered(); diff --git a/ui/qt/bluetooth_device_dialog.h b/ui/qt/bluetooth_device_dialog.h index d5860a33f7..5901dfc865 100644 --- a/ui/qt/bluetooth_device_dialog.h +++ b/ui/qt/bluetooth_device_dialog.h @@ -67,6 +67,7 @@ signals: protected: void keyPressEvent(QKeyEvent *event); + void captureFileClosing(); protected slots: void changeEvent(QEvent* event); @@ -84,7 +85,6 @@ private: static void saveItemData(QTableWidgetItem *item, bluetooth_device_tap_t *tap_device, packet_info *pinfo); private slots: - void captureFileClosing(); void setTitle(QString bdAddr, QString name); void on_tableWidget_itemActivated(QTableWidgetItem *item); void on_buttonBox_clicked(QAbstractButton *button); diff --git a/ui/qt/bluetooth_devices_dialog.cpp b/ui/qt/bluetooth_devices_dialog.cpp index 09364f8e70..1048b24a6b 100644 --- a/ui/qt/bluetooth_devices_dialog.cpp +++ b/ui/qt/bluetooth_devices_dialog.cpp @@ -110,12 +110,12 @@ BluetoothDevicesDialog::~BluetoothDevicesDialog() } -void BluetoothDevicesDialog::captureFileClosing() +void BluetoothDevicesDialog::captureFileClosed() { ui->interfaceComboBox->setEnabled(FALSE); ui->showInformationStepsCheckBox->setEnabled(FALSE); - WiresharkDialog::captureFileClosing(); + WiresharkDialog::captureFileClosed(); } diff --git a/ui/qt/bluetooth_devices_dialog.h b/ui/qt/bluetooth_devices_dialog.h index 4d07e1ec2f..3ad0202398 100644 --- a/ui/qt/bluetooth_devices_dialog.h +++ b/ui/qt/bluetooth_devices_dialog.h @@ -53,6 +53,7 @@ signals: protected: void keyPressEvent(QKeyEvent *event); + void captureFileClosed(); protected slots: void changeEvent(QEvent* event); @@ -68,7 +69,6 @@ private: static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); private slots: - void captureFileClosing(); void on_tableTreeWidget_itemActivated(QTreeWidgetItem *item, int); void on_buttonBox_clicked(QAbstractButton *button); void on_actionMark_Unmark_Cell_triggered(); diff --git a/ui/qt/bluetooth_hci_summary_dialog.cpp b/ui/qt/bluetooth_hci_summary_dialog.cpp index be3e424156..0b64c3ee60 100644 --- a/ui/qt/bluetooth_hci_summary_dialog.cpp +++ b/ui/qt/bluetooth_hci_summary_dialog.cpp @@ -151,10 +151,16 @@ void BluetoothHciSummaryDialog::captureFileClosing() { remove_tap_listener(&tapinfo_); + WiresharkDialog::captureFileClosing(); +} + + +void BluetoothHciSummaryDialog::captureFileClosed() +{ ui->interfaceComboBox->setEnabled(FALSE); ui->adapterComboBox->setEnabled(FALSE); - WiresharkDialog::captureFileClosing(); + WiresharkDialog::captureFileClosed(); } diff --git a/ui/qt/bluetooth_hci_summary_dialog.h b/ui/qt/bluetooth_hci_summary_dialog.h index 0595031ffa..61bbac01e7 100644 --- a/ui/qt/bluetooth_hci_summary_dialog.h +++ b/ui/qt/bluetooth_hci_summary_dialog.h @@ -53,6 +53,8 @@ signals: protected: void keyPressEvent(QKeyEvent *event); + void captureFileClosing(); + void captureFileClosed(); protected slots: void changeEvent(QEvent* event); @@ -82,7 +84,6 @@ private: static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); private slots: - void captureFileClosing(); void recursiveCopyTreeItems(QTreeWidgetItem *item, QString ©, int ident_level); void on_tableTreeWidget_itemActivated(QTreeWidgetItem *item, int); void on_buttonBox_clicked(QAbstractButton *button); diff --git a/ui/qt/conversation_dialog.cpp b/ui/qt/conversation_dialog.cpp index eef606339e..e055622f98 100644 --- a/ui/qt/conversation_dialog.cpp +++ b/ui/qt/conversation_dialog.cpp @@ -135,11 +135,16 @@ void ConversationDialog::captureFileClosing() disconnect(cur_tree, SIGNAL(filterAction(QString,FilterAction::Action,FilterAction::ActionType)), this, SIGNAL(filterAction(QString,FilterAction::Action,FilterAction::ActionType))); } + TrafficTableDialog::captureFileClosing(); +} + +void ConversationDialog::captureFileClosed() +{ displayFilterCheckBox()->setEnabled(false); enabledTypesPushButton()->setEnabled(false); follow_bt_->setEnabled(false); graph_bt_->setEnabled(false); - TrafficTableDialog::captureFileClosing(); + TrafficTableDialog::captureFileClosed(); } bool ConversationDialog::addTrafficTable(register_ct_t* table) diff --git a/ui/qt/conversation_dialog.h b/ui/qt/conversation_dialog.h index 95f42e4726..784b0147cc 100644 --- a/ui/qt/conversation_dialog.h +++ b/ui/qt/conversation_dialog.h @@ -52,8 +52,9 @@ public: explicit ConversationDialog(QWidget &parent, CaptureFile &cf, int cli_proto_id = -1, const char *filter = NULL); ~ConversationDialog(); -public slots: +protected: void captureFileClosing(); + void captureFileClosed(); signals: void filterAction(QString filter, FilterAction::Action action, FilterAction::ActionType type); diff --git a/ui/qt/endpoint_dialog.cpp b/ui/qt/endpoint_dialog.cpp index 94f1bdfd7a..4578fd20d3 100644 --- a/ui/qt/endpoint_dialog.cpp +++ b/ui/qt/endpoint_dialog.cpp @@ -117,9 +117,14 @@ void EndpointDialog::captureFileClosing() disconnect(cur_tree, SIGNAL(filterAction(QString,FilterAction::Action,FilterAction::ActionType)), this, SIGNAL(filterAction(QString,FilterAction::Action,FilterAction::ActionType))); } + TrafficTableDialog::captureFileClosing(); +} + +void EndpointDialog::captureFileClosed() +{ displayFilterCheckBox()->setEnabled(false); enabledTypesPushButton()->setEnabled(false); - TrafficTableDialog::captureFileClosing(); + TrafficTableDialog::captureFileClosed(); } bool EndpointDialog::addTrafficTable(register_ct_t *table) diff --git a/ui/qt/endpoint_dialog.h b/ui/qt/endpoint_dialog.h index a30aee277a..e1aec0efe8 100644 --- a/ui/qt/endpoint_dialog.h +++ b/ui/qt/endpoint_dialog.h @@ -59,8 +59,9 @@ public: signals: -public slots: +protected: void captureFileClosing(); + void captureFileClosed(); private: #ifdef HAVE_MAXMINDDB diff --git a/ui/qt/follow_stream_dialog.cpp b/ui/qt/follow_stream_dialog.cpp index ef2846d61e..2489f75e93 100644 --- a/ui/qt/follow_stream_dialog.cpp +++ b/ui/qt/follow_stream_dialog.cpp @@ -144,8 +144,6 @@ FollowStreamDialog::FollowStreamDialog(QWidget &parent, CaptureFile &cf, follow_ this, SLOT(fillHintLabel(int))); connect(ui->teStreamContent, SIGNAL(mouseClickedOnTextCursorPosition(int)), this, SLOT(goToPacketForTextPos(int))); - connect(&cap_file_, SIGNAL(captureEvent(CaptureEvent)), - this, SLOT(captureEvent(CaptureEvent))); fillHintLabel(-1); } @@ -1061,15 +1059,12 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index, return true; } -void FollowStreamDialog::captureEvent(CaptureEvent e) +void FollowStreamDialog::captureFileClosed() { - if ((e.captureContext() == CaptureEvent::File) && - (e.eventType() == CaptureEvent::Closing)) { - QString tooltip = tr("File closed."); - ui->streamNumberSpinBox->setToolTip(tooltip); - ui->streamNumberLabel->setToolTip(tooltip); - WiresharkDialog::captureFileClosing(); - } + QString tooltip = tr("File closed."); + ui->streamNumberSpinBox->setToolTip(tooltip); + ui->streamNumberLabel->setToolTip(tooltip); + WiresharkDialog::captureFileClosed(); } /* diff --git a/ui/qt/follow_stream_dialog.h b/ui/qt/follow_stream_dialog.h index d6cbfeebf1..ec2ad3cf75 100644 --- a/ui/qt/follow_stream_dialog.h +++ b/ui/qt/follow_stream_dialog.h @@ -45,12 +45,10 @@ public: void addCodecs(const QMap<QString, QTextCodec *> &codecMap); bool follow(QString previous_filter = QString(), bool use_stream_index = false, guint stream_num = 0, guint sub_stream_num = 0); -public slots: - void captureEvent(CaptureEvent e); - protected: bool eventFilter(QObject *obj, QEvent *event); void keyPressEvent(QKeyEvent *event); + void captureFileClosed(); private slots: void on_cbCharset_currentIndexChanged(int idx); diff --git a/ui/qt/iax2_analysis_dialog.cpp b/ui/qt/iax2_analysis_dialog.cpp index 098b43e942..4a66fbb1ab 100644 --- a/ui/qt/iax2_analysis_dialog.cpp +++ b/ui/qt/iax2_analysis_dialog.cpp @@ -391,8 +391,6 @@ Iax2AnalysisDialog::Iax2AnalysisDialog(QWidget &parent, CaptureFile &cf) : this, SLOT(updateWidgets())); connect(ui->reverseTreeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(updateWidgets())); - connect(&cap_file_, SIGNAL(captureEvent(CaptureEvent)), - this, SLOT(captureEvent(CaptureEvent))); updateWidgets(); registerTapListener("IAX2", this, Q_NULLPTR, 0, tapReset, tapPacket, tapDraw); @@ -410,15 +408,6 @@ Iax2AnalysisDialog::~Iax2AnalysisDialog() delete rev_tempfile_; } -void Iax2AnalysisDialog::captureEvent(CaptureEvent e) -{ - if ((e.captureContext() == CaptureEvent::File) && - (e.eventType() == CaptureEvent::Closing)) - { - updateWidgets(); - } -} - void Iax2AnalysisDialog::updateWidgets() { bool enable_tab = false; diff --git a/ui/qt/iax2_analysis_dialog.h b/ui/qt/iax2_analysis_dialog.h index e03a524e3d..e069d85243 100644 --- a/ui/qt/iax2_analysis_dialog.h +++ b/ui/qt/iax2_analysis_dialog.h @@ -56,7 +56,6 @@ signals: void goToPacket(int packet_num); protected slots: - void captureEvent(CaptureEvent e); virtual void updateWidgets(); private slots: diff --git a/ui/qt/lte_mac_statistics_dialog.cpp b/ui/qt/lte_mac_statistics_dialog.cpp index 51d8113507..73087dbb5d 100644 --- a/ui/qt/lte_mac_statistics_dialog.cpp +++ b/ui/qt/lte_mac_statistics_dialog.cpp @@ -866,7 +866,6 @@ void LteMacStatisticsDialog::updateHeaderLabels() void LteMacStatisticsDialog::captureFileClosing() { remove_tap_listener(this); - updateWidgets(); WiresharkDialog::captureFileClosing(); } diff --git a/ui/qt/lte_mac_statistics_dialog.h b/ui/qt/lte_mac_statistics_dialog.h index 6d11873d3e..2ea8832327 100644 --- a/ui/qt/lte_mac_statistics_dialog.h +++ b/ui/qt/lte_mac_statistics_dialog.h @@ -43,6 +43,7 @@ public: ~LteMacStatisticsDialog(); protected: + void captureFileClosing(); private: // Extra controls needed for this dialog. @@ -73,7 +74,6 @@ private: private slots: virtual void fillTree(); void updateHeaderLabels(); - void captureFileClosing(); void filterUpdated(QString filter); }; diff --git a/ui/qt/lte_rlc_statistics_dialog.cpp b/ui/qt/lte_rlc_statistics_dialog.cpp index 0bd58aad68..7325137824 100644 --- a/ui/qt/lte_rlc_statistics_dialog.cpp +++ b/ui/qt/lte_rlc_statistics_dialog.cpp @@ -915,7 +915,6 @@ void LteRlcStatisticsDialog::updateHeaderLabels() void LteRlcStatisticsDialog::captureFileClosing() { remove_tap_listener(this); - updateWidgets(); WiresharkDialog::captureFileClosing(); } diff --git a/ui/qt/lte_rlc_statistics_dialog.h b/ui/qt/lte_rlc_statistics_dialog.h index aedaa22bd8..2c5f2e481d 100644 --- a/ui/qt/lte_rlc_statistics_dialog.h +++ b/ui/qt/lte_rlc_statistics_dialog.h @@ -26,6 +26,7 @@ public: void incFrameCount() { ++packet_count_; } protected: + void captureFileClosing(); signals: void launchRLCGraph(bool channelKnown, @@ -60,8 +61,6 @@ private slots: virtual void fillTree(); void updateItemSelectionChanged(); - void captureFileClosing(); - void useRLCFramesFromMacCheckBoxToggled(bool state); void launchULGraphButtonClicked(); void launchDLGraphButtonClicked(); diff --git a/ui/qt/multicast_statistics_dialog.cpp b/ui/qt/multicast_statistics_dialog.cpp index c6076c3a05..6f2935f055 100644 --- a/ui/qt/multicast_statistics_dialog.cpp +++ b/ui/qt/multicast_statistics_dialog.cpp @@ -243,9 +243,6 @@ MulticastStatisticsDialog::MulticastStatisticsDialog(QWidget &parent, CaptureFil connect(this, SIGNAL(updateFilter(QString)), this, SLOT(updateMulticastParameters())); - connect(&cap_file_, SIGNAL(captureEvent(CaptureEvent)), - this, SLOT(captureEvent(CaptureEvent))); - /* Register the tap listener */ register_tap_listener_mcast_stream(tapinfo_); @@ -449,17 +446,12 @@ void MulticastStatisticsDialog::fillTree() updateWidgets(); } -void MulticastStatisticsDialog::captureEvent(CaptureEvent e) +void MulticastStatisticsDialog::captureFileClosing() { - if ((e.captureContext() == CaptureEvent::File) && - (e.eventType() == CaptureEvent::Closing)) - { - /* Remove the stream tap listener */ - remove_tap_listener_mcast_stream(tapinfo_); + /* Remove the stream tap listener */ + remove_tap_listener_mcast_stream(tapinfo_); - updateWidgets(); - WiresharkDialog::captureFileClosing(); - } + WiresharkDialog::captureFileClosing(); } // Stat command + args diff --git a/ui/qt/multicast_statistics_dialog.h b/ui/qt/multicast_statistics_dialog.h index 40c72d216b..4c91f5f4db 100644 --- a/ui/qt/multicast_statistics_dialog.h +++ b/ui/qt/multicast_statistics_dialog.h @@ -23,6 +23,9 @@ public: MulticastStatisticsDialog(QWidget &parent, CaptureFile &cf, const char *filter = NULL); ~MulticastStatisticsDialog(); +protected: + void captureFileClosing(); + private: struct _mcaststream_tapinfo *tapinfo_; SyntaxLineEdit *burst_measurement_interval_le_; @@ -43,7 +46,6 @@ private slots: void updateWidgets(); void updateMulticastParameters(); virtual void fillTree(); - void captureEvent(CaptureEvent e); }; #endif // MULTICASTSTATISTICSDIALOG_H diff --git a/ui/qt/packet_dialog.h b/ui/qt/packet_dialog.h index 09a305d015..ebc4e6e84e 100644 --- a/ui/qt/packet_dialog.h +++ b/ui/qt/packet_dialog.h @@ -33,6 +33,9 @@ public: explicit PacketDialog(QWidget &parent, CaptureFile &cf, frame_data *fdata); ~PacketDialog(); +protected: + void captureFileClosing(); + signals: void showProtocolPreferences(const QString module_name); void editProtocolPreference(struct preference *pref, struct pref_module *module); @@ -40,7 +43,6 @@ signals: private slots: void on_buttonBox_helpRequested(); - void captureFileClosing(); void setHintText(FieldInformation *); private: diff --git a/ui/qt/rtp_analysis_dialog.cpp b/ui/qt/rtp_analysis_dialog.cpp index 6b26513e16..9406c06dc9 100644 --- a/ui/qt/rtp_analysis_dialog.cpp +++ b/ui/qt/rtp_analysis_dialog.cpp @@ -391,12 +391,6 @@ RtpAnalysisDialog::~RtpAnalysisDialog() delete rev_tempfile_; } -// TODO: Can be removed if not used to fix issue with disabling buttons -void RtpAnalysisDialog::captureFileClosing() -{ - WiresharkDialog::captureFileClosing(); -} - void RtpAnalysisDialog::updateWidgets() { bool enable_tab = false; diff --git a/ui/qt/rtp_analysis_dialog.h b/ui/qt/rtp_analysis_dialog.h index 20c3f9f80a..9e3321ab8d 100644 --- a/ui/qt/rtp_analysis_dialog.h +++ b/ui/qt/rtp_analysis_dialog.h @@ -44,9 +44,6 @@ public: signals: void goToPacket(int packet_num); -protected: - virtual void captureFileClosing(); - protected slots: virtual void updateWidgets(); diff --git a/ui/qt/rtp_stream_dialog.cpp b/ui/qt/rtp_stream_dialog.cpp index 2fe278a282..bc63b4b290 100644 --- a/ui/qt/rtp_stream_dialog.cpp +++ b/ui/qt/rtp_stream_dialog.cpp @@ -543,14 +543,19 @@ QList<QVariant> RtpStreamDialog::streamRowData(int row) const void RtpStreamDialog::captureFileClosing() { - ui->todCheckBox->setEnabled(false); - ui->displayFilterCheckBox->setEnabled(false); - remove_tap_listener_rtpstream(&tapinfo_); WiresharkDialog::captureFileClosing(); } +void RtpStreamDialog::captureFileClosed() +{ + ui->todCheckBox->setEnabled(false); + ui->displayFilterCheckBox->setEnabled(false); + + WiresharkDialog::captureFileClosed(); +} + void RtpStreamDialog::showStreamMenu(QPoint pos) { ui->actionGoToSetup->setEnabled(!file_closed_); diff --git a/ui/qt/rtp_stream_dialog.h b/ui/qt/rtp_stream_dialog.h index 0d048d9eb2..1ba02c476d 100644 --- a/ui/qt/rtp_stream_dialog.h +++ b/ui/qt/rtp_stream_dialog.h @@ -45,6 +45,8 @@ public slots: protected: bool eventFilter(QObject *obj, QEvent *event); + void captureFileClosing(); + void captureFileClosed(); private: Ui::RtpStreamDialog *ui; @@ -72,7 +74,6 @@ private: private slots: - void captureFileClosing(); void showStreamMenu(QPoint pos); void on_actionCopyAsCsv_triggered(); void on_actionCopyAsYaml_triggered(); diff --git a/ui/qt/show_packet_bytes_dialog.cpp b/ui/qt/show_packet_bytes_dialog.cpp index fc1b5249a7..4b406864c2 100644 --- a/ui/qt/show_packet_bytes_dialog.cpp +++ b/ui/qt/show_packet_bytes_dialog.cpp @@ -760,6 +760,13 @@ void ShowPacketBytesDialog::updatePacketBytes(void) void ShowPacketBytesDialog::captureFileClosing() { + finfo_ = NULL; // This will invalidate the source backend + + WiresharkDialog::captureFileClosing(); +} + +void ShowPacketBytesDialog::captureFileClosed() +{ // We have lost the source backend and must disable all functions // for manipulating decoding and displayed range. @@ -771,9 +778,7 @@ void ShowPacketBytesDialog::captureFileClosing() ui->lEnd->setEnabled(false); ui->sbEnd->setEnabled(false); - finfo_ = NULL; // This will invalidate the source backend - - WiresharkDialog::captureFileClosing(); + WiresharkDialog::captureFileClosed(); } void ShowPacketBytesTextEdit::contextMenuEvent(QContextMenuEvent *event) diff --git a/ui/qt/show_packet_bytes_dialog.h b/ui/qt/show_packet_bytes_dialog.h index 554baa600e..aa38a7c78d 100644 --- a/ui/qt/show_packet_bytes_dialog.h +++ b/ui/qt/show_packet_bytes_dialog.h @@ -40,12 +40,11 @@ public: void addCodecs(const QMap<QString, QTextCodec *> &codecMap); -public slots: - void captureFileClosing(); - protected: bool eventFilter(QObject *obj, QEvent *event); void keyPressEvent(QKeyEvent *event); + void captureFileClosing(); + void captureFileClosed(); private slots: void on_sbStart_valueChanged(int value); diff --git a/ui/qt/voip_calls_dialog.cpp b/ui/qt/voip_calls_dialog.cpp index ce4c302137..c1b69fef61 100644 --- a/ui/qt/voip_calls_dialog.cpp +++ b/ui/qt/voip_calls_dialog.cpp @@ -140,9 +140,7 @@ void VoipCallsDialog::captureFileClosing() { // The time formatting is currently provided by VoipCallsInfoModel, but when // the cache is active, the ToD cannot be modified. - ui->todCheckBox->setEnabled(false); cache_model_->setSourceModel(NULL); - ui->displayFilterCheckBox->setEnabled(false); if (!voip_calls_tap_listeners_removed_) { voip_calls_remove_all_tap_listeners(&tapinfo_); voip_calls_tap_listeners_removed_ = true; @@ -152,6 +150,16 @@ void VoipCallsDialog::captureFileClosing() WiresharkDialog::captureFileClosing(); } +void VoipCallsDialog::captureFileClosed() +{ + // The time formatting is currently provided by VoipCallsInfoModel, but when + // the cache is active, the ToD cannot be modified. + ui->todCheckBox->setEnabled(false); + ui->displayFilterCheckBox->setEnabled(false); + + WiresharkDialog::captureFileClosed(); +} + void VoipCallsDialog::contextMenuEvent(QContextMenuEvent *event) { bool selected = ui->callTreeView->selectionModel()->hasSelection(); diff --git a/ui/qt/voip_calls_dialog.h b/ui/qt/voip_calls_dialog.h index 82a66fdc0d..4f80ce249d 100644 --- a/ui/qt/voip_calls_dialog.h +++ b/ui/qt/voip_calls_dialog.h @@ -55,6 +55,8 @@ public slots: protected: void contextMenuEvent(QContextMenuEvent *event); virtual void removeTapListeners(); + void captureFileClosing(); + void captureFileClosed(); protected slots: void changeEvent(QEvent* event); @@ -90,7 +92,6 @@ private: QList<QVariant> streamRowData(int row) const; private slots: - void captureFileClosing(); void selectAll(); void selectNone(); void copyAsCSV(); diff --git a/ui/qt/wireshark_dialog.cpp b/ui/qt/wireshark_dialog.cpp index a15a615f8a..a582f740e0 100644 --- a/ui/qt/wireshark_dialog.cpp +++ b/ui/qt/wireshark_dialog.cpp @@ -135,8 +135,8 @@ void WiresharkDialog::captureEvent(CaptureEvent e) captureFileClosing(); break; case CaptureEvent::Closed: - captureFileClosing(); file_closed_ = true; + captureFileClosed(); break; default: break; @@ -168,13 +168,15 @@ void WiresharkDialog::removeTapListeners() void WiresharkDialog::captureFileClosing() { - if (file_closed_) - return; - removeTapListeners(); updateWidgets(); } +void WiresharkDialog::captureFileClosed() +{ + updateWidgets(); +} + /* * Editor modelines * diff --git a/ui/qt/wireshark_dialog.h b/ui/qt/wireshark_dialog.h index fc6ef54d1d..5b1ca795af 100644 --- a/ui/qt/wireshark_dialog.h +++ b/ui/qt/wireshark_dialog.h @@ -117,10 +117,19 @@ protected: /** * @brief Called when the capture file is about to close. This can be + * used to disconnect taps and similar actions. + * updateWidgets() is called at the end. + * To enable/disable widgets captureFileClosed() is more suitable. + */ + virtual void captureFileClosing(); + + /** + * @brief Called when the capture file was closed. This can be * used to enable or disable widgets according to the state of * file_closed_. + * updateWidgets() is called at the end. */ - virtual void captureFileClosing(); + virtual void captureFileClosed(); protected slots: void captureEvent(CaptureEvent); diff --git a/ui/qt/wlan_statistics_dialog.cpp b/ui/qt/wlan_statistics_dialog.cpp index 21a803945b..e008bee3fe 100644 --- a/ui/qt/wlan_statistics_dialog.cpp +++ b/ui/qt/wlan_statistics_dialog.cpp @@ -693,7 +693,6 @@ void WlanStatisticsDialog::updateHeaderLabels() void WlanStatisticsDialog::captureFileClosing() { remove_tap_listener(this); - updateWidgets(); WiresharkDialog::captureFileClosing(); } diff --git a/ui/qt/wlan_statistics_dialog.h b/ui/qt/wlan_statistics_dialog.h index b7fff75540..fc63a532cc 100644 --- a/ui/qt/wlan_statistics_dialog.h +++ b/ui/qt/wlan_statistics_dialog.h @@ -24,6 +24,7 @@ public: ~WlanStatisticsDialog(); protected: + void captureFileClosing(); private: int packet_count_; @@ -46,7 +47,6 @@ private slots: virtual void fillTree(); void addStationTreeItems(); void updateHeaderLabels(); - void captureFileClosing(); void filterUpdated(QString filter); }; |