Allow "capture info data" to not be a singleton.
[metze/wireshark/wip.git] / ui / qt / main_window_slots.cpp
index 2579f02169fa31aff375b8b505b950f2f9354c11..cb6f8eff0f9787b818b6fe94b8dc3fbc9502d769 100644 (file)
 
 #include <config.h>
 
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
+// Qt 5.5.0 + Visual C++ 2013
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4996)
 #endif
 
 #include "main_window.h"
@@ -34,7 +32,6 @@
 
 #ifdef _WIN32
 #include <windows.h>
-#include <io.h>
 #endif
 
 #ifdef HAVE_LIBPCAP
 
 #include "wsutil/file_util.h"
 #include "wsutil/filesystem.h"
-#include <wsutil/str_util.h>
+#include "wsutil/str_util.h"
 
 #include "epan/addr_resolv.h"
-#include "epan/color_dissector_filters.h"
+#include "epan/dissector_filters.h"
 #include "epan/column.h"
 #include "epan/dfilter/dfilter-macro.h"
 #include "epan/epan_dissect.h"
 #include "lbm_lbtru_transport_dialog.h"
 #include "lte_mac_statistics_dialog.h"
 #include "lte_rlc_statistics_dialog.h"
+#include "lte_rlc_graph_dialog.h"
 #include "mtp3_summary_dialog.h"
 #include "multicast_statistics_dialog.h"
 #include "packet_comment_dialog.h"
@@ -292,6 +290,9 @@ void MainWindow::filterPackets(QString new_filter, bool force)
     } else {
         emit displayFilterSuccess(false);
     }
+    if (packet_list_) {
+        packet_list_->resetColumns();
+    }
 }
 
 // A new layout should be applied when it differs from the old layout AND
@@ -304,7 +305,11 @@ void MainWindow::layoutPanes()
     QVector<unsigned> new_layout = QVector<unsigned>() << prefs.gui_layout_type
                                                        << prefs.gui_layout_content_1
                                                        << prefs.gui_layout_content_2
-                                                       << prefs.gui_layout_content_3;
+                                                       << prefs.gui_layout_content_3
+                                                       << recent.packet_list_show
+                                                       << recent.tree_view_show
+                                                       << recent.byte_view_show;
+
     if (cur_layout_ == new_layout) return;
 
     QSplitter *parents[3];
@@ -451,6 +456,11 @@ void MainWindow::layoutToolbars()
     }
 
     main_ui_->mainToolBar->setToolButtonStyle(tbstyle);
+
+    main_ui_->mainToolBar->setVisible(recent.main_toolbar_show);
+    main_ui_->displayFilterToolBar->setVisible(recent.filter_toolbar_show);
+    main_ui_->wirelessToolBar->setVisible(recent.wireless_toolbar_show);
+    main_ui_->statusBar->setVisible(recent.statusbar_show);
 }
 
 void MainWindow::updatePreferenceActions()
@@ -463,6 +473,31 @@ void MainWindow::updatePreferenceActions()
     main_ui_->actionGoAutoScroll->setChecked(prefs.capture_auto_scroll);
 }
 
