From 13297438d98e3388d650fc55c2a77d5b52367e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Wed, 18 Nov 2015 00:11:28 +0100 Subject: [PATCH] Lua: Disable Reload Lua Plugins while reading file. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hide the menu item if built without Lua. Change-Id: I316cddd55064da590eb4167b495a7fb00a41581f Reviewed-on: https://code.wireshark.org/review/11931 Petri-Dish: Stig Bjørlykke Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke --- ui/qt/main_window.cpp | 4 ++++ ui/qt/main_window.h | 2 -- ui/qt/main_window_slots.cpp | 7 +++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp index 822b47f0a9..40ee722ded 100644 --- a/ui/qt/main_window.cpp +++ b/ui/qt/main_window.cpp @@ -251,6 +251,10 @@ MainWindow::MainWindow(QWidget *parent) : interfaceSelectionChanged(); loadWindowGeometry(); +#ifndef HAVE_LUA + main_ui_->actionAnalyzeReloadLuaPlugins->setVisible(false); +#endif + //To prevent users use features before initialization complete //Otherwise unexpected problems may occur setFeaturesEnabled(false); diff --git a/ui/qt/main_window.h b/ui/qt/main_window.h index 7bf23771ba..da232a0e0a 100644 --- a/ui/qt/main_window.h +++ b/ui/qt/main_window.h @@ -448,9 +448,7 @@ private slots: void on_actionAnalyzeEnabledProtocols_triggered(); void on_actionAnalyzeDecodeAs_triggered(); -#ifdef HAVE_LUA void on_actionAnalyzeReloadLuaPlugins_triggered(); -#endif void openFollowStreamDialog(follow_type_t type); void on_actionAnalyzeFollowTCPStream_triggered(); diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index 672ef9cfbb..d7e53bba67 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -655,6 +655,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(); } @@ -678,6 +680,7 @@ void MainWindow::captureFileReadFinished() { setForCapturedPackets(true); main_ui_->statusBar->setFileName(capture_file_); + main_ui_->actionAnalyzeReloadLuaPlugins->setEnabled(true); packet_list_->captureFileReadFinished(); @@ -2548,9 +2551,9 @@ void MainWindow::on_actionAnalyzeDecodeAs_triggered() wsApp->flushAppSignals(); } -#ifdef HAVE_LUA void MainWindow::on_actionAnalyzeReloadLuaPlugins_triggered() { +#ifdef HAVE_LUA if (wsApp->isReloadingLua()) return; @@ -2573,8 +2576,8 @@ void MainWindow::on_actionAnalyzeReloadLuaPlugins_triggered() wsApp->setReloadingLua(false); SimpleDialog::displayQueuedMessages(); -} #endif +} void MainWindow::openFollowStreamDialog(follow_type_t type) { FollowStreamDialog *fsd = new FollowStreamDialog(*this, capture_file_, type);