Wireshark (Qt): The lower left status bar reports "Ready to load or capture" when a live capture is active

10947 Qt Wireshark - The lower left status bar reports "Ready to load or capture" when a live capture is active

Reported by Jim Young

Bug: 10947
Change-Id: I7dcd5081194bbeab43fef4d994220ac3ea23f536
Reviewed-on: https://code.wireshark.org/review/8067
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
This commit is contained in:
Alexis La Goutte 2015-04-13 20:47:31 +02:00
parent e580b919bc
commit 1fa0e72d53
1 changed files with 25 additions and 0 deletions

View File

@ -753,9 +753,25 @@ void MainWindow::startCapture() {
CaptureFile::globalCapFile()->window = this;
if (capture_start(&global_capture_opts, &cap_session_, main_window_update)) {
capture_options *capture_opts = cap_session_.capture_opts;
GString *interface_names;
/* enable autoscroll timer as needed. */
packet_list_->setAutoScroll(main_ui_->actionGoAutoScroll->isChecked());
/* Add "interface name<live capture in progress>" on main status bar */
interface_names = get_iface_list_string(capture_opts, 0);
if (strlen (interface_names->str) > 0) {
g_string_append(interface_names, ":");
}
g_string_append(interface_names, " ");
main_ui_->statusBar->popFileStatus();
QString msg = QString().sprintf("%s<live capture in progress>", interface_names->str);
QString msgtip = QString().sprintf("to file: %s", (capture_opts->save_file) ? capture_opts->save_file : "");
main_ui_->statusBar->pushFileStatus(msg, msgtip);
g_string_free(interface_names, TRUE);
/* The capture succeeded, which means the capture filter syntax is
valid; add this capture filter to the recent capture filter list. */
for (i = 0; i < global_capture_opts.ifaces->len; i++) {
@ -852,6 +868,15 @@ void MainWindow::stopCapture() {
capture_stop(&cap_session_);
#endif // HAVE_LIBPCAP
/* Pop the "<live capture in progress>" message off the status bar. */
main_ui_->statusBar->popFileStatus();
QString msg = QString().sprintf("%s", get_basename(capture_file_.capFile()->filename));
QString msgtip = QString("%1 (%2)")
.arg(capture_file_.capFile()->filename)
.arg(file_size_to_qstring(capture_file_.capFile()->f_datalen));
main_ui_->statusBar->pushFileStatus(msg, msgtip);
/* disable autoscroll timer if any. */
packet_list_->setAutoScroll(false);
}