+void MainWindow::updateRecentActions()
+{
+    main_ui_->actionViewMainToolbar->setChecked(recent.main_toolbar_show);
+    main_ui_->actionViewFilterToolbar->setChecked(recent.filter_toolbar_show);
+    main_ui_->actionViewWirelessToolbar->setChecked(recent.wireless_toolbar_show);
+    main_ui_->actionViewStatusBar->setChecked(recent.statusbar_show);
+    main_ui_->actionViewPacketList->setChecked(recent.packet_list_show);
+    main_ui_->actionViewPacketDetails->setChecked(recent.tree_view_show);
+    main_ui_->actionViewPacketBytes->setChecked(recent.byte_view_show);
+
+    foreach (QAction* tda, td_actions.keys()) {
+        if (recent.gui_time_format == td_actions[tda]) {
+            tda->setChecked(true);
+        }
+    }
+    foreach (QAction* tpa, tp_actions.keys()) {
+        if (recent.gui_time_precision == tp_actions[tpa]) {
+            tpa->setChecked(true);
+        }
+    }
+    main_ui_->actionViewTimeDisplaySecondsWithHoursAndMinutes->setChecked(recent.gui_seconds_format == TS_SECONDS_HOUR_MIN_SEC);
+
+    main_ui_->actionViewColorizePacketList->setChecked(recent.packet_list_colorize);
+}
+
 void MainWindow::filterAction(QString &action_filter, FilterAction::Action action, FilterAction::ActionType type)
 {
     QString cur_filter, new_filter;
@@ -657,6 +692,8 @@ void MainWindow::captureFileReadStarted(const QString &action) {
     QString msgtip = QString();
     main_ui_->statusBar->pushFileStatus(msg, msgtip);
     main_ui_->mainStack->setCurrentWidget(&master_split_);
+    main_ui_->actionAnalyzeReloadLuaPlugins->setEnabled(false);
+
     WiresharkApplication::processEvents();
 }
 
@@ -680,39 +717,32 @@ void MainWindow::captureFileReadFinished() {
     setForCapturedPackets(true);
 
     main_ui_->statusBar->setFileName(capture_file_);
+    main_ui_->actionAnalyzeReloadLuaPlugins->setEnabled(true);
 
     packet_list_->captureFileReadFinished();
 
     emit setDissectedCaptureFile(capture_file_.capFile());
 }
 
-// Our event loop becomes nested whenever we call update_progress_dlg, which
-// includes several places in file.c. The GTK+ UI stays out of trouble by
-// showing a modal progress dialog. We attempt to do the equivalent below by
-// disabling parts of the main window. At a minumum the ProgressFrame in the
-// main status bar must remain accessible.
-//
-// We might want to do this any time the main status bar progress frame is
-// shown and hidden.
 void MainWindow::captureFileRetapStarted()
 {
     // XXX Push a status message?
-    main_ui_->actionFileClose->setEnabled(false);
-    main_ui_->actionViewReload->setEnabled(false);
-    main_ui_->centralWidget->setEnabled(false);
+    freeze();
 }
 
 void MainWindow::captureFileRetapFinished()
 {
-    main_ui_->actionFileClose->setEnabled(true);
-    main_ui_->actionViewReload->setEnabled(true);
-    main_ui_->centralWidget->setEnabled(true);
+    thaw();
+}
+
+void MainWindow::captureFileFlushTapsData()
+{
+    draw_tap_listeners(FALSE);
 }
 
 void MainWindow::captureFileClosing() {
     setMenusForCaptureFile(true);
     setForCapturedPackets(false);
-    setMenusForSelectedPacket();
     setForCaptureInProgress(false);
 
     // Reset expert information indicator
@@ -728,13 +758,16 @@ void MainWindow::captureFileClosed() {
 
     file_set_dialog_.fileClosed();
     setMenusForFileSet(false);
+    setWindowModified(false);
 
     // Reset expert information indicator
     main_ui_->statusBar->captureFileClosing();
 
     main_ui_->statusBar->popFileStatus();
 
-    setTitlebarForSelectedTreeRow();
+    setDefaultWindowTitle();
+    setWindowIcon(wsApp->normalIcon());
+    setMenusForSelectedPacket();
     setMenusForSelectedTreeRow();
 
     if (!global_capture_opts.multi_files_on)
@@ -753,13 +786,13 @@ void MainWindow::filterExpressionsChanged()
     // Recreate filter buttons
     foreach (QAction *act, main_ui_->displayFilterToolBar->actions()) {
         // Permanent actions shouldn't have data
-        if (act->property(dfe_property_).isValid() || act->isSeparator()) {
+        if (act->property(dfe_property_).isValid()) {
             main_ui_->displayFilterToolBar->removeAction(act);
             delete act;
         }
     }
 
-    bool first = true;
+    // XXX Add a context menu for removing and changing buttons.
     for (struct filter_expression *fe = *pfilter_expression_head; fe != NULL; fe = fe->next) {
         if (!fe->enabled) continue;
         QAction *dfb_action = new QAction(fe->label, main_ui_->displayFilterToolBar);
@@ -768,10 +801,6 @@ void MainWindow::filterExpressionsChanged()
         dfb_action->setProperty(dfe_property_, true);
         main_ui_->displayFilterToolBar->addAction(dfb_action);
         connect(dfb_action, SIGNAL(triggered()), this, SLOT(displayFilterButtonClicked()));
-        if (first) {
-            first = false;
-            main_ui_->displayFilterToolBar->insertSeparator(dfb_action);
-        }
     }
 }
 
@@ -794,8 +823,6 @@ void MainWindow::startCapture() {
         return;
     }
 
-    main_ui_->mainStack->setCurrentWidget(&master_split_);
-
     // Ideally we should have disabled the start capture
     // toolbar buttons and menu items. This may not be the
     // case, e.g. with QtMacExtras.
@@ -806,6 +833,8 @@ void MainWindow::startCapture() {
         return;
     }
 
+    main_ui_->mainStack->setCurrentWidget(&master_split_);
+
     /* XXX - we might need to init other pref data as well... */
 
     /* XXX - can this ever happen? */
@@ -820,12 +849,12 @@ void MainWindow::startCapture() {
     collect_ifaces(&global_capture_opts);
 
     CaptureFile::globalCapFile()->window = this;
-    if (capture_start(&global_capture_opts, &cap_session_, main_window_update)) {
+    if (capture_start(&global_capture_opts, &cap_session_, &info_data_, 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());
+        packet_list_->setVerticalAutoScroll(main_ui_->actionGoAutoScroll->isChecked());
 
         /* Add "interface name<live capture in progress>" on main status bar */
         interface_names = get_iface_list_string(capture_opts, 0);
@@ -940,7 +969,7 @@ void MainWindow::stopCapture() {
     main_ui_->statusBar->setFileName(capture_file_);
 
     /* disable autoscroll timer if any. */
-    packet_list_->setAutoScroll(false);
+    packet_list_->setVerticalAutoScroll(false);
 }
 
 // Keep focus rects from showing through the welcome screen. Primarily for
@@ -1017,7 +1046,7 @@ void MainWindow::recentActionTriggered() {
 
 void MainWindow::setMenusForSelectedPacket()
 {
-    gboolean is_ip = FALSE, is_tcp = FALSE, is_udp = FALSE, is_sctp = FALSE, is_ssl = FALSE, is_rtp = FALSE;
+    gboolean is_ip = FALSE, is_tcp = FALSE, is_udp = FALSE, is_sctp = FALSE, is_ssl = FALSE, is_rtp = FALSE, is_lte_rlc = FALSE;
 
     /* Making the menu context-sensitive allows for easier selection of the
        desired item and has the added benefit, with large captures, of
@@ -1068,7 +1097,9 @@ void MainWindow::setMenusForSelectedPacket()
 
         if (capture_file_.capFile()->edt)
         {
-            proto_get_frame_protocols(capture_file_.capFile()->edt->pi.layers, &is_ip, &is_tcp, &is_udp, &is_sctp, &is_ssl, &is_rtp);
+            proto_get_frame_protocols(capture_file_.capFile()->edt->pi.layers,
+                                      &is_ip, &is_tcp, &is_udp, &is_sctp,
+                                      &is_ssl, &is_rtp, &is_lte_rlc);
         }
     }
 
@@ -1135,16 +1166,16 @@ void MainWindow::setMenusForSelectedPacket()
     packet_list_->conversationMenu()->clear();
     packet_list_->colorizeMenu()->clear();
 
-    for (GList *color_list_entry = color_conv_filter_list; color_list_entry; color_list_entry = g_list_next(color_list_entry)) {
+    for (GList *conv_filter_list_entry = conv_filter_list; conv_filter_list_entry; conv_filter_list_entry = g_list_next(conv_filter_list_entry)) {
         // Main menu items
-        color_conversation_filter_t* color_filter = (color_conversation_filter_t *)color_list_entry->data;
-        QAction *conv_action = main_ui_->menuConversationFilter->addAction(color_filter->display_name);
+        conversation_filter_t* conv_filter = (conversation_filter_t *)conv_filter_list_entry->data;
+        QAction *conv_action = main_ui_->menuConversationFilter->addAction(conv_filter->display_name);
 
         bool enable = false;
         QString filter;
-        if (capture_file_.capFile()->edt) {
-            enable = color_filter->is_filter_valid(&capture_file_.capFile()->edt->pi);
-            filter = gchar_free_to_qstring(color_filter->build_filter_string(&capture_file_.capFile()->edt->pi));
+        if (capture_file_.capFile() && capture_file_.capFile()->edt) {
+            enable = conv_filter->is_filter_valid(&capture_file_.capFile()->edt->pi);
+            filter = gchar_free_to_qstring(conv_filter->build_filter_string(&capture_file_.capFile()->edt->pi));
         }
         conv_action->setEnabled(enable);
         conv_action->setData(filter);
@@ -1179,6 +1210,7 @@ void MainWindow::setMenusForSelectedPacket()
     main_ui_->actionSCTPShowAllAssociations->setEnabled(is_sctp);
     main_ui_->actionSCTPFilterThisAssociation->setEnabled(is_sctp);
     main_ui_->actionTelephonyRTPStreamAnalysis->setEnabled(is_rtp);
+    main_ui_->actionTelephonyLteRlcGraph->setEnabled(is_lte_rlc);
 }
 
 void MainWindow::setMenusForSelectedTreeRow(field_info *fi) {
@@ -1227,7 +1259,7 @@ void MainWindow::setMenusForSelectedTreeRow(field_info *fi) {
             field_id = proto_registrar_get_parent(fi->hfinfo->id);
         }
 
-        if (field_id >= 0 && !proto_is_private(field_id)) {
+        if (field_id >= 0) {
             can_open_url = true;
             main_ui_->actionContextWikiProtocolPage->setData(field_id);
             main_ui_->actionContextFilterFieldReference->setData(field_id);
@@ -1270,18 +1302,18 @@ void MainWindow::setMenusForSelectedTreeRow(field_info *fi) {
     if (!proto_tree_ || !proto_tree_->hasFocus()) return;
 
     main_ui_->menuConversationFilter->clear();
-    for (GList *color_list_entry = color_conv_filter_list; color_list_entry; color_list_entry = g_list_next(color_list_entry)) {
-        color_conversation_filter_t* color_filter = (color_conversation_filter_t *)color_list_entry->data;
-        QAction *conv_action = main_ui_->menuConversationFilter->addAction(color_filter->display_name);
+    for (GList *conv_filter_list_entry = conv_filter_list; conv_filter_list_entry; conv_filter_list_entry = g_list_next(conv_filter_list_entry)) {
+        conversation_filter_t* conv_filter = (conversation_filter_t *)conv_filter_list_entry->data;
+        QAction *conv_action = main_ui_->menuConversationFilter->addAction(conv_filter->display_name);
 
-        bool conv_enable = false;
-        QString conv_filter;
-        if (capture_file_.capFile() && capture_file_.capFile()->edt) {
-            conv_enable = color_filter->is_filter_valid(&capture_file_.capFile()->edt->pi);
-            conv_filter = color_filter->build_filter_string(&capture_file_.capFile()->edt->pi);
+        bool enable = false;
+        QString filter;
+        if (fi && capture_file_.capFile() && capture_file_.capFile()->edt) {
+            enable = conv_filter->is_filter_valid(&capture_file_.capFile()->edt->pi);
+            filter = conv_filter->build_filter_string(&capture_file_.capFile()->edt->pi);
         }
-        conv_action->setEnabled(conv_enable);
-        conv_action->setData(conv_filter);
+        conv_action->setEnabled(enable);
+        conv_action->setData(filter);
         connect(conv_action, SIGNAL(triggered()), this, SLOT(applyConversationFilter()));
     }
 
@@ -1347,22 +1379,28 @@ void MainWindow::startInterfaceCapture(bool valid)
 
 void MainWindow::redissectPackets()
 {
-    if (capture_file_.capFile())
+    if (capture_file_.capFile()) {
         cf_redissect_packets(capture_file_.capFile());
-    main_ui_->statusBar->expertUpdate();
+        main_ui_->statusBar->expertUpdate();
+    }
 
     proto_free_deregistered_fields();
 }
 
-void MainWindow::fieldsChanged()
+void MainWindow::checkDisplayFilter()
 {
-    color_filters_reload();
-    tap_listeners_dfilter_recompile();
-
     if (!df_combo_box_->checkDisplayFilter()) {
         g_free(CaptureFile::globalCapFile()->dfilter);
         CaptureFile::globalCapFile()->dfilter = NULL;
     }
+}
+
+void MainWindow::fieldsChanged()
+{
+    color_filters_reload();
+    tap_listeners_dfilter_recompile();
+
+    emit checkDisplayFilter();
 
     if (have_custom_cols(&CaptureFile::globalCapFile()->cinfo)) {
         // Recreate packet list columns according to new/changed/deleted fields
@@ -1497,6 +1535,12 @@ void MainWindow::on_actionDisplayFilterExpression_triggered()
     dfe_dialog->show();
 }
 
+void MainWindow::on_actionNewDisplayFilterExpression_triggered()
+{
+    main_ui_->filterExpressionFrame->addExpression(df_combo_box_->lineEdit()->text());
+    showAccordionFrame(main_ui_->filterExpressionFrame);
+}
+
 // On Qt4 + OS X with unifiedTitleAndToolBarOnMac set it's possible to make
 // the main window obnoxiously wide.
 
@@ -1572,7 +1616,7 @@ void MainWindow::on_actionFileSaveAs_triggered()
 
 void MainWindow::on_actionFileSetListFiles_triggered()
 {
-    file_set_dialog_.exec();
+    file_set_dialog_.show();
 }
 
 void MainWindow::on_actionFileSetNextFile_triggered()
@@ -1648,12 +1692,12 @@ void MainWindow::on_actionFileExportPacketBytes_triggered()
             open_failure_alert_box(file_name.toUtf8().constData(), errno, TRUE);
             return;
         }
-        if (write(fd, data_p, capture_file_.capFile()->finfo_selected->length) < 0) {
+        if (ws_write(fd, data_p, capture_file_.capFile()->finfo_selected->length) < 0) {
             write_failure_alert_box(file_name.toUtf8().constData(), errno);
-            ::close(fd);
+            ws_close(fd);
             return;
         }
-        if (::close(fd) < 0) {
+        if (ws_close(fd) < 0) {
             write_failure_alert_box(file_name.toUtf8().constData(), errno);
             return;
         }
@@ -1722,11 +1766,11 @@ void MainWindow::on_actionFileExportSSLSessionKeys_triggered()
          */
         if (ws_write(fd, keylist, (unsigned int)strlen(keylist)) < 0) {
             write_failure_alert_box(file_name.toUtf8().constData(), errno);
-            ::close(fd);
+            ws_close(fd);
             g_free(keylist);
             return;
         }
-        if (::close(fd) < 0) {
+        if (ws_close(fd) < 0) {
             write_failure_alert_box(file_name.toUtf8().constData(), errno);
             g_free(keylist);
             return;
@@ -1884,6 +1928,9 @@ void MainWindow::on_actionEditFindPacket_triggered()
     previous_focus_ = wsApp->focusWidget();
     connect(previous_focus_, SIGNAL(destroyed()), this, SLOT(resetPreviousFocus()));
     showAccordionFrame(main_ui_->searchFrame, true);
+    if (main_ui_->searchFrame->isVisible()) {
+        main_ui_->searchFrame->setFocus();
+    }
 }
 
 void MainWindow::on_actionEditFindNext_triggered()
@@ -1898,17 +1945,23 @@ void MainWindow::on_actionEditFindPrevious_triggered()
 
 void MainWindow::on_actionEditMarkPacket_triggered()
 {
+    freeze();
     packet_list_->markFrame();
+    thaw();
 }
 
 void MainWindow::on_actionEditMarkAllDisplayed_triggered()
 {
+    freeze();
     packet_list_->markAllDisplayedFrames(true);
+    thaw();
 }
 
 void MainWindow::on_actionEditUnmarkAllDisplayed_triggered()
 {
+    freeze();
     packet_list_->markAllDisplayedFrames(false);
+    thaw();
 }
 
 void MainWindow::on_actionEditNextMark_triggered()
@@ -1925,17 +1978,23 @@ void MainWindow::on_actionEditPreviousMark_triggered()
 
 void MainWindow::on_actionEditIgnorePacket_triggered()
 {
+    freeze();
     packet_list_->ignoreFrame();
+    thaw();
 }
 
 void MainWindow::on_actionEditIgnoreAllDisplayed_triggered()
 {
+    freeze();
     packet_list_->ignoreAllDisplayedFrames(true);
+    thaw();
 }
 
 void MainWindow::on_actionEditUnignoreAllDisplayed_triggered()
 {
+    freeze();
     packet_list_->ignoreAllDisplayedFrames(false);
+    thaw();
 }
 
 void MainWindow::on_actionEditSetTimeReference_triggered()
@@ -1965,6 +2024,7 @@ void MainWindow::on_actionEditTimeShift_triggered()
     TimeShiftDialog ts_dialog(this, capture_file_.capFile());
     connect(this, SIGNAL(setCaptureFile(capture_file*)),
             &ts_dialog, SLOT(setCaptureFile(capture_file*)));
+    connect(&ts_dialog, SIGNAL(timeShifted()), packet_list_, SLOT(applyTimeShift()));
     ts_dialog.exec();
 }
 
@@ -2069,7 +2129,7 @@ void MainWindow::setTimestampFormat(QAction *action)
             cf_timestamp_auto_precision(capture_file_.capFile());
         }
         if (packet_list_) {
-            packet_list_->columnsChanged();
+            packet_list_->resetColumns();
         }
     }
 }
@@ -2091,7 +2151,7 @@ void MainWindow::setTimestampPrecision(QAction *action)
             cf_timestamp_auto_precision(capture_file_.capFile());
         }
         if (packet_list_) {
-            packet_list_->columnsChanged();
+            packet_list_->resetColumns();
         }
     }
 }
@@ -2110,7 +2170,7 @@ void MainWindow::on_actionViewTimeDisplaySecondsWithHoursAndMinutes_triggered(bo
         cf_timestamp_auto_precision(capture_file_.capFile());
     }
     if (packet_list_) {
-        packet_list_->columnsChanged();
+        packet_list_->resetColumns();
     }
 }
 
@@ -2134,7 +2194,7 @@ void MainWindow::setNameResolution()
     gbl_resolv_flags.transport_name = main_ui_->actionViewNameResolutionTransport->isChecked() ? TRUE : FALSE;
 
     if (packet_list_) {
-        packet_list_->columnsChanged();
+        packet_list_->resetColumns();
     }
 }
 
