summaryrefslogtreecommitdiff
path: root/ui/qt/main_window_slots.cpp
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2017-02-16 10:41:58 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2017-02-16 20:53:22 +0000
commit14e19128dca1b318896ab7768d4527723dbefd17 (patch)
tree08f677e469805715b5b17bd5d24927f5a49de0bd /ui/qt/main_window_slots.cpp
parent384c26622b0adc7eda415ba6e2a9fc704cd27794 (diff)
downloadwireshark-14e19128dca1b318896ab7768d4527723dbefd17.tar.gz
Qt: Disable pane menu items if not used in layout
If a pane is not used in the layout it should not be possible to show and hide this from the menu, as this may give unexpected results. Change-Id: I335168e66e1dffc89992cad480dd7daaea7e9d59 Reviewed-on: https://code.wireshark.org/review/20140 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'ui/qt/main_window_slots.cpp')
-rw-r--r--ui/qt/main_window_slots.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp
index 83fdd82811..7898f6c352 100644
--- a/ui/qt/main_window_slots.cpp
+++ b/ui/qt/main_window_slots.cpp
@@ -487,6 +487,10 @@ void MainWindow::layoutToolbars()
void MainWindow::updatePreferenceActions()
{
+ main_ui_->actionViewPacketList->setEnabled(prefs_has_layout_pane_content(layout_pane_content_plist));
+ main_ui_->actionViewPacketDetails->setEnabled(prefs_has_layout_pane_content(layout_pane_content_pdetails));
+ main_ui_->actionViewPacketBytes->setEnabled(prefs_has_layout_pane_content(layout_pane_content_pbytes));
+
main_ui_->actionViewNameResolutionPhysical->setChecked(gbl_resolv_flags.mac_name);
main_ui_->actionViewNameResolutionNetwork->setChecked(gbl_resolv_flags.network_name);
main_ui_->actionViewNameResolutionTransport->setChecked(gbl_resolv_flags.transport_name);
@@ -501,9 +505,9 @@ void MainWindow::updateRecentActions()
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);
+ main_ui_->actionViewPacketList->setChecked(recent.packet_list_show && prefs_has_layout_pane_content(layout_pane_content_plist));
+ main_ui_->actionViewPacketDetails->setChecked(recent.tree_view_show && prefs_has_layout_pane_content(layout_pane_content_pdetails));
+ main_ui_->actionViewPacketBytes->setChecked(recent.byte_view_show && prefs_has_layout_pane_content(layout_pane_content_pbytes));
foreach (QAction* tda, td_actions.keys()) {
if (recent.gui_time_format == td_actions[tda]) {