From b2939c262ef1da85302a78baa0091a3ea4e2439b Mon Sep 17 00:00:00 2001 From: Kurt Hindenburg Date: Tue, 1 Jun 2010 00:05:41 +0000 Subject: [PATCH] Fix issue where the menu status for View menubar is not correct. BUG: 181345 svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1133041 --- src/MainWindow.cpp | 13 ++++++++++++- src/MainWindow.h | 3 +++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 906f8ddc6..0aa76a3f8 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -267,7 +267,6 @@ void MainWindow::setupActions() // View Menu _toggleMenuBarAction = KStandardAction::showMenubar(menuBar(), SLOT(setVisible(bool)), collection); _toggleMenuBarAction->setShortcut( QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_M) ); - _toggleMenuBarAction->setChecked( !menuBar()->isHidden() ); // Hide the Show/Hide menubar item if the menu bar is a MacOS-style menu bar if ( menuBar()->isTopLevelMenu() ) @@ -504,5 +503,17 @@ void MainWindow::configureNotifications() KNotifyConfigWidget::configure( this ); } +void MainWindow::showEvent(QShowEvent *event) +{ + // This code from Konqueror. + // We need to check if our toolbars are shown/hidden here, and set + // our menu items accordingly. We can't do it in the constructor because + // view profiles store toolbar info, and that info is read after + // construct time. + _toggleMenuBarAction->setChecked( !menuBar()->isHidden() ); + // Call parent method + KXmlGuiWindow::showEvent(event); +} + #include "MainWindow.moc" diff --git a/src/MainWindow.h b/src/MainWindow.h index 21aadea3d..0e51e5ee9 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -143,6 +143,9 @@ class MainWindow : public KXmlGuiWindow void closeActiveSessionRequest(); protected: + // Reimplemented for internal reasons. + virtual void showEvent(QShowEvent *event); + // reimplemented from KMainWindow virtual bool queryClose(); virtual void saveProperties(KConfigGroup& group);