@@ -2187,13 +2247,13 @@ void MainWindow::on_actionViewColorizePacketList_triggered(bool checked) {
     recent.packet_list_colorize = checked;
     color_filters_enable(checked);
     packet_list_->packetListModel()->resetColorized();
-    packet_list_->update();
 }
 
 void MainWindow::on_actionViewColoringRules_triggered()
 {
     ColoringRulesDialog coloring_rules_dialog(this);
-
+    connect(&coloring_rules_dialog, SIGNAL(accepted()),
+            packet_list_, SLOT(recolorPackets()));
     coloring_rules_dialog.exec();
 }
 
@@ -2208,26 +2268,26 @@ void MainWindow::colorizeConversation(bool create_rule)
         guint8 cc_num = cc_action->data().toUInt();
         gchar *filter = NULL;
 
-        const color_conversation_filter_t *color_filter = find_color_conversation_filter("tcp");
+        const conversation_filter_t *color_filter = find_conversation_filter("tcp");
         if ((color_filter != NULL) && (color_filter->is_filter_valid(pi)))
             filter = color_filter->build_filter_string(pi);
         if (filter == NULL) {
-            color_filter = find_color_conversation_filter("udp");
+            color_filter = find_conversation_filter("udp");
             if ((color_filter != NULL) && (color_filter->is_filter_valid(pi)))
                 filter = color_filter->build_filter_string(pi);
         }
         if (filter == NULL) {
-            color_filter = find_color_conversation_filter("ip");
+            color_filter = find_conversation_filter("ip");
             if ((color_filter != NULL) && (color_filter->is_filter_valid(pi)))
                 filter = color_filter->build_filter_string(pi);
         }
         if (filter == NULL) {
-            color_filter = find_color_conversation_filter("ipv6");
+            color_filter = find_conversation_filter("ipv6");
             if ((color_filter != NULL) && (color_filter->is_filter_valid(pi)))
                 filter = color_filter->build_filter_string(pi);
         }
         if (filter == NULL) {
-            color_filter = find_color_conversation_filter("eth");
+            color_filter = find_conversation_filter("eth");
             if ((color_filter != NULL) && (color_filter->is_filter_valid(pi)))
                 filter = color_filter->build_filter_string(pi);
         }
