aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-10-13 17:12:20 -0700
committerMichael Mann <mmann78@netscape.net>2015-12-13 04:25:13 +0000
commit76dd8a27b77aa959d4f6c6fb09c48b2e79d9cd47 (patch)
treeb76e5c210abb2503ffc19276b928fc8d55dc208e
parentf06bbe37c12c7788702cc8649e3da1f18c730931 (diff)
Start deprecating the capture info API.
The GTK+ UI has a capture info dialog which shows a summary of captured protocols, including IPX (!), NetBIOS (!!) and VINES (!!OMG!!). It's been disabled by default since 2006 (g59aa9e40). Remove the preference in the Qt UI capture pane. It's still available via the advanced prefs. Add comments in various parts of the code noting that the capture_info routines and structs are GTK+ only. Also note that if we *do* want to add a Qt capture info dialog we'll probably want to modernize the information we show. Change-Id: I3c63f6f01b60f0767fb33602a7f0c3b537dbde51 Reviewed-on: https://code.wireshark.org/review/10991 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--capture_info.h8
-rw-r--r--capture_opts.h2
-rw-r--r--epan/packet.h5
-rw-r--r--epan/prefs.c2
-rw-r--r--ui/preference_utils.c2
-rw-r--r--ui/qt/capture_info_dialog.cpp3
-rw-r--r--ui/qt/capture_preferences_frame.cpp8
-rw-r--r--ui/qt/capture_preferences_frame.h2
-rw-r--r--ui/qt/capture_preferences_frame.ui11
9 files changed, 20 insertions, 23 deletions
diff --git a/capture_info.h b/capture_info.h
index 46bd72aade..8a72114a8f 100644
--- a/capture_info.h
+++ b/capture_info.h
@@ -23,10 +23,16 @@
/** @file
*
- * capture info functions
+ * Capture info functions.
*
*/
+/*
+ * GTK+ only.
+ * If we add this to the Qt UI we should modernize the statistics we show.
+ * At the very least we should remove or hide IPX and VINES.
+ */
+
#ifndef __CAPTURE_INFO_H__
#define __CAPTURE_INFO_H__
diff --git a/capture_opts.h b/capture_opts.h
index eda550e7c9..082e189072 100644
--- a/capture_opts.h
+++ b/capture_opts.h
@@ -295,7 +295,7 @@ typedef struct capture_options_tag {
/* GUI related */
gboolean real_time_mode; /**< Update list of packets in real time */
- gboolean show_info; /**< show the info dialog */
+ gboolean show_info; /**< show the info dialog. GTK+ only. */
gboolean quit_after_cap; /**< Makes a "capture only mode". Implies -k */
gboolean restart; /**< restart after closing is done */
gchar *orig_save_file; /**< the original capture file name (saved for a restart) */
diff --git a/epan/packet.h b/epan/packet.h
index 4c04c4b119..c585bda83f 100644
--- a/epan/packet.h
+++ b/epan/packet.h
@@ -56,6 +56,11 @@ struct epan_range;
((guint)(offset) + (guint)(len) > (guint)(offset) && \
(guint)(offset) + (guint)(len) <= (guint)(captured_len))
+/*
+ * GTK+ only.
+ * If we add this to the Qt UI we should modernize the statistics we show.
+ * At the very least we should remove or hide IPX and VINES.
+ */
typedef struct _packet_counts {
gint sctp;
gint tcp;
diff --git a/epan/prefs.c b/epan/prefs.c
index 0159bcbd95..ec288b1864 100644
--- a/epan/prefs.c
+++ b/epan/prefs.c
@@ -2280,6 +2280,7 @@ prefs_register_modules(void)
"Save window maximized state at exit?",
&prefs.gui_geometry_save_maximized);
+ /* GTK+ only */
prefs_register_bool_preference(gui_module, "macosx_style",
"Use OS X style",
"Use OS X style (OS X with native GTK only)?",
@@ -2474,6 +2475,7 @@ prefs_register_modules(void)
prefs_register_bool_preference(capture_module, "auto_scroll", "Scroll packet list during capture",
"Scroll packet list during capture?", &prefs.capture_auto_scroll);
+ /* GTK+ only */
prefs_register_bool_preference(capture_module, "show_info", "Show capture info dialog while capturing",
"Show capture info dialog while capturing?", &prefs.capture_show_info);
diff --git a/ui/preference_utils.c b/ui/preference_utils.c
index 0f80ef6742..51265aa5c5 100644
--- a/ui/preference_utils.c
+++ b/ui/preference_utils.c
@@ -241,7 +241,7 @@ prefs_to_capture_opts(void)
/* the same applies to other preferences settings as well. */
global_capture_opts.default_options.promisc_mode = prefs.capture_prom_mode;
global_capture_opts.use_pcapng = prefs.capture_pcap_ng;
- global_capture_opts.show_info = prefs.capture_show_info;
+ global_capture_opts.show_info = prefs.capture_show_info; /* GTK+ only */
global_capture_opts.real_time_mode = prefs.capture_real_time;
auto_scroll_live = prefs.capture_auto_scroll;
#endif /* HAVE_LIBPCAP */
diff --git a/ui/qt/capture_info_dialog.cpp b/ui/qt/capture_info_dialog.cpp
index 01debd8009..9150fc6612 100644
--- a/ui/qt/capture_info_dialog.cpp
+++ b/ui/qt/capture_info_dialog.cpp
@@ -28,6 +28,9 @@
#include "capture_info_dialog.h"
#include "capture_info.h"
+// This is effectively GTK+ only.
+// If we implement this here we should modernize the staticstis we show.
+
/* create the capture info dialog */
/* will keep pointers to the fields in the counts parameter */
void capture_info_ui_create(
diff --git a/ui/qt/capture_preferences_frame.cpp b/ui/qt/capture_preferences_frame.cpp
index 4cf99e2644..82e8202951 100644
--- a/ui/qt/capture_preferences_frame.cpp
+++ b/ui/qt/capture_preferences_frame.cpp
@@ -36,7 +36,6 @@
#include "ui/capture_ui_utils.h"
#include "ui/ui_util.h"
-#include <cstdio>
#include <epan/prefs-int.h>
CapturePreferencesFrame::CapturePreferencesFrame(QWidget *parent) :
@@ -50,7 +49,6 @@ CapturePreferencesFrame::CapturePreferencesFrame(QWidget *parent) :
pref_pcap_ng_ = prefFromPrefPtr(&prefs.capture_pcap_ng);
pref_real_time_ = prefFromPrefPtr(&prefs.capture_real_time);
pref_auto_scroll_ = prefFromPrefPtr(&prefs.capture_auto_scroll);
- pref_show_info_ = prefFromPrefPtr(&prefs.capture_show_info);
// Setting the left margin via a style sheet clobbers its
// appearance.
@@ -108,7 +106,6 @@ void CapturePreferencesFrame::updateWidgets()
ui->capturePcapNgCheckBox->setChecked(pref_pcap_ng_->stashed_val.boolval);
ui->captureRealTimeCheckBox->setChecked(pref_real_time_->stashed_val.boolval);
ui->captureAutoScrollCheckBox->setChecked(pref_auto_scroll_->stashed_val.boolval);
- ui->captureShowInfoCheckBox->setChecked(pref_show_info_->stashed_val.boolval);
#endif // HAVE_LIBPCAP
}
@@ -138,11 +135,6 @@ void CapturePreferencesFrame::on_captureAutoScrollCheckBox_toggled(bool checked)
pref_auto_scroll_->stashed_val.boolval = checked;
}
-void CapturePreferencesFrame::on_captureShowInfoCheckBox_toggled(bool checked)
-{
- pref_show_info_->stashed_val.boolval = checked;
-}
-
/*
* Editor modelines
*
diff --git a/ui/qt/capture_preferences_frame.h b/ui/qt/capture_preferences_frame.h
index 176f0e4f2b..8410291207 100644
--- a/ui/qt/capture_preferences_frame.h
+++ b/ui/qt/capture_preferences_frame.h
@@ -47,7 +47,6 @@ private slots:
void on_capturePcapNgCheckBox_toggled(bool checked);
void on_captureRealTimeCheckBox_toggled(bool checked);
void on_captureAutoScrollCheckBox_toggled(bool checked);
- void on_captureShowInfoCheckBox_toggled(bool checked);
private:
Ui::CapturePreferencesFrame *ui;
@@ -57,7 +56,6 @@ private:
pref_t *pref_pcap_ng_;
pref_t *pref_real_time_;
pref_t *pref_auto_scroll_;
- pref_t *pref_show_info_;
void updateWidgets();
};
diff --git a/ui/qt/capture_preferences_frame.ui b/ui/qt/capture_preferences_frame.ui
index c937b4d357..3664f4068d 100644
--- a/ui/qt/capture_preferences_frame.ui
+++ b/ui/qt/capture_preferences_frame.ui
@@ -98,16 +98,6 @@
</widget>
</item>
<item>
- <widget class="QCheckBox" name="captureShowInfoCheckBox">
- <property name="toolTip">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Show the capture summary dialog while capturing.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
- </property>
- <property name="text">
- <string>Show the capture summary dialog while capturing</string>
- </property>
- </widget>
- </item>
- <item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -122,5 +112,6 @@
</item>
</layout>
</widget>
+ <resources/>
<connections/>
</ui>