diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2017-03-27 16:17:51 +0200 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-03-28 01:35:54 +0000 |
commit | 4cc0d1e72881f2ce3e975e5e6d0ae735b20791ad (patch) | |
tree | df543466a21ddc26d1e2a433489c89611ad51e76 /ui | |
parent | 0c0f6a650e854672a915ba0c318ba6bb5f16a552 (diff) | |
download | wireshark-4cc0d1e72881f2ce3e975e5e6d0ae735b20791ad.tar.gz |
Qt: the maximum packet size is WTAP_MAX_PACKET_SIZE, not 65535
Also ensure that the update of sparkline does not lose focus of the
spinbox currently edited.
Change-Id: Icf7dd180fe3cb1d8bfab9017f923bf38e6210554
Reviewed-on: https://code.wireshark.org/review/20749
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt/capture_interfaces_dialog.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ui/qt/capture_interfaces_dialog.cpp b/ui/qt/capture_interfaces_dialog.cpp index 66334959e9..cb1253868e 100644 --- a/ui/qt/capture_interfaces_dialog.cpp +++ b/ui/qt/capture_interfaces_dialog.cpp @@ -55,6 +55,8 @@ #include <epan/addr_resolv.h> #include <wsutil/filesystem.h> +#include <wiretap/wtap.h> + #include "qt_ui_utils.h" #include "sparkline_delegate.h" @@ -668,7 +670,7 @@ void CaptureInterfacesDialog::updateInterfaces() if (capture_dev_user_snaplen_find(device->name, &hassnap, &snaplen)) { /* Default snap length set in preferences */ device->snaplen = snaplen; - device->has_snaplen = hassnap; + device->has_snaplen = snaplen == WTAP_MAX_PACKET_SIZE ? FALSE : hassnap; } else { /* No preferences set yet, use default values */ device->snaplen = WTAP_MAX_PACKET_SIZE; @@ -751,6 +753,7 @@ void CaptureInterfacesDialog::updateStatistics(void) { interface_t *device; + disconnect(ui->interfaceTree, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(interfaceItemChanged(QTreeWidgetItem*,int))); for (int row = 0; row < ui->interfaceTree->topLevelItemCount(); row++) { for (guint if_idx = 0; if_idx < global_capture_opts.all_ifaces->len; if_idx++) { @@ -768,6 +771,7 @@ void CaptureInterfacesDialog::updateStatistics(void) ti->setData(col_traffic_, Qt::UserRole, qVariantFromValue(points)); } } + connect(ui->interfaceTree, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(interfaceItemChanged(QTreeWidgetItem*,int))); ui->interfaceTree->viewport()->update(); } @@ -1186,7 +1190,7 @@ QWidget* InterfaceTreeDelegate::createEditor(QWidget *parent, const QStyleOption case col_snaplen_: { QSpinBox *sb = new QSpinBox(parent); - sb->setRange(1, 65535); + sb->setRange(1, WTAP_MAX_PACKET_SIZE); sb->setValue(snap); sb->setWrapping(true); connect(sb, SIGNAL(valueChanged(int)), this, SLOT(snapshotLengthChanged(int))); @@ -1197,7 +1201,7 @@ QWidget* InterfaceTreeDelegate::createEditor(QWidget *parent, const QStyleOption case col_buffer_: { QSpinBox *sb = new QSpinBox(parent); - sb->setRange(1, 65535); + sb->setRange(1, WTAP_MAX_PACKET_SIZE); sb->setValue(buffer); sb->setWrapping(true); connect(sb, SIGNAL(valueChanged(int)), this, SLOT(bufferSizeChanged(int))); |