aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/capture_file.h
diff options
context:
space:
mode:
authorGerald Combs <gerald@zing.org>2014-12-21 13:23:02 -0800
committerGerald Combs <gerald@wireshark.org>2014-12-22 18:12:31 +0000
commit5cdad9fe423662e2aea3d63540cd19b7e518b7c3 (patch)
tree16deed9efb4df400a81b564ec1aa5d9f5b1c9c61 /ui/qt/capture_file.h
parent30c3d394adbf8deff83854f01dc1082db9cac598 (diff)
Qt: Add methods to CaptureFile and WiresharkApplication.
Add isValid, fileTitle, and retapPackets methods to CaptureFile. Add application name and title separator convenience methods to WiresharkApplication. Convert traffic tables, conversations, and endpoints to use CaptureFile directly and to let the user know when the capture file is closed. Set the file dialog titles while we're here. Change-Id: I990392786d3833e1e0b3638aa2d34a5ada39fa13 Reviewed-on: https://code.wireshark.org/review/5957 Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/capture_file.h')
-rw-r--r--ui/qt/capture_file.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/ui/qt/capture_file.h b/ui/qt/capture_file.h
index db0cab2b88..224926b461 100644
--- a/ui/qt/capture_file.h
+++ b/ui/qt/capture_file.h
@@ -40,6 +40,23 @@ public:
capture_file *capFile() const { return cap_file_; }
void setCapFile(capture_file *cap_file) { cap_file_ = cap_file; }
+ /** Check capture file validity
+ *
+ * @return true if the file is open, readable, and tappable. false if the file
+ * is closed.
+ */
+ bool isValid() const;
+
+ /** Return a filename suitable for use in a window title.
+ *
+ * @return One of: the basename of the capture file without an extension,
+ * the basename followed by "[closed]", or "[no capture file]".
+ */
+ const QString & fileTitle() { return file_title_; }
+
+ /** Retap the capture file
+ */
+ void retapPackets();
// XXX This shouldn't be needed.
static capture_file *globalCapFile();
@@ -73,7 +90,10 @@ private:
void captureFileEvent(int event, gpointer data);
void captureEvent(int event, capture_session *cap_session);
+ static QString no_capture_file_;
+
capture_file *cap_file_;
+ QString file_title_;
};
#endif // CAPTURE_FILE_H