@@ -2238,6 +2298,8 @@ void MainWindow::colorizeConversation(bool create_rule)
 
         if (create_rule) {
             ColoringRulesDialog coloring_rules_dialog(this, filter);
+            connect(&coloring_rules_dialog, SIGNAL(accepted()),
+                    packet_list_, SLOT(recolorPackets()));
             coloring_rules_dialog.exec();
         } else {
             color_filters_set_tmp(cc_num, filter, FALSE);
@@ -2265,6 +2327,8 @@ void MainWindow::colorizeWithFilter()
     } else {
         // New coloring rule
         ColoringRulesDialog coloring_rules_dialog(window(), filter);
+        connect(&coloring_rules_dialog, SIGNAL(accepted()),
+                packet_list_, SLOT(recolorPackets()));
         coloring_rules_dialog.exec();
     }
     main_ui_->actionViewColorizeResetColorization->setEnabled(tmp_color_filters_used());
@@ -2353,6 +2417,19 @@ void MainWindow::on_actionViewReload_triggered()
     cf_reload(CaptureFile::globalCapFile());
 }
 
+void MainWindow::on_actionViewReload_as_File_Format_or_Capture_triggered()
+{
+    capture_file *cf = CaptureFile::globalCapFile();
+
+    if (cf->open_type == WTAP_TYPE_AUTO)
+        cf->open_type = open_info_name_to_type("MIME Files Format");
+    else /* TODO: This should be latest format chosen by user */
+        cf->open_type = WTAP_TYPE_AUTO;
+
+    cf_reload(cf);
+}
+
+
 // Expand / collapse slots in proto_tree
 
 // Go Menu
@@ -2526,9 +2603,9 @@ void MainWindow::on_actionAnalyzeDecodeAs_triggered()
     wsApp->flushAppSignals();
 }
 
-#ifdef HAVE_LUA
 void MainWindow::on_actionAnalyzeReloadLuaPlugins_triggered()
 {
+#ifdef HAVE_LUA
     if (wsApp->isReloadingLua())
         return;
 
@@ -2544,15 +2621,15 @@ void MainWindow::on_actionAnalyzeReloadLuaPlugins_triggered()
     main_ui_->preferenceEditorFrame->animatedHide();
 
     char *gdp_path, *dp_path;
-    (void) wsApp->readConfigurationFiles(&gdp_path, &dp_path);
+    wsApp->readConfigurationFiles(&gdp_path, &dp_path, true);
 
     fieldsChanged();
     redissectPackets();
 
     wsApp->setReloadingLua(false);
     SimpleDialog::displayQueuedMessages();
-}
 #endif
+}
 
 void MainWindow::openFollowStreamDialog(follow_type_t type) {
     FollowStreamDialog *fsd = new FollowStreamDialog(*this, capture_file_, type);
@@ -3017,6 +3094,11 @@ void MainWindow::statCommandLteRlcStatistics(const char *arg, void *)
     LteRlcStatisticsDialog *lte_rlc_stats_dlg = new LteRlcStatisticsDialog(*this, capture_file_, arg);
     connect(lte_rlc_stats_dlg, SIGNAL(filterAction(QString&,FilterAction::Action,FilterAction::ActionType)),
             this, SLOT(filterAction(QString&,FilterAction::Action,FilterAction::ActionType)));
+    // N.B. It is necessary for the RLC Statistics window to launch the RLC graph in this way, to ensure
+    // that the goToPacket() signal/slot connection gets set up...
+    connect(lte_rlc_stats_dlg, SIGNAL(launchRLCGraph(bool, guint16, guint8, guint16, guint16, guint8)),
+            this, SLOT(launchRLCGraph(bool, guint16, guint8, guint16, guint16, guint8)));
+
     lte_rlc_stats_dlg->show();
 }
 
@@ -3025,6 +3107,26 @@ void MainWindow::on_actionTelephonyLteRlcStatistics_triggered()
     statCommandLteRlcStatistics(NULL, NULL);
 }
 
+void MainWindow::launchRLCGraph(bool channelKnown,
+                                guint16 ueid, guint8 rlcMode,
+                                guint16 channelType, guint16 channelId, guint8 direction)
+{
+    LteRlcGraphDialog *lrg_dialog = new LteRlcGraphDialog(*this, capture_file_, channelKnown);
+    connect(lrg_dialog, SIGNAL(goToPacket(int)), packet_list_, SLOT(goToPacket(int)));
+    // This is a bit messy, but wanted to hide these parameters from users of
+    // on_actionTelephonyLteRlcGraph_triggered().
+    if (channelKnown) {
+        lrg_dialog->setChannelInfo(ueid, rlcMode, channelType, channelId, direction);
+    }
+    lrg_dialog->show();
+}
+
+void MainWindow::on_actionTelephonyLteRlcGraph_triggered()
+{
+    // We don't yet know the channel.
+    launchRLCGraph(false, 0, 0, 0, 0, 0);
+}
+
 void MainWindow::on_actionTelephonyMtp3Summary_triggered()
 {
     Mtp3SummaryDialog *mtp3s_dialog = new Mtp3SummaryDialog(*this, capture_file_);
@@ -3073,7 +3175,7 @@ void MainWindow::on_actionTelephonySipFlows_triggered()
 
 // Bluetooth Menu
 
-void MainWindow::on_actionATT_Server_Attributes_triggered()
+void MainWindow::on_actionBluetoothATT_Server_Attributes_triggered()
 {
     BluetoothAttServerAttributesDialog *bluetooth_att_sever_attributes_dialog = new BluetoothAttServerAttributesDialog(*this, capture_file_);
     connect(bluetooth_att_sever_attributes_dialog, SIGNAL(goToPacket(int)),
@@ -3083,7 +3185,7 @@ void MainWindow::on_actionATT_Server_Attributes_triggered()
     bluetooth_att_sever_attributes_dialog->show();
 }
 
-void MainWindow::on_actionDevices_triggered()
+void MainWindow::on_actionBluetoothDevices_triggered()
 {
     BluetoothDevicesDialog *bluetooth_devices_dialog = new BluetoothDevicesDialog(*this, capture_file_);
     connect(bluetooth_devices_dialog, SIGNAL(goToPacket(int)),
@@ -3093,7 +3195,7 @@ void MainWindow::on_actionDevices_triggered()
     bluetooth_devices_dialog->show();
 }
 
-void MainWindow::on_actionHCI_Summary_triggered()
+void MainWindow::on_actionBluetoothHCI_Summary_triggered()
 {
     BluetoothHciSummaryDialog *bluetooth_hci_summary_dialog = new BluetoothHciSummaryDialog(*this, capture_file_);
     connect(bluetooth_hci_summary_dialog, SIGNAL(goToPacket(int)),
@@ -3230,9 +3332,67 @@ void MainWindow::on_actionGoGoToLinkedPacket_triggered()
     packet_list_->goToPacket(packet_num);
 }
 
+// gtk/main_menubar.c:goto_conversation_frame
+void MainWindow::goToConversationFrame(bool go_next) {
+    gchar     *filter       = NULL;
+    dfilter_t *dfcode       = NULL;
+    gboolean   found_packet = FALSE;
+    packet_info *pi = &(capture_file_.capFile()->edt->pi);
+    conversation_filter_t* conv_filter;
+
+    /* Try to build a conversation
+     * filter in the order TCP, UDP, IP, Ethernet and apply the
+     * coloring */
+    conv_filter = find_conversation_filter("tcp");
+    if ((conv_filter != NULL) && (conv_filter->is_filter_valid(pi)))
+        filter = conv_filter->build_filter_string(pi);
+    conv_filter = find_conversation_filter("udp");
+    if ((conv_filter != NULL) && (conv_filter->is_filter_valid(pi)))
+        filter = conv_filter->build_filter_string(pi);
+    conv_filter = find_conversation_filter("ip");
+    if ((conv_filter != NULL) && (conv_filter->is_filter_valid(pi)))
+        filter = conv_filter->build_filter_string(pi);
+    conv_filter = find_conversation_filter("ipv6");
+    if ((conv_filter != NULL) && (conv_filter->is_filter_valid(pi)))
+        filter = conv_filter->build_filter_string(pi);
+
+    if( filter == NULL ) {
+        main_ui_->statusBar->pushTemporaryStatus(tr("Unable to build conversation filter."));
+        g_free(filter);
+        return;
+    }
+
+    if (!dfilter_compile(filter, &dfcode, NULL)) {
+        /* The attempt failed; report an error. */
+        main_ui_->statusBar->pushTemporaryStatus(tr("Error compiling filter for this conversation."));
+        g_free(filter);
+        return;
+    }
+
+    found_packet = cf_find_packet_dfilter(capture_file_.capFile(), dfcode, go_next ? SD_FORWARD : SD_BACKWARD);
+
+    if (!found_packet) {
+        /* We didn't find a packet */
+        main_ui_->statusBar->pushTemporaryStatus(tr("No previous/next packet in conversation."));
+    }
+
+    dfilter_free(dfcode);
+    g_free(filter);
+}
+
+void MainWindow::on_actionGoNextConversationPacket_triggered()
+{
+    goToConversationFrame(true);
+}
+
+void MainWindow::on_actionGoPreviousConversationPacket_triggered()
+{
+    goToConversationFrame(false);
+}
+
 void MainWindow::on_actionGoAutoScroll_toggled(bool checked)
 {
-    packet_list_->setAutoScroll(checked);
+    packet_list_->setVerticalAutoScroll(checked);
 }
 
 void MainWindow::resetPreviousFocus() {
@@ -3375,7 +3535,9 @@ void MainWindow::on_actionCaptureOptions_triggered()
 
 void MainWindow::on_actionCaptureRefreshInterfaces_triggered()
 {
+    main_ui_->actionCaptureRefreshInterfaces->setEnabled(false);
     wsApp->refreshLocalInterfaces();
+    main_ui_->actionCaptureRefreshInterfaces->setEnabled(true);
 }
 #endif
 
@@ -3530,6 +3692,10 @@ void MainWindow::on_actionContextFilterFieldReference_triggered()
     QDesktopServices::openUrl(dfref_url);
 }
 
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
 /*
  * Editor modelines